diff --git a/components/prism-keyman.js b/components/prism-keyman.js index 55f76c96e9..18f6bded2e 100644 --- a/components/prism-keyman.js +++ b/components/prism-keyman.js @@ -28,7 +28,7 @@ Prism.languages.keyman = { alias: 'keyword' }, 'structural-keyword': { - pattern: /\b(?:ansi|begin|group|match|nomatch|unicode|using keys)\b/i, + pattern: /\b(?:ansi|begin|group|match|newcontext|nomatch|postkeystroke|readonly|unicode|using keys)\b/i, alias: 'keyword' }, diff --git a/components/prism-keyman.min.js b/components/prism-keyman.min.js index 749507f544..f24968c0a9 100644 --- a/components/prism-keyman.min.js +++ b/components/prism-keyman.min.js @@ -1 +1 @@ -Prism.languages.keyman={comment:{pattern:/\bc .*/i,greedy:!0},string:{pattern:/"[^"\r\n]*"|'[^'\r\n]*'/,greedy:!0},"virtual-key":{pattern:/\[\s*(?:(?:ALT|CAPS|CTRL|LALT|LCTRL|NCAPS|RALT|RCTRL|SHIFT)\s+)*(?:[TKU]_[\w?]+|[A-E]\d\d?|"[^"\r\n]*"|'[^'\r\n]*')\s*\]/i,greedy:!0,alias:"function"},"header-keyword":{pattern:/&\w+/,alias:"bold"},"header-statement":{pattern:/\b(?:bitmap|bitmaps|caps always off|caps on only|copyright|hotkey|language|layout|message|name|shift frees caps|version)\b/i,alias:"bold"},"rule-keyword":{pattern:/\b(?:any|baselayout|beep|call|context|deadkey|dk|if|index|layer|notany|nul|outs|platform|reset|return|save|set|store|use)\b/i,alias:"keyword"},"structural-keyword":{pattern:/\b(?:ansi|begin|group|match|nomatch|unicode|using keys)\b/i,alias:"keyword"},"compile-target":{pattern:/\$(?:keyman|keymanonly|keymanweb|kmfl|weaver):/i,alias:"property"},number:/\b(?:U\+[\dA-F]+|d\d+|x[\da-f]+|\d+)\b/i,operator:/[+>\\$]|\.\./,punctuation:/[()=,]/}; \ No newline at end of file +Prism.languages.keyman={comment:{pattern:/\bc .*/i,greedy:!0},string:{pattern:/"[^"\r\n]*"|'[^'\r\n]*'/,greedy:!0},"virtual-key":{pattern:/\[\s*(?:(?:ALT|CAPS|CTRL|LALT|LCTRL|NCAPS|RALT|RCTRL|SHIFT)\s+)*(?:[TKU]_[\w?]+|[A-E]\d\d?|"[^"\r\n]*"|'[^'\r\n]*')\s*\]/i,greedy:!0,alias:"function"},"header-keyword":{pattern:/&\w+/,alias:"bold"},"header-statement":{pattern:/\b(?:bitmap|bitmaps|caps always off|caps on only|copyright|hotkey|language|layout|message|name|shift frees caps|version)\b/i,alias:"bold"},"rule-keyword":{pattern:/\b(?:any|baselayout|beep|call|context|deadkey|dk|if|index|layer|notany|nul|outs|platform|reset|return|save|set|store|use)\b/i,alias:"keyword"},"structural-keyword":{pattern:/\b(?:ansi|begin|group|match|newcontext|nomatch|postkeystroke|readonly|unicode|using keys)\b/i,alias:"keyword"},"compile-target":{pattern:/\$(?:keyman|keymanonly|keymanweb|kmfl|weaver):/i,alias:"property"},number:/\b(?:U\+[\dA-F]+|d\d+|x[\da-f]+|\d+)\b/i,operator:/[+>\\$]|\.\./,punctuation:/[()=,]/}; \ No newline at end of file diff --git a/tests/languages/keyman/structural-keyword_feature.test b/tests/languages/keyman/structural-keyword_feature.test index f95e029468..67d1b7628d 100644 --- a/tests/languages/keyman/structural-keyword_feature.test +++ b/tests/languages/keyman/structural-keyword_feature.test @@ -5,6 +5,9 @@ group using keys match nomatch +newcontext +postkeystroke +readonly ---------------------------------------------------- @@ -15,7 +18,10 @@ nomatch ["structural-keyword", "group"], ["structural-keyword", "using keys"], ["structural-keyword", "match"], - ["structural-keyword", "nomatch"] + ["structural-keyword", "nomatch"], + ["structural-keyword", "newcontext"], + ["structural-keyword", "postkeystroke"], + ["structural-keyword", "readonly"] ] ----------------------------------------------------