Skip to content
This repository has been archived by the owner on Aug 17, 2019. It is now read-only.

quiverteam/kv1-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KeyValues Parser

An F# implementation of a parser for the KeyValues file format. Used in QPC to parse qpc and qgc files.

Dependencies

  • FParsec via Nuget

Status

The full kv1 spec parses. Here's a stress test of what it can parse:

$Configuration
{
    $Include "windows.h" [$WINDOWS]
    $Include "posix.h" [$OSX || ($LINUX && $POSIX)]
}

Which parses successfully to this F# representation of the data:

Statement
  ("$Configuration",
   BlockValue
     [Statement ("$Include", StringValue "windows.h", DefCond "$WINDOWS");
      Statement
        ("$Include", StringValue "posix.h",
         OrCond (DefCond "$OSX", AndCond (DefCond "$LINUX", DefCond "$POSIX")))],
   EmptyCond)