single-file-core 1.2.13 → 1.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,14 @@
1
+ start = expression
2
+ expression = statement*
3
+ statement = functionCall / variable / text
4
+ arg = "|"? value:statement { return value; }
5
+ args = arg arg*
6
+ functionCall = "%" name:identifier "<" args:args ">" length:resultLength? { return options.callFunction(name, args, length); }
7
+ variable = "{" name:identifier "}" length:resultLength? { return options.getVariableValue(name, length); }
8
+ resultLength = "[" length:number unit:lengthUnit "]" { return { length, unit }; }
9
+ lengthUnit = "ch"?
10
+ identifier = [a-z0-9-]+ { return text(); }
11
+ number = [0-9]+ { return Number(text()); }
12
+ text = char+ { return text(); }
13
+ char = !"%" !"{" !"|" !">" escapedChar
14
+ escapedChar = "\\\\%" / "\\\\{" / "\\\\|" / "\\\\>" / .