metaborg / nabl

Spoofax' Name Binding Language
Apache License 2.0
7 stars 12 forks source link

Parse error on escape characters in template literals #83

Closed casperbp closed 2 years ago

casperbp commented 2 years ago

According the the references (https://www.spoofax.dev/references/statix/basic-constraints/#messages):

Just as regular string literals, tabs, newlines and carriage returns can be encoded with \t, \n and \r, respectively.

However, writing \t, \n, or \r in a template literal causes a parse error. For example, the .stxtest program

resolve {} try { false } | error $[test\n test]

results in the error message at the \ token: Syntax error, expected: ']'.

Version info Spoofax version: 2.6.0.20211108-110809-master Statix setup: multi-file