Hi all,
Template:
Goodbye\n{{x:cruél}}\n{{world}}!
Context:
{'x:cruél': "cruel", world: "world"}
compiles to:
Goodbye\ncruel\nworld!
Handlebars.java's parser however does not allow for these chars in an identifier:
com.github.jknack.handlebars.HandlebarsException: inline@79696ab:2:1: found: '{{', expected: '<EOF>'
{{x:cruél}}
^
at com.github.jknack.handlebars.internal.HbsErrorReporter.syntaxError(HbsErrorReporter.java:93)
at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:65)
at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:566)
at com.github.jknack.handlebars.internal.HbsErrorStrategy.reportInputMismatch(HbsErrorStrategy.java:186)
at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:148)
at com.github.jknack.handlebars.internal.HbsParser.template(HbsParser.java:172)
....
this could be fixed by changing the lexer's rule for ID_START to include ':' and the UTF-8 range for accented characters:
ID_START
:
[a-zA-Z_$@:\u00C0-\u00FF]
;
unless I am missing something, this should not affect anything else right?
Carlos.