Created
May 28, 2019 12:20
-
-
Save atroche/3eb1ef10bcd458f5397820b245fde0e2 to your computer and use it in GitHub Desktop.
Victoria II Save Game PEG (Parsing Expression Grammar) definition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://phrogz.net/js/pegsh/ | |
config = definition+ | |
definition = var_name '=' value (whitespace+)? | |
var_name = [a-zA-Z_0-9]+ | |
value = string / number / boolean / object / reference | |
reference = var_name | |
number = [\-0-9.]+ | |
boolean = 'yes' / 'no' | |
string = quote [.1-9a-zA-Z_]+ quote | |
quote = '"' | |
newline = '\n' | |
whitespace = [_ \n\t] | |
object = whitespace* '{' whitespace* (definition+ / set)? whitespace* '}' | |
set = ((number / object) whitespace+)+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment