entries with values with comments
This commit is contained in:
@ -1,13 +1,14 @@
|
||||
start: _COMMENT _HEADER entry*
|
||||
entry: "##" name "[" _NUMBER "]" _NL property+
|
||||
property: "-" _key ":" _values _NL
|
||||
_key : /(?! ).+?(?=:)(?<! )/ // key: everything until next ":", not beginning or ending with a space
|
||||
_key : /(?! ).+?(?= *:)/ // key: everything until next ":", not beginning or ending with a space
|
||||
_values : [_value ("," _value)*]
|
||||
_value : quoted_value | unquoted_value
|
||||
quoted_value : /\".+?\"/ // with quotation marks, can contain commas
|
||||
unquoted_value : /(?![ \"])[^,\n]+(?<![ \"])/ // cannot contain commas, cannot start or end with quotation mark
|
||||
quoted_value : /\".*?\"/ // with quotation marks, can contain commas
|
||||
unquoted_value : /(?![ \"]).+?(?= *,| *\n)/
|
||||
|
||||
name: /(?! ).+?(?= \[)/ // developer name: everything until " ["
|
||||
|
||||
name: /(?! ).+?(?= +\[)/ // developer name: everything until " ["
|
||||
|
||||
_NUMBER: /[0-9]+/
|
||||
|
||||
@ -15,9 +16,9 @@ CR : /\r/
|
||||
LF : /\n/
|
||||
_NL : CR? LF
|
||||
WS : (" "|/\t/)+
|
||||
_EL : /^$\n/m
|
||||
_EL : /^$\n/m // empty new line
|
||||
_COMMENT : /^\[comment\]: #.*$\n/m // [comment]: # xxx
|
||||
_HEADER : /^# .+$\n/m
|
||||
_HEADER : /^# .+$\n/m // line staring with "# "
|
||||
|
||||
%ignore WS
|
||||
%ignore _EL
|
||||
|
Reference in New Issue
Block a user