Skip to content

Commit

Permalink
AQL: Differenciate between strings and identifiers (#3183)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment committed Nov 22, 2021
1 parent 9f5e511 commit fa540ab
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
6 changes: 5 additions & 1 deletion components/prism-aql.js
Expand Up @@ -6,7 +6,11 @@ Prism.languages.aql = {
greedy: true
},
'string': {
pattern: /(["'´`])(?:(?!\1)[^\\\r\n]|\\.)*\1/,
pattern: /(["'])(?:(?!\1)[^\\\r\n]|\\.)*\1/,
greedy: true
},
'identifier': {
pattern: /([´`])(?:(?!\1)[^\\\r\n]|\\.)*\1/,
greedy: true
},
'variable': /@@?\w+/,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-aql.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions tests/languages/aql/identifier_feature.test
@@ -0,0 +1,9 @@
´filter´
`sort`

----------------------------------------------------

[
["identifier", "´filter´"],
["identifier", "`sort`"]
]
8 changes: 2 additions & 6 deletions tests/languages/aql/string_feature.test
Expand Up @@ -10,9 +10,6 @@
'this is a longer string.'
'the path separator on Windows is \\'

´filter´
`sort`

----------------------------------------------------

[
Expand All @@ -21,13 +18,12 @@
["string", "\"this is a \\\"quoted\\\" word\""],
["string", "\"this is a longer string.\""],
["string", "\"the path separator on Windows is \\\\\""],

["string", "'yikes!'"],
["string", "'don\\'t know'"],
["string", "'this is a \"quoted\" word'"],
["string", "'this is a longer string.'"],
["string", "'the path separator on Windows is \\\\'"],
["string", "´filter´"],
["string", "`sort`"]
["string", "'the path separator on Windows is \\\\'"]
]

----------------------------------------------------
Expand Down

0 comments on commit fa540ab

Please sign in to comment.