Hey there,
So I had to extend json grammar file with a small addition, this is the grammar file:
@top JsonText { value }
value { True | False | Null | Number | String | Object | Array | TemplateExpression }
String { string }
Char { char* }
Object { "{" list<Property>? "}" }
Array { "[" list<value>? "]" }
TemplateExpression { "{{" Char "}}" }
Property { PropertyName ":" value }
PropertyName { string }
@tokens {
True { "true" }
False { "false" }
Null { "null" }
Number { '-'? int frac? exp? }
int { '0' | $[1-9] std.digit* }
frac { '.' std.digit+ }
exp { $[eE] $[+\-]? std.digit+ }
string { '"' char* '"' }
char { $[\u{20}\u{21}\u{23}-\u{5b}\u{5d}-\u{10ffff}] | "\\" esc }
esc { $["\\\/bfnrt] | "u" hex hex hex hex }
hex { $[0-9a-fA-F] }
whitespace { $[ \n\r\t] }
"{" "}" "[" "]"
}
@skip { whitespace }
list<item> { item ("," item)* }
@external propSource jsonHighlighting from "./highlight"
@detectDelim
Didn’t changed anything but adding TemplateExpression
.
When running the lezer-generator, I get Unexpected token 'propSource'
, what am I doing wrong?
Thanks