Skip to content

Commit

Permalink
Fix escaped backslash at end of string (#162)
Browse files Browse the repository at this point in the history
Fixes #159
  • Loading branch information
rosshamish committed May 13, 2024
1 parent 08a024b commit 0470269
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 6 deletions.
2 changes: 1 addition & 1 deletion kusto-syntax-highlighting/syntaxes/kusto.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@
"Escapes": {
"patterns": [
{
"match": "\\\\['\"]",
"match": "(\\\\['\"]|\\\\\\\\)",
"name": "constant.character.escape.kusto"
}
]
Expand Down
2 changes: 1 addition & 1 deletion kusto-syntax-highlighting/syntaxes/kusto.tmLanguage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ repository:
comment: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/scalar-data-types/string
Escapes:
patterns:
- match: \\['"]
- match: (\\['"]|\\\\)
name: constant.character.escape.kusto
Numeric:
patterns:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ print s1 = 'string with " (double quotes)',
print myPath1 = @'C:\Folder\filename.txt'

// Escaping using '\' notation
print s = '\\n.*(>|\'|=|\")[a-zA-Z0-9/+]{86}=='
print s = '\\n.*(>|\'|=|\")[a-zA-Z0-9/+]{86}==\\'

// Encode a C# program in a Kusto multi-line string
print program=```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,18 @@
>
>// Escaping using '\' notation
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.kusto comment.line.kusto
>print s = '\\n.*(>|\'|=|\")[a-zA-Z0-9/+]{86}=='
>print s = '\\n.*(>|\'|=|\")[a-zA-Z0-9/+]{86}==\\'
#^^^^^ source.kusto keyword.other.query.kusto
# ^^^^^ source.kusto
# ^ source.kusto string.quoted.single.kusto punctuation.definition.string.kusto
# ^^^^^^^^ source.kusto string.quoted.single.kusto
# ^^ source.kusto string.quoted.single.kusto constant.character.escape.kusto
# ^^^^^^ source.kusto string.quoted.single.kusto
# ^^ source.kusto string.quoted.single.kusto constant.character.escape.kusto
# ^^^ source.kusto string.quoted.single.kusto
# ^^ source.kusto string.quoted.single.kusto constant.character.escape.kusto
# ^^^^^^^^^^^^^^^^^^^^ source.kusto string.quoted.single.kusto
# ^ source.kusto string.quoted.single.kusto punctuation.definition.string.kusto
# ^^ source.kusto string.quoted.single.kusto constant.character.escape.kusto
# ^ source.kusto string.quoted.single.kusto punctuation.definition.string.kusto
>
>// Encode a C# program in a Kusto multi-line string
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.kusto comment.line.kusto
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
let scannerId = "9d632724-5c18-43e9-9314-555e9587b30c";
cluster("foo").database("bar").table("baz")
| extend FileNameParts = split(FullFileName, "Modified\\")
| extend FileName = trim("'", FileName)
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
>let scannerId = "9d632724-5c18-43e9-9314-555e9587b30c";
#^^^ source.kusto keyword.control.kusto
# ^^^^^^^^^^^^^ source.kusto
# ^ source.kusto string.quoted.double.kusto punctuation.definition.string.kusto
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.kusto string.quoted.double.kusto
# ^ source.kusto string.quoted.double.kusto punctuation.definition.string.kusto
# ^^ source.kusto
>cluster("foo").database("bar").table("baz")
#^^^^^^^ source.kusto meta.special.database.kusto support.function.kusto
# ^ source.kusto meta.special.database.kusto
# ^ source.kusto meta.special.database.kusto string.quoted.double.kusto punctuation.definition.string.kusto
# ^^^ source.kusto meta.special.database.kusto string.quoted.double.kusto
# ^ source.kusto meta.special.database.kusto string.quoted.double.kusto punctuation.definition.string.kusto
# ^ source.kusto meta.special.database.kusto
# ^ source.kusto
# ^^^^^^^^ source.kusto meta.special.database.kusto support.function.kusto
# ^ source.kusto meta.special.database.kusto
# ^ source.kusto meta.special.database.kusto string.quoted.double.kusto punctuation.definition.string.kusto
# ^^^ source.kusto meta.special.database.kusto string.quoted.double.kusto
# ^ source.kusto meta.special.database.kusto string.quoted.double.kusto punctuation.definition.string.kusto
# ^ source.kusto meta.special.database.kusto
# ^ source.kusto
# ^^^^^ source.kusto support.function.kusto
# ^ source.kusto
# ^ source.kusto string.quoted.double.kusto punctuation.definition.string.kusto
# ^^^ source.kusto string.quoted.double.kusto
# ^ source.kusto string.quoted.double.kusto punctuation.definition.string.kusto
# ^^ source.kusto
>| extend FileNameParts = split(FullFileName, "Modified\\")
#^^ source.kusto
# ^^^^^^ source.kusto keyword.other.query.kusto
# ^^^^^^^^^^^^^^^^^ source.kusto
# ^^^^^ source.kusto support.function.kusto
# ^^^^^^^^^^^^^^^ source.kusto
# ^ source.kusto string.quoted.double.kusto punctuation.definition.string.kusto
# ^^^^^^^^ source.kusto string.quoted.double.kusto
# ^^ source.kusto string.quoted.double.kusto constant.character.escape.kusto
# ^ source.kusto string.quoted.double.kusto punctuation.definition.string.kusto
# ^^ source.kusto
>| extend FileName = trim("'", FileName)
#^^ source.kusto
# ^^^^^^ source.kusto keyword.other.query.kusto
# ^^^^^^^^^^^^ source.kusto
# ^^^^ source.kusto support.function.kusto
# ^ source.kusto
# ^ source.kusto string.quoted.double.kusto punctuation.definition.string.kusto
# ^ source.kusto string.quoted.double.kusto
# ^ source.kusto string.quoted.double.kusto punctuation.definition.string.kusto
# ^^^^^^^^^^^^ source.kusto

0 comments on commit 0470269

Please sign in to comment.