Skip to content
Permalink
Browse files
Dataweave: Fixed keywords being highlighted as functions (#3113)
  • Loading branch information
RunDevelopment committed Oct 5, 2021
1 parent 5c412cb commit 532212b26587fc99993ac3d9e5d7468dcb95fcd9
Showing with 14 additions and 6 deletions.
  1. +1 −1 components/prism-dataweave.js
  2. +1 −1 components/prism-dataweave.min.js
  3. +12 −4 tests/languages/dataweave/keywords_feature.test
@@ -30,12 +30,12 @@
pattern: /\/(?:[^\\\/\r\n]|\\[^\r\n])+\//,
greedy: true
},
'keyword': /\b(?:and|as|at|case|do|else|fun|if|input|is|match|not|ns|null|or|output|type|unless|update|using|var)\b/,
'function': /\b[A-Z_]\w*(?=\s*\()/i,
'number': /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
'punctuation': /[{}[\];(),.:@]/,
'operator': /<<|>>|->|[<>~=]=?|!=|--?-?|\+\+?|!|\?/,
'boolean': /\b(?:false|true)\b/,
'keyword': /\b(?:and|as|at|case|do|else|fun|if|input|is|match|not|ns|null|or|output|type|unless|update|using|var)\b/
};

}(Prism));

Some generated files are not rendered by default. Learn more.

@@ -15,11 +15,15 @@ update {
if(true or false and not true) do {

}
else
else
payload match {
case a is String -> x as String
}

null
unless
using

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

[
@@ -89,7 +93,7 @@ payload match {

["punctuation", "}"],

["function", "if"],
["keyword", "if"],
["punctuation", "("],
["boolean", "true"],
["keyword", "or"],
@@ -105,7 +109,7 @@ payload match {

["keyword", "else"],

" \r\npayload ",
"\r\npayload ",
["keyword", "match"],
["punctuation", "{"],

@@ -118,7 +122,11 @@ payload match {
["keyword", "as"],
" String\r\n",

["punctuation", "}"]
["punctuation", "}"],

["keyword", "null"],
["keyword", "unless"],
["keyword", "using"]
]

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

0 comments on commit 532212b

Please sign in to comment.