Skip to content

Commit

Permalink
Fix #250, strings vs expressions boundary cases
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenWeatherford committed Jul 16, 2019
1 parent 451a792 commit 3d9d692
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions grammars/arm-expression-string.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"$preprocessComment2": "The 'builtin' key/value are special - they're created during build from our function metadata",
"$preprocessComment3": "Currently you need to run 'build grammars' after changing this file",
"preprocess": {
"escaped-json-character": "(?:\\\\(?:[\"\\\\/bfnrt]|u[0-9a-fA-F]{4}))",
"escaped-apostrophe": "(?:[']['])",
"idchar": "[_$[:alnum:]]",
"id": "(?:[_$[:alpha:]]{{idchar}}*)",
"ns-userfunc": "(?:({{id}})\\s*(\\.)\\s*({{id}}))",
Expand Down Expand Up @@ -42,8 +44,9 @@
"repository": {
"expressionstring": {
"name": "meta.expression.tle.arm",
"begin": "\"\\[(?!\\[)",
"$beginComment": "A string that starts with [[ is not an expression",
"$begin": "(?x) \"\\[(?!\\[) (?= .*) \\]\"",
"begin": "(?x) \"\\[(?!\\[) (?= ([^\"]|{{escaped-json-character}}|5)* \\]\" )",
"$beginComment": "An expression must start with [ (no whitespace before), not start with [[, and end with ] (no whitespace after)",
"end": "\\]\"",
"beginCaptures": {
"0": {
Expand Down

0 comments on commit 3d9d692

Please sign in to comment.