|
|
@ -1,5 +1,8 @@
|
|
|
|
start
|
|
|
|
start
|
|
|
|
= deriveTag
|
|
|
|
= _ root:deriveTag _ { return root; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_
|
|
|
|
|
|
|
|
= [ \n\r\t]*
|
|
|
|
|
|
|
|
|
|
|
|
value
|
|
|
|
value
|
|
|
|
= deriveTag
|
|
|
|
= deriveTag
|
|
|
@ -8,7 +11,7 @@ value
|
|
|
|
/ string
|
|
|
|
/ string
|
|
|
|
|
|
|
|
|
|
|
|
multipleItems
|
|
|
|
multipleItems
|
|
|
|
= item:value subsequentItems:("," value)* { return [item].concat(subsequentItems.map(subsequentItem => subsequentItem[1])); }
|
|
|
|
= item:value? subsequentItems:("," value)* { return (item != null) ? [item].concat(subsequentItems.map(subsequentItem => subsequentItem[1])) : []; }
|
|
|
|
|
|
|
|
|
|
|
|
deriveTag
|
|
|
|
deriveTag
|
|
|
|
= "Derive(" items:multipleItems ")" { return {type: "deriveTag", items: items}; }
|
|
|
|
= "Derive(" items:multipleItems ")" { return {type: "deriveTag", items: items}; }
|
|
|
@ -23,8 +26,9 @@ string
|
|
|
|
= '"' chars:stringCharacter* '"' { return chars.join(""); }
|
|
|
|
= '"' chars:stringCharacter* '"' { return chars.join(""); }
|
|
|
|
|
|
|
|
|
|
|
|
stringCharacter
|
|
|
|
stringCharacter
|
|
|
|
= !('"' / "\\") char:. { return char; }
|
|
|
|
= !('"' / "\\") char:. { return char; } // Prefer a non-backslash character...
|
|
|
|
/ stringEscapedQuote { return '"'; }
|
|
|
|
/ stringEscapedQuote { return '"'; } // ... then an escaped quotation mark...
|
|
|
|
|
|
|
|
/ !('"') char:. { return char; } // ... and finally any other character that doesn't terminate the string.
|
|
|
|
|
|
|
|
|
|
|
|
stringEscapedQuote
|
|
|
|
stringEscapedQuote
|
|
|
|
= '\\"'
|
|
|
|
= '\\"'
|
|
|
|