From 27dc7ac768ac1797a6fba16c378f3cf038a21117 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Sun, 15 Nov 2020 23:05:39 +0100 Subject: [PATCH 01/18] Added regex test coverage --- components/prism-birb.js | 4 +- components/prism-birb.min.js | 2 +- components/prism-bsl.js | 22 +- components/prism-bsl.min.js | 2 +- components/prism-clojure.js | 2 +- components/prism-clojure.min.js | 2 +- components/prism-jsstacktrace.js | 18 +- components/prism-jsstacktrace.min.js | 2 +- components/prism-moonscript.js | 3 +- components/prism-nim.js | 5 +- components/prism-nim.min.js | 2 +- components/prism-nix.js | 10 +- components/prism-nix.min.js | 2 +- components/prism-ocaml.js | 2 +- components/prism-ocaml.min.js | 2 +- components/prism-regex.js | 14 +- components/prism-regex.min.js | 2 +- components/prism-renpy.js | 6 +- components/prism-renpy.min.js | 2 +- components/prism-tap.js | 1 + components/prism-zig.js | 4 +- components/prism-zig.min.js | 2 +- package.json | 3 +- tests/coverage.js | 127 + tests/helper/prism-loader.js | 6 +- tests/helper/test-case.js | 26 +- tests/helper/util.js | 29 +- tests/languages/ada/punctuation_feature.test | 14 + .../applescript/punctuation_feature.test | 18 + tests/languages/aql/boolean_feature.test | 13 + tests/languages/arduino/builtin_feature.test | 667 +++ tests/languages/arduino/constant_feature.test | 43 + tests/languages/arduino/keyword_feature.test | 75 + .../languages/basic/punctuation_feature.test | 11 + tests/languages/batch/command_feature.test | 51 +- tests/languages/batch/label_feature.test | 7 +- tests/languages/birb/class-name_feature.test | 57 + tests/languages/birb/function_feature.test | 4 +- tests/languages/birb/keyword_feature.test | 90 +- tests/languages/bsl/directive_feature.test | 13 + tests/languages/bsl/punctuation_feature.test | 17 + tests/languages/bsl/string_feature.test | 8 +- tests/languages/cil/directive_feature.test | 15 + tests/languages/cil/number_feature.test | 15 + tests/languages/cil/punctuation_feature.test | 21 + tests/languages/clojure/number_feature.test | 9 + tests/languages/concurnas/string_feature.test | 32 +- .../class-name-declaration_feature.test | 17 +- .../csharp/interpolation-string_feature.test | 34 + .../css!+css-extras/color_feature.test | 341 ++ tests/languages/dhall/builtin_feature.test | 9 + .../languages/eiffel/punctuation_feature.test | 29 + .../excel-formula/comment_feature.test | 10 + tests/languages/factor/comments_feature.test | 6 + tests/languages/factor/numbers_feature.test | 81 +- tests/languages/factor/strings_feature.test | 190 +- .../path_feature.test | 17 +- tests/languages/fortran/number_feature.test | 12 +- .../fortran/punctuation_feature.test | 15 + tests/languages/ftl/directive_feature.test | 19 +- tests/languages/gdscript/number_feature.test | 11 +- .../ichigojam/punctuation_feature.test | 13 + tests/languages/iecst/comment_feature.test | 11 + tests/languages/io/builtin_feature.test | 161 + tests/languages/io/keyword_feature.test | 141 + tests/languages/j/operator_feature.test | 14 + tests/languages/java/class-name_feature.test | 44 +- tests/languages/java/generics_feature.test | 12 + .../control-flow-keyword_feature.js | 35 + .../keyword_nil_feature.test | 13 + .../javascript!+regex/regex_inclusion.test | 8 +- tests/languages/jolie/builtin_feature.test | 27 + .../languages/jolie/punctuation_feature.test | 8 + .../languages/jsstacktrace/alias_feature.test | 26 + tests/languages/less/variable_feature.test | 9 + .../lilypond/class-name_feature.test | 15 + tests/languages/lisp/defun_feature.test | 211 +- tests/languages/lisp/punctuation_feature.test | 12 +- .../livescript/punctuation_feature.test | 18 + .../lolcode/punctuation_feature.test | 10 + tests/languages/lolcode/string_feature.test | 24 +- .../markup+http/text-xml_inclusion.test | 30 + .../moonscript/function_feature.test | 715 +++ tests/languages/nim/identifier_feature.test | 14 + .../languages/ocaml/punctuation_feature.test | 19 + .../pascaligo/class-name_feature.test | 42 + .../peoplecode/class-name_feature.test | 277 ++ .../peoplecode/function_feature.test | 9 + tests/languages/perl/variable_feature.test | 7 + tests/languages/promql/number_feature.test | 17 + tests/languages/promql/operator_feature.test | 25 + .../promql/time_series_selection.test | 8 + tests/languages/pure/punctuation_feature.test | 13 + tests/languages/purebasic/asm_feature.test | 118 + .../languages/purebasic/function_feature.test | 212 +- .../languages/purebasic/keyword_feature.test | 211 + tests/languages/q/comment_feature.test | 7 + tests/languages/q/punctuation_feature.test | 18 + tests/languages/r/punctuation_feature.test | 14 + .../languages/racket/identifier_feature.test | 7 + tests/languages/regex/charclass_feature.test | 60 +- tests/languages/regex/charset_feature.test | 51 +- tests/languages/regex/range_feature.test | 20 +- tests/languages/renpy/boolean_feature.test | 11 + tests/languages/renpy/comment_feature.test | 7 + tests/languages/renpy/function_feature.test | 41 + tests/languages/renpy/keyword_feature.test | 181 + tests/languages/renpy/string_feature.test | 28 + tests/languages/renpy/tag_feature.test | 76 + tests/languages/rip/punctuation_feature.test | 28 + tests/languages/rust/namespace_feature.test | 29 +- tests/languages/sas/number_feature.test | 10 +- .../languages/sass/variable-line_feature.test | 10 +- tests/languages/smali/builtin_feature.test | 72 + tests/languages/smali/label_feature.test | 16 + tests/languages/smali/register_feature.test | 28 + tests/languages/sparql/keyword_feature.test | 13 +- .../languages/splunk-spl/boolean_feature.test | 11 + .../splunk-spl/property_feature.test | 9 + .../splunk-spl/punctuation_feature.test | 11 + tests/languages/sqf/function_feature.test | 4397 +++++++++++++++++ .../languages/stan/function-arg_feature.test | 21 + tests/languages/tap/subtest_feature.test | 7 + tests/languages/tcl/punctuation_feature.test | 12 + tests/languages/textile/tag_feature.test | 20 + .../unrealscript/category_feature.test | 47 + tests/languages/vala/constant_feature.test | 7 + tests/languages/vala/regex_feature.test | 11 + .../languages/warpscript/keyword_feature.test | 49 + tests/languages/warpscript/macro_feature.test | 7 + .../warpscript/variable_feature.test | 7 + tests/languages/xojo/punctuation_feature.test | 12 + tests/languages/zig/comment_feature.test | 21 + tests/languages/zig/string_feature.test | 151 + tests/pattern-tests.js | 16 +- tests/run.js | 16 +- 136 files changed, 9820 insertions(+), 541 deletions(-) create mode 100644 tests/coverage.js create mode 100644 tests/languages/ada/punctuation_feature.test create mode 100644 tests/languages/applescript/punctuation_feature.test create mode 100644 tests/languages/aql/boolean_feature.test create mode 100644 tests/languages/arduino/builtin_feature.test create mode 100644 tests/languages/arduino/constant_feature.test create mode 100644 tests/languages/arduino/keyword_feature.test create mode 100644 tests/languages/basic/punctuation_feature.test create mode 100644 tests/languages/birb/class-name_feature.test create mode 100644 tests/languages/bsl/directive_feature.test create mode 100644 tests/languages/bsl/punctuation_feature.test create mode 100644 tests/languages/cil/directive_feature.test create mode 100644 tests/languages/cil/number_feature.test create mode 100644 tests/languages/cil/punctuation_feature.test create mode 100644 tests/languages/clojure/number_feature.test create mode 100644 tests/languages/css!+css-extras/color_feature.test create mode 100644 tests/languages/dhall/builtin_feature.test create mode 100644 tests/languages/eiffel/punctuation_feature.test create mode 100644 tests/languages/excel-formula/comment_feature.test create mode 100644 tests/languages/fortran/punctuation_feature.test create mode 100644 tests/languages/ichigojam/punctuation_feature.test create mode 100644 tests/languages/iecst/comment_feature.test create mode 100644 tests/languages/io/builtin_feature.test create mode 100644 tests/languages/io/keyword_feature.test create mode 100644 tests/languages/j/operator_feature.test create mode 100644 tests/languages/javascript!+js-extras/control-flow-keyword_feature.js create mode 100644 tests/languages/javascript!+js-extras/keyword_nil_feature.test create mode 100644 tests/languages/jolie/builtin_feature.test create mode 100644 tests/languages/jolie/punctuation_feature.test create mode 100644 tests/languages/jsstacktrace/alias_feature.test create mode 100644 tests/languages/less/variable_feature.test create mode 100644 tests/languages/lilypond/class-name_feature.test create mode 100644 tests/languages/livescript/punctuation_feature.test create mode 100644 tests/languages/lolcode/punctuation_feature.test create mode 100644 tests/languages/markup+http/text-xml_inclusion.test create mode 100644 tests/languages/moonscript/function_feature.test create mode 100644 tests/languages/nim/identifier_feature.test create mode 100644 tests/languages/ocaml/punctuation_feature.test create mode 100644 tests/languages/pascaligo/class-name_feature.test create mode 100644 tests/languages/peoplecode/class-name_feature.test create mode 100644 tests/languages/peoplecode/function_feature.test create mode 100644 tests/languages/promql/number_feature.test create mode 100644 tests/languages/promql/operator_feature.test create mode 100644 tests/languages/pure/punctuation_feature.test create mode 100644 tests/languages/purebasic/asm_feature.test create mode 100644 tests/languages/purebasic/keyword_feature.test create mode 100644 tests/languages/q/punctuation_feature.test create mode 100644 tests/languages/r/punctuation_feature.test create mode 100644 tests/languages/racket/identifier_feature.test create mode 100644 tests/languages/renpy/boolean_feature.test create mode 100644 tests/languages/renpy/comment_feature.test create mode 100644 tests/languages/renpy/function_feature.test create mode 100644 tests/languages/renpy/keyword_feature.test create mode 100644 tests/languages/renpy/string_feature.test create mode 100644 tests/languages/renpy/tag_feature.test create mode 100644 tests/languages/rip/punctuation_feature.test create mode 100644 tests/languages/smali/builtin_feature.test create mode 100644 tests/languages/smali/label_feature.test create mode 100644 tests/languages/smali/register_feature.test create mode 100644 tests/languages/splunk-spl/boolean_feature.test create mode 100644 tests/languages/splunk-spl/property_feature.test create mode 100644 tests/languages/splunk-spl/punctuation_feature.test create mode 100644 tests/languages/sqf/function_feature.test create mode 100644 tests/languages/stan/function-arg_feature.test create mode 100644 tests/languages/tap/subtest_feature.test create mode 100644 tests/languages/tcl/punctuation_feature.test create mode 100644 tests/languages/textile/tag_feature.test create mode 100644 tests/languages/unrealscript/category_feature.test create mode 100644 tests/languages/vala/constant_feature.test create mode 100644 tests/languages/vala/regex_feature.test create mode 100644 tests/languages/warpscript/keyword_feature.test create mode 100644 tests/languages/warpscript/macro_feature.test create mode 100644 tests/languages/warpscript/variable_feature.test create mode 100644 tests/languages/xojo/punctuation_feature.test create mode 100644 tests/languages/zig/comment_feature.test create mode 100644 tests/languages/zig/string_feature.test diff --git a/components/prism-birb.js b/components/prism-birb.js index de6cd6892a..26a0b7a9a3 100644 --- a/components/prism-birb.js +++ b/components/prism-birb.js @@ -3,7 +3,7 @@ Prism.languages.birb = Prism.languages.extend('clike', { /\b[A-Z](?:[\d_]*[a-zA-Z]\w*)?\b/, // matches variable and function return types (parameters as well). - /\b[A-Z]\w*(?=\s+\w+\s*[;,=()])/ + /\b(?:[A-Z]\w*|(?!(?:var|void)\b)[a-z]\w*)(?=\s+\w+\s*[;,=()])/ ], 'string': { pattern: /r?("|')(?:\\.|(?!\1)[^\\])*\1/, @@ -20,4 +20,4 @@ Prism.languages.insertBefore('birb','function',{ greedy: true, alias: 'symbol' } -}); \ No newline at end of file +}); diff --git a/components/prism-birb.min.js b/components/prism-birb.min.js index 0e111ba8f2..cd637ae4b2 100644 --- a/components/prism-birb.min.js +++ b/components/prism-birb.min.js @@ -1 +1 @@ -Prism.languages.birb=Prism.languages.extend("clike",{"class-name":[/\b[A-Z](?:[\d_]*[a-zA-Z]\w*)?\b/,/\b[A-Z]\w*(?=\s+\w+\s*[;,=()])/],string:{pattern:/r?("|')(?:\\.|(?!\1)[^\\])*\1/,greedy:!0},keyword:/\b(?:assert|break|case|class|const|default|else|enum|final|follows|for|grab|if|nest|next|new|noSeeb|return|static|switch|throw|var|void|while)\b/,variable:/\b[a-z_]\w*\b/,operator:/\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?|:/}),Prism.languages.insertBefore("birb","function",{metadata:{pattern:/<\w+>/,greedy:!0,alias:"symbol"}}); \ No newline at end of file +Prism.languages.birb=Prism.languages.extend("clike",{"class-name":[/\b[A-Z](?:[\d_]*[a-zA-Z]\w*)?\b/,/\b(?:[A-Z]\w*|(?!(?:var|void)\b)[a-z]\w*)(?=\s+\w+\s*[;,=()])/],string:{pattern:/r?("|')(?:\\.|(?!\1)[^\\])*\1/,greedy:!0},keyword:/\b(?:assert|break|case|class|const|default|else|enum|final|follows|for|grab|if|nest|next|new|noSeeb|return|static|switch|throw|var|void|while)\b/,variable:/\b[a-z_]\w*\b/,operator:/\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?|:/}),Prism.languages.insertBefore("birb","function",{metadata:{pattern:/<\w+>/,greedy:!0,alias:"symbol"}}); \ No newline at end of file diff --git a/components/prism-bsl.js b/components/prism-bsl.js index 79819c2903..d92e128e85 100644 --- a/components/prism-bsl.js +++ b/components/prism-bsl.js @@ -31,40 +31,42 @@ Prism.languages.bsl = { pattern: /(^(?=\d)|[^\w\u0400-\u0484\u0487-\u052f\u1c80-\u1c88\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:\d+\.?\d*|\.\d+)(?:E[+-]?\d+)?/i, lookbehind: true }, - 'operator': [ + 'operator': [ /[<>+\-*/]=?|[%=]/, // RU { pattern: /(^|[^\w\u0400-\u0484\u0487-\u052f\u1c80-\u1c88\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:и|или|не)(?![\w\u0400-\u0484\u0487-\u052f\u1c80-\u1c88\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])/i, lookbehind: true - }, + }, // EN { pattern: /\b(?:and|or|not)\b/i } - ], - 'punctuation': /\(\.|\.\)|[()\[\]:;,.]/, + 'punctuation': /\(\.|\.\)|[()\[\]:;,.]/, 'directive': [ // Теги препроцессора вида &Клиент, &Сервер, ... // Preprocessor tags of the type &Client, &Server, ... { pattern: /^(\s*)&.*/m, lookbehind: true, + greedy: true, alias: 'important' }, // Инструкции препроцессора вида: - // #Если Сервер Тогда - // ... + // #Если Сервер Тогда + // ... // #КонецЕсли // Preprocessor instructions of the form: - // #If Server Then - // ... + // #If Server Then + // ... // #EndIf { - pattern: /^\s*#.*/gm, + pattern: /(^\s*)#.*/gm, + lookbehind: true, + greedy: true, alias: 'important' - } + } ] }; diff --git a/components/prism-bsl.min.js b/components/prism-bsl.min.js index c2d118b4b4..a881e42ebd 100644 --- a/components/prism-bsl.min.js +++ b/components/prism-bsl.min.js @@ -1 +1 @@ -Prism.languages.bsl={comment:/\/\/.*/,string:[{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},{pattern:/'(?:[^'\r\n\\]|\\.)*'/}],keyword:[{pattern:/(^|[^\w\u0400-\u0484\u0487-\u052f\u1c80-\u1c88\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:пока|для|новый|прервать|попытка|исключение|вызватьисключение|иначе|конецпопытки|неопределено|функция|перем|возврат|конецфункции|если|иначеесли|процедура|конецпроцедуры|тогда|знач|экспорт|конецесли|из|каждого|истина|ложь|по|цикл|конеццикла|выполнить)(?![\w\u0400-\u0484\u0487-\u052f\u1c80-\u1c88\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])/i,lookbehind:!0},{pattern:/\b(?:while|for|new|break|try|except|raise|else|endtry|undefined|function|var|return|endfunction|null|if|elseif|procedure|endprocedure|then|val|export|endif|in|each|true|false|to|do|enddo|execute)\b/i}],number:{pattern:/(^(?=\d)|[^\w\u0400-\u0484\u0487-\u052f\u1c80-\u1c88\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:\d+\.?\d*|\.\d+)(?:E[+-]?\d+)?/i,lookbehind:!0},operator:[/[<>+\-*/]=?|[%=]/,{pattern:/(^|[^\w\u0400-\u0484\u0487-\u052f\u1c80-\u1c88\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:и|или|не)(?![\w\u0400-\u0484\u0487-\u052f\u1c80-\u1c88\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])/i,lookbehind:!0},{pattern:/\b(?:and|or|not)\b/i}],punctuation:/\(\.|\.\)|[()\[\]:;,.]/,directive:[{pattern:/^(\s*)&.*/m,lookbehind:!0,alias:"important"},{pattern:/^\s*#.*/gm,alias:"important"}]},Prism.languages.oscript=Prism.languages.bsl; \ No newline at end of file +Prism.languages.bsl={comment:/\/\/.*/,string:[{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},{pattern:/'(?:[^'\r\n\\]|\\.)*'/}],keyword:[{pattern:/(^|[^\w\u0400-\u0484\u0487-\u052f\u1c80-\u1c88\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:пока|для|новый|прервать|попытка|исключение|вызватьисключение|иначе|конецпопытки|неопределено|функция|перем|возврат|конецфункции|если|иначеесли|процедура|конецпроцедуры|тогда|знач|экспорт|конецесли|из|каждого|истина|ложь|по|цикл|конеццикла|выполнить)(?![\w\u0400-\u0484\u0487-\u052f\u1c80-\u1c88\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])/i,lookbehind:!0},{pattern:/\b(?:while|for|new|break|try|except|raise|else|endtry|undefined|function|var|return|endfunction|null|if|elseif|procedure|endprocedure|then|val|export|endif|in|each|true|false|to|do|enddo|execute)\b/i}],number:{pattern:/(^(?=\d)|[^\w\u0400-\u0484\u0487-\u052f\u1c80-\u1c88\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:\d+\.?\d*|\.\d+)(?:E[+-]?\d+)?/i,lookbehind:!0},operator:[/[<>+\-*/]=?|[%=]/,{pattern:/(^|[^\w\u0400-\u0484\u0487-\u052f\u1c80-\u1c88\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:и|или|не)(?![\w\u0400-\u0484\u0487-\u052f\u1c80-\u1c88\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])/i,lookbehind:!0},{pattern:/\b(?:and|or|not)\b/i}],punctuation:/\(\.|\.\)|[()\[\]:;,.]/,directive:[{pattern:/^(\s*)&.*/m,lookbehind:!0,greedy:!0,alias:"important"},{pattern:/(^\s*)#.*/gm,lookbehind:!0,greedy:!0,alias:"important"}]},Prism.languages.oscript=Prism.languages.bsl; \ No newline at end of file diff --git a/components/prism-clojure.js b/components/prism-clojure.js index b69925aced..bf9920e8d7 100644 --- a/components/prism-clojure.js +++ b/components/prism-clojure.js @@ -11,6 +11,6 @@ Prism.languages.clojure = { lookbehind: true }, 'boolean': /\b(?:true|false|nil)\b/, - 'number': /\b[\da-f]+\b/i, + 'number': /\b\d+\b/i, 'punctuation': /[{}\[\](),]/ }; diff --git a/components/prism-clojure.min.js b/components/prism-clojure.min.js index 122f9ba52e..9fc106de1f 100644 --- a/components/prism-clojure.min.js +++ b/components/prism-clojure.min.js @@ -1 +1 @@ -Prism.languages.clojure={comment:/;.*/,string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0},operator:/(?:::|[:|'])\b[a-z][\w*+!?-]*\b/i,keyword:{pattern:/([^\w+*'?-])(?:def|if|do|let|\.\.|quote|var|->>|->|fn|loop|recur|throw|try|monitor-enter|\.|new|set!|def\-|defn|defn\-|defmacro|defmulti|defmethod|defstruct|defonce|declare|definline|definterface|defprotocol|==|defrecord|>=|deftype|<=|defproject|ns|\*|\+|\-|\/|<|=|>|accessor|agent|agent-errors|aget|alength|all-ns|alter|and|append-child|apply|array-map|aset|aset-boolean|aset-byte|aset-char|aset-double|aset-float|aset-int|aset-long|aset-short|assert|assoc|await|await-for|bean|binding|bit-and|bit-not|bit-or|bit-shift-left|bit-shift-right|bit-xor|boolean|branch\?|butlast|byte|cast|char|children|class|clear-agent-errors|comment|commute|comp|comparator|complement|concat|conj|cons|constantly|cond|if-not|construct-proxy|contains\?|count|create-ns|create-struct|cycle|dec|deref|difference|disj|dissoc|distinct|doall|doc|dorun|doseq|dosync|dotimes|doto|double|down|drop|drop-while|edit|end\?|ensure|eval|every\?|false\?|ffirst|file-seq|filter|find|find-doc|find-ns|find-var|first|float|flush|for|fnseq|frest|gensym|get-proxy-class|get|hash-map|hash-set|identical\?|identity|if-let|import|in-ns|inc|index|insert-child|insert-left|insert-right|inspect-table|inspect-tree|instance\?|int|interleave|intersection|into|into-array|iterate|join|key|keys|keyword|keyword\?|last|lazy-cat|lazy-cons|left|lefts|line-seq|list\*|list|load|load-file|locking|long|macroexpand|macroexpand-1|make-array|make-node|map|map-invert|map\?|mapcat|max|max-key|memfn|merge|merge-with|meta|min|min-key|name|namespace|neg\?|newline|next|nil\?|node|not|not-any\?|not-every\?|not=|ns-imports|ns-interns|ns-map|ns-name|ns-publics|ns-refers|ns-resolve|ns-unmap|nth|nthrest|or|parse|partial|path|peek|pop|pos\?|pr|pr-str|print|print-str|println|println-str|prn|prn-str|project|proxy|proxy-mappings|quot|rand|rand-int|range|re-find|re-groups|re-matcher|re-matches|re-pattern|re-seq|read|read-line|reduce|ref|ref-set|refer|rem|remove|remove-method|remove-ns|rename|rename-keys|repeat|replace|replicate|resolve|rest|resultset-seq|reverse|rfirst|right|rights|root|rrest|rseq|second|select|select-keys|send|send-off|seq|seq-zip|seq\?|set|short|slurp|some|sort|sort-by|sorted-map|sorted-map-by|sorted-set|special-symbol\?|split-at|split-with|str|string\?|struct|struct-map|subs|subvec|symbol|symbol\?|sync|take|take-nth|take-while|test|time|to-array|to-array-2d|tree-seq|true\?|union|up|update-proxy|val|vals|var-get|var-set|var\?|vector|vector-zip|vector\?|when|when-first|when-let|when-not|with-local-vars|with-meta|with-open|with-out-str|xml-seq|xml-zip|zero\?|zipmap|zipper)(?=[^\w+*'?-])/,lookbehind:!0},boolean:/\b(?:true|false|nil)\b/,number:/\b[\da-f]+\b/i,punctuation:/[{}\[\](),]/}; \ No newline at end of file +Prism.languages.clojure={comment:/;.*/,string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0},operator:/(?:::|[:|'])\b[a-z][\w*+!?-]*\b/i,keyword:{pattern:/([^\w+*'?-])(?:def|if|do|let|\.\.|quote|var|->>|->|fn|loop|recur|throw|try|monitor-enter|\.|new|set!|def\-|defn|defn\-|defmacro|defmulti|defmethod|defstruct|defonce|declare|definline|definterface|defprotocol|==|defrecord|>=|deftype|<=|defproject|ns|\*|\+|\-|\/|<|=|>|accessor|agent|agent-errors|aget|alength|all-ns|alter|and|append-child|apply|array-map|aset|aset-boolean|aset-byte|aset-char|aset-double|aset-float|aset-int|aset-long|aset-short|assert|assoc|await|await-for|bean|binding|bit-and|bit-not|bit-or|bit-shift-left|bit-shift-right|bit-xor|boolean|branch\?|butlast|byte|cast|char|children|class|clear-agent-errors|comment|commute|comp|comparator|complement|concat|conj|cons|constantly|cond|if-not|construct-proxy|contains\?|count|create-ns|create-struct|cycle|dec|deref|difference|disj|dissoc|distinct|doall|doc|dorun|doseq|dosync|dotimes|doto|double|down|drop|drop-while|edit|end\?|ensure|eval|every\?|false\?|ffirst|file-seq|filter|find|find-doc|find-ns|find-var|first|float|flush|for|fnseq|frest|gensym|get-proxy-class|get|hash-map|hash-set|identical\?|identity|if-let|import|in-ns|inc|index|insert-child|insert-left|insert-right|inspect-table|inspect-tree|instance\?|int|interleave|intersection|into|into-array|iterate|join|key|keys|keyword|keyword\?|last|lazy-cat|lazy-cons|left|lefts|line-seq|list\*|list|load|load-file|locking|long|macroexpand|macroexpand-1|make-array|make-node|map|map-invert|map\?|mapcat|max|max-key|memfn|merge|merge-with|meta|min|min-key|name|namespace|neg\?|newline|next|nil\?|node|not|not-any\?|not-every\?|not=|ns-imports|ns-interns|ns-map|ns-name|ns-publics|ns-refers|ns-resolve|ns-unmap|nth|nthrest|or|parse|partial|path|peek|pop|pos\?|pr|pr-str|print|print-str|println|println-str|prn|prn-str|project|proxy|proxy-mappings|quot|rand|rand-int|range|re-find|re-groups|re-matcher|re-matches|re-pattern|re-seq|read|read-line|reduce|ref|ref-set|refer|rem|remove|remove-method|remove-ns|rename|rename-keys|repeat|replace|replicate|resolve|rest|resultset-seq|reverse|rfirst|right|rights|root|rrest|rseq|second|select|select-keys|send|send-off|seq|seq-zip|seq\?|set|short|slurp|some|sort|sort-by|sorted-map|sorted-map-by|sorted-set|special-symbol\?|split-at|split-with|str|string\?|struct|struct-map|subs|subvec|symbol|symbol\?|sync|take|take-nth|take-while|test|time|to-array|to-array-2d|tree-seq|true\?|union|up|update-proxy|val|vals|var-get|var-set|var\?|vector|vector-zip|vector\?|when|when-first|when-let|when-not|with-local-vars|with-meta|with-open|with-out-str|xml-seq|xml-zip|zero\?|zipmap|zipper)(?=[^\w+*'?-])/,lookbehind:!0},boolean:/\b(?:true|false|nil)\b/,number:/\b\d+\b/i,punctuation:/[{}\[\](),]/}; \ No newline at end of file diff --git a/components/prism-jsstacktrace.js b/components/prism-jsstacktrace.js index 161c3546fc..3f1c930656 100644 --- a/components/prism-jsstacktrace.js +++ b/components/prism-jsstacktrace.js @@ -3,7 +3,7 @@ Prism.languages.jsstacktrace = { pattern: /^\S.*/m, alias: 'string' }, - + 'stack-frame': { pattern: /^[ \t]+at[ \t]+.*/m, inside: { @@ -11,30 +11,30 @@ Prism.languages.jsstacktrace = { pattern: /[ \t]+at[ \t]+(?:node\.js|\|.*(?:node_modules|\(\\)|\(\|\$|\(internal\/|\(node\.js)).*/m, alias: 'comment' }, - + 'filename': { pattern: /(\bat\s+|\()(?:[a-zA-Z]:)?[^():]+(?=:)/, lookbehind: true, alias: 'url' }, - + 'function': { - pattern: /(at\s+(?:new\s+)?)[_$a-zA-Z\xA0-\uFFFF<][.$\w\xA0-\uFFFF<>]*/, + pattern: /(\bat\s+(?:new\s+)?)[_$a-zA-Z\xA0-\uFFFF<][.$\w\xA0-\uFFFF<>]*/, lookbehind: true, inside: { 'punctuation': /\./ } }, - + 'punctuation': /[()]/, - + 'keyword': /\b(?:at|new)\b/, - + 'alias': { pattern: /\[(?:as\s+)?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\]/, alias: 'variable' }, - + 'line-number': { pattern: /:[0-9]+(?::[0-9]+)?\b/, alias: 'number', @@ -42,7 +42,7 @@ Prism.languages.jsstacktrace = { 'punctuation': /:/ } }, - + } } } diff --git a/components/prism-jsstacktrace.min.js b/components/prism-jsstacktrace.min.js index caad56d23d..7947cc979c 100644 --- a/components/prism-jsstacktrace.min.js +++ b/components/prism-jsstacktrace.min.js @@ -1 +1 @@ -Prism.languages.jsstacktrace={"error-message":{pattern:/^\S.*/m,alias:"string"},"stack-frame":{pattern:/^[ \t]+at[ \t]+.*/m,inside:{"not-my-code":{pattern:/[ \t]+at[ \t]+(?:node\.js|\|.*(?:node_modules|\(\\)|\(\|\$|\(internal\/|\(node\.js)).*/m,alias:"comment"},filename:{pattern:/(\bat\s+|\()(?:[a-zA-Z]:)?[^():]+(?=:)/,lookbehind:!0,alias:"url"},function:{pattern:/(at\s+(?:new\s+)?)[_$a-zA-Z\xA0-\uFFFF<][.$\w\xA0-\uFFFF<>]*/,lookbehind:!0,inside:{punctuation:/\./}},punctuation:/[()]/,keyword:/\b(?:at|new)\b/,alias:{pattern:/\[(?:as\s+)?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\]/,alias:"variable"},"line-number":{pattern:/:[0-9]+(?::[0-9]+)?\b/,alias:"number",inside:{punctuation:/:/}}}}}; \ No newline at end of file +Prism.languages.jsstacktrace={"error-message":{pattern:/^\S.*/m,alias:"string"},"stack-frame":{pattern:/^[ \t]+at[ \t]+.*/m,inside:{"not-my-code":{pattern:/[ \t]+at[ \t]+(?:node\.js|\|.*(?:node_modules|\(\\)|\(\|\$|\(internal\/|\(node\.js)).*/m,alias:"comment"},filename:{pattern:/(\bat\s+|\()(?:[a-zA-Z]:)?[^():]+(?=:)/,lookbehind:!0,alias:"url"},function:{pattern:/(\bat\s+(?:new\s+)?)[_$a-zA-Z\xA0-\uFFFF<][.$\w\xA0-\uFFFF<>]*/,lookbehind:!0,inside:{punctuation:/\./}},punctuation:/[()]/,keyword:/\b(?:at|new)\b/,alias:{pattern:/\[(?:as\s+)?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\]/,alias:"variable"},"line-number":{pattern:/:[0-9]+(?::[0-9]+)?\b/,alias:"number",inside:{punctuation:/:/}}}}}; \ No newline at end of file diff --git a/components/prism-moonscript.js b/components/prism-moonscript.js index 22d6b98036..9c7bd2e960 100644 --- a/components/prism-moonscript.js +++ b/components/prism-moonscript.js @@ -15,7 +15,7 @@ Prism.languages.moonscript = { 'moonscript': { pattern: /(^#\{)[\s\S]+(?=\})/, lookbehind: true, - inside: null // see beow + inside: null // see below }, 'interpolation-punctuation': { pattern: /#\{|\}/, @@ -41,6 +41,7 @@ Prism.languages.moonscript = { lookbehind: true }, 'function': { + // builtin functions pattern: /\b(?:_G|_VERSION|assert|collectgarbage|coroutine\.(?:running|create|resume|status|wrap|yield)|debug\.(?:debug|gethook|getinfo|getlocal|getupvalue|setlocal|setupvalue|sethook|traceback|getfenv|getmetatable|getregistry|setfenv|setmetatable)|dofile|error|getfenv|getmetatable|io\.(?:stdin|stdout|stderr|close|flush|input|lines|open|output|popen|read|tmpfile|type|write)|ipairs|load|loadfile|loadstring|math\.(?:abs|acos|asin|atan|atan2|ceil|sin|cos|tan|deg|exp|floor|log|log10|max|min|fmod|modf|cosh|sinh|tanh|pow|rad|sqrt|frexp|ldexp|random|randomseed|pi)|module|next|os\.(?:clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\.(?:cpath|loaded|loadlib|path|preload|seeall)|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|string\.(?:byte|char|dump|find|len|lower|rep|sub|upper|format|gsub|gmatch|match|reverse)|table\.(?:maxn|concat|sort|insert|remove)|tonumber|tostring|type|unpack|xpcall)\b/, inside: { 'punctuation': /\./ diff --git a/components/prism-nim.js b/components/prism-nim.js index 97990d9f63..78745dd94a 100644 --- a/components/prism-nim.js +++ b/components/prism-nim.js @@ -16,8 +16,9 @@ Prism.languages.nim = { } }, // We don't want to highlight operators inside backticks - 'ignore': { + 'identifier': { pattern: /`[^`\r\n]+`/, + greedy: true, inside: { 'punctuation': /`/ } @@ -30,4 +31,4 @@ Prism.languages.nim = { lookbehind: true }, 'punctuation': /[({\[]\.|\.[)}\]]|[`(){}\[\],:]/ -}; \ No newline at end of file +}; diff --git a/components/prism-nim.min.js b/components/prism-nim.min.js index 0a254a6345..364b524fe8 100644 --- a/components/prism-nim.min.js +++ b/components/prism-nim.min.js @@ -1 +1 @@ -Prism.languages.nim={comment:/#.*/,string:{pattern:/(?:(?:\b(?!\d)(?:\w|\\x[8-9a-fA-F][0-9a-fA-F])+)?(?:"""[\s\S]*?"""(?!")|"(?:\\[\s\S]|""|[^"\\])*")|'(?:\\(?:\d+|x[\da-fA-F]{2}|.)|[^'])')/,greedy:!0},number:/\b(?:0[xXoObB][\da-fA-F_]+|\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:[eE][+-]?\d[\d_]*)?)(?:'?[iuf]\d*)?/,keyword:/\b(?:addr|as|asm|atomic|bind|block|break|case|cast|concept|const|continue|converter|defer|discard|distinct|do|elif|else|end|enum|except|export|finally|for|from|func|generic|if|import|include|interface|iterator|let|macro|method|mixin|nil|object|out|proc|ptr|raise|ref|return|static|template|try|tuple|type|using|var|when|while|with|without|yield)\b/,function:{pattern:/(?:(?!\d)(?:\w|\\x[8-9a-fA-F][0-9a-fA-F])+|`[^`\r\n]+`)\*?(?:\[[^\]]+\])?(?=\s*\()/,inside:{operator:/\*$/}},ignore:{pattern:/`[^`\r\n]+`/,inside:{punctuation:/`/}},operator:{pattern:/(^|[({\[](?=\.\.)|(?![({\[]\.).)(?:(?:[=+\-*\/<>@$~&%|!?^:\\]|\.\.|\.(?![)}\]]))+|\b(?:and|div|of|or|in|is|isnot|mod|not|notin|shl|shr|xor)\b)/m,lookbehind:!0},punctuation:/[({\[]\.|\.[)}\]]|[`(){}\[\],:]/}; \ No newline at end of file +Prism.languages.nim={comment:/#.*/,string:{pattern:/(?:(?:\b(?!\d)(?:\w|\\x[8-9a-fA-F][0-9a-fA-F])+)?(?:"""[\s\S]*?"""(?!")|"(?:\\[\s\S]|""|[^"\\])*")|'(?:\\(?:\d+|x[\da-fA-F]{2}|.)|[^'])')/,greedy:!0},number:/\b(?:0[xXoObB][\da-fA-F_]+|\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:[eE][+-]?\d[\d_]*)?)(?:'?[iuf]\d*)?/,keyword:/\b(?:addr|as|asm|atomic|bind|block|break|case|cast|concept|const|continue|converter|defer|discard|distinct|do|elif|else|end|enum|except|export|finally|for|from|func|generic|if|import|include|interface|iterator|let|macro|method|mixin|nil|object|out|proc|ptr|raise|ref|return|static|template|try|tuple|type|using|var|when|while|with|without|yield)\b/,function:{pattern:/(?:(?!\d)(?:\w|\\x[8-9a-fA-F][0-9a-fA-F])+|`[^`\r\n]+`)\*?(?:\[[^\]]+\])?(?=\s*\()/,inside:{operator:/\*$/}},identifier:{pattern:/`[^`\r\n]+`/,greedy:!0,inside:{punctuation:/`/}},operator:{pattern:/(^|[({\[](?=\.\.)|(?![({\[]\.).)(?:(?:[=+\-*\/<>@$~&%|!?^:\\]|\.\.|\.(?![)}\]]))+|\b(?:and|div|of|or|in|is|isnot|mod|not|notin|shl|shr|xor)\b)/m,lookbehind:!0},punctuation:/[({\[]\.|\.[)}\]]|[`(){}\[\],:]/}; \ No newline at end of file diff --git a/components/prism-nix.js b/components/prism-nix.js index 0cd3302304..221d7fd519 100644 --- a/components/prism-nix.js +++ b/components/prism-nix.js @@ -8,13 +8,7 @@ Prism.languages.nix = { // The lookbehind ensures the ${} is not preceded by \ or '' pattern: /(^|(?:^|(?!'').)[^\\])\$\{(?:[^{}]|\{[^}]*\})*\}/, lookbehind: true, - inside: { - 'antiquotation': { - pattern: /^\$(?=\{)/, - alias: 'variable' - } - // See rest below - } + inside: null // See below } } }, @@ -37,4 +31,4 @@ Prism.languages.nix = { 'punctuation': /[{}()[\].,:;]/ }; -Prism.languages.nix.string.inside.interpolation.inside.rest = Prism.languages.nix; +Prism.languages.nix.string.inside.interpolation.inside = Prism.languages.nix; diff --git a/components/prism-nix.min.js b/components/prism-nix.min.js index 71ac54f8bb..add90d67d8 100644 --- a/components/prism-nix.min.js +++ b/components/prism-nix.min.js @@ -1 +1 @@ -Prism.languages.nix={comment:/\/\*[\s\S]*?\*\/|#.*/,string:{pattern:/"(?:[^"\\]|\\[\s\S])*"|''(?:(?!'')[\s\S]|''(?:'|\\|\$\{))*''/,greedy:!0,inside:{interpolation:{pattern:/(^|(?:^|(?!'').)[^\\])\$\{(?:[^{}]|\{[^}]*\})*\}/,lookbehind:!0,inside:{antiquotation:{pattern:/^\$(?=\{)/,alias:"variable"}}}}},url:[/\b(?:[a-z]{3,7}:\/\/)[\w\-+%~\/.:#=?&]+/,{pattern:/([^\/])(?:[\w\-+%~.:#=?&]*(?!\/\/)[\w\-+%~\/.:#=?&])?(?!\/\/)\/[\w\-+%~\/.:#=?&]*/,lookbehind:!0}],antiquotation:{pattern:/\$(?=\{)/,alias:"variable"},number:/\b\d+\b/,keyword:/\b(?:assert|builtins|else|if|in|inherit|let|null|or|then|with)\b/,function:/\b(?:abort|add|all|any|attrNames|attrValues|baseNameOf|compareVersions|concatLists|currentSystem|deepSeq|derivation|dirOf|div|elem(?:At)?|fetch(?:url|Tarball)|filter(?:Source)?|fromJSON|genList|getAttr|getEnv|hasAttr|hashString|head|import|intersectAttrs|is(?:Attrs|Bool|Function|Int|List|Null|String)|length|lessThan|listToAttrs|map|mul|parseDrvName|pathExists|read(?:Dir|File)|removeAttrs|replaceStrings|seq|sort|stringLength|sub(?:string)?|tail|throw|to(?:File|JSON|Path|String|XML)|trace|typeOf)\b|\bfoldl'\B/,boolean:/\b(?:true|false)\b/,operator:/[=!<>]=?|\+\+?|\|\||&&|\/\/|->?|[?@]/,punctuation:/[{}()[\].,:;]/},Prism.languages.nix.string.inside.interpolation.inside.rest=Prism.languages.nix; \ No newline at end of file +Prism.languages.nix={comment:/\/\*[\s\S]*?\*\/|#.*/,string:{pattern:/"(?:[^"\\]|\\[\s\S])*"|''(?:(?!'')[\s\S]|''(?:'|\\|\$\{))*''/,greedy:!0,inside:{interpolation:{pattern:/(^|(?:^|(?!'').)[^\\])\$\{(?:[^{}]|\{[^}]*\})*\}/,lookbehind:!0,inside:null}}},url:[/\b(?:[a-z]{3,7}:\/\/)[\w\-+%~\/.:#=?&]+/,{pattern:/([^\/])(?:[\w\-+%~.:#=?&]*(?!\/\/)[\w\-+%~\/.:#=?&])?(?!\/\/)\/[\w\-+%~\/.:#=?&]*/,lookbehind:!0}],antiquotation:{pattern:/\$(?=\{)/,alias:"variable"},number:/\b\d+\b/,keyword:/\b(?:assert|builtins|else|if|in|inherit|let|null|or|then|with)\b/,function:/\b(?:abort|add|all|any|attrNames|attrValues|baseNameOf|compareVersions|concatLists|currentSystem|deepSeq|derivation|dirOf|div|elem(?:At)?|fetch(?:url|Tarball)|filter(?:Source)?|fromJSON|genList|getAttr|getEnv|hasAttr|hashString|head|import|intersectAttrs|is(?:Attrs|Bool|Function|Int|List|Null|String)|length|lessThan|listToAttrs|map|mul|parseDrvName|pathExists|read(?:Dir|File)|removeAttrs|replaceStrings|seq|sort|stringLength|sub(?:string)?|tail|throw|to(?:File|JSON|Path|String|XML)|trace|typeOf)\b|\bfoldl'\B/,boolean:/\b(?:true|false)\b/,operator:/[=!<>]=?|\+\+?|\|\||&&|\/\/|->?|[?@]/,punctuation:/[{}()[\].,:;]/},Prism.languages.nix.string.inside.interpolation.inside=Prism.languages.nix; \ No newline at end of file diff --git a/components/prism-ocaml.js b/components/prism-ocaml.js index 101c82b066..da6d1814da 100644 --- a/components/prism-ocaml.js +++ b/components/prism-ocaml.js @@ -37,5 +37,5 @@ Prism.languages.ocaml = { 'boolean': /\b(?:false|true)\b/, // Custom operators are allowed 'operator': /:=|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/, - 'punctuation': /[(){}\[\]|.,:;]|\b_\b/ + 'punctuation': /[(){}\[\].,:;]|\b_\b/ }; diff --git a/components/prism-ocaml.min.js b/components/prism-ocaml.min.js index 016c477dc6..cfed2ddd96 100644 --- a/components/prism-ocaml.min.js +++ b/components/prism-ocaml.min.js @@ -1 +1 @@ -Prism.languages.ocaml={comment:/\(\*[\s\S]*?\*\)/,string:[{pattern:/"(?:\\.|[^\\\r\n"])*"/,greedy:!0},{pattern:/(['`])(?:\\(?:\d+|x[\da-f]+|.)|(?!\1)[^\\\r\n])\1/i,greedy:!0}],number:/\b(?:0x[\da-f][\da-f_]+|(?:0[bo])?\d[\d_]*\.?[\d_]*(?:e[+-]?[\d_]+)?)/i,directive:{pattern:/\B#\w+/,alias:"important"},label:{pattern:/\B~\w+/,alias:"function"},"type-variable":{pattern:/\B'\w+/,alias:"function"},variant:{pattern:/`\w+/,alias:"variable"},module:{pattern:/\b[A-Z]\w+/,alias:"variable"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,boolean:/\b(?:false|true)\b/,operator:/:=|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,punctuation:/[(){}\[\]|.,:;]|\b_\b/}; \ No newline at end of file +Prism.languages.ocaml={comment:/\(\*[\s\S]*?\*\)/,string:[{pattern:/"(?:\\.|[^\\\r\n"])*"/,greedy:!0},{pattern:/(['`])(?:\\(?:\d+|x[\da-f]+|.)|(?!\1)[^\\\r\n])\1/i,greedy:!0}],number:/\b(?:0x[\da-f][\da-f_]+|(?:0[bo])?\d[\d_]*\.?[\d_]*(?:e[+-]?[\d_]+)?)/i,directive:{pattern:/\B#\w+/,alias:"important"},label:{pattern:/\B~\w+/,alias:"function"},"type-variable":{pattern:/\B'\w+/,alias:"function"},variant:{pattern:/`\w+/,alias:"variable"},module:{pattern:/\b[A-Z]\w+/,alias:"variable"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,boolean:/\b(?:false|true)\b/,operator:/:=|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,punctuation:/[(){}\[\].,:;]|\b_\b/}; \ No newline at end of file diff --git a/components/prism-regex.js b/components/prism-regex.js index 0b9a576955..3a77b6a7f7 100644 --- a/components/prism-regex.js +++ b/components/prism-regex.js @@ -5,11 +5,11 @@ alias: 'escape' }; var escape = /\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|c[a-zA-Z]|0[0-7]{0,2}|[123][0-7]{2}|.)/; - var charClass = { + var charSet = { pattern: /\.|\\[wsd]|\\p{[^{}]+}/i, alias: 'class-name' }; - var charClassWithoutDot = { + var charsetWithoutDot = { pattern: /\\[wsd]|\\p{[^{}]+}/i, alias: 'class-name' }; @@ -25,16 +25,16 @@ }; Prism.languages.regex = { - 'charset': { + 'charclass': { pattern: /((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/, lookbehind: true, inside: { - 'charset-negation': { + 'charclass-negation': { pattern: /(^\[)\^/, lookbehind: true, alias: 'operator' }, - 'charset-punctuation': { + 'charclass-punctuation': { pattern: /^\[|\]$/, alias: 'punctuation' }, @@ -49,12 +49,12 @@ } }, 'special-escape': specialEscape, - 'charclass': charClassWithoutDot, + 'charset': charsetWithoutDot, 'escape': escape } }, 'special-escape': specialEscape, - 'charclass': charClass, + 'charset': charSet, 'backreference': [ { // a backreference which is not an octal escape diff --git a/components/prism-regex.min.js b/components/prism-regex.min.js index 15de75e94a..46788e994c 100644 --- a/components/prism-regex.min.js +++ b/components/prism-regex.min.js @@ -1 +1 @@ -!function(a){var e={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|c[a-zA-Z]|0[0-7]{0,2}|[123][0-7]{2}|.)/,t="(?:[^\\\\-]|"+n.source+")",s=RegExp(t+"-"+t),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};a.languages.regex={charset:{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"charset-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"charset-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:s,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":e,charclass:{pattern:/\\[wsd]|\\p{[^{}]+}/i,alias:"class-name"},escape:n}},"special-escape":e,charclass:{pattern:/\.|\\[wsd]|\\p{[^{}]+}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|']+(?=[>']$)/,lookbehind:!0,alias:"variable"};a.languages.regex={charclass:{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"charclass-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"charclass-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:s,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":e,charset:{pattern:/\\[wsd]|\\p{[^{}]+}/i,alias:"class-name"},escape:n}},"special-escape":e,charset:{pattern:/\.|\\[wsd]|\\p{[^{}]+}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|]?|>[=>]?|[&|^~]|\b(?:or|and|not|with|at)\b/,punctuation:/[{}[\];(),.:]/},Prism.languages.rpy=Prism.languages.renpy; \ No newline at end of file +Prism.languages.renpy={comment:{pattern:/(^|[^\\])#.+/,lookbehind:!0},string:{pattern:/("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\])*\2|(?:^#?(?:(?:[0-9a-fA-F]{2}){3}|(?:[0-9a-fA-F]){3})$)/m,greedy:!0},function:/[a-z_]\w*(?=\()/i,property:/\b(?:insensitive|idle|hover|selected_idle|selected_hover|background|position|alt|xpos|ypos|pos|xanchor|yanchor|anchor|xalign|yalign|align|xcenter|ycenter|xofsset|yoffset|ymaximum|maximum|xmaximum|xminimum|yminimum|minimum|xsize|ysizexysize|xfill|yfill|area|antialias|black_color|bold|caret|color|first_indent|font|size|italic|justify|kerning|language|layout|line_leading|line_overlap_split|line_spacing|min_width|newline_indent|outlines|rest_indent|ruby_style|slow_cps|slow_cps_multiplier|strikethrough|text_align|underline|hyperlink_functions|vertical|hinting|foreground|left_margin|xmargin|top_margin|bottom_margin|ymargin|left_padding|right_padding|xpadding|top_padding|bottom_padding|ypadding|size_group|child|hover_sound|activate_sound|mouse|focus_mask|keyboard_focus|bar_vertical|bar_invert|bar_resizing|left_gutter|right_gutter|top_gutter|bottom_gutter|left_bar|right_bar|top_bar|bottom_bar|thumb|thumb_shadow|thumb_offset|unscrollable|spacing|first_spacing|box_reverse|box_wrap|order_reverse|fit_first|ysize|thumbnail_width|thumbnail_height|help|text_ypos|text_xpos|idle_color|hover_color|selected_idle_color|selected_hover_color|insensitive_color|alpha|insensitive_background|hover_background|zorder|value|width|xadjustment|xanchoraround|xaround|xinitial|xoffset|xzoom|yadjustment|yanchoraround|yaround|yinitial|yzoom|zoom|ground|height|text_style|text_y_fudge|selected_insensitive|has_sound|has_music|has_voice|focus|hovered|image_style|length|minwidth|mousewheel|offset|prefix|radius|range|right_margin|rotate|rotate_pad|developer|screen_width|screen_height|window_title|name|version|windows_icon|default_fullscreen|default_text_cps|default_afm_time|main_menu_music|sample_sound|enter_sound|exit_sound|save_directory|enter_transition|exit_transition|intra_transition|main_game_transition|game_main_transition|end_splash_transition|end_game_transition|after_load_transition|window_show_transition|window_hide_transition|adv_nvl_transition|nvl_adv_transition|enter_yesno_transition|exit_yesno_transition|enter_replay_transition|exit_replay_transition|say_attribute_transition|directory_name|executable_name|include_update|window_icon|modal|google_play_key|google_play_salt|drag_name|drag_handle|draggable|dragged|droppable|dropped|narrator_menu|action|default_afm_enable|version_name|version_tuple|inside|fadeout|fadein|layers|layer_clipping|linear|scrollbars|side_xpos|side_ypos|side_spacing|edgescroll|drag_joined|drag_raise|drop_shadow|drop_shadow_color|subpixel|easein|easeout|time|crop|auto|update|get_installed_packages|can_update|UpdateVersion|Update|overlay_functions|translations|window_left_padding|show_side_image|show_two_window)\b/,tag:/\b(?:label|image|menu|[hv]box|frame|text|imagemap|imagebutton|bar|vbar|screen|textbutton|buttoscreenn|fixed|grid|input|key|mousearea|side|timer|viewport|window|hotspot|hotbar|self|button|drag|draggroup|tag|mm_menu_frame|nvl|block|parallel)\b|\$/,keyword:/\b(?:as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|yield|adjustment|alignaround|allow|angle|around|box_layout|cache|changed|child_size|clicked|clipping|corner1|corner2|default|delay|exclude|scope|slow|slow_abortable|slow_done|sound|style_group|substitute|suffix|transform_anchor|transpose|unhovered|config|theme|mm_root|gm_root|rounded_window|build|disabled_text|disabled|widget_selected|widget_text|widget_hover|widget|updater|behind|call|expression|hide|init|jump|onlayer|python|renpy|scene|set|show|transform|play|queue|stop|pause|define|repeat|contains|choice|on|function|event|animation|clockwise|counterclockwise|circles|knot|null|None|random|has|add|use|fade|dissolve|style|store|id|voice|center|left|right|less_rounded|music|movie|clear|persistent|ui)\b/,boolean:/\b(?:[Tt]rue|[Ff]alse)\b/,number:/(?:\b(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*)|\B\.\d+)(?:e[+-]?\d+)?j?/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not|with|at)\b/,punctuation:/[{}[\];(),.:]/},Prism.languages.rpy=Prism.languages.renpy; \ No newline at end of file diff --git a/components/prism-tap.js b/components/prism-tap.js index cc2961477b..59132ac67f 100644 --- a/components/prism-tap.js +++ b/components/prism-tap.js @@ -1,3 +1,4 @@ +// https://en.wikipedia.org/wiki/Test_Anything_Protocol Prism.languages.tap = { fail: /not ok[^#{\n\r]*/, pass: /ok[^#{\n\r]*/, diff --git a/components/prism-zig.js b/components/prism-zig.js index ead8b97f81..2eb5e54591 100644 --- a/components/prism-zig.js +++ b/components/prism-zig.js @@ -32,7 +32,7 @@ Prism.languages.zig = { 'comment': [ { - pattern: /\/{3}.*/, + pattern: /\/{2}[/!].*/, alias: 'doc-comment' }, /\/{2}.*/ @@ -52,7 +52,7 @@ }, { // characters 'a', '\n', '\xFF', '\u{10FFFF}' - pattern: /(^|[^\\])'(?:[^'\\\r\n]|\\(?:.|x[a-fA-F\d]{2}|u\{[a-fA-F\d]{1,6}\}))'/, + pattern: /(^|[^\\])'(?:[^'\\\r\n\uD800-\uDFFF]|[\uD800-\uDFFF].|\\(?:.|x[a-fA-F\d]{2}|u\{[a-fA-F\d]{1,6}\}))'/, lookbehind: true, greedy: true } diff --git a/components/prism-zig.min.js b/components/prism-zig.min.js index 3d5a639668..f0fd1c3d18 100644 --- a/components/prism-zig.min.js +++ b/components/prism-zig.min.js @@ -1 +1 @@ -!function(n){function e(e){return function(){return e}}var r=/\b(?:align|allowzero|and|asm|async|await|break|cancel|catch|comptime|const|continue|defer|else|enum|errdefer|error|export|extern|fn|for|if|inline|linksection|nakedcc|noalias|null|or|orelse|packed|promise|pub|resume|return|stdcallcc|struct|suspend|switch|test|threadlocal|try|undefined|union|unreachable|usingnamespace|var|volatile|while)\b/,a="\\b(?!"+r.source+")(?!\\d)\\w+\\b",o="align\\s*\\((?:[^()]|\\([^()]*\\))*\\)",s="(?!\\s)(?:!?\\s*(?:"+"(?:\\?|\\bpromise->|(?:\\[[^[\\]]*\\]|\\*(?!\\*)|\\*\\*)(?:\\s*|\\s*const\\b|\\s*volatile\\b|\\s*allowzero\\b)*)".replace(//g,e(o))+"\\s*)*"+"(?:\\bpromise\\b|(?:\\berror\\.)?(?:\\.)*(?!\\s+))".replace(//g,e(a))+")+";n.languages.zig={comment:[{pattern:/\/{3}.*/,alias:"doc-comment"},/\/{2}.*/],string:[{pattern:/(^|[^\\@])c?"(?:[^"\\\r\n]|\\.)*"/,lookbehind:!0,greedy:!0},{pattern:/([\r\n])([ \t]+c?\\{2}).*(?:(?:\r\n?|\n)\2.*)*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\])'(?:[^'\\\r\n]|\\(?:.|x[a-fA-F\d]{2}|u\{[a-fA-F\d]{1,6}\}))'/,lookbehind:!0,greedy:!0}],builtin:/\B@(?!\d)\w+(?=\s*\()/,label:{pattern:/(\b(?:break|continue)\s*:\s*)\w+\b|\b(?!\d)\w+\b(?=\s*:\s*(?:\{|while\b))/,lookbehind:!0},"class-name":[/\b(?!\d)\w+(?=\s*=\s*(?:(?:extern|packed)\s+)?(?:enum|struct|union)\s*[({])/,{pattern:RegExp("(:\\s*)(?=\\s*(?:\\s*)?[=;,)])|(?=\\s*(?:\\s*)?\\{)".replace(//g,e(s)).replace(//g,e(o))),lookbehind:!0,inside:null},{pattern:RegExp("(\\)\\s*)(?=\\s*(?:\\s*)?;)".replace(//g,e(s)).replace(//g,e(o))),lookbehind:!0,inside:null}],"builtin-types":{pattern:/\b(?:anyerror|bool|c_u?(?:short|int|long|longlong)|c_longdouble|c_void|comptime_(?:float|int)|[iu](?:8|16|32|64|128|size)|f(?:16|32|64|128)|noreturn|type|void)\b/,alias:"keyword"},keyword:r,function:/\b(?!\d)\w+(?=\s*\()/,number:/\b(?:0b[01]+|0o[0-7]+|0x[a-fA-F\d]+\.?[a-fA-F\d]*(?:[pP][+-]?[a-fA-F\d]+)?|\d+\.?\d*(?:[eE][+-]?\d+)?)\b/,boolean:/\b(?:false|true)\b/,operator:/\.[*?]|\.{2,3}|[-=]>|\*\*|\+\+|\|\||(?:<<|>>|[-+*]%|[-+*/%^&|<>!=])=?|[?~]/,punctuation:/[.:,;(){}[\]]/},n.languages.zig["class-name"].forEach(function(e){null===e.inside&&(e.inside=n.languages.zig)})}(Prism); \ No newline at end of file +!function(n){function e(e){return function(){return e}}var r=/\b(?:align|allowzero|and|asm|async|await|break|cancel|catch|comptime|const|continue|defer|else|enum|errdefer|error|export|extern|fn|for|if|inline|linksection|nakedcc|noalias|null|or|orelse|packed|promise|pub|resume|return|stdcallcc|struct|suspend|switch|test|threadlocal|try|undefined|union|unreachable|usingnamespace|var|volatile|while)\b/,a="\\b(?!"+r.source+")(?!\\d)\\w+\\b",o="align\\s*\\((?:[^()]|\\([^()]*\\))*\\)",s="(?!\\s)(?:!?\\s*(?:"+"(?:\\?|\\bpromise->|(?:\\[[^[\\]]*\\]|\\*(?!\\*)|\\*\\*)(?:\\s*|\\s*const\\b|\\s*volatile\\b|\\s*allowzero\\b)*)".replace(//g,e(o))+"\\s*)*"+"(?:\\bpromise\\b|(?:\\berror\\.)?(?:\\.)*(?!\\s+))".replace(//g,e(a))+")+";n.languages.zig={comment:[{pattern:/\/{2}[/!].*/,alias:"doc-comment"},/\/{2}.*/],string:[{pattern:/(^|[^\\@])c?"(?:[^"\\\r\n]|\\.)*"/,lookbehind:!0,greedy:!0},{pattern:/([\r\n])([ \t]+c?\\{2}).*(?:(?:\r\n?|\n)\2.*)*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\])'(?:[^'\\\r\n\uD800-\uDFFF]|[\uD800-\uDFFF].|\\(?:.|x[a-fA-F\d]{2}|u\{[a-fA-F\d]{1,6}\}))'/,lookbehind:!0,greedy:!0}],builtin:/\B@(?!\d)\w+(?=\s*\()/,label:{pattern:/(\b(?:break|continue)\s*:\s*)\w+\b|\b(?!\d)\w+\b(?=\s*:\s*(?:\{|while\b))/,lookbehind:!0},"class-name":[/\b(?!\d)\w+(?=\s*=\s*(?:(?:extern|packed)\s+)?(?:enum|struct|union)\s*[({])/,{pattern:RegExp("(:\\s*)(?=\\s*(?:\\s*)?[=;,)])|(?=\\s*(?:\\s*)?\\{)".replace(//g,e(s)).replace(//g,e(o))),lookbehind:!0,inside:null},{pattern:RegExp("(\\)\\s*)(?=\\s*(?:\\s*)?;)".replace(//g,e(s)).replace(//g,e(o))),lookbehind:!0,inside:null}],"builtin-types":{pattern:/\b(?:anyerror|bool|c_u?(?:short|int|long|longlong)|c_longdouble|c_void|comptime_(?:float|int)|[iu](?:8|16|32|64|128|size)|f(?:16|32|64|128)|noreturn|type|void)\b/,alias:"keyword"},keyword:r,function:/\b(?!\d)\w+(?=\s*\()/,number:/\b(?:0b[01]+|0o[0-7]+|0x[a-fA-F\d]+\.?[a-fA-F\d]*(?:[pP][+-]?[a-fA-F\d]+)?|\d+\.?\d*(?:[eE][+-]?\d+)?)\b/,boolean:/\b(?:false|true)\b/,operator:/\.[*?]|\.{2,3}|[-=]>|\*\*|\+\+|\|\||(?:<<|>>|[-+*]%|[-+*/%^&|<>!=])=?|[?~]/,punctuation:/[.:,;(){}[\]]/},n.languages.zig["class-name"].forEach(function(e){null===e.inside&&(e.inside=n.languages.zig)})}(Prism); \ No newline at end of file diff --git a/package.json b/package.json index c48a5bd3b1..6bc2af1c00 100755 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "build": "gulp", "test:aliases": "mocha tests/aliases-test.js", "test:core": "mocha tests/core/**/*.js", + "test:coverage": "mocha tests/coverage.js", "test:dependencies": "mocha tests/dependencies-test.js", "test:examples": "mocha tests/examples-test.js", "test:identifiers": "mocha tests/identifier-test.js", @@ -15,7 +16,7 @@ "test:patterns": "mocha tests/pattern-tests.js", "test:plugins": "mocha tests/plugins/**/*.js", "test:runner": "mocha tests/testrunner-tests.js", - "test": "npm run test:runner && npm run test:core && npm run test:dependencies && npm run test:languages && npm run test:plugins && npm run test:aliases && npm run test:patterns && npm run test:examples && npm run test:identifiers" + "test": "npm run test:runner && npm run test:core && npm run test:dependencies && npm run test:languages && npm run test:plugins && npm run test:aliases && npm run test:patterns && npm run test:examples && npm run test:identifiers && npm run test:coverage" }, "repository": { "type": "git", diff --git a/tests/coverage.js b/tests/coverage.js new file mode 100644 index 0000000000..7b3155fbca --- /dev/null +++ b/tests/coverage.js @@ -0,0 +1,127 @@ +"use strict"; + +const TestDiscovery = require("./helper/test-discovery"); +const TestCase = require("./helper/test-case"); +const path = require("path"); +const PrismLoader = require("./helper/prism-loader"); +const { BFS, BFSPathToPrismTokenPath } = require("./helper/util"); +const { assert } = require("chai"); +const components = require("../components.json"); +const ALL_LANGUAGES = [...Object.keys(components.languages).filter(k => k !== 'meta')]; + + +describe('Pattern test coverage', function () { + const testSuite = TestDiscovery.loadAllTests(__dirname + "/languages"); + + /** + * @type {Map} + * @typedef PatternData + * @property {string} pattern + * @property {string} language + * @property {Set} from + * @property {RegExpExecArray[]} matches + */ + const patterns = new Map(); + + /** + * @param {string | string[]} languages + * @returns {import("./helper/prism-loader").PrismInstance} + */ + function createInstance(languages) { + const Prism = PrismLoader.createInstance(languages); + + BFS(Prism.languages, (path, object) => { + const { key, value } = path[path.length - 1]; + const tokenPath = BFSPathToPrismTokenPath(path); + + if (Object.prototype.toString.call(value) == '[object RegExp]') { + const regex = makeGlobal(value); + object[key] = regex; + + const patternKey = String(regex); + let data = patterns.get(patternKey); + if (!data) { + data = { + pattern: String(regex), + language: path[1].key, + from: new Set([tokenPath]), + matches: [] + }; + patterns.set(patternKey, data); + } else { + data.from.add(tokenPath); + } + + regex.exec = string => { + let match = RegExp.prototype.exec.call(regex, string); + if (match) { + data.matches.push(match); + } + return match; + }; + } + }); + + return Prism; + } + + // This will cause ALL regexes of Prism to be registered in the patterns map. + // (Languages that don't have any tests can't be caught otherwise.) + createInstance(ALL_LANGUAGES); + + describe('Run all language tests', function () { + // define tests for all tests in all languages in the test suite + for (const languageIdentifier in testSuite) { + if (!testSuite.hasOwnProperty(languageIdentifier)) { + continue; + } + + it(languageIdentifier, function () { + this.timeout(10000); + + for (const filePath of testSuite[languageIdentifier]) { + if (path.extname(filePath) === '.test') { + TestCase.runTestCase({ languageIdentifier, filePath, createInstance }); + } else { + TestCase.runTestsWithHooks({ languageIdentifier, codes: require(filePath), createInstance }); + } + } + }); + } + }); + + describe('Coverage', function () { + for (const language of ALL_LANGUAGES) { + it(`- should cover all patterns in ${language}`, function () { + const untested = [...patterns.values()].filter(d => d.language === language && d.matches.length === 0); + if (untested.length > 0) { + assert.fail([ + `${untested.length} pattern(s) in ${language} are untested:\n` + + 'You can learn more about writing tests at https://prismjs.com/test-suite.html#writing-tests', + ...untested.map(data => { + const occurrences = [...data.from]; + return [ + `${occurrences[0]}:`, + `\t${data.pattern.length > 80 ? data.pattern.slice(0, 80) + '…' : data.pattern}`, + 'This pattern is completely untested. Add test files that match this pattern.', + ...(occurrences.length > 1 ? ['Other occurrences of this pattern:', ...occurrences.slice(1)] : []) + ].join('\n'); + }) + ].join('\n\n')); + } + }); + } + }); +}); + +/** + * @param {RegExp} regex + * @returns {RegExp} + */ +function makeGlobal(regex) { + if (regex.global) { + return regex; + } else { + return RegExp(regex.source, regex.flags + 'g'); + } +} diff --git a/tests/helper/prism-loader.js b/tests/helper/prism-loader.js index 30f1729ad5..b0984c8ffe 100644 --- a/tests/helper/prism-loader.js +++ b/tests/helper/prism-loader.js @@ -10,8 +10,10 @@ const coreChecks = require('./checks'); /** * @typedef PrismLoaderContext - * @property {import('../../components/prism-core')} Prism The Prism instance. + * @property {PrismInstance} Prism The Prism instance. * @property {Set} loaded A set of loaded components. + * + * @typedef {import('../../components/prism-core')} PrismInstance */ /** @type {Map} */ @@ -27,7 +29,7 @@ module.exports = { * Creates a new Prism instance with the given language loaded * * @param {string|string[]} languages - * @returns {import('../../components/prism-core')} + * @returns {PrismInstance} */ createInstance(languages) { let context = { diff --git a/tests/helper/test-case.js b/tests/helper/test-case.js index a00ceda1aa..a881c24ae9 100644 --- a/tests/helper/test-case.js +++ b/tests/helper/test-case.js @@ -47,15 +47,18 @@ module.exports = { * * The languages will be loaded in the order they were provided. * - * @param {string} languageIdentifier - * @param {string} filePath - * @param {boolean} acceptEmpty + * @param {object} param0 + * @param {string} param0.languageIdentifier + * @param {string} param0.filePath + * @param {boolean} [param0.acceptEmpty] + * @param {(languages: string[]) => import("./prism-loader").PrismInstance} [param0.createInstance] */ - runTestCase(languageIdentifier, filePath, acceptEmpty) { + runTestCase({ languageIdentifier, filePath, acceptEmpty, createInstance }) { const testCase = this.parseTestCaseFile(filePath); const usedLanguages = this.parseLanguageNames(languageIdentifier); - const Prism = PrismLoader.createInstance(usedLanguages.languages); + createInstance = createInstance || PrismLoader.createInstance.bind(PrismLoader); + const Prism = createInstance(usedLanguages.languages); // the first language is the main language to highlight const simplifiedTokenStream = this.simpleTokenize(Prism, testCase.code, usedLanguages.mainLanguage); @@ -220,12 +223,17 @@ module.exports = { * * Code is provided as the key and expected result as the value. * - * @param {string} languageIdentifier - * @param {object} codes + * @param {object} param0 + * @param {string} param0.languageIdentifier + * @param {object} param0.codes + * @param {(languages: string[]) => import("./prism-loader").PrismInstance} [param0.createInstance] */ - runTestsWithHooks(languageIdentifier, codes) { + runTestsWithHooks({ languageIdentifier, codes, createInstance }) { const usedLanguages = this.parseLanguageNames(languageIdentifier); - const Prism = PrismLoader.createInstance(usedLanguages.languages); + + createInstance = createInstance || PrismLoader.createInstance.bind(PrismLoader); + const Prism = createInstance(usedLanguages.languages); + // the first language is the main language to highlight for (const code in codes) { diff --git a/tests/helper/util.js b/tests/helper/util.js index c5efc8ebcf..cadc70a17d 100644 --- a/tests/helper/util.js +++ b/tests/helper/util.js @@ -20,7 +20,7 @@ module.exports = { * Performs a breadth-first search on the given start element. * * @param {any} start - * @param {(path: { key: string, value: any }[]) => void} callback + * @param {(path: { key: string, value: any }[], obj: Record) => void} callback */ BFS(start, callback) { const visited = new Set(); @@ -29,8 +29,6 @@ module.exports = { [{ key: null, value: start }] ]; - callback(toVisit[0]); - while (toVisit.length > 0) { /** @type {{ key: string, value: any }[][]} */ const newToVisit = []; @@ -44,7 +42,7 @@ module.exports = { const value = obj[key]; path.push({ key, value }); - callback(path); + callback(path, obj); if (Array.isArray(value) || Object.prototype.toString.call(value) == '[object Object]') { newToVisit.push([...path]); @@ -59,6 +57,29 @@ module.exports = { } }, + /** + * Given the `BFS` path given to `BFS` callbacks, this will return the Prism language token path of the current + * value (e.g. `Prism.languages.xml.tag.pattern`). + * + * @param {readonly{ key: string, value: any }[]} path + * @returns {string} + */ + BFSPathToPrismTokenPath(path) { + let tokenPath = 'Prism.languages'; + for (const { key } of path) { + if (!key) { + // do nothing + } else if (/^\d+$/.test(key)) { + tokenPath += `[${key}]`; + } else if (/^[a-z]\w*$/i.test(key)) { + tokenPath += `.${key}`; + } else { + tokenPath += `[${JSON.stringify(key)}]`; + } + } + return tokenPath; + }, + /** * Returns the AST of a given pattern. * diff --git a/tests/languages/ada/punctuation_feature.test b/tests/languages/ada/punctuation_feature.test new file mode 100644 index 0000000000..fec99a60a0 --- /dev/null +++ b/tests/languages/ada/punctuation_feature.test @@ -0,0 +1,14 @@ +. .. +, ; ( ) : + +---------------------------------------------------- + +[ + ["punctuation", "."], + ["punctuation", ".."], + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ":"] +] \ No newline at end of file diff --git a/tests/languages/applescript/punctuation_feature.test b/tests/languages/applescript/punctuation_feature.test new file mode 100644 index 0000000000..6b96c33559 --- /dev/null +++ b/tests/languages/applescript/punctuation_feature.test @@ -0,0 +1,18 @@ +{ } ( ) : , +¬ « » 《 》 + +---------------------------------------------------- + +[ + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ":"], + ["punctuation", ","], + ["punctuation", "¬"], + ["punctuation", "«"], + ["punctuation", "»"], + ["punctuation", "《"], + ["punctuation", "》"] +] diff --git a/tests/languages/aql/boolean_feature.test b/tests/languages/aql/boolean_feature.test new file mode 100644 index 0000000000..06db779894 --- /dev/null +++ b/tests/languages/aql/boolean_feature.test @@ -0,0 +1,13 @@ +true +false +TRUE +FALSE + +---------------------------------------------------- + +[ + ["boolean", "true"], + ["boolean", "false"], + ["boolean", "TRUE"], + ["boolean", "FALSE"] +] \ No newline at end of file diff --git a/tests/languages/arduino/builtin_feature.test b/tests/languages/arduino/builtin_feature.test new file mode 100644 index 0000000000..3b00050a80 --- /dev/null +++ b/tests/languages/arduino/builtin_feature.test @@ -0,0 +1,667 @@ +KeyboardController +MouseController +SoftwareSerial +EthernetServer +EthernetClient +LiquidCrystal +LiquidCrystal_I2C +RobotControl +GSMVoiceCall +EthernetUDP +EsploraTFT +HttpClient +RobotMotor +WiFiClient +GSMScanner +FileSystem +Scheduler +GSMServer +YunClient +YunServer +IPAddress +GSMClient +GSMModem +Keyboard +Ethernet +Console +GSMBand +Esplora +Stepper +Process +WiFiUDP +GSM_SMS +Mailbox +USBHost +Firmata +PImage +Client +Server +GSMPIN +FileIO +Bridge +Serial +EEPROM +Stream +Mouse +Audio +Servo +File +Task +GPRS +WiFi +Wire +TFT +GSM +SPI +SD +runShellCommandAsynchronously +analogWriteResolution +retrieveCallingNumber +printFirmwareVersion +analogReadResolution +sendDigitalPortPair +noListenOnLocalhost +readJoystickButton +setFirmwareVersion +readJoystickSwitch +scrollDisplayRight +getVoiceCallStatus +scrollDisplayLeft +writeMicroseconds +delayMicroseconds +beginTransmission +getSignalStrength +runAsynchronously +getAsynchronously +listenOnLocalhost +getCurrentCarrier +readAccelerometer +messageAvailable +sendDigitalPorts +lineFollowConfig +countryNameWrite +runShellCommand +readStringUntil +rewindDirectory +readTemperature +setClockDivider +readLightSensor +endTransmission +analogReference +detachInterrupt +countryNameRead +attachInterrupt +encryptionType +readBytesUntil +robotNameWrite +readMicrophone +robotNameRead +cityNameWrite +userNameWrite +readJoystickY +readJoystickX +mouseReleased +openNextFile +scanNetworks +noInterrupts +digitalWrite +beginSpeaker +mousePressed +isActionDone +mouseDragged +displayLogos +noAutoscroll +addParameter +remoteNumber +getModifiers +keyboardRead +userNameRead +waitContinue +processInput +parseCommand +printVersion +readNetworks +writeMessage +blinkVersion +cityNameRead +readMessage +setDataMode +parsePacket +isListening +setBitOrder +beginPacket +isDirectory +motorsWrite +drawCompass +digitalRead +clearScreen +serialEvent +rightToLeft +setTextSize +leftToRight +requestFrom +keyReleased +compassRead +analogWrite +interrupts +WiFiServer +disconnect +playMelody +parseFloat +autoscroll +getPINUsed +setPINUsed +setTimeout +sendAnalog +readSlider +analogRead +beginWrite +createChar +motorsStop +keyPressed +tempoWrite +readButton +subnetMask +debugPrint +macAddress +writeGreen +randomSeed +attachGPRS +readString +sendString +remotePort +releaseAll +mouseMoved +background +getXChange +getYChange +answerCall +getResult +voiceCall +endPacket +constrain +getSocket +writeJSON +getButton +available +connected +findUntil +readBytes +exitValue +readGreen +writeBlue +startLoop +isPressed +sendSysex +pauseMode +gatewayIP +setCursor +getOemKey +tuneWrite +noDisplay +loadImage +switchPIN +onRequest +onReceive +changePIN +playFile +noBuffer +parseInt +overflow +checkPIN +knobRead +beginTFT +bitClear +updateIR +bitWrite +position +writeRGB +highByte +writeRed +setSpeed +readBlue +noStroke +remoteIP +transfer +shutdown +hangCall +beginSMS +endWrite +attached +maintain +noCursor +checkReg +checkPUK +shiftOut +isValid +shiftIn +pulseIn +connect +println +localIP +pinMode +getIMEI +display +noBlink +process +getBand +running +beginSD +drawBMP +lowByte +setBand +release +bitRead +prepare +pointTo +readRed +setMode +noFill +remove +listen +stroke +detach +attach +noTone +exists +buffer +height +bitSet +circle +config +cursor +random +IRread +setDNS +endSMS +getKey +micros +millis +begin +print +write +ready +flush +width +isPIN +blink +clear +press +mkdir +rmdir +close +point +yield +image +BSSID +click +delay +read +text +move +peek +beep +rect +line +open +seek +fill +size +turn +stop +home +find +step +tone +sqrt +RSSI +SSID +end +bit +tan +cos +sin +pow +map +abs +max +min +get +run +put + +---------------------------------------------------- + +[ + ["builtin", "KeyboardController"], + ["builtin", "MouseController"], + ["builtin", "SoftwareSerial"], + ["builtin", "EthernetServer"], + ["builtin", "EthernetClient"], + ["builtin", "LiquidCrystal"], + ["builtin", "LiquidCrystal_I2C"], + ["builtin", "RobotControl"], + ["builtin", "GSMVoiceCall"], + ["builtin", "EthernetUDP"], + ["builtin", "EsploraTFT"], + ["builtin", "HttpClient"], + ["builtin", "RobotMotor"], + ["builtin", "WiFiClient"], + ["builtin", "GSMScanner"], + ["builtin", "FileSystem"], + ["builtin", "Scheduler"], + ["builtin", "GSMServer"], + ["builtin", "YunClient"], + ["builtin", "YunServer"], + ["builtin", "IPAddress"], + ["builtin", "GSMClient"], + ["builtin", "GSMModem"], + ["builtin", "Keyboard"], + ["builtin", "Ethernet"], + ["builtin", "Console"], + ["builtin", "GSMBand"], + ["builtin", "Esplora"], + ["builtin", "Stepper"], + ["builtin", "Process"], + ["builtin", "WiFiUDP"], + ["builtin", "GSM_SMS"], + ["builtin", "Mailbox"], + ["builtin", "USBHost"], + ["builtin", "Firmata"], + ["builtin", "PImage"], + ["builtin", "Client"], + ["builtin", "Server"], + ["builtin", "GSMPIN"], + ["builtin", "FileIO"], + ["builtin", "Bridge"], + ["builtin", "Serial"], + ["builtin", "EEPROM"], + ["builtin", "Stream"], + ["builtin", "Mouse"], + ["builtin", "Audio"], + ["builtin", "Servo"], + ["builtin", "File"], + ["builtin", "Task"], + ["builtin", "GPRS"], + ["builtin", "WiFi"], + ["builtin", "Wire"], + ["builtin", "TFT"], + ["builtin", "GSM"], + ["builtin", "SPI"], + ["builtin", "SD"], + ["builtin", "runShellCommandAsynchronously"], + ["builtin", "analogWriteResolution"], + ["builtin", "retrieveCallingNumber"], + ["builtin", "printFirmwareVersion"], + ["builtin", "analogReadResolution"], + ["builtin", "sendDigitalPortPair"], + ["builtin", "noListenOnLocalhost"], + ["builtin", "readJoystickButton"], + ["builtin", "setFirmwareVersion"], + ["builtin", "readJoystickSwitch"], + ["builtin", "scrollDisplayRight"], + ["builtin", "getVoiceCallStatus"], + ["builtin", "scrollDisplayLeft"], + ["builtin", "writeMicroseconds"], + ["builtin", "delayMicroseconds"], + ["builtin", "beginTransmission"], + ["builtin", "getSignalStrength"], + ["builtin", "runAsynchronously"], + ["builtin", "getAsynchronously"], + ["builtin", "listenOnLocalhost"], + ["builtin", "getCurrentCarrier"], + ["builtin", "readAccelerometer"], + ["builtin", "messageAvailable"], + ["builtin", "sendDigitalPorts"], + ["builtin", "lineFollowConfig"], + ["builtin", "countryNameWrite"], + ["builtin", "runShellCommand"], + ["builtin", "readStringUntil"], + ["builtin", "rewindDirectory"], + ["builtin", "readTemperature"], + ["builtin", "setClockDivider"], + ["builtin", "readLightSensor"], + ["builtin", "endTransmission"], + ["builtin", "analogReference"], + ["builtin", "detachInterrupt"], + ["builtin", "countryNameRead"], + ["builtin", "attachInterrupt"], + ["builtin", "encryptionType"], + ["builtin", "readBytesUntil"], + ["builtin", "robotNameWrite"], + ["builtin", "readMicrophone"], + ["builtin", "robotNameRead"], + ["builtin", "cityNameWrite"], + ["builtin", "userNameWrite"], + ["builtin", "readJoystickY"], + ["builtin", "readJoystickX"], + ["builtin", "mouseReleased"], + ["builtin", "openNextFile"], + ["builtin", "scanNetworks"], + ["builtin", "noInterrupts"], + ["builtin", "digitalWrite"], + ["builtin", "beginSpeaker"], + ["builtin", "mousePressed"], + ["builtin", "isActionDone"], + ["builtin", "mouseDragged"], + ["builtin", "displayLogos"], + ["builtin", "noAutoscroll"], + ["builtin", "addParameter"], + ["builtin", "remoteNumber"], + ["builtin", "getModifiers"], + ["builtin", "keyboardRead"], + ["builtin", "userNameRead"], + ["builtin", "waitContinue"], + ["builtin", "processInput"], + ["builtin", "parseCommand"], + ["builtin", "printVersion"], + ["builtin", "readNetworks"], + ["builtin", "writeMessage"], + ["builtin", "blinkVersion"], + ["builtin", "cityNameRead"], + ["builtin", "readMessage"], + ["builtin", "setDataMode"], + ["builtin", "parsePacket"], + ["builtin", "isListening"], + ["builtin", "setBitOrder"], + ["builtin", "beginPacket"], + ["builtin", "isDirectory"], + ["builtin", "motorsWrite"], + ["builtin", "drawCompass"], + ["builtin", "digitalRead"], + ["builtin", "clearScreen"], + ["builtin", "serialEvent"], + ["builtin", "rightToLeft"], + ["builtin", "setTextSize"], + ["builtin", "leftToRight"], + ["builtin", "requestFrom"], + ["builtin", "keyReleased"], + ["builtin", "compassRead"], + ["builtin", "analogWrite"], + ["builtin", "interrupts"], + ["builtin", "WiFiServer"], + ["builtin", "disconnect"], + ["builtin", "playMelody"], + ["builtin", "parseFloat"], + ["builtin", "autoscroll"], + ["builtin", "getPINUsed"], + ["builtin", "setPINUsed"], + ["builtin", "setTimeout"], + ["builtin", "sendAnalog"], + ["builtin", "readSlider"], + ["builtin", "analogRead"], + ["builtin", "beginWrite"], + ["builtin", "createChar"], + ["builtin", "motorsStop"], + ["builtin", "keyPressed"], + ["builtin", "tempoWrite"], + ["builtin", "readButton"], + ["builtin", "subnetMask"], + ["builtin", "debugPrint"], + ["builtin", "macAddress"], + ["builtin", "writeGreen"], + ["builtin", "randomSeed"], + ["builtin", "attachGPRS"], + ["builtin", "readString"], + ["builtin", "sendString"], + ["builtin", "remotePort"], + ["builtin", "releaseAll"], + ["builtin", "mouseMoved"], + ["builtin", "background"], + ["builtin", "getXChange"], + ["builtin", "getYChange"], + ["builtin", "answerCall"], + ["builtin", "getResult"], + ["builtin", "voiceCall"], + ["builtin", "endPacket"], + ["builtin", "constrain"], + ["builtin", "getSocket"], + ["builtin", "writeJSON"], + ["builtin", "getButton"], + ["builtin", "available"], + ["builtin", "connected"], + ["builtin", "findUntil"], + ["builtin", "readBytes"], + ["builtin", "exitValue"], + ["builtin", "readGreen"], + ["builtin", "writeBlue"], + ["builtin", "startLoop"], + ["builtin", "isPressed"], + ["builtin", "sendSysex"], + ["builtin", "pauseMode"], + ["builtin", "gatewayIP"], + ["builtin", "setCursor"], + ["builtin", "getOemKey"], + ["builtin", "tuneWrite"], + ["builtin", "noDisplay"], + ["builtin", "loadImage"], + ["builtin", "switchPIN"], + ["builtin", "onRequest"], + ["builtin", "onReceive"], + ["builtin", "changePIN"], + ["builtin", "playFile"], + ["builtin", "noBuffer"], + ["builtin", "parseInt"], + ["builtin", "overflow"], + ["builtin", "checkPIN"], + ["builtin", "knobRead"], + ["builtin", "beginTFT"], + ["builtin", "bitClear"], + ["builtin", "updateIR"], + ["builtin", "bitWrite"], + ["builtin", "position"], + ["builtin", "writeRGB"], + ["builtin", "highByte"], + ["builtin", "writeRed"], + ["builtin", "setSpeed"], + ["builtin", "readBlue"], + ["builtin", "noStroke"], + ["builtin", "remoteIP"], + ["builtin", "transfer"], + ["builtin", "shutdown"], + ["builtin", "hangCall"], + ["builtin", "beginSMS"], + ["builtin", "endWrite"], + ["builtin", "attached"], + ["builtin", "maintain"], + ["builtin", "noCursor"], + ["builtin", "checkReg"], + ["builtin", "checkPUK"], + ["builtin", "shiftOut"], + ["builtin", "isValid"], + ["builtin", "shiftIn"], + ["builtin", "pulseIn"], + ["builtin", "connect"], + ["builtin", "println"], + ["builtin", "localIP"], + ["builtin", "pinMode"], + ["builtin", "getIMEI"], + ["builtin", "display"], + ["builtin", "noBlink"], + ["builtin", "process"], + ["builtin", "getBand"], + ["builtin", "running"], + ["builtin", "beginSD"], + ["builtin", "drawBMP"], + ["builtin", "lowByte"], + ["builtin", "setBand"], + ["builtin", "release"], + ["builtin", "bitRead"], + ["builtin", "prepare"], + ["builtin", "pointTo"], + ["builtin", "readRed"], + ["builtin", "setMode"], + ["builtin", "noFill"], + ["builtin", "remove"], + ["builtin", "listen"], + ["builtin", "stroke"], + ["builtin", "detach"], + ["builtin", "attach"], + ["builtin", "noTone"], + ["builtin", "exists"], + ["builtin", "buffer"], + ["builtin", "height"], + ["builtin", "bitSet"], + ["builtin", "circle"], + ["builtin", "config"], + ["builtin", "cursor"], + ["builtin", "random"], + ["builtin", "IRread"], + ["builtin", "setDNS"], + ["builtin", "endSMS"], + ["builtin", "getKey"], + ["builtin", "micros"], + ["builtin", "millis"], + ["builtin", "begin"], + ["builtin", "print"], + ["builtin", "write"], + ["builtin", "ready"], + ["builtin", "flush"], + ["builtin", "width"], + ["builtin", "isPIN"], + ["builtin", "blink"], + ["builtin", "clear"], + ["builtin", "press"], + ["builtin", "mkdir"], + ["builtin", "rmdir"], + ["builtin", "close"], + ["builtin", "point"], + ["builtin", "yield"], + ["builtin", "image"], + ["builtin", "BSSID"], + ["builtin", "click"], + ["builtin", "delay"], + ["builtin", "read"], + ["builtin", "text"], + ["builtin", "move"], + ["builtin", "peek"], + ["builtin", "beep"], + ["builtin", "rect"], + ["builtin", "line"], + ["builtin", "open"], + ["builtin", "seek"], + ["builtin", "fill"], + ["builtin", "size"], + ["builtin", "turn"], + ["builtin", "stop"], + ["builtin", "home"], + ["builtin", "find"], + ["builtin", "step"], + ["builtin", "tone"], + ["builtin", "sqrt"], + ["builtin", "RSSI"], + ["builtin", "SSID"], + ["builtin", "end"], + ["builtin", "bit"], + ["builtin", "tan"], + ["builtin", "cos"], + ["builtin", "sin"], + ["builtin", "pow"], + ["builtin", "map"], + ["builtin", "abs"], + ["builtin", "max"], + ["builtin", "min"], + ["builtin", "get"], + ["builtin", "run"], + ["builtin", "put"] +] \ No newline at end of file diff --git a/tests/languages/arduino/constant_feature.test b/tests/languages/arduino/constant_feature.test new file mode 100644 index 0000000000..db9daec046 --- /dev/null +++ b/tests/languages/arduino/constant_feature.test @@ -0,0 +1,43 @@ +DIGITAL_MESSAGE +FIRMATA_STRING +ANALOG_MESSAGE +REPORT_DIGITAL +REPORT_ANALOG +INPUT_PULLUP +SET_PIN_MODE +INTERNAL2V56 +SYSTEM_RESET +LED_BUILTIN +INTERNAL1V1 +SYSEX_START +INTERNAL +EXTERNAL +DEFAULT +OUTPUT +INPUT +HIGH +LOW + +---------------------------------------------------- + +[ + ["constant", "DIGITAL_MESSAGE"], + ["constant", "FIRMATA_STRING"], + ["constant", "ANALOG_MESSAGE"], + ["constant", "REPORT_DIGITAL"], + ["constant", "REPORT_ANALOG"], + ["constant", "INPUT_PULLUP"], + ["constant", "SET_PIN_MODE"], + ["constant", "INTERNAL2V56"], + ["constant", "SYSTEM_RESET"], + ["constant", "LED_BUILTIN"], + ["constant", "INTERNAL1V1"], + ["constant", "SYSEX_START"], + ["constant", "INTERNAL"], + ["constant", "EXTERNAL"], + ["constant", "DEFAULT"], + ["constant", "OUTPUT"], + ["constant", "INPUT"], + ["constant", "HIGH"], + ["constant", "LOW"] +] \ No newline at end of file diff --git a/tests/languages/arduino/keyword_feature.test b/tests/languages/arduino/keyword_feature.test new file mode 100644 index 0000000000..89fd4737a7 --- /dev/null +++ b/tests/languages/arduino/keyword_feature.test @@ -0,0 +1,75 @@ +setup +if +else +while +do +for +return +in +instanceof +default +function +loop +goto +switch +case +new +try +throw +catch +finally +null +break +continue +boolean +bool +void +byte +word +string +String +array +int +long +integer +double + +---------------------------------------------------- + +[ + ["keyword", "setup"], + ["keyword", "if"], + ["keyword", "else"], + ["keyword", "while"], + ["keyword", "do"], + ["keyword", "for"], + ["keyword", "return"], + ["keyword", "in"], + ["keyword", "instanceof"], + ["keyword", "default"], + ["keyword", "function"], + ["keyword", "loop"], + ["keyword", "goto"], + ["keyword", "switch"], + ["keyword", "case"], + ["keyword", "new"], + ["keyword", "try"], + ["keyword", "throw"], + ["keyword", "catch"], + ["keyword", "finally"], + ["keyword", "null"], + ["keyword", "break"], + ["keyword", "continue"], + ["keyword", "boolean"], + ["keyword", "bool"], + ["keyword", "void"], + ["keyword", "byte"], + ["keyword", "word"], + ["keyword", "string"], + ["keyword", "String"], + ["keyword", "array"], + ["keyword", "int"], + ["keyword", "long"], + ["keyword", "integer"], + ["keyword", "double"] +] \ No newline at end of file diff --git a/tests/languages/basic/punctuation_feature.test b/tests/languages/basic/punctuation_feature.test new file mode 100644 index 0000000000..707eb4c662 --- /dev/null +++ b/tests/languages/basic/punctuation_feature.test @@ -0,0 +1,11 @@ +, ; : ( ) + +---------------------------------------------------- + +[ + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", ":"], + ["punctuation", "("], + ["punctuation", ")"] +] \ No newline at end of file diff --git a/tests/languages/batch/command_feature.test b/tests/languages/batch/command_feature.test index 350788a8bd..144773ea8f 100644 --- a/tests/languages/batch/command_feature.test +++ b/tests/languages/batch/command_feature.test @@ -1,10 +1,19 @@ FOR /l %%a in (5,-1,1) do (TITLE %title% -- closing in %%as) + +FOR /F %%A IN ('TYPE "%InFile%"^|find /v /c ""') + SET title=%~n0 + echo.Hello World + @ECHO OFF + if not defined ProgressFormat set "ProgressFormat=[PPPP]" + EXIT /b + set /a ProgressCnt+=1 + IF "%~1" NEQ "" (SET %~1=%new%) ELSE (echo.%new%) ---------------------------------------------------- @@ -12,13 +21,18 @@ IF "%~1" NEQ "" (SET %~1=%new%) ELSE (echo.%new%) [ ["command", [ ["keyword", "FOR"], - ["parameter", ["/l"]], + ["parameter", [ + "/l" + ]], ["variable", "%%a"], ["keyword", "in"], ["punctuation", "("], - ["number", "5"], ["punctuation", ","], - ["number", "-1"], ["punctuation", ","], - ["number", "1"], ["punctuation", ")"], + ["number", "5"], + ["punctuation", ","], + ["number", "-1"], + ["punctuation", ","], + ["number", "1"], + ["punctuation", ")"], ["keyword", "do"] ]], ["punctuation", "("], @@ -30,6 +44,27 @@ IF "%~1" NEQ "" (SET %~1=%new%) ELSE (echo.%new%) ]], ["punctuation", ")"], + ["command", [ + ["keyword", "FOR"], + ["parameter", [ + "/F" + ]], + ["variable", "%%A"], + " IN ('TYPE ", + ["string", "\"%InFile%\""], + ["operator", "^"], + "|find ", + ["parameter", [ + "/v" + ]], + ["parameter", [ + "/c" + ]], + ["string", "\"\""], + "'" + ]], + ["punctuation", ")"], + ["command", [ ["keyword", "SET"], ["variable", "title"], @@ -61,12 +96,16 @@ IF "%~1" NEQ "" (SET %~1=%new%) ELSE (echo.%new%) ["command", [ ["keyword", "EXIT"], - ["parameter", ["/b"]] + ["parameter", [ + "/b" + ]] ]], ["command", [ ["keyword", "set"], - ["parameter", ["/a"]], + ["parameter", [ + "/a" + ]], ["variable", "ProgressCnt"], ["operator", "+="], ["number", "1"] diff --git a/tests/languages/batch/label_feature.test b/tests/languages/batch/label_feature.test index a672ba0cc3..51506db747 100644 --- a/tests/languages/batch/label_feature.test +++ b/tests/languages/batch/label_feature.test @@ -1,11 +1,16 @@ :foo :Foo_Bar +GOTO:eof ---------------------------------------------------- [ ["label", ":foo"], - ["label", ":Foo_Bar"] + ["label", ":Foo_Bar"], + ["command", [ + ["keyword", "GOTO"], + ["label", ":eof"] + ]] ] ---------------------------------------------------- diff --git a/tests/languages/birb/class-name_feature.test b/tests/languages/birb/class-name_feature.test new file mode 100644 index 0000000000..b583dd8c5e --- /dev/null +++ b/tests/languages/birb/class-name_feature.test @@ -0,0 +1,57 @@ +class Birb { + String name = "Birb"; + int age = 5; + bool isMale = true; + + String getName() { + return name; + } +} + +List list = ["Seeb", 10, false]; + +---------------------------------------------------- + +[ + ["keyword", "class"], + ["class-name", "Birb"], + ["punctuation", "{"], + ["class-name", "String"], + ["variable", "name"], + ["operator", "="], + ["string", "\"Birb\""], + ["punctuation", ";"], + ["class-name", "int"], + ["variable", "age"], + ["operator", "="], + ["number", "5"], + ["punctuation", ";"], + ["class-name", "bool"], + ["variable", "isMale"], + ["operator", "="], + ["boolean", "true"], + ["punctuation", ";"], + + ["class-name", "String"], + ["function", "getName"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["class-name", "return"], + ["variable", "name"], + ["punctuation", ";"], + ["punctuation", "}"], + ["punctuation", "}"], + + ["class-name", "List"], + ["variable", "list"], + ["operator", "="], + ["punctuation", "["], + ["string", "\"Seeb\""], + ["punctuation", ","], + ["number", "10"], + ["punctuation", ","], + ["boolean", "false"], + ["punctuation", "]"], + ["punctuation", ";"] +] diff --git a/tests/languages/birb/function_feature.test b/tests/languages/birb/function_feature.test index 9b61b4b65a..ab0b6f823e 100644 --- a/tests/languages/birb/function_feature.test +++ b/tests/languages/birb/function_feature.test @@ -7,7 +7,7 @@ foo(0); ["keyword", "void"], ["function", "foo"], ["punctuation", "("], - ["variable", "int"], + ["class-name", "int"], ["variable", "a"], ["punctuation", ")"], ["punctuation", "{"], @@ -22,4 +22,4 @@ foo(0); ---------------------------------------------------- -Checks for functions. \ No newline at end of file +Checks for functions. diff --git a/tests/languages/birb/keyword_feature.test b/tests/languages/birb/keyword_feature.test index 8d1c1a3777..49f4634d27 100644 --- a/tests/languages/birb/keyword_feature.test +++ b/tests/languages/birb/keyword_feature.test @@ -1,35 +1,79 @@ -assert break case +assert; +break; +case; class; -const default -else enum -final +const; +default; +else; +enum; +final; follows; -for grab -if nest +for; +grab; +if; +nest; next; new; -noSeeb return -static switch -throw var -void while +noSeeb; +return; +static; +switch; +throw; +var; +void; +while; ---------------------------------------------------- [ - ["keyword", "assert"], ["keyword", "break"], ["keyword", "case"], - ["keyword", "class"], ["punctuation", ";"], - ["keyword", "const"], ["keyword", "default"], - ["keyword", "else"], ["keyword", "enum"], + ["keyword", "assert"], + ["punctuation", ";"], + ["keyword", "break"], + ["punctuation", ";"], + ["keyword", "case"], + ["punctuation", ";"], + ["keyword", "class"], + ["punctuation", ";"], + ["keyword", "const"], + ["punctuation", ";"], + ["keyword", "default"], + ["punctuation", ";"], + ["keyword", "else"], + ["punctuation", ";"], + ["keyword", "enum"], + ["punctuation", ";"], ["keyword", "final"], - ["keyword", "follows"], ["punctuation", ";"], - ["keyword", "for"], ["keyword", "grab"], - ["keyword", "if"], ["keyword", "nest"], - ["keyword", "next"], ["punctuation", ";"], - ["keyword", "new"], ["punctuation", ";"], - ["keyword", "noSeeb"], ["keyword", "return"], - ["keyword", "static"], ["keyword", "switch"], - ["keyword", "throw"], ["keyword", "var"], - ["keyword", "void"], ["keyword", "while"] + ["punctuation", ";"], + ["keyword", "follows"], + ["punctuation", ";"], + ["keyword", "for"], + ["punctuation", ";"], + ["keyword", "grab"], + ["punctuation", ";"], + ["keyword", "if"], + ["punctuation", ";"], + ["keyword", "nest"], + ["punctuation", ";"], + ["keyword", "next"], + ["punctuation", ";"], + ["keyword", "new"], + ["punctuation", ";"], + ["keyword", "noSeeb"], + ["punctuation", ";"], + ["keyword", "return"], + ["punctuation", ";"], + ["keyword", "static"], + ["punctuation", ";"], + ["keyword", "switch"], + ["punctuation", ";"], + ["keyword", "throw"], + ["punctuation", ";"], + ["keyword", "var"], + ["punctuation", ";"], + ["keyword", "void"], + ["punctuation", ";"], + ["keyword", "while"], + ["punctuation", ";"] ] ---------------------------------------------------- diff --git a/tests/languages/bsl/directive_feature.test b/tests/languages/bsl/directive_feature.test new file mode 100644 index 0000000000..5a80f3b7a8 --- /dev/null +++ b/tests/languages/bsl/directive_feature.test @@ -0,0 +1,13 @@ +&Client + +#If Server Then +#EndIf + +---------------------------------------------------- + +[ + ["directive", "&Client"], + + ["directive", "#If Server Then"], + ["directive", "#EndIf"] +] \ No newline at end of file diff --git a/tests/languages/bsl/punctuation_feature.test b/tests/languages/bsl/punctuation_feature.test new file mode 100644 index 0000000000..959335a2c8 --- /dev/null +++ b/tests/languages/bsl/punctuation_feature.test @@ -0,0 +1,17 @@ +(. .) +( ) [ ] : ; , . + +---------------------------------------------------- + +[ + ["punctuation", "(."], + ["punctuation", ".)"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", ":"], + ["punctuation", ";"], + ["punctuation", ","], + ["punctuation", "."] +] \ No newline at end of file diff --git a/tests/languages/bsl/string_feature.test b/tests/languages/bsl/string_feature.test index 4df2508a87..a1626ed204 100644 --- a/tests/languages/bsl/string_feature.test +++ b/tests/languages/bsl/string_feature.test @@ -1,11 +1,17 @@ "" "fo" +'' +'foo' + ---------------------------------------------------- [ ["string", "\"\""], - ["string", "\"fo\""] + ["string", "\"fo\""], + + ["string", "''"], + ["string", "'foo'"] ] ---------------------------------------------------- diff --git a/tests/languages/cil/directive_feature.test b/tests/languages/cil/directive_feature.test new file mode 100644 index 0000000000..8a39e9e390 --- /dev/null +++ b/tests/languages/cil/directive_feature.test @@ -0,0 +1,15 @@ +.class public Foo { +.method +.maxstack 2 + +---------------------------------------------------- + +[ + ["directive", ".class"], + ["keyword", "public"], + " Foo ", + ["punctuation", "{"], + ["directive", ".method"], + ["directive", ".maxstack"], + ["number", "2"] +] \ No newline at end of file diff --git a/tests/languages/cil/number_feature.test b/tests/languages/cil/number_feature.test new file mode 100644 index 0000000000..9fc6d85478 --- /dev/null +++ b/tests/languages/cil/number_feature.test @@ -0,0 +1,15 @@ +0x0 +0xFF.5F +-0x1 +-0xFF.5F + +---------------------------------------------------- + +[ + ["number", "0x0"], + ["number", "0xFF.5F"], + "\n-", + ["number", "0x1"], + "\n-", + ["number", "0xFF.5F"] +] \ No newline at end of file diff --git a/tests/languages/cil/punctuation_feature.test b/tests/languages/cil/punctuation_feature.test new file mode 100644 index 0000000000..8b4c9fc561 --- /dev/null +++ b/tests/languages/cil/punctuation_feature.test @@ -0,0 +1,21 @@ +( ) [ ] { } +; , : = + +IL_001f + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", ";"], + ["punctuation", ","], + ["punctuation", ":"], + ["punctuation", "="], + + ["punctuation", "IL_001f"] +] \ No newline at end of file diff --git a/tests/languages/clojure/number_feature.test b/tests/languages/clojure/number_feature.test new file mode 100644 index 0000000000..cebb719202 --- /dev/null +++ b/tests/languages/clojure/number_feature.test @@ -0,0 +1,9 @@ +0 +123 + +---------------------------------------------------- + +[ + ["number", "0"], + ["number", "123"] +] \ No newline at end of file diff --git a/tests/languages/concurnas/string_feature.test b/tests/languages/concurnas/string_feature.test index 609a5b38fb..b2d88e0a57 100644 --- a/tests/languages/concurnas/string_feature.test +++ b/tests/languages/concurnas/string_feature.test @@ -1,4 +1,5 @@ "hi" +"addition result: {1+2}" 'hi' r'say' r"hello" @@ -9,11 +10,32 @@ myAPL || x[⍋x←6?40] || ---------------------------------------------------- [ - ["string", [["string", "\"hi\""]]], - ["string", [["string", "'hi'"]]], - ["string", [["string", "r'say'"]]], - ["string", [["string", "r\"hello\""]]], - ["string", [["string", "'contains: \"'"]]], + ["string", [ + ["string", "\"hi\""] + ]], + ["string", [ + ["string", "\"addition result: "], + ["interpolation", [ + ["punctuation", "{"], + ["number", "1"], + ["operator", "+"], + ["number", "2"], + ["punctuation", "}"] + ]], + ["string", "\""] + ]], + ["string", [ + ["string", "'hi'"] + ]], + ["string", [ + ["string", "r'say'"] + ]], + ["string", [ + ["string", "r\"hello\""] + ]], + ["string", [ + ["string", "'contains: \"'"] + ]], ["langext", "myAPL || x[⍋x←6?40] ||"], "\r\n || invalid ||" ] diff --git a/tests/languages/csharp/class-name-declaration_feature.test b/tests/languages/csharp/class-name-declaration_feature.test index 93410553eb..cb9f306336 100644 --- a/tests/languages/csharp/class-name-declaration_feature.test +++ b/tests/languages/csharp/class-name-declaration_feature.test @@ -13,6 +13,8 @@ public static RGBColor FromRainbow(Rainbow colorBand) => _ => throw new ArgumentException(message: "invalid enum value", paramName: nameof(colorBand)), }; +try {} catch (ArgumentException e) {} + ---------------------------------------------------- [ @@ -102,7 +104,20 @@ public static RGBColor FromRainbow(Rainbow colorBand) => ["punctuation", ")"], ["punctuation", ","], ["punctuation", "}"], - ["punctuation", ";"] + ["punctuation", ";"], + + ["keyword", "try"], + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "catch"], + ["punctuation", "("], + ["class-name", [ + "ArgumentException" + ]], + " e", + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"] ] ---------------------------------------------------- diff --git a/tests/languages/csharp/interpolation-string_feature.test b/tests/languages/csharp/interpolation-string_feature.test index d5c2142721..54e7b4bce9 100644 --- a/tests/languages/csharp/interpolation-string_feature.test +++ b/tests/languages/csharp/interpolation-string_feature.test @@ -1,4 +1,5 @@ $"Hello, {{ {name} }}! Today is {date.DayOfWeek}, it's {date:HH:mm} now." +@$"Hello, {{ {name} }}! Today is {date.DayOfWeek}, it's {date:HH:mm} now." $"{a,5} and {b + "" /* foo ":} */:format} {h(a, b)}" $"{1}{2}{3}" @@ -47,6 +48,39 @@ $@"{ ]], ["string", " now.\""] ]], + ["interpolation-string", [ + ["string", "@$\"Hello, {{ "], + ["interpolation", [ + ["punctuation", "{"], + ["expression", [ + "name" + ]], + ["punctuation", "}"] + ]], + ["string", " }}! Today is "], + ["interpolation", [ + ["punctuation", "{"], + ["expression", [ + "date", + ["punctuation", "."], + "DayOfWeek" + ]], + ["punctuation", "}"] + ]], + ["string", ", it's "], + ["interpolation", [ + ["punctuation", "{"], + ["expression", [ + "date" + ]], + ["format-string", [ + ["punctuation", ":"], + "HH:mm" + ]], + ["punctuation", "}"] + ]], + ["string", " now.\""] + ]], ["interpolation-string", [ ["string", "$\""], ["interpolation", [ diff --git a/tests/languages/css!+css-extras/color_feature.test b/tests/languages/css!+css-extras/color_feature.test new file mode 100644 index 0000000000..6cea57cf75 --- /dev/null +++ b/tests/languages/css!+css-extras/color_feature.test @@ -0,0 +1,341 @@ +AliceBlue +AntiqueWhite +Aqua +Aquamarine +Azure +Beige +Bisque +Black +BlanchedAlmond +Blue +BlueViolet +Brown +BurlyWood +CadetBlue +Chartreuse +Chocolate +Coral +CornflowerBlue +Cornsilk +Crimson +Cyan +DarkBlue +DarkCyan +DarkGoldenRod +DarkGrey +DarkGreen +DarkKhaki +DarkMagenta +DarkOliveGreen +DarkOrange +DarkOrchid +DarkRed +DarkSalmon +DarkSeaGreen +DarkSlateBlue +DarkSlateGrey +DarkTurquoise +DarkViolet +DeepPink +DeepSkyBlue +DimGrey +DodgerBlue +FireBrick +FloralWhite +ForestGreen +Fuchsia +Gainsboro +GhostWhite +Gold +GoldenRod +Grey +Green +GreenYellow +HoneyDew +HotPink +IndianRed +Indigo +Ivory +Khaki +Lavender +LavenderBlush +LawnGreen +LemonChiffon +LightBlue +LightCoral +LightCyan +LightGoldenRodYellow +LightGrey +LightGreen +LightPink +LightSalmon +LightSeaGreen +LightSkyBlue +LightSlateGrey +LightSteelBlue +LightYellow +Lime +LimeGreen +Linen +Magenta +Maroon +MediumAquaMarine +MediumBlue +MediumOrchid +MediumPurple +MediumSeaGreen +MediumSlateBlue +MediumSpringGreen +MediumTurquoise +MediumVioletRed +MidnightBlue +MintCream +MistyRose +Moccasin +NavajoWhite +Navy +OldLace +Olive +OliveDrab +Orange +OrangeRed +Orchid +PaleGoldenRod +PaleGreen +PaleTurquoise +PaleVioletRed +PapayaWhip +PeachPuff +Peru +Pink +Plum +PowderBlue +Purple +Red +RosyBrown +RoyalBlue +SaddleBrown +Salmon +SandyBrown +SeaGreen +SeaShell +Sienna +Silver +SkyBlue +SlateBlue +SlateGrey +Snow +SpringGreen +SteelBlue +Tan +Teal +Thistle +Tomato +Transparent +Turquoise +Violet +Wheat +White +WhiteSmoke +Yellow +YellowGreen + +rgb(0,0,0) +rgba(0 , 255 , 0, 0.123) +hsl(170, 50%, 45%) +hsla(120,100%,50%,0.3) + +---------------------------------------------------- + +[ + ["color", "AliceBlue"], + ["color", "AntiqueWhite"], + ["color", "Aqua"], + ["color", "Aquamarine"], + ["color", "Azure"], + ["color", "Beige"], + ["color", "Bisque"], + ["color", "Black"], + ["color", "BlanchedAlmond"], + ["color", "Blue"], + ["color", "BlueViolet"], + ["color", "Brown"], + ["color", "BurlyWood"], + ["color", "CadetBlue"], + ["color", "Chartreuse"], + ["color", "Chocolate"], + ["color", "Coral"], + ["color", "CornflowerBlue"], + ["color", "Cornsilk"], + ["color", "Crimson"], + ["color", "Cyan"], + ["color", "DarkBlue"], + ["color", "DarkCyan"], + ["color", "DarkGoldenRod"], + ["color", "DarkGrey"], + ["color", "DarkGreen"], + ["color", "DarkKhaki"], + ["color", "DarkMagenta"], + ["color", "DarkOliveGreen"], + ["color", "DarkOrange"], + ["color", "DarkOrchid"], + ["color", "DarkRed"], + ["color", "DarkSalmon"], + ["color", "DarkSeaGreen"], + ["color", "DarkSlateBlue"], + ["color", "DarkSlateGrey"], + ["color", "DarkTurquoise"], + ["color", "DarkViolet"], + ["color", "DeepPink"], + ["color", "DeepSkyBlue"], + ["color", "DimGrey"], + ["color", "DodgerBlue"], + ["color", "FireBrick"], + ["color", "FloralWhite"], + ["color", "ForestGreen"], + ["color", "Fuchsia"], + ["color", "Gainsboro"], + ["color", "GhostWhite"], + ["color", "Gold"], + ["color", "GoldenRod"], + ["color", "Grey"], + ["color", "Green"], + ["color", "GreenYellow"], + ["color", "HoneyDew"], + ["color", "HotPink"], + ["color", "IndianRed"], + ["color", "Indigo"], + ["color", "Ivory"], + ["color", "Khaki"], + ["color", "Lavender"], + ["color", "LavenderBlush"], + ["color", "LawnGreen"], + ["color", "LemonChiffon"], + ["color", "LightBlue"], + ["color", "LightCoral"], + ["color", "LightCyan"], + ["color", "LightGoldenRodYellow"], + ["color", "LightGrey"], + ["color", "LightGreen"], + ["color", "LightPink"], + ["color", "LightSalmon"], + ["color", "LightSeaGreen"], + ["color", "LightSkyBlue"], + ["color", "LightSlateGrey"], + ["color", "LightSteelBlue"], + ["color", "LightYellow"], + ["color", "Lime"], + ["color", "LimeGreen"], + ["color", "Linen"], + ["color", "Magenta"], + ["color", "Maroon"], + ["color", "MediumAquaMarine"], + ["color", "MediumBlue"], + ["color", "MediumOrchid"], + ["color", "MediumPurple"], + ["color", "MediumSeaGreen"], + ["color", "MediumSlateBlue"], + ["color", "MediumSpringGreen"], + ["color", "MediumTurquoise"], + ["color", "MediumVioletRed"], + ["color", "MidnightBlue"], + ["color", "MintCream"], + ["color", "MistyRose"], + ["color", "Moccasin"], + ["color", "NavajoWhite"], + ["color", "Navy"], + ["color", "OldLace"], + ["color", "Olive"], + ["color", "OliveDrab"], + ["color", "Orange"], + ["color", "OrangeRed"], + ["color", "Orchid"], + ["color", "PaleGoldenRod"], + ["color", "PaleGreen"], + ["color", "PaleTurquoise"], + ["color", "PaleVioletRed"], + ["color", "PapayaWhip"], + ["color", "PeachPuff"], + ["color", "Peru"], + ["color", "Pink"], + ["color", "Plum"], + ["color", "PowderBlue"], + ["color", "Purple"], + ["color", "Red"], + ["color", "RosyBrown"], + ["color", "RoyalBlue"], + ["color", "SaddleBrown"], + ["color", "Salmon"], + ["color", "SandyBrown"], + ["color", "SeaGreen"], + ["color", "SeaShell"], + ["color", "Sienna"], + ["color", "Silver"], + ["color", "SkyBlue"], + ["color", "SlateBlue"], + ["color", "SlateGrey"], + ["color", "Snow"], + ["color", "SpringGreen"], + ["color", "SteelBlue"], + ["color", "Tan"], + ["color", "Teal"], + ["color", "Thistle"], + ["color", "Tomato"], + ["color", "Transparent"], + ["color", "Turquoise"], + ["color", "Violet"], + ["color", "Wheat"], + ["color", "White"], + ["color", "WhiteSmoke"], + ["color", "Yellow"], + ["color", "YellowGreen"], + + ["color", [ + ["function", "rgb"], + ["punctuation", "("], + ["number", "0"], + ["punctuation", ","], + ["number", "0"], + ["punctuation", ","], + ["number", "0"], + ["punctuation", ")"] + ]], + ["color", [ + ["function", "rgba"], + ["punctuation", "("], + ["number", "0"], + ["punctuation", ","], + ["number", "255"], + ["punctuation", ","], + ["number", "0"], + ["punctuation", ","], + ["number", "0.123"], + ["punctuation", ")"] + ]], + ["color", [ + ["function", "hsl"], + ["punctuation", "("], + ["number", "170"], + ["punctuation", ","], + ["number", "50"], + ["unit", "%"], + ["punctuation", ","], + ["number", "45"], + ["unit", "%"], + ["punctuation", ")"] + ]], + ["color", [ + ["function", "hsla"], + ["punctuation", "("], + ["number", "120"], + ["punctuation", ","], + ["number", "100"], + ["unit", "%"], + ["punctuation", ","], + ["number", "50"], + ["unit", "%"], + ["punctuation", ","], + ["number", "0.3"], + ["punctuation", ")"] + ]] +] \ No newline at end of file diff --git a/tests/languages/dhall/builtin_feature.test b/tests/languages/dhall/builtin_feature.test new file mode 100644 index 0000000000..e6da8f7913 --- /dev/null +++ b/tests/languages/dhall/builtin_feature.test @@ -0,0 +1,9 @@ +Some +None + +---------------------------------------------------- + +[ + ["builtin", "Some"], + ["builtin", "None"] +] \ No newline at end of file diff --git a/tests/languages/eiffel/punctuation_feature.test b/tests/languages/eiffel/punctuation_feature.test new file mode 100644 index 0000000000..5c0b85fe5b --- /dev/null +++ b/tests/languages/eiffel/punctuation_feature.test @@ -0,0 +1,29 @@ +:= << >> (| |) -> + +.foo + +{ } [ ] ; ( ) , : ? + +---------------------------------------------------- + +[ + ["punctuation", ":="], + ["punctuation", "<<"], + ["punctuation", ">>"], + ["punctuation", "(|"], + ["punctuation", "|)"], + ["punctuation", "->"], + + ["punctuation", "."], + "foo\n\n", + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", ";"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ","], + ["punctuation", ":"], + ["punctuation", "?"] +] \ No newline at end of file diff --git a/tests/languages/excel-formula/comment_feature.test b/tests/languages/excel-formula/comment_feature.test new file mode 100644 index 0000000000..3b5614583a --- /dev/null +++ b/tests/languages/excel-formula/comment_feature.test @@ -0,0 +1,10 @@ +N("comment") + +---------------------------------------------------- + +[ + ["function-name", "N"], + ["punctuation", "("], + ["comment", "\"comment\""], + ["punctuation", ")"] +] \ No newline at end of file diff --git a/tests/languages/factor/comments_feature.test b/tests/languages/factor/comments_feature.test index 5dc45765ea..23380a2f26 100644 --- a/tests/languages/factor/comments_feature.test +++ b/tests/languages/factor/comments_feature.test @@ -1,6 +1,7 @@ a! ! word !a ! word ! comment +! TODO: something ! bad ! fine ! "also a comment" @@ -37,6 +38,11 @@ ment*/ [ "normal-word", "!a"], [ "comment", [ "! word" ] ], [ "comment", [ "! comment" ] ], + ["comment", [ + "! ", + ["function", "TODO"], + ": something" + ]], [ "normal-word", "!" ], [ "normal-word", "bad" ], [ "comment", [ "! \tfine" ] ], diff --git a/tests/languages/factor/numbers_feature.test b/tests/languages/factor/numbers_feature.test index 3526183d87..93843c2c67 100644 --- a/tests/languages/factor/numbers_feature.test +++ b/tests/languages/factor/numbers_feature.test @@ -8,42 +8,55 @@ NAN: 80000deadbeef ---------------------------------------------------- +0x1.0p3 +0b1.010p2 +0x1.p1 + +---------------------------------------------------- [ - [ "number", "5" ], - [ "number", "1/5" ], - [ "number", "+9" ], - [ "number", "-9" ], - [ "number", "+1/5" ], - [ "number", "-1/5" ], - [ "number", "23+1/5" ], - [ "number", "-23-1/5" ], - [ "normal-word", "23-1/5" ], - [ "comment", [ "! last one = word" ] ], - [ "number", "0.01" ], - [ "number", "0e0" ], - [ "number", "3E4" ], - [ "number", "3e-4" ], - [ "number", "3E-4" ], - [ "number", "030" ], - [ "number", "0xd" ], - [ "number", "0o30" ], - [ "number", "0b1100" ], - [ "number", "-0" ], - [ "number", "-0.01" ], - [ "number", "-0e0" ], - [ "number", "-3E4" ], - [ "number", "-3E-4" ], - [ "number", "-030" ], - [ "number", "-0xd" ], - [ "number", "-0o30" ], - [ "number", "-0b1100" ], - [ "number", "348756424956392657834385437598743583648756332457" ], - [ "number", "-348756424956392657834385437598743583648756332457" ], - [ "number", "NAN: 80000deadbeef" ] + ["number", "5"], + ["number", "1/5"], + ["number", "+9"], + ["number", "-9"], + ["number", "+1/5"], + ["number", "-1/5"], + ["number", "23+1/5"], + ["number", "-23-1/5"], + ["normal-word", "23-1/5"], + ["comment", [ + "! last one = word" + ]], + + ["number", "0.01"], + ["number", "0e0"], + ["number", "3E4"], + ["number", "3e-4"], + ["number", "3E-4"], + ["number", "030"], + ["number", "0xd"], + ["number", "0o30"], + ["number", "0b1100"], + ["number", "-0"], + ["number", "-0.01"], + ["number", "-0e0"], + ["number", "-3E4"], + ["number", "-3E-4"], + ["number", "-030"], + ["number", "-0xd"], + ["number", "-0o30"], + ["number", "-0b1100"], + + ["number", "348756424956392657834385437598743583648756332457"], + ["number", "-348756424956392657834385437598743583648756332457"], + + ["number", "NAN: 80000deadbeef"], + + ["number", "0x1.0p3"], + ["number", "0b1.010p2"], + ["number", "0x1.p1"] ] ---------------------------------------------------- +---------------------------------------------------- -numbers +numbers \ No newline at end of file diff --git a/tests/languages/factor/strings_feature.test b/tests/languages/factor/strings_feature.test index 94e77b0c3f..77e6a36dc7 100644 --- a/tests/languages/factor/strings_feature.test +++ b/tests/languages/factor/strings_feature.test @@ -19,6 +19,8 @@ "+5" "-5" +"sssssh" "(" ")" surround . + HEREDOC: marker text \n marker @@ -40,88 +42,150 @@ P" " P"" P" as\\"" ----------------------------------------------------------- +---------------------------------------------------- [ - [ "string", ["\"s\""] ], - [ "normal-word", "word\"word\"" ], - [ "comment", ["! word: word\"word\""] ], - [ "string", ["\"adjacent\""] ], - [ "string", ["\"strings\""] ], - [ "string", ["\" ! str not comment\""] ], - [ "comment", ["! comment"] ], - - [ "string", ["\"!\""] ], - [ "string", ["\" ! \""] ], - [ "string", ["\"! \""] ], - - [ "string", [ + ["string", [ + "\"s\"" + ]], + ["normal-word", "word\"word\""], + ["comment", [ + "! word: word\"word\"" + ]], + ["string", [ + "\"adjacent\"" + ]], + ["string", [ + "\"strings\"" + ]], + ["string", [ + "\" ! str not comment\"" + ]], + ["comment", [ + "! comment" + ]], + ["string", [ + "\"!\"" + ]], + ["string", [ + "\" ! \"" + ]], + ["string", [ + "\"! \"" + ]], + + ["string", [ "\"", - [ "number", "\\\"" ], + ["number", "\\\""], "\"" - ] ], - [ "string", ["\"'\""] ], - [ "string", [ + ]], + ["string", [ + "\"'\"" + ]], + ["string", [ "\"", ["number", "\\n"], "\"" - ] ], - [ "string", ["\"", ["number", "\\\\"], "\""] ], + ]], + ["string", [ + "\"", + ["number", "\\\\"], + "\"" + ]], - [ "string", ["\"str\""] ], + ["string", [ + "\"str\"" + ]], "5\r\n", - - ["string", ["\"str\""] ], + ["string", [ + "\"str\"" + ]], "[ ", - [ "quotation-delimiter", "]" ], - - [ "string", ["\"str\""] ], + ["quotation-delimiter", "]"], + ["string", [ + "\"str\"" + ]], "{ ", - [ "curly-brace-literal-delimiter", "}" ], - - [ "curly-brace-literal-delimiter", "{" ], - [ "string", ["\"a\""] ], + ["curly-brace-literal-delimiter", "}"], + ["curly-brace-literal-delimiter", "{"], + ["string", [ + "\"a\"" + ]], "}\r\n", - - [ "string", ["\"5\""] ], - [ "string", ["\"1/5\""] ], - [ "string", ["\"+5\""] ], - [ "string", ["\"-5\""] ], - - [ "multiline-string", [ + ["string", [ + "\"5\"" + ]], + ["string", [ + "\"1/5\"" + ]], + ["string", [ + "\"+5\"" + ]], + ["string", [ + "\"-5\"" + ]], + + ["string", [ + "\"sssssh\"" + ]], + ["string", [ + "\"(\"" + ]], + ["string", [ + "\")\"" + ]], + ["sequences-builtin", "surround"], + ["normal-word", "."], + + ["multiline-string", [ "HEREDOC: marker\r\ntext ", - [ "number", "\\n" ], + ["number", "\\n"], "\r\nmarker" - ] ], + ]], - [ "multiline-string", [ + ["multiline-string", [ "STRING: name\r\ntext ", - [ "number", "\\n" ], - [ "semicolon-or-setlocal", ";" ] - ] ], - - [ "multiline-string", [ "[[ string ]]" ] ], - [ "multiline-string", [ "[[ string]]" ] ], - [ "multiline-string", [ "[==[ string ]==]" ] ], - [ "multiline-string", [ "[==[ string]==]" ] ], - [ "normal-word", "[[word" ], - [ "normal-word", "]]" ], - [ "custom-string", ["URL\" \""] ], - [ "normal-word", "URL\"\"" ], - - [ "custom-string", ["SBUF\" \""] ], - [ "normal-word", "SBUF\"\"" ], - - [ "custom-string", ["P\" \""] ], - [ "normal-word", "P\"\"" ], - [ "custom-string", [ + ["number", "\\n"], + ["semicolon-or-setlocal", ";"] + ]], + + ["multiline-string", [ + "[[ string ]]" + ]], + ["multiline-string", [ + "[[ string]]" + ]], + ["multiline-string", [ + "[==[ string ]==]" + ]], + ["multiline-string", [ + "[==[ string]==]" + ]], + + ["normal-word", "[[word"], + ["normal-word", "]]"], + + ["custom-string", [ + "URL\" \"" + ]], + ["normal-word", "URL\"\""], + ["custom-string", [ + "SBUF\" \"" + ]], + ["normal-word", "SBUF\"\""], + ["custom-string", [ + "P\" \"" + ]], + ["normal-word", "P\"\""], + + ["custom-string", [ "P\" as", - [ "number", "\\\\" ], + ["number", "\\\\"], "\"" - ] ], + ]], "\"" ] ----------------------------------------------------------- +---------------------------------------------------- -string kinds +string kinds \ No newline at end of file diff --git a/tests/languages/firestore-security-rules/path_feature.test b/tests/languages/firestore-security-rules/path_feature.test index 1ff01e6dc6..edb83e652a 100644 --- a/tests/languages/firestore-security-rules/path_feature.test +++ b/tests/languages/firestore-security-rules/path_feature.test @@ -5,6 +5,7 @@ /foo/{x}/{y}/{z}/bar /foo/$(x)/$(y)/bar/$(request.auth.uid) +/cities/{document=**} ---------------------------------------------------- @@ -15,6 +16,7 @@ ["punctuation", "/"], "foo" ]], + ["path", [ ["punctuation", "/"], "foo", @@ -61,6 +63,7 @@ ["punctuation", "/"], "bar" ]], + ["path", [ ["punctuation", "/"], "foo", @@ -91,9 +94,21 @@ "uid", ["punctuation", ")"] ]] + ]], + ["path", [ + ["punctuation", "/"], + "cities", + ["punctuation", "/"], + ["variable", [ + ["punctuation", "{"], + "document", + ["operator", "="], + ["keyword", "**"], + ["punctuation", "}"] + ]] ]] ] ---------------------------------------------------- -Checks for paths. +Checks for paths. \ No newline at end of file diff --git a/tests/languages/fortran/number_feature.test b/tests/languages/fortran/number_feature.test index c7b4a4cf3c..f01a642bc3 100644 --- a/tests/languages/fortran/number_feature.test +++ b/tests/languages/fortran/number_feature.test @@ -25,13 +25,13 @@ Z"00BC" ["number", "10.93E7_QUAD"], ["number", "3E4"], ["quoted-number", "B'01110'"], - ["quoted-number", "B\"010\""], - ["quoted-number", "O'047'"], - ["quoted-number", "O\"642\""], - ["quoted-number", "Z'F41A'"], - ["quoted-number", "Z\"00BC\""] + ["quoted-number", "B\"010\""], + ["quoted-number", "O'047'"], + ["quoted-number", "O\"642\""], + ["quoted-number", "Z'F41A'"], + ["quoted-number", "Z\"00BC\""] ] ---------------------------------------------------- -Checks for numbers and quoted numbers. \ No newline at end of file +Checks for numbers and quoted numbers. diff --git a/tests/languages/fortran/punctuation_feature.test b/tests/languages/fortran/punctuation_feature.test new file mode 100644 index 0000000000..c87e940de9 --- /dev/null +++ b/tests/languages/fortran/punctuation_feature.test @@ -0,0 +1,15 @@ +(/ /) +( ) , ; : & + +---------------------------------------------------- + +[ + ["punctuation", "(/"], + ["punctuation", "/)"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", ":"], + ["punctuation", "&"] +] \ No newline at end of file diff --git a/tests/languages/ftl/directive_feature.test b/tests/languages/ftl/directive_feature.test index 783c3027b2..57bdb62393 100644 --- a/tests/languages/ftl/directive_feature.test +++ b/tests/languages/ftl/directive_feature.test @@ -1,3 +1,5 @@ +<#import "/libs/commons.ftl" as com> + <#if a < b> a is less than b <#elseif (a > b)> @@ -12,6 +14,21 @@ ---------------------------------------------------- [ + ["ftl", [ + ["ftl-directive", [ + ["punctuation", "<"], + ["directive", "#import"], + ["content", [ + ["string", [ + "\"/libs/commons.ftl\"" + ]], + ["keyword", "as"], + " com" + ]], + ["punctuation", ">"] + ]] + ]], + ["ftl", [ ["ftl-directive", [ ["punctuation", "<"], @@ -81,4 +98,4 @@ ---------------------------------------------------- -Checks for directive. This includes both predefined and user-defined ones. +Checks for directive. This includes both predefined and user-defined ones. \ No newline at end of file diff --git a/tests/languages/gdscript/number_feature.test b/tests/languages/gdscript/number_feature.test index 00ad250b01..22dd13464a 100644 --- a/tests/languages/gdscript/number_feature.test +++ b/tests/languages/gdscript/number_feature.test @@ -11,6 +11,8 @@ 0xBAD_FACE 0b_0010_0010_0100_0100 +INF NAN PI TAU + ---------------------------------------------------- [ @@ -26,9 +28,14 @@ ["number", "1_000_000_000_000"], ["number", "0xBAD_FACE"], - ["number", "0b_0010_0010_0100_0100"] + ["number", "0b_0010_0010_0100_0100"], + + ["number", "INF"], + ["number", "NAN"], + ["number", "PI"], + ["number", "TAU"] ] ---------------------------------------------------- -Checks for numbers. +Checks for numbers. \ No newline at end of file diff --git a/tests/languages/ichigojam/punctuation_feature.test b/tests/languages/ichigojam/punctuation_feature.test new file mode 100644 index 0000000000..f972683053 --- /dev/null +++ b/tests/languages/ichigojam/punctuation_feature.test @@ -0,0 +1,13 @@ +[ ] , ; : ( ) + +---------------------------------------------------- + +[ + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", ":"], + ["punctuation", "("], + ["punctuation", ")"] +] \ No newline at end of file diff --git a/tests/languages/iecst/comment_feature.test b/tests/languages/iecst/comment_feature.test new file mode 100644 index 0000000000..2e371dd654 --- /dev/null +++ b/tests/languages/iecst/comment_feature.test @@ -0,0 +1,11 @@ +// comment +(* comment *) +/* comment */ + +---------------------------------------------------- + +[ + ["comment", "// comment"], + ["comment", "(* comment *)"], + ["comment", "/* comment */"] +] \ No newline at end of file diff --git a/tests/languages/io/builtin_feature.test b/tests/languages/io/builtin_feature.test new file mode 100644 index 0000000000..0d6cf1786b --- /dev/null +++ b/tests/languages/io/builtin_feature.test @@ -0,0 +1,161 @@ +Array +AudioDevice +AudioMixer +Block +Box +Buffer +CFunction +CGI +Color +Curses +DBM +DNSResolver +DOConnection +DOProxy +DOServer +Date +Directory +Duration +DynLib +Error +Exception +FFT +File +Fnmatch +Font +Future +GL +GLE +GLScissor +GLU +GLUCylinder +GLUQuadric +GLUSphere +GLUT +Host +Image +Importer +LinkList +List +Lobby +Locals +MD5 +MP3Decoder +MP3Encoder +Map +Message +Movie +Notification +Number +Object +OpenGL +Point +Protos +Regex +SGML +SGMLElement +SGMLParser +SQLite +Server +Sequence +ShowMessage +SleepyCat +SleepyCatCursor +Socket +SocketManager +Sound +Soup +Store +String +Tree +UDPSender +UPDReceiver +URL +User +Warning +WeakLink +Random +BigNum + +---------------------------------------------------- + +[ + ["builtin", "Array"], + ["builtin", "AudioDevice"], + ["builtin", "AudioMixer"], + ["builtin", "Block"], + ["builtin", "Box"], + ["builtin", "Buffer"], + ["builtin", "CFunction"], + ["builtin", "CGI"], + ["builtin", "Color"], + ["builtin", "Curses"], + ["builtin", "DBM"], + ["builtin", "DNSResolver"], + ["builtin", "DOConnection"], + ["builtin", "DOProxy"], + ["builtin", "DOServer"], + ["builtin", "Date"], + ["builtin", "Directory"], + ["builtin", "Duration"], + ["builtin", "DynLib"], + ["builtin", "Error"], + ["builtin", "Exception"], + ["builtin", "FFT"], + ["builtin", "File"], + ["builtin", "Fnmatch"], + ["builtin", "Font"], + ["builtin", "Future"], + ["builtin", "GL"], + ["builtin", "GLE"], + ["builtin", "GLScissor"], + ["builtin", "GLU"], + ["builtin", "GLUCylinder"], + ["builtin", "GLUQuadric"], + ["builtin", "GLUSphere"], + ["builtin", "GLUT"], + ["builtin", "Host"], + ["builtin", "Image"], + ["builtin", "Importer"], + ["builtin", "LinkList"], + ["builtin", "List"], + ["builtin", "Lobby"], + ["builtin", "Locals"], + ["builtin", "MD5"], + ["builtin", "MP3Decoder"], + ["builtin", "MP3Encoder"], + ["builtin", "Map"], + ["builtin", "Message"], + ["builtin", "Movie"], + ["builtin", "Notification"], + ["builtin", "Number"], + ["builtin", "Object"], + ["builtin", "OpenGL"], + ["builtin", "Point"], + ["builtin", "Protos"], + ["builtin", "Regex"], + ["builtin", "SGML"], + ["builtin", "SGMLElement"], + ["builtin", "SGMLParser"], + ["builtin", "SQLite"], + ["builtin", "Server"], + ["builtin", "Sequence"], + ["builtin", "ShowMessage"], + ["builtin", "SleepyCat"], + ["builtin", "SleepyCatCursor"], + ["builtin", "Socket"], + ["builtin", "SocketManager"], + ["builtin", "Sound"], + ["builtin", "Soup"], + ["builtin", "Store"], + ["builtin", "String"], + ["builtin", "Tree"], + ["builtin", "UDPSender"], + ["builtin", "UPDReceiver"], + ["builtin", "URL"], + ["builtin", "User"], + ["builtin", "Warning"], + ["builtin", "WeakLink"], + ["builtin", "Random"], + ["builtin", "BigNum"] +] \ No newline at end of file diff --git a/tests/languages/io/keyword_feature.test b/tests/languages/io/keyword_feature.test new file mode 100644 index 0000000000..4cd84fef13 --- /dev/null +++ b/tests/languages/io/keyword_feature.test @@ -0,0 +1,141 @@ +activate +activeCoroCount +asString +block +break +catch +clone +collectGarbage +compileString +continue +do +doFile +doMessage +doString +else +elseif +exit +for +foreach +forward +getSlot +getEnvironmentVariable +hasSlot +if +ifFalse +ifNil +ifNilEval +ifTrue +isActive +isNil +isResumable +list +message +method +parent +pass +pause +perform +performWithArgList +print +println +proto +raise +raiseResumable +removeSlot +resend +resume +schedulerSleepSeconds +self +sender +setSchedulerSleepSeconds +setSlot +shallowCopy +slotNames +super +system +then +thisBlock +thisContext +call +try +type +uniqueId +updateSlot +wait +while +write +yield + +---------------------------------------------------- + +[ + ["keyword", "activate"], + ["keyword", "activeCoroCount"], + ["keyword", "asString"], + ["keyword", "block"], + ["keyword", "break"], + ["keyword", "catch"], + ["keyword", "clone"], + ["keyword", "collectGarbage"], + ["keyword", "compileString"], + ["keyword", "continue"], + ["keyword", "do"], + ["keyword", "doFile"], + ["keyword", "doMessage"], + ["keyword", "doString"], + ["keyword", "else"], + ["keyword", "elseif"], + ["keyword", "exit"], + ["keyword", "for"], + ["keyword", "foreach"], + ["keyword", "forward"], + ["keyword", "getSlot"], + ["keyword", "getEnvironmentVariable"], + ["keyword", "hasSlot"], + ["keyword", "if"], + ["keyword", "ifFalse"], + ["keyword", "ifNil"], + ["keyword", "ifNilEval"], + ["keyword", "ifTrue"], + ["keyword", "isActive"], + ["keyword", "isNil"], + ["keyword", "isResumable"], + ["keyword", "list"], + ["keyword", "message"], + ["keyword", "method"], + ["keyword", "parent"], + ["keyword", "pass"], + ["keyword", "pause"], + ["keyword", "perform"], + ["keyword", "performWithArgList"], + ["keyword", "print"], + ["keyword", "println"], + ["keyword", "proto"], + ["keyword", "raise"], + ["keyword", "raiseResumable"], + ["keyword", "removeSlot"], + ["keyword", "resend"], + ["keyword", "resume"], + ["keyword", "schedulerSleepSeconds"], + ["keyword", "self"], + ["keyword", "sender"], + ["keyword", "setSchedulerSleepSeconds"], + ["keyword", "setSlot"], + ["keyword", "shallowCopy"], + ["keyword", "slotNames"], + ["keyword", "super"], + ["keyword", "system"], + ["keyword", "then"], + ["keyword", "thisBlock"], + ["keyword", "thisContext"], + ["keyword", "call"], + ["keyword", "try"], + ["keyword", "type"], + ["keyword", "uniqueId"], + ["keyword", "updateSlot"], + ["keyword", "wait"], + ["keyword", "while"], + ["keyword", "write"], + ["keyword", "yield"] +] \ No newline at end of file diff --git a/tests/languages/j/operator_feature.test b/tests/languages/j/operator_feature.test new file mode 100644 index 0000000000..5baf00d94a --- /dev/null +++ b/tests/languages/j/operator_feature.test @@ -0,0 +1,14 @@ +_. +=. =: +a. +a: + +---------------------------------------------------- + +[ + ["operator", "_."], + ["operator", "=."], + ["operator", "=:"], + ["operator", "a."], + ["operator", "a:"] +] \ No newline at end of file diff --git a/tests/languages/java/class-name_feature.test b/tests/languages/java/class-name_feature.test index a5929a721c..36d2472b30 100644 --- a/tests/languages/java/class-name_feature.test +++ b/tests/languages/java/class-name_feature.test @@ -1,11 +1,17 @@ class Foo extends foo.bar.Foo { - java.util.List bar(foo.bar.Baz bat) throws java.lang.IOException { - throw new java.lang.UnsupportedOperationException("Not implemented"); + java.util.List bar(foo.bar.Baz bat) throws java.lang.Exception { + var foo = new java.lang.UnsupportedOperationException("Not implemented"); + Exception e = foo; + throw e; } } +ID id; + +String.valueOf(5); + ---------------------------------------------------- [ @@ -70,10 +76,12 @@ class Foo extends foo.bar.Foo { "lang", ["punctuation", "."] ]], - "IOException" + "Exception" ]], ["punctuation", "{"], - ["keyword", "throw"], + ["keyword", "var"], + " foo ", + ["operator", "="], ["keyword", "new"], ["class-name", [ ["namespace", [ @@ -88,7 +96,33 @@ class Foo extends foo.bar.Foo { ["string", "\"Not implemented\""], ["punctuation", ")"], ["punctuation", ";"], + ["class-name", [ + "Exception" + ]], + " e ", + ["operator", "="], + " foo", + ["punctuation", ";"], + ["keyword", "throw"], + " e", + ["punctuation", ";"], + ["punctuation", "}"], + ["punctuation", "}"], - ["punctuation", "}"] + ["class-name", [ + "ID" + ]], + " id", + ["punctuation", ";"], + + ["class-name", [ + "String" + ]], + ["punctuation", "."], + ["function", "valueOf"], + ["punctuation", "("], + ["number", "5"], + ["punctuation", ")"], + ["punctuation", ";"] ] diff --git a/tests/languages/java/generics_feature.test b/tests/languages/java/generics_feature.test index 12d9fb6231..672a47ae36 100644 --- a/tests/languages/java/generics_feature.test +++ b/tests/languages/java/generics_feature.test @@ -1,6 +1,7 @@ public class Solo {} Solo val = new Solo<>(); Duo dual = new Duo(12.2585, 'C'); +Optional foo; ---------------------------------------------------- @@ -92,6 +93,17 @@ Duo dual = new Duo(12.2585, 'C'); ["punctuation", ","], ["string", "'C'"], ["punctuation", ")"], + ["punctuation", ";"], + + ["class-name", [ + "Optional" + ]], + ["generics", [ + ["punctuation", "<"], + ["operator", "?"], + ["punctuation", ">"] + ]], + " foo", ["punctuation", ";"] ] diff --git a/tests/languages/javascript!+js-extras/control-flow-keyword_feature.js b/tests/languages/javascript!+js-extras/control-flow-keyword_feature.js new file mode 100644 index 0000000000..9ace899158 --- /dev/null +++ b/tests/languages/javascript!+js-extras/control-flow-keyword_feature.js @@ -0,0 +1,35 @@ +module.exports = { + [` +await +break +catch +continue +do +else +for +finally +if +return +switch +throw +try +while +yield +`]: ` +await +break +catch +continue +do +else +for +finally +if +return +switch +throw +try +while +yield +` +}; diff --git a/tests/languages/javascript!+js-extras/keyword_nil_feature.test b/tests/languages/javascript!+js-extras/keyword_nil_feature.test new file mode 100644 index 0000000000..453bb04a17 --- /dev/null +++ b/tests/languages/javascript!+js-extras/keyword_nil_feature.test @@ -0,0 +1,13 @@ +null +undefined + +---------------------------------------------------- + +[ + ["keyword", "null"], + ["keyword", "undefined"] +] + +---------------------------------------------------- + +Checks that null and undefined are keywords. diff --git a/tests/languages/javascript!+regex/regex_inclusion.test b/tests/languages/javascript!+regex/regex_inclusion.test index 3720fe7ce5..f5b50f7f9d 100644 --- a/tests/languages/javascript!+regex/regex_inclusion.test +++ b/tests/languages/javascript!+regex/regex_inclusion.test @@ -9,17 +9,17 @@ "a", ["quantifier", "+"], ["group", ["(?:"]], - ["charset", [ - ["charset-punctuation", "["], + ["charclass", [ + ["charclass-punctuation", "["], ["range", [ "a", ["range-punctuation", "-"], "z" ]], - ["charset-punctuation", "]"] + ["charclass-punctuation", "]"] ]], ["alternation", "|"], - ["charclass", "\\d"], + ["charset", "\\d"], ["group", ")"], ["quantifier", "?"] ]], diff --git a/tests/languages/jolie/builtin_feature.test b/tests/languages/jolie/builtin_feature.test new file mode 100644 index 0000000000..f478531d65 --- /dev/null +++ b/tests/languages/jolie/builtin_feature.test @@ -0,0 +1,27 @@ +undefined +string +int +void +long +Byte +bool +double +float +char +any + +---------------------------------------------------- + +[ + ["builtin", "undefined"], + ["builtin", "string"], + ["builtin", "int"], + ["builtin", "void"], + ["builtin", "long"], + ["builtin", "Byte"], + ["builtin", "bool"], + ["builtin", "double"], + ["builtin", "float"], + ["builtin", "char"], + ["builtin", "any"] +] \ No newline at end of file diff --git a/tests/languages/jolie/punctuation_feature.test b/tests/languages/jolie/punctuation_feature.test new file mode 100644 index 0000000000..d705738bc1 --- /dev/null +++ b/tests/languages/jolie/punctuation_feature.test @@ -0,0 +1,8 @@ +, . + +---------------------------------------------------- + +[ + ["punctuation", ","], + ["punctuation", "."] +] \ No newline at end of file diff --git a/tests/languages/jsstacktrace/alias_feature.test b/tests/languages/jsstacktrace/alias_feature.test new file mode 100644 index 0000000000..1e84103793 --- /dev/null +++ b/tests/languages/jsstacktrace/alias_feature.test @@ -0,0 +1,26 @@ +Foo + at REPLServer.runBound [as eval] (domain.js:293:12) + +---------------------------------------------------- + +[ + ["error-message", "Foo"], + ["stack-frame", [ + ["keyword", "at"], + ["function", [ + "REPLServer", + ["punctuation", "."], + "runBound" + ]], + ["alias", "[as eval]"], + ["punctuation", "("], + ["filename", "domain.js"], + ["line-number", [ + ["punctuation", ":"], + "293", + ["punctuation", ":"], + "12" + ]], + ["punctuation", ")"] + ]] +] \ No newline at end of file diff --git a/tests/languages/less/variable_feature.test b/tests/languages/less/variable_feature.test new file mode 100644 index 0000000000..74daa41f02 --- /dev/null +++ b/tests/languages/less/variable_feature.test @@ -0,0 +1,9 @@ +@foo +@@foo + +---------------------------------------------------- + +[ + ["variable", "@foo"], + ["variable", "@@foo"] +] \ No newline at end of file diff --git a/tests/languages/lilypond/class-name_feature.test b/tests/languages/lilypond/class-name_feature.test new file mode 100644 index 0000000000..2394662f2e --- /dev/null +++ b/tests/languages/lilypond/class-name_feature.test @@ -0,0 +1,15 @@ +\new Staff \hornNotes + +---------------------------------------------------- + +[ + ["keyword", [ + ["punctuation", "\\"], + "new" + ]], + ["class-name", "Staff"], + ["keyword", [ + ["punctuation", "\\"], + "hornNotes" + ]] +] \ No newline at end of file diff --git a/tests/languages/lisp/defun_feature.test b/tests/languages/lisp/defun_feature.test index b9c1f7fdc5..ac1609cf4a 100644 --- a/tests/languages/lisp/defun_feature.test +++ b/tests/languages/lisp/defun_feature.test @@ -1,25 +1,218 @@ (defun foo ()) (defun foo (bar)) + (defun foo (bar &body arg1) ) + (defun foo (bar &rest arg1) ) + (defun foo (bar &body arg1 arg2) ) + (defun foo (bar &key arg1) ) (defun foo (bar &key arg1 &allow-other-keys) ) + (defun foo (&optional arg1) ) + (defun defabc ()) +(defun show-members (a b &rest values) (write (list a b values))) +(cl-defun find-thing (thing &rest rest &key need &allow-other-keys) + (or (apply 'cl-member thing thing-list :allow-other-keys t rest) + (if need (error "Thing not found")))) + ---------------------------------------------------- [ - ["punctuation", "("], ["defun", [ ["keyword", "defun" ], ["function", "foo"], ["punctuation", "("], ["arguments", []], ["punctuation", ")"]]], ["punctuation", ")"], - ["punctuation", "("], ["defun", [ ["keyword", "defun" ], ["function", "foo"], ["punctuation", "("], ["arguments", [[ "argument", "bar" ]]], ["punctuation", ")"]]], ["punctuation", ")"], - ["punctuation", "("], ["defun", [ ["keyword", "defun" ], ["function", "foo"], ["punctuation", "("], ["arguments", [[ "argument", "bar" ], ["rest-vars", [["lisp-marker", "&body" ], ["argument", "arg1"]]]]], ["punctuation", ")"]] ], ["punctuation", ")"], - ["punctuation", "("], ["defun", [ ["keyword", "defun" ], ["function", "foo"], ["punctuation", "("], ["arguments", [[ "argument", "bar" ], ["rest-vars", [["lisp-marker", "&rest" ], ["argument", "arg1"]]]]], ["punctuation", ")"]] ], ["punctuation", ")"], - ["punctuation", "("], ["defun", [ ["keyword", "defun" ], ["function", "foo"], ["punctuation", "("], ["arguments", [[ "argument", "bar" ], ["rest-vars", [["lisp-marker", "&body" ], ["argument", "arg1"], ["argument", "arg2"]]]]], ["punctuation", ")"]] ], ["punctuation", ")"], - ["punctuation", "("], ["defun", [ ["keyword", "defun" ], ["function", "foo"], ["punctuation", "("], ["arguments", [[ "argument", "bar" ], ["keys", [["lisp-marker", "&key" ], ["argument", "arg1"]]]]], ["punctuation", ")"]] ], ["punctuation", ")"], - ["punctuation", "("], ["defun", [ ["keyword", "defun" ], ["function", "foo"], ["punctuation", "("], ["arguments", [[ "argument", "bar" ], ["keys", [["lisp-marker", "&key" ], ["argument", "arg1"], ["lisp-marker", "&allow-other-keys"]]]]], ["punctuation", ")"]] ], ["punctuation", ")"], - ["punctuation", "("], ["defun", [ ["keyword", "defun" ], ["function", "foo"], ["punctuation", "("], ["arguments", [["other-marker-vars", [["lisp-marker", "&optional" ], ["argument", "arg1"]]]]], ["punctuation", ")"]] ], ["punctuation", ")"], - ["punctuation", "("], ["defun", [ ["keyword", "defun" ], ["function", "defabc"], ["punctuation", "("], ["arguments", []], ["punctuation", ")"]]], ["punctuation", ")"] + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "foo"], + ["punctuation", "("], + ["arguments", [ + ]], + ["punctuation", ")"] + ]], + ["punctuation", ")"], + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "foo"], + ["punctuation", "("], + ["arguments", [ + ["argument", "bar"] + ]], + ["punctuation", ")"] + ]], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "foo"], + ["punctuation", "("], + ["arguments", [ + ["argument", "bar"], + ["rest-vars", [ + ["lisp-marker", "&body"], + ["argument", "arg1"] + ]] + ]], + ["punctuation", ")"] + ]], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "foo"], + ["punctuation", "("], + ["arguments", [ + ["argument", "bar"], + ["rest-vars", [ + ["lisp-marker", "&rest"], + ["argument", "arg1"] + ]] + ]], + ["punctuation", ")"] + ]], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "foo"], + ["punctuation", "("], + ["arguments", [ + ["argument", "bar"], + ["rest-vars", [ + ["lisp-marker", "&body"], + ["argument", "arg1"], + ["argument", "arg2"] + ]] + ]], + ["punctuation", ")"] + ]], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "foo"], + ["punctuation", "("], + ["arguments", [ + ["argument", "bar"], + ["keys", [ + ["lisp-marker", "&key"], + ["argument", "arg1"] + ]] + ]], + ["punctuation", ")"] + ]], + ["punctuation", ")"], + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "foo"], + ["punctuation", "("], + ["arguments", [ + ["argument", "bar"], + ["keys", [ + ["lisp-marker", "&key"], + ["argument", "arg1"], + ["lisp-marker", "&allow-other-keys"] + ]] + ]], + ["punctuation", ")"] + ]], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "foo"], + ["punctuation", "("], + ["arguments", [ + ["other-marker-vars", [ + ["lisp-marker", "&optional"], + ["argument", "arg1"] + ]] + ]], + ["punctuation", ")"] + ]], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "defabc"], + ["punctuation", "("], + ["arguments", [ + ]], + ["punctuation", ")"] + ]], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "show-members"], + ["punctuation", "("], + ["arguments", [ + ["argument", "a"], + ["argument", "b"], + ["rest-vars", [ + ["lisp-marker", "&rest"], + ["argument", "values"] + ]] + ]], + ["punctuation", ")"] + ]], + ["punctuation", "("], + ["car", "write"], + ["punctuation", "("], + ["car", "list"], + " a b values", + ["punctuation", ")"], + ["punctuation", ")"], + ["punctuation", ")"], + ["punctuation", "("], + ["defun", [ + ["keyword", "cl-defun"], + ["function", "find-thing"], + ["punctuation", "("], + ["arguments", [ + ["argument", "thing"], + ["rest-vars", [ + ["lisp-marker", "&rest"], + ["argument", "rest"], + ["lisp-marker", "&key"], + ["argument", "need"], + ["lisp-marker", "&allow-other-keys"] + ]] + ]], + ["punctuation", ")"] + ]], + ["punctuation", "("], + ["keyword", "or"], + ["punctuation", "("], + ["car", "apply"], + ["quoted-symbol", "'cl-member"], + " thing thing-list ", + ["lisp-property", ":allow-other-keys"], + ["boolean", "t"], + " rest", + ["punctuation", ")"], + ["punctuation", "("], + ["keyword", "if"], + " need ", + ["punctuation", "("], + ["keyword", "error"], + ["string", [ + "\"Thing not found\"" + ]], + ["punctuation", ")"], + ["punctuation", ")"], + ["punctuation", ")"], + ["punctuation", ")"] ] ---------------------------------------------------- diff --git a/tests/languages/lisp/punctuation_feature.test b/tests/languages/lisp/punctuation_feature.test index 904ef79f48..8a26d9b030 100644 --- a/tests/languages/lisp/punctuation_feature.test +++ b/tests/languages/lisp/punctuation_feature.test @@ -1,16 +1,22 @@ () ( ) [] +. ( ---------------------------------------------------- [ - ["punctuation", "("], ["punctuation", ")"], - ["punctuation", "("], ["punctuation", ")"], - ["punctuation", "["], ["punctuation", "]"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "."], ["punctuation", "("] ] + ---------------------------------------------------- Checks for punctuation. \ No newline at end of file diff --git a/tests/languages/livescript/punctuation_feature.test b/tests/languages/livescript/punctuation_feature.test new file mode 100644 index 0000000000..b8a6784957 --- /dev/null +++ b/tests/languages/livescript/punctuation_feature.test @@ -0,0 +1,18 @@ +( ) { } [ ] | ., : ; ` + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "|"], + ["punctuation", "."], + ["punctuation", ","], + ["punctuation", ":"], + ["punctuation", ";"], + ["punctuation", "`"] +] diff --git a/tests/languages/lolcode/punctuation_feature.test b/tests/languages/lolcode/punctuation_feature.test new file mode 100644 index 0000000000..b5f887d2f3 --- /dev/null +++ b/tests/languages/lolcode/punctuation_feature.test @@ -0,0 +1,10 @@ +... … , ! + +---------------------------------------------------- + +[ + ["punctuation", "..."], + ["punctuation", "…"], + ["punctuation", ","], + ["punctuation", "!"] +] \ No newline at end of file diff --git a/tests/languages/lolcode/string_feature.test b/tests/languages/lolcode/string_feature.test index e3a25a9cda..dc07f6656a 100644 --- a/tests/languages/lolcode/string_feature.test +++ b/tests/languages/lolcode/string_feature.test @@ -2,14 +2,20 @@ "foobar" "fo:"o" "foo:)bar:>baz" +"foo:(FF)baz" +"foo:[bar]baz" "foo:{bar}baz" "foo BTW bar" BTW and out ---------------------------------------------------- [ - ["string", ["\"\""]], - ["string", ["\"foobar\""]], + ["string", [ + "\"\"" + ]], + ["string", [ + "\"foobar\"" + ]], ["string", [ "\"fo", ["symbol", ":\""], @@ -22,12 +28,24 @@ ["symbol", ":>"], "baz\"" ]], + ["string", [ + "\"foo", + ["symbol", ":(FF)"], + "baz\"" + ]], + ["string", [ + "\"foo", + ["symbol", ":[bar]"], + "baz\"" + ]], ["string", [ "\"foo", ["variable", ":{bar}"], "baz\"" ]], - ["string", ["\"foo BTW bar\""]], + ["string", [ + "\"foo BTW bar\"" + ]], ["comment", "BTW and out"] ] diff --git a/tests/languages/markup+http/text-xml_inclusion.test b/tests/languages/markup+http/text-xml_inclusion.test new file mode 100644 index 0000000000..803de06a10 --- /dev/null +++ b/tests/languages/markup+http/text-xml_inclusion.test @@ -0,0 +1,30 @@ +Content-type: text/xml + + + +---------------------------------------------------- + +[ + ["header-name", "Content-type:"], + " text/xml", + ["text-xml", [ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "foo" + ]], + ["punctuation", ">"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]] +] + +---------------------------------------------------- + +Checks for XML content in HTTP. diff --git a/tests/languages/moonscript/function_feature.test b/tests/languages/moonscript/function_feature.test new file mode 100644 index 0000000000..3dc4f27eb3 --- /dev/null +++ b/tests/languages/moonscript/function_feature.test @@ -0,0 +1,715 @@ +_G +_VERSION +assert +collectgarbage +coroutine.create +coroutine.resume +coroutine.running +coroutine.status +coroutine.wrap +coroutine.yield +debug.debug +debug.getfenv +debug.gethook +debug.getinfo +debug.getlocal +debug.getmetatable +debug.getregistry +debug.getupvalue +debug.setfenv +debug.sethook +debug.setlocal +debug.setmetatable +debug.setupvalue +debug.traceback +dofile +error +getfenv +getmetatable +io.close +io.flush +io.input +io.lines +io.open +io.output +io.popen +io.read +io.stderr +io.stdin +io.stdout +io.tmpfile +io.type +io.write +ipairs +load +loadfile +loadstring +math.abs +math.acos +math.asin +math.atan +math.atan2 +math.ceil +math.cos +math.cosh +math.deg +math.exp +math.floor +math.fmod +math.frexp +math.ldexp +math.log +math.log10 +math.max +math.min +math.modf +math.pi +math.pow +math.rad +math.random +math.randomseed +math.sin +math.sinh +math.sqrt +math.tan +math.tanh +module +next +os.clock +os.date +os.difftime +os.execute +os.exit +os.getenv +os.remove +os.rename +os.setlocale +os.time +os.tmpname +package.cpath +package.loaded +package.loadlib +package.path +package.preload +package.seeall +pairs +pcall +print +rawequal +rawget +rawset +require +select +setfenv +setmetatable +string.byte +string.char +string.dump +string.find +string.format +string.gmatch +string.gsub +string.len +string.lower +string.match +string.rep +string.reverse +string.sub +string.upper +table.concat +table.insert +table.maxn +table.remove +table.sort +tonumber +tostring +type +unpack +xpcall + +---------------------------------------------------- + +[ + ["function", [ + "_G" + ]], + ["function", [ + "_VERSION" + ]], + ["function", [ + "assert" + ]], + ["function", [ + "collectgarbage" + ]], + ["function", [ + "coroutine", + ["punctuation", "."], + "create" + ]], + ["function", [ + "coroutine", + ["punctuation", "."], + "resume" + ]], + ["function", [ + "coroutine", + ["punctuation", "."], + "running" + ]], + ["function", [ + "coroutine", + ["punctuation", "."], + "status" + ]], + ["function", [ + "coroutine", + ["punctuation", "."], + "wrap" + ]], + ["function", [ + "coroutine", + ["punctuation", "."], + "yield" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "debug" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "getfenv" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "gethook" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "getinfo" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "getlocal" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "getmetatable" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "getregistry" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "getupvalue" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "setfenv" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "sethook" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "setlocal" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "setmetatable" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "setupvalue" + ]], + ["function", [ + "debug", + ["punctuation", "."], + "traceback" + ]], + ["function", [ + "dofile" + ]], + ["function", [ + "error" + ]], + ["function", [ + "getfenv" + ]], + ["function", [ + "getmetatable" + ]], + ["function", [ + "io", + ["punctuation", "."], + "close" + ]], + ["function", [ + "io", + ["punctuation", "."], + "flush" + ]], + ["function", [ + "io", + ["punctuation", "."], + "input" + ]], + ["function", [ + "io", + ["punctuation", "."], + "lines" + ]], + ["function", [ + "io", + ["punctuation", "."], + "open" + ]], + ["function", [ + "io", + ["punctuation", "."], + "output" + ]], + ["function", [ + "io", + ["punctuation", "."], + "popen" + ]], + ["function", [ + "io", + ["punctuation", "."], + "read" + ]], + ["function", [ + "io", + ["punctuation", "."], + "stderr" + ]], + ["function", [ + "io", + ["punctuation", "."], + "stdin" + ]], + ["function", [ + "io", + ["punctuation", "."], + "stdout" + ]], + ["function", [ + "io", + ["punctuation", "."], + "tmpfile" + ]], + ["function", [ + "io", + ["punctuation", "."], + "type" + ]], + ["function", [ + "io", + ["punctuation", "."], + "write" + ]], + ["function", [ + "ipairs" + ]], + ["function", [ + "load" + ]], + ["function", [ + "loadfile" + ]], + ["function", [ + "loadstring" + ]], + ["function", [ + "math", + ["punctuation", "."], + "abs" + ]], + ["function", [ + "math", + ["punctuation", "."], + "acos" + ]], + ["function", [ + "math", + ["punctuation", "."], + "asin" + ]], + ["function", [ + "math", + ["punctuation", "."], + "atan" + ]], + ["function", [ + "math", + ["punctuation", "."], + "atan2" + ]], + ["function", [ + "math", + ["punctuation", "."], + "ceil" + ]], + ["function", [ + "math", + ["punctuation", "."], + "cos" + ]], + ["function", [ + "math", + ["punctuation", "."], + "cosh" + ]], + ["function", [ + "math", + ["punctuation", "."], + "deg" + ]], + ["function", [ + "math", + ["punctuation", "."], + "exp" + ]], + ["function", [ + "math", + ["punctuation", "."], + "floor" + ]], + ["function", [ + "math", + ["punctuation", "."], + "fmod" + ]], + ["function", [ + "math", + ["punctuation", "."], + "frexp" + ]], + ["function", [ + "math", + ["punctuation", "."], + "ldexp" + ]], + ["function", [ + "math", + ["punctuation", "."], + "log" + ]], + ["function", [ + "math", + ["punctuation", "."], + "log10" + ]], + ["function", [ + "math", + ["punctuation", "."], + "max" + ]], + ["function", [ + "math", + ["punctuation", "."], + "min" + ]], + ["function", [ + "math", + ["punctuation", "."], + "modf" + ]], + ["function", [ + "math", + ["punctuation", "."], + "pi" + ]], + ["function", [ + "math", + ["punctuation", "."], + "pow" + ]], + ["function", [ + "math", + ["punctuation", "."], + "rad" + ]], + ["function", [ + "math", + ["punctuation", "."], + "random" + ]], + ["function", [ + "math", + ["punctuation", "."], + "randomseed" + ]], + ["function", [ + "math", + ["punctuation", "."], + "sin" + ]], + ["function", [ + "math", + ["punctuation", "."], + "sinh" + ]], + ["function", [ + "math", + ["punctuation", "."], + "sqrt" + ]], + ["function", [ + "math", + ["punctuation", "."], + "tan" + ]], + ["function", [ + "math", + ["punctuation", "."], + "tanh" + ]], + ["function", [ + "module" + ]], + ["function", [ + "next" + ]], + ["function", [ + "os", + ["punctuation", "."], + "clock" + ]], + ["function", [ + "os", + ["punctuation", "."], + "date" + ]], + ["function", [ + "os", + ["punctuation", "."], + "difftime" + ]], + ["function", [ + "os", + ["punctuation", "."], + "execute" + ]], + ["function", [ + "os", + ["punctuation", "."], + "exit" + ]], + ["function", [ + "os", + ["punctuation", "."], + "getenv" + ]], + ["function", [ + "os", + ["punctuation", "."], + "remove" + ]], + ["function", [ + "os", + ["punctuation", "."], + "rename" + ]], + ["function", [ + "os", + ["punctuation", "."], + "setlocale" + ]], + ["function", [ + "os", + ["punctuation", "."], + "time" + ]], + ["function", [ + "os", + ["punctuation", "."], + "tmpname" + ]], + ["function", [ + "package", + ["punctuation", "."], + "cpath" + ]], + ["function", [ + "package", + ["punctuation", "."], + "loaded" + ]], + ["function", [ + "package", + ["punctuation", "."], + "loadlib" + ]], + ["function", [ + "package", + ["punctuation", "."], + "path" + ]], + ["function", [ + "package", + ["punctuation", "."], + "preload" + ]], + ["function", [ + "package", + ["punctuation", "."], + "seeall" + ]], + ["function", [ + "pairs" + ]], + ["function", [ + "pcall" + ]], + ["function", [ + "print" + ]], + ["function", [ + "rawequal" + ]], + ["function", [ + "rawget" + ]], + ["function", [ + "rawset" + ]], + ["function", [ + "require" + ]], + ["function", [ + "select" + ]], + ["function", [ + "setfenv" + ]], + ["function", [ + "setmetatable" + ]], + ["function", [ + "string", + ["punctuation", "."], + "byte" + ]], + ["function", [ + "string", + ["punctuation", "."], + "char" + ]], + ["function", [ + "string", + ["punctuation", "."], + "dump" + ]], + ["function", [ + "string", + ["punctuation", "."], + "find" + ]], + ["function", [ + "string", + ["punctuation", "."], + "format" + ]], + ["function", [ + "string", + ["punctuation", "."], + "gmatch" + ]], + ["function", [ + "string", + ["punctuation", "."], + "gsub" + ]], + ["function", [ + "string", + ["punctuation", "."], + "len" + ]], + ["function", [ + "string", + ["punctuation", "."], + "lower" + ]], + ["function", [ + "string", + ["punctuation", "."], + "match" + ]], + ["function", [ + "string", + ["punctuation", "."], + "rep" + ]], + ["function", [ + "string", + ["punctuation", "."], + "reverse" + ]], + ["function", [ + "string", + ["punctuation", "."], + "sub" + ]], + ["function", [ + "string", + ["punctuation", "."], + "upper" + ]], + ["function", [ + "table", + ["punctuation", "."], + "concat" + ]], + ["function", [ + "table", + ["punctuation", "."], + "insert" + ]], + ["function", [ + "table", + ["punctuation", "."], + "maxn" + ]], + ["function", [ + "table", + ["punctuation", "."], + "remove" + ]], + ["function", [ + "table", + ["punctuation", "."], + "sort" + ]], + ["function", [ + "tonumber" + ]], + ["function", [ + "tostring" + ]], + ["function", [ + "type" + ]], + ["function", [ + "unpack" + ]], + ["function", [ + "xpcall" + ]] +] \ No newline at end of file diff --git a/tests/languages/nim/identifier_feature.test b/tests/languages/nim/identifier_feature.test new file mode 100644 index 0000000000..6dc8adc86b --- /dev/null +++ b/tests/languages/nim/identifier_feature.test @@ -0,0 +1,14 @@ +var `var` = 42 + +---------------------------------------------------- + +[ + ["keyword", "var"], + ["identifier", [ + ["punctuation", "`"], + "var", + ["punctuation", "`"] + ]], + ["operator", "="], + ["number", "42"] +] \ No newline at end of file diff --git a/tests/languages/ocaml/punctuation_feature.test b/tests/languages/ocaml/punctuation_feature.test new file mode 100644 index 0000000000..bcec8a0606 --- /dev/null +++ b/tests/languages/ocaml/punctuation_feature.test @@ -0,0 +1,19 @@ +( ) { } [ ] +. , : ; +_ + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "."], + ["punctuation", ","], + ["punctuation", ":"], + ["punctuation", ";"], + ["punctuation", "_"] +] diff --git a/tests/languages/pascaligo/class-name_feature.test b/tests/languages/pascaligo/class-name_feature.test new file mode 100644 index 0000000000..dcf8cf3a5d --- /dev/null +++ b/tests/languages/pascaligo/class-name_feature.test @@ -0,0 +1,42 @@ +type storage is int + +function add (const store : storage; const delta : int) : storage is store + delta + +---------------------------------------------------- + +[ + ["keyword", "type"], + ["class-name", [ + "storage" + ]], + ["keyword", "is"], + ["class-name", [ + ["builtin", "int"] + ]], + + ["keyword", "function"], + ["function", "add"], + ["punctuation", "("], + ["keyword", "const"], + " store ", + ["punctuation", ":"], + ["class-name", [ + "storage" + ]], + ["punctuation", ";"], + ["keyword", "const"], + " delta ", + ["punctuation", ":"], + ["class-name", [ + ["builtin", "int"] + ]], + ["punctuation", ")"], + ["punctuation", ":"], + ["class-name", [ + "storage" + ]], + ["keyword", "is"], + " store ", + ["operator", "+"], + " delta" +] \ No newline at end of file diff --git a/tests/languages/peoplecode/class-name_feature.test b/tests/languages/peoplecode/class-name_feature.test new file mode 100644 index 0000000000..197180de7a --- /dev/null +++ b/tests/languages/peoplecode/class-name_feature.test @@ -0,0 +1,277 @@ +class FactorialClass + method factorial(&I as number) returns number; +end-class; + +class Fruit + property number FruitCount; +end-class; + +class Banana extends Fruit + property number BananaCount; +end-class; + +local Banana &MyBanana = Create Banana(); +local Fruit &MyFruit = &MyBanana; /* okay, Banana is a subtype of Fruit */ +local number &Num = &MyBanana.BananaCount; + +/* generic building class */ +class BuildingAsset + method Acquire(); + method DisasterPrep(); +end-class; + +method Acquire + %This.DisasterPrep(); +end-method;method DisasterPrep + PrepareForFire(); +end-method; + +/* building in Vancouver */ +class VancouverBuilding extends BuildingAssetmethod DisasterPrep(); +end-class; + +method DisasterPrep + PrepareForEarthquake();%Super.DisasterPrep(); /* call superclass method */ +end-method; + +/* building in Edmonton */ +class EdmontonBuilding extends BuildingAssetmethod DisasterPrep(); +end-class; + +method DisasterPrep + PrepareForFreezing();%Super.DisasterPrep(); /* call superclass method */ +end-method; + +local BuildingAsset &Building = Create VancouverBuilding(); + +&Building.Acquire(); /* calls PrepareForEarthquake then PrepareForFire */ + +&Building = Create EdmontonBuilding(); + +&Building.Acquire(); /* calls PrepareForFreezing then PrepareForFire */ + +---------------------------------------------------- + +[ + ["keyword", "class"], + ["class-name", [ + "FactorialClass" + ]], + ["keyword", "method"], + ["function-definition", "factorial"], + ["punctuation", "("], + "&I ", + ["keyword", "as"], + ["class-name", [ + "number" + ]], + ["punctuation", ")"], + ["keyword", "returns"], + ["class-name", [ + "number" + ]], + ["punctuation", ";"], + ["keyword", "end-class"], + ["punctuation", ";"], + + ["keyword", "class"], + ["class-name", [ + "Fruit" + ]], + ["keyword", "property"], + ["class-name", [ + "number" + ]], + " FruitCount", + ["punctuation", ";"], + ["keyword", "end-class"], + ["punctuation", ";"], + + ["keyword", "class"], + ["class-name", [ + "Banana" + ]], + ["keyword", "extends"], + ["class-name", [ + "Fruit" + ]], + ["keyword", "property"], + ["class-name", [ + "number" + ]], + " BananaCount", + ["punctuation", ";"], + ["keyword", "end-class"], + ["punctuation", ";"], + + ["keyword", "local"], + ["class-name", [ + "Banana" + ]], + " &MyBanana ", + ["operator", "="], + ["keyword", "Create"], + ["class-name", [ + "Banana" + ]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["keyword", "local"], + ["class-name", [ + "Fruit" + ]], + " &MyFruit ", + ["operator", "="], + " &MyBanana", + ["punctuation", ";"], + ["comment", "/* okay, Banana is a subtype of Fruit */"], + ["keyword", "local"], + ["class-name", [ + "number" + ]], + " &Num ", + ["operator", "="], + " &MyBanana", + ["punctuation", "."], + "BananaCount", + ["punctuation", ";"], + + ["comment", "/* generic building class */"], + ["keyword", "class"], + ["class-name", [ + "BuildingAsset" + ]], + ["keyword", "method"], + ["function-definition", "Acquire"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["keyword", "method"], + ["function-definition", "DisasterPrep"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["keyword", "end-class"], + ["punctuation", ";"], + + ["keyword", "method"], + ["function-definition", "Acquire"], + ["variable", "%This"], + ["punctuation", "."], + ["function", "DisasterPrep"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["keyword", "end-method"], + ["punctuation", ";"], + ["keyword", "method"], + ["function-definition", "DisasterPrep"], + ["function", "PrepareForFire"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["keyword", "end-method"], + ["punctuation", ";"], + + ["comment", "/* building in Vancouver */"], + ["keyword", "class"], + ["class-name", [ + "VancouverBuilding" + ]], + ["keyword", "extends"], + ["class-name", [ + "BuildingAssetmethod" + ]], + ["function", "DisasterPrep"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["keyword", "end-class"], + ["punctuation", ";"], + + ["keyword", "method"], + ["function-definition", "DisasterPrep"], + ["function", "PrepareForEarthquake"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["variable", "%Super"], + ["punctuation", "."], + ["function", "DisasterPrep"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["comment", "/* call superclass method */"], + ["keyword", "end-method"], + ["punctuation", ";"], + + ["comment", "/* building in Edmonton */"], + ["keyword", "class"], + ["class-name", [ + "EdmontonBuilding" + ]], + ["keyword", "extends"], + ["class-name", [ + "BuildingAssetmethod" + ]], + ["function", "DisasterPrep"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["keyword", "end-class"], + ["punctuation", ";"], + + ["keyword", "method"], + ["function-definition", "DisasterPrep"], + ["function", "PrepareForFreezing"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["variable", "%Super"], + ["punctuation", "."], + ["function", "DisasterPrep"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["comment", "/* call superclass method */"], + ["keyword", "end-method"], + ["punctuation", ";"], + + ["keyword", "local"], + ["class-name", [ + "BuildingAsset" + ]], + " &Building ", + ["operator", "="], + ["keyword", "Create"], + ["class-name", [ + "VancouverBuilding" + ]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + "\n\n&Building", + ["punctuation", "."], + ["function", "Acquire"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["comment", "/* calls PrepareForEarthquake then PrepareForFire */"], + "\n\n&Building ", + ["operator", "="], + ["keyword", "Create"], + ["class-name", [ + "EdmontonBuilding" + ]], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + "\n\n&Building", + ["punctuation", "."], + ["function", "Acquire"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"], + ["comment", "/* calls PrepareForFreezing then PrepareForFire */"] +] \ No newline at end of file diff --git a/tests/languages/peoplecode/function_feature.test b/tests/languages/peoplecode/function_feature.test new file mode 100644 index 0000000000..262b78fdb6 --- /dev/null +++ b/tests/languages/peoplecode/function_feature.test @@ -0,0 +1,9 @@ +GetCurrEffRow() + +---------------------------------------------------- + +[ + ["function", "GetCurrEffRow"], + ["punctuation", "("], + ["punctuation", ")"] +] \ No newline at end of file diff --git a/tests/languages/perl/variable_feature.test b/tests/languages/perl/variable_feature.test index aad023c485..9a5bb537f6 100644 --- a/tests/languages/perl/variable_feature.test +++ b/tests/languages/perl/variable_feature.test @@ -3,6 +3,8 @@ $#foo ${^POSTMATCH} +${...} + $^V @1 @@ -26,6 +28,11 @@ $foo::'bar ["variable", "${^POSTMATCH}"], + ["variable", "$"], + ["punctuation", "{"], + ["operator", "..."], + ["punctuation", "}"], + ["variable", "$^V"], ["variable", "@1"], diff --git a/tests/languages/promql/number_feature.test b/tests/languages/promql/number_feature.test new file mode 100644 index 0000000000..168f5da2c9 --- /dev/null +++ b/tests/languages/promql/number_feature.test @@ -0,0 +1,17 @@ +23 +-2.43 +3.4e-9 +0x8f +-Inf +NaN + +---------------------------------------------------- + +[ + ["number", "23"], + ["number", "-2.43"], + ["number", "3.4e-9"], + ["number", "0x8f"], + ["number", "-Inf"], + ["number", "NaN"] +] \ No newline at end of file diff --git a/tests/languages/promql/operator_feature.test b/tests/languages/promql/operator_feature.test new file mode 100644 index 0000000000..2c3de2a0e4 --- /dev/null +++ b/tests/languages/promql/operator_feature.test @@ -0,0 +1,25 @@ +^ * / % + - +== != <= < >= > + +and unless or + +---------------------------------------------------- + +[ + ["operator", "^"], + ["operator", "*"], + ["operator", "/"], + ["operator", "%"], + ["operator", "+"], + ["operator", "-"], + ["operator", "=="], + ["operator", "!="], + ["operator", "<="], + ["operator", "<"], + ["operator", ">="], + ["operator", ">"], + + ["operator", "and"], + ["operator", "unless"], + ["operator", "or"] +] \ No newline at end of file diff --git a/tests/languages/promql/time_series_selection.test b/tests/languages/promql/time_series_selection.test index dc7edbe954..a933e53da8 100644 --- a/tests/languages/promql/time_series_selection.test +++ b/tests/languages/promql/time_series_selection.test @@ -1,5 +1,7 @@ http_requests_total{job="apiserver", handler="/api/comments"}[5m] +http_requests_total offset 5m + http_requests_total{job=~".*server"} ---------------------------------------------------- @@ -23,6 +25,12 @@ http_requests_total{job=~".*server"} ["punctuation", "]"] ]], + "\r\n\r\nhttp_requests_total ", + ["keyword", "offset"], + ["context-range", [ + ["range-duration", "5m"] + ]], + "\r\n\r\nhttp_requests_total", ["context-labels", [ ["punctuation", "{"], diff --git a/tests/languages/pure/punctuation_feature.test b/tests/languages/pure/punctuation_feature.test new file mode 100644 index 0000000000..2d40e86960 --- /dev/null +++ b/tests/languages/pure/punctuation_feature.test @@ -0,0 +1,13 @@ +( ) { } [ ] ; + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", ";"] +] diff --git a/tests/languages/purebasic/asm_feature.test b/tests/languages/purebasic/asm_feature.test new file mode 100644 index 0000000000..713aa418eb --- /dev/null +++ b/tests/languages/purebasic/asm_feature.test @@ -0,0 +1,118 @@ +Procedure.i XorTwoBlocks2(*buffer1, *buffer2, length) + ; move all the required data to source reg, destination reg and counter reg + !mov esi, [p.p_buffer1] ; read 32-bit integer from p.p_buffer1 and move to esi + !mov edi, [p.p_buffer2] ; read 32-bit integer from p.p_buffer2 and move to edi + !mov ecx, [p.v_length] ; read 32-bit integer from p.v_length and move to ecx + + !@@: ; anonymous label, can be reached by @b (back) or @f (forward) + !mov al, byte [edi + ecx - 1] ; read byte from destination + !xor byte [esi + ecx - 1], al ; xor source with destination (i.e. xor bytes from both blocks) + !dec ecx ; decrease counter + !jne @b ; jumb back to first anonymous label behind + ProcedureReturn 0 +EndProcedure + +---------------------------------------------------- + +[ + ["keyword", "Procedure"], + ["punctuation", "."], + "i ", + ["function", "XorTwoBlocks2"], + ["punctuation", "("], + ["operator", "*buffer1"], + ["punctuation", ","], + ["operator", "*buffer2"], + ["punctuation", ","], + " length", + ["punctuation", ")"], + ["comment", "; move all the required data to source reg, destination reg and counter reg"], + ["asm", [ + ["operator", "!"], + ["function", "mov"], + ["register", "esi"], + ["operator", ","], + ["operator", "["], + "p", + ["operator", "."], + "p_buffer1", + ["operator", "]"] + ]], + ["comment", "; read 32-bit integer from p.p_buffer1 and move to esi"], + ["asm", [ + ["operator", "!"], + ["function", "mov"], + ["register", "edi"], + ["operator", ","], + ["operator", "["], + "p", + ["operator", "."], + "p_buffer2", + ["operator", "]"] + ]], + ["comment", "; read 32-bit integer from p.p_buffer2 and move to edi"], + ["asm", [ + ["operator", "!"], + ["function", "mov"], + ["register", "ecx"], + ["operator", ","], + ["operator", "["], + "p", + ["operator", "."], + "v_length", + ["operator", "]"] + ]], + ["comment", "; read 32-bit integer from p.v_length and move to ecx"], + + ["asm", [ + ["operator", "!"], + ["label", "@@"], + ["operator", ":"] + ]], + ["comment", "; anonymous label, can be reached by @b (back) or @f (forward)"], + ["asm", [ + ["operator", "!"], + ["function", "mov"], + ["register", "al"], + ["operator", ","], + " byte ", + ["operator", "["], + ["register", "edi"], + ["operator", "+"], + ["register", "ecx"], + ["operator", "-"], + ["number", "1"], + ["operator", "]"] + ]], + ["comment", "; read byte from destination"], + ["asm", [ + ["operator", "!"], + ["function", "xor"], + " byte ", + ["operator", "["], + ["register", "esi"], + ["operator", "+"], + ["register", "ecx"], + ["operator", "-"], + ["number", "1"], + ["operator", "]"], + ["operator", ","], + ["register", "al"] + ]], + ["comment", "; xor source with destination (i.e. xor bytes from both blocks)"], + ["asm", [ + ["operator", "!"], + ["function", "dec"], + ["register", "ecx"] + ]], + ["comment", "; decrease counter"], + ["asm", [ + ["operator", "!"], + ["function", "jne"], + ["label-reference-anonymous", "@b"] + ]], + ["comment", "; jumb back to first anonymous label behind"], + ["keyword", "ProcedureReturn"], + ["number", "0"], + ["keyword", "EndProcedure"] +] \ No newline at end of file diff --git a/tests/languages/purebasic/function_feature.test b/tests/languages/purebasic/function_feature.test index a2d62b58e7..ab46b5d4e5 100644 --- a/tests/languages/purebasic/function_feature.test +++ b/tests/languages/purebasic/function_feature.test @@ -1,211 +1,9 @@ -DECLARECDLL -DECLAREDLL -COMPILERSELECT -COMPILERCASE -COMPILERDEFAULT -COMPILERENDSELECT -COMPILERERROR -ENABLEEXPLICIT -DISABLEEXPLICIT -NOT -AND -OR -XOR -CALLDEBUGGER -DEBUGLEVEL -ENABLEDEBUGGER -DISABLEDEBUGGER -RESTORE -READ -INCLUDEPATH -INCLUDEBINARY -THREADED -RUNTIME -WITH -ENDWITH -STRUCTUREUNION -ENDSTRUCTUREUNION -ALIGN -NEWLIST -NEWMAP -INTERFACE -ENDINTERFACE -EXTENDS -ENUMERATION -ENDENUMERATION -SWAP -FOREACH -CONTINUE -FAKERETURN -GOTO -GOSUB -RETURN -BREAK -MODULE -ENDMODULE -DECLAREMODULE -ENDDECLAREMODULE -DECLARE -DECLAREC -PROTOTYPE -PROTOTYPEC -ENABLEASM -DISABLEASM -DIM -REDIM -DATA -DATASECTION -ENDDATASECTION -TO -PROCEDURERETURN -DEBUG -DEFAULT -CASE -SELECT -ENDSELECT -AS -IMPORT -ENDIMPORT -IMPORTC -COMPILERIF -COMPILERELSE -COMPILERENDIF -COMPILERELSEIF -END -STRUCTURE -ENDSTRUCTURE -WHILE -WEND -FOR -NEXT -STEP -IF -ELSE -ELSEIF -ENDIF -REPEAT -UNTIL -PROCEDURE -PROCEDUREDLL -PROCEDUREC -PROCEDURECDLL -ENDPROCEDURE -PROTECTED -SHARED -STATIC -GLOBAL -DEFINE -INCLUDEFILE -XINCLUDEFILE -MACRO -ENDMACRO +foo() ---------------------------------------------------- [ - ["keyword", "DECLARECDLL"], - ["keyword", "DECLAREDLL"], - ["keyword", "COMPILERSELECT"], - ["keyword", "COMPILERCASE"], - ["keyword", "COMPILERDEFAULT"], - ["keyword", "COMPILERENDSELECT"], - ["keyword", "COMPILERERROR"], - ["keyword", "ENABLEEXPLICIT"], - ["keyword", "DISABLEEXPLICIT"], - ["keyword", "NOT"], - ["keyword", "AND"], - ["keyword", "OR"], - ["keyword", "XOR"], - ["keyword", "CALLDEBUGGER"], - ["keyword", "DEBUGLEVEL"], - ["keyword", "ENABLEDEBUGGER"], - ["keyword", "DISABLEDEBUGGER"], - ["keyword", "RESTORE"], - ["keyword", "READ"], - ["keyword", "INCLUDEPATH"], - ["keyword", "INCLUDEBINARY"], - ["keyword", "THREADED"], - ["keyword", "RUNTIME"], - ["keyword", "WITH"], - ["keyword", "ENDWITH"], - ["keyword", "STRUCTUREUNION"], - ["keyword", "ENDSTRUCTUREUNION"], - ["keyword", "ALIGN"], - ["keyword", "NEWLIST"], - ["keyword", "NEWMAP"], - ["keyword", "INTERFACE"], - ["keyword", "ENDINTERFACE"], - ["keyword", "EXTENDS"], - ["keyword", "ENUMERATION"], - ["keyword", "ENDENUMERATION"], - ["keyword", "SWAP"], - ["keyword", "FOREACH"], - ["keyword", "CONTINUE"], - ["keyword", "FAKERETURN"], - ["keyword", "GOTO"], - ["keyword", "GOSUB"], - ["keyword", "RETURN"], - ["keyword", "BREAK"], - ["keyword", "MODULE"], - ["keyword", "ENDMODULE"], - ["keyword", "DECLAREMODULE"], - ["keyword", "ENDDECLAREMODULE"], - ["keyword", "DECLARE"], - ["keyword", "DECLAREC"], - ["keyword", "PROTOTYPE"], - ["keyword", "PROTOTYPEC"], - ["keyword", "ENABLEASM"], - ["keyword", "DISABLEASM"], - ["keyword", "DIM"], - ["keyword", "REDIM"], - ["keyword", "DATA"], - ["keyword", "DATASECTION"], - ["keyword", "ENDDATASECTION"], - ["keyword", "TO"], - ["keyword", "PROCEDURERETURN"], - ["keyword", "DEBUG"], - ["keyword", "DEFAULT"], - ["keyword", "CASE"], - ["keyword", "SELECT"], - ["keyword", "ENDSELECT"], - ["keyword", "AS"], - ["keyword", "IMPORT"], - ["keyword", "ENDIMPORT"], - ["keyword", "IMPORTC"], - ["keyword", "COMPILERIF"], - ["keyword", "COMPILERELSE"], - ["keyword", "COMPILERENDIF"], - ["keyword", "COMPILERELSEIF"], - ["keyword", "END"], - ["keyword", "STRUCTURE"], - ["keyword", "ENDSTRUCTURE"], - ["keyword", "WHILE"], - ["keyword", "WEND"], - ["keyword", "FOR"], - ["keyword", "NEXT"], - ["keyword", "STEP"], - ["keyword", "IF"], - ["keyword", "ELSE"], - ["keyword", "ELSEIF"], - ["keyword", "ENDIF"], - ["keyword", "REPEAT"], - ["keyword", "UNTIL"], - ["keyword", "PROCEDURE"], - ["keyword", "PROCEDUREDLL"], - ["keyword", "PROCEDUREC"], - ["keyword", "PROCEDURECDLL"], - ["keyword", "ENDPROCEDURE"], - ["keyword", "PROTECTED"], - ["keyword", "SHARED"], - ["keyword", "STATIC"], - ["keyword", "GLOBAL"], - ["keyword", "DEFINE"], - ["keyword", "INCLUDEFILE"], - ["keyword", "XINCLUDEFILE"], - ["keyword", "MACRO"], - ["keyword", "ENDMACRO"] -] - ----------------------------------------------------- - -Checks for keywords. \ No newline at end of file + ["function", "foo"], + ["punctuation", "("], + ["punctuation", ")"] +] \ No newline at end of file diff --git a/tests/languages/purebasic/keyword_feature.test b/tests/languages/purebasic/keyword_feature.test new file mode 100644 index 0000000000..53836adaac --- /dev/null +++ b/tests/languages/purebasic/keyword_feature.test @@ -0,0 +1,211 @@ +DECLARECDLL +DECLAREDLL +COMPILERSELECT +COMPILERCASE +COMPILERDEFAULT +COMPILERENDSELECT +COMPILERERROR +ENABLEEXPLICIT +DISABLEEXPLICIT +NOT +AND +OR +XOR +CALLDEBUGGER +DEBUGLEVEL +ENABLEDEBUGGER +DISABLEDEBUGGER +RESTORE +READ +INCLUDEPATH +INCLUDEBINARY +THREADED +RUNTIME +WITH +ENDWITH +STRUCTUREUNION +ENDSTRUCTUREUNION +ALIGN +NEWLIST +NEWMAP +INTERFACE +ENDINTERFACE +EXTENDS +ENUMERATION +ENDENUMERATION +SWAP +FOREACH +CONTINUE +FAKERETURN +GOTO +GOSUB +RETURN +BREAK +MODULE +ENDMODULE +DECLAREMODULE +ENDDECLAREMODULE +DECLARE +DECLAREC +PROTOTYPE +PROTOTYPEC +ENABLEASM +DISABLEASM +DIM +REDIM +DATA +DATASECTION +ENDDATASECTION +TO +PROCEDURERETURN +DEBUG +DEFAULT +CASE +SELECT +ENDSELECT +AS +IMPORT +ENDIMPORT +IMPORTC +COMPILERIF +COMPILERELSE +COMPILERENDIF +COMPILERELSEIF +END +STRUCTURE +ENDSTRUCTURE +WHILE +WEND +FOR +NEXT +STEP +IF +ELSE +ELSEIF +ENDIF +REPEAT +UNTIL +PROCEDURE +PROCEDUREDLL +PROCEDUREC +PROCEDURECDLL +ENDPROCEDURE +PROTECTED +SHARED +STATIC +GLOBAL +DEFINE +INCLUDEFILE +XINCLUDEFILE +MACRO +ENDMACRO + +---------------------------------------------------- + +[ + ["keyword", "DECLARECDLL"], + ["keyword", "DECLAREDLL"], + ["keyword", "COMPILERSELECT"], + ["keyword", "COMPILERCASE"], + ["keyword", "COMPILERDEFAULT"], + ["keyword", "COMPILERENDSELECT"], + ["keyword", "COMPILERERROR"], + ["keyword", "ENABLEEXPLICIT"], + ["keyword", "DISABLEEXPLICIT"], + ["keyword", "NOT"], + ["keyword", "AND"], + ["keyword", "OR"], + ["keyword", "XOR"], + ["keyword", "CALLDEBUGGER"], + ["keyword", "DEBUGLEVEL"], + ["keyword", "ENABLEDEBUGGER"], + ["keyword", "DISABLEDEBUGGER"], + ["keyword", "RESTORE"], + ["keyword", "READ"], + ["keyword", "INCLUDEPATH"], + ["keyword", "INCLUDEBINARY"], + ["keyword", "THREADED"], + ["keyword", "RUNTIME"], + ["keyword", "WITH"], + ["keyword", "ENDWITH"], + ["keyword", "STRUCTUREUNION"], + ["keyword", "ENDSTRUCTUREUNION"], + ["keyword", "ALIGN"], + ["keyword", "NEWLIST"], + ["keyword", "NEWMAP"], + ["keyword", "INTERFACE"], + ["keyword", "ENDINTERFACE"], + ["keyword", "EXTENDS"], + ["keyword", "ENUMERATION"], + ["keyword", "ENDENUMERATION"], + ["keyword", "SWAP"], + ["keyword", "FOREACH"], + ["keyword", "CONTINUE"], + ["keyword", "FAKERETURN"], + ["keyword", "GOTO"], + ["keyword", "GOSUB"], + ["keyword", "RETURN"], + ["keyword", "BREAK"], + ["keyword", "MODULE"], + ["keyword", "ENDMODULE"], + ["keyword", "DECLAREMODULE"], + ["keyword", "ENDDECLAREMODULE"], + ["keyword", "DECLARE"], + ["keyword", "DECLAREC"], + ["keyword", "PROTOTYPE"], + ["keyword", "PROTOTYPEC"], + ["keyword", "ENABLEASM"], + ["keyword", "DISABLEASM"], + ["keyword", "DIM"], + ["keyword", "REDIM"], + ["keyword", "DATA"], + ["keyword", "DATASECTION"], + ["keyword", "ENDDATASECTION"], + ["keyword", "TO"], + ["keyword", "PROCEDURERETURN"], + ["keyword", "DEBUG"], + ["keyword", "DEFAULT"], + ["keyword", "CASE"], + ["keyword", "SELECT"], + ["keyword", "ENDSELECT"], + ["keyword", "AS"], + ["keyword", "IMPORT"], + ["keyword", "ENDIMPORT"], + ["keyword", "IMPORTC"], + ["keyword", "COMPILERIF"], + ["keyword", "COMPILERELSE"], + ["keyword", "COMPILERENDIF"], + ["keyword", "COMPILERELSEIF"], + ["keyword", "END"], + ["keyword", "STRUCTURE"], + ["keyword", "ENDSTRUCTURE"], + ["keyword", "WHILE"], + ["keyword", "WEND"], + ["keyword", "FOR"], + ["keyword", "NEXT"], + ["keyword", "STEP"], + ["keyword", "IF"], + ["keyword", "ELSE"], + ["keyword", "ELSEIF"], + ["keyword", "ENDIF"], + ["keyword", "REPEAT"], + ["keyword", "UNTIL"], + ["keyword", "PROCEDURE"], + ["keyword", "PROCEDUREDLL"], + ["keyword", "PROCEDUREC"], + ["keyword", "PROCEDURECDLL"], + ["keyword", "ENDPROCEDURE"], + ["keyword", "PROTECTED"], + ["keyword", "SHARED"], + ["keyword", "STATIC"], + ["keyword", "GLOBAL"], + ["keyword", "DEFINE"], + ["keyword", "INCLUDEFILE"], + ["keyword", "XINCLUDEFILE"], + ["keyword", "MACRO"], + ["keyword", "ENDMACRO"] +] + +---------------------------------------------------- + +Checks for keywords. \ No newline at end of file diff --git a/tests/languages/q/comment_feature.test b/tests/languages/q/comment_feature.test index c78bb33618..1921493ddd 100644 --- a/tests/languages/q/comment_feature.test +++ b/tests/languages/q/comment_feature.test @@ -6,6 +6,8 @@ Foo bar "baz" \ +`john / an atom of type symbol + \ Foo Bar "baz" @@ -15,7 +17,12 @@ Bar "baz" [ ["comment", "#!/usr/bin/env q"], ["comment", "/ Foobar \"baz\""], + ["comment", "/\r\nFoo\r\nbar \"baz\"\r\n\\"], + + ["symbol", "`john"], + ["comment", "/ an atom of type symbol"], + ["comment", "\\\r\nFoo\r\nBar \"baz\""] ] diff --git a/tests/languages/q/punctuation_feature.test b/tests/languages/q/punctuation_feature.test new file mode 100644 index 0000000000..f1522f0d05 --- /dev/null +++ b/tests/languages/q/punctuation_feature.test @@ -0,0 +1,18 @@ +( ) { } [ ] ; + +sp.s + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", ";"], + "\r\n\r\nsp", + ["punctuation", "."], + "s" +] \ No newline at end of file diff --git a/tests/languages/r/punctuation_feature.test b/tests/languages/r/punctuation_feature.test new file mode 100644 index 0000000000..7661ecb5dd --- /dev/null +++ b/tests/languages/r/punctuation_feature.test @@ -0,0 +1,14 @@ +( ) { } [ ] , ; + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", ","], + ["punctuation", ";"] +] \ No newline at end of file diff --git a/tests/languages/racket/identifier_feature.test b/tests/languages/racket/identifier_feature.test new file mode 100644 index 0000000000..0ac5d36a62 --- /dev/null +++ b/tests/languages/racket/identifier_feature.test @@ -0,0 +1,7 @@ +|\x9;\x9;| + +---------------------------------------------------- + +[ + ["identifier", "|\\x9;\\x9;|"] +] \ No newline at end of file diff --git a/tests/languages/regex/charclass_feature.test b/tests/languages/regex/charclass_feature.test index 4a045fa75c..1247b717d0 100644 --- a/tests/languages/regex/charclass_feature.test +++ b/tests/languages/regex/charclass_feature.test @@ -1,23 +1,51 @@ -. -\w \W -\s \S -\d \D -\p{ASCII} -\P{ASCII} +[] +[^] +[foo] +[\]\b] +[.^$\1] +[\d\D\p{L}] ---------------------------------------------------- [ - ["charclass", "."], - ["charclass", "\\w"], - ["charclass", "\\W"], - ["charclass", "\\s"], - ["charclass", "\\S"], - ["charclass", "\\d"], - ["charclass", "\\D"], - - ["charclass", "\\p{ASCII}"], - ["charclass", "\\P{ASCII}"] + ["charclass", [ + ["charclass-punctuation", "["], + ["charclass-punctuation", "]"] + ]], + + ["charclass", [ + ["charclass-punctuation", "["], + ["charclass-negation", "^"], + ["charclass-punctuation", "]"] + ]], + + ["charclass", [ + ["charclass-punctuation", "["], + "foo", + ["charclass-punctuation", "]"] + ]], + + ["charclass", [ + ["charclass-punctuation", "["], + ["special-escape", "\\]"], + ["escape", "\\b"], + ["charclass-punctuation", "]"] + ]], + + ["charclass", [ + ["charclass-punctuation", "["], + ".^$", + ["escape", "\\1"], + ["charclass-punctuation", "]"] + ]], + + ["charclass", [ + ["charclass-punctuation", "["], + ["charset", "\\d"], + ["charset", "\\D"], + ["charset", "\\p{L}"], + ["charclass-punctuation", "]"] + ]] ] ---------------------------------------------------- diff --git a/tests/languages/regex/charset_feature.test b/tests/languages/regex/charset_feature.test index 317216e2de..f43bc2b968 100644 --- a/tests/languages/regex/charset_feature.test +++ b/tests/languages/regex/charset_feature.test @@ -1,42 +1,23 @@ -[] -[^] -[foo] -[\]\b] -[.^$\1] +. +\w \W +\s \S +\d \D +\p{ASCII} +\P{ASCII} ---------------------------------------------------- [ - ["charset", [ - ["charset-punctuation", "["], - ["charset-punctuation", "]"] - ]], - - ["charset", [ - ["charset-punctuation", "["], - ["charset-negation", "^"], - ["charset-punctuation", "]"] - ]], - - ["charset", [ - ["charset-punctuation", "["], - "foo", - ["charset-punctuation", "]"] - ]], - - ["charset", [ - ["charset-punctuation", "["], - ["special-escape", "\\]"], - ["escape", "\\b"], - ["charset-punctuation", "]"] - ]], - - ["charset", [ - ["charset-punctuation", "["], - ".^$", - ["escape", "\\1"], - ["charset-punctuation", "]"] - ]] + ["charset", "."], + ["charset", "\\w"], + ["charset", "\\W"], + ["charset", "\\s"], + ["charset", "\\S"], + ["charset", "\\d"], + ["charset", "\\D"], + + ["charset", "\\p{ASCII}"], + ["charset", "\\P{ASCII}"] ] ---------------------------------------------------- diff --git a/tests/languages/regex/range_feature.test b/tests/languages/regex/range_feature.test index 6de46ddbe8..635e5424d7 100644 --- a/tests/languages/regex/range_feature.test +++ b/tests/languages/regex/range_feature.test @@ -5,8 +5,8 @@ ---------------------------------------------------- [ - ["charset", [ - ["charset-punctuation", "["], + ["charclass", [ + ["charclass-punctuation", "["], ["range", [ "a", ["range-punctuation", "-"], @@ -22,11 +22,11 @@ ["range-punctuation", "-"], "9" ]], - ["charset-punctuation", "]"] + ["charclass-punctuation", "]"] ]], - ["charset", [ - ["charset-punctuation", "["], + ["charclass", [ + ["charclass-punctuation", "["], ["range", [ ["escape", "\\xa1"], ["range-punctuation", "-"], @@ -37,14 +37,14 @@ ["range-punctuation", "-"], ["escape", "\\u{256}"] ]], - ["charset-punctuation", "]"] + ["charclass-punctuation", "]"] ]], - ["charset", [ - ["charset-punctuation", "["], - ["charset-negation", "^"], + ["charclass", [ + ["charclass-punctuation", "["], + ["charclass-negation", "^"], "-aaa-", - ["charset-punctuation", "]"] + ["charclass-punctuation", "]"] ]] ] diff --git a/tests/languages/renpy/boolean_feature.test b/tests/languages/renpy/boolean_feature.test new file mode 100644 index 0000000000..2ff6eced18 --- /dev/null +++ b/tests/languages/renpy/boolean_feature.test @@ -0,0 +1,11 @@ +true false +True False + +---------------------------------------------------- + +[ + ["boolean", "true"], + ["boolean", "false"], + ["boolean", "True"], + ["boolean", "False"] +] \ No newline at end of file diff --git a/tests/languages/renpy/comment_feature.test b/tests/languages/renpy/comment_feature.test new file mode 100644 index 0000000000..c3e0227da9 --- /dev/null +++ b/tests/languages/renpy/comment_feature.test @@ -0,0 +1,7 @@ +# comment + +---------------------------------------------------- + +[ + ["comment", "# comment"] +] \ No newline at end of file diff --git a/tests/languages/renpy/function_feature.test b/tests/languages/renpy/function_feature.test new file mode 100644 index 0000000000..97c491b1f5 --- /dev/null +++ b/tests/languages/renpy/function_feature.test @@ -0,0 +1,41 @@ +renpy.register_bmfont("bmfont", 22, filename="bmfont.fnt") + +# Resize the background of the text window if it's too small. +init python: + style.window.background = Frame("frame.png", 10, 10) + +---------------------------------------------------- + +[ + ["keyword", "renpy"], + ["punctuation", "."], + ["function", "register_bmfont"], + ["punctuation", "("], + ["string", "\"bmfont\""], + ["punctuation", ","], + ["number", "22"], + ["punctuation", ","], + " filename", + ["operator", "="], + ["string", "\"bmfont.fnt\""], + ["punctuation", ")"], + + ["comment", "# Resize the background of the text window if it's too small."], + ["keyword", "init"], + ["keyword", "python"], + ["punctuation", ":"], + ["keyword", "style"], + ["punctuation", "."], + ["tag", "window"], + ["punctuation", "."], + ["property", "background"], + ["operator", "="], + ["function", "Frame"], + ["punctuation", "("], + ["string", "\"frame.png\""], + ["punctuation", ","], + ["number", "10"], + ["punctuation", ","], + ["number", "10"], + ["punctuation", ")"] +] \ No newline at end of file diff --git a/tests/languages/renpy/keyword_feature.test b/tests/languages/renpy/keyword_feature.test new file mode 100644 index 0000000000..ff44f6b42f --- /dev/null +++ b/tests/languages/renpy/keyword_feature.test @@ -0,0 +1,181 @@ +as assert +break class +continue def +del elif +else except +exec finally +for from +global if +import in +is lambda +pass print +raise return +try while +yield adjustment +alignaround allow +angle around +box_layout cache +changed child_size +clicked clipping +corner1 corner2 +default delay +exclude scope +slow slow_abortable +slow_done sound +style_group substitute +suffix transform_anchor +transpose unhovered +config theme +mm_root gm_root +rounded_window build +disabled_text disabled +widget_selected widget_text +widget_hover widget +updater behind +call expression +hide init +jump onlayer +python renpy +scene set +show transform +play queue +stop pause +define +repeat contains +choice on +function event +animation clockwise +counterclockwise circles +knot null +None random +has add +use fade +dissolve style +store id +voice center +left right +less_rounded music +movie clear +persistent ui + +---------------------------------------------------- + +[ + ["keyword", "as"], + ["keyword", "assert"], + ["keyword", "break"], + ["keyword", "class"], + ["keyword", "continue"], + ["keyword", "def"], + ["keyword", "del"], + ["keyword", "elif"], + ["keyword", "else"], + ["keyword", "except"], + ["keyword", "exec"], + ["keyword", "finally"], + ["keyword", "for"], + ["keyword", "from"], + ["keyword", "global"], + ["keyword", "if"], + ["keyword", "import"], + ["keyword", "in"], + ["keyword", "is"], + ["keyword", "lambda"], + ["keyword", "pass"], + ["keyword", "print"], + ["keyword", "raise"], + ["keyword", "return"], + ["keyword", "try"], + ["keyword", "while"], + ["keyword", "yield"], + ["keyword", "adjustment"], + ["keyword", "alignaround"], + ["keyword", "allow"], + ["keyword", "angle"], + ["keyword", "around"], + ["keyword", "box_layout"], + ["keyword", "cache"], + ["keyword", "changed"], + ["keyword", "child_size"], + ["keyword", "clicked"], + ["keyword", "clipping"], + ["keyword", "corner1"], + ["keyword", "corner2"], + ["keyword", "default"], + ["keyword", "delay"], + ["keyword", "exclude"], + ["keyword", "scope"], + ["keyword", "slow"], + ["keyword", "slow_abortable"], + ["keyword", "slow_done"], + ["keyword", "sound"], + ["keyword", "style_group"], + ["keyword", "substitute"], + ["keyword", "suffix"], + ["keyword", "transform_anchor"], + ["keyword", "transpose"], + ["keyword", "unhovered"], + ["keyword", "config"], + ["keyword", "theme"], + ["keyword", "mm_root"], + ["keyword", "gm_root"], + ["keyword", "rounded_window"], + ["keyword", "build"], + ["keyword", "disabled_text"], + ["keyword", "disabled"], + ["keyword", "widget_selected"], + ["keyword", "widget_text"], + ["keyword", "widget_hover"], + ["keyword", "widget"], + ["keyword", "updater"], + ["keyword", "behind"], + ["keyword", "call"], + ["keyword", "expression"], + ["keyword", "hide"], + ["keyword", "init"], + ["keyword", "jump"], + ["keyword", "onlayer"], + ["keyword", "python"], + ["keyword", "renpy"], + ["keyword", "scene"], + ["keyword", "set"], + ["keyword", "show"], + ["keyword", "transform"], + ["keyword", "play"], + ["keyword", "queue"], + ["keyword", "stop"], + ["keyword", "pause"], + ["keyword", "define"], + ["keyword", "repeat"], + ["keyword", "contains"], + ["keyword", "choice"], + ["keyword", "on"], + ["keyword", "function"], + ["keyword", "event"], + ["keyword", "animation"], + ["keyword", "clockwise"], + ["keyword", "counterclockwise"], + ["keyword", "circles"], + ["keyword", "knot"], + ["keyword", "null"], + ["keyword", "None"], + ["keyword", "random"], + ["keyword", "has"], + ["keyword", "add"], + ["keyword", "use"], + ["keyword", "fade"], + ["keyword", "dissolve"], + ["keyword", "style"], + ["keyword", "store"], + ["keyword", "id"], + ["keyword", "voice"], + ["keyword", "center"], + ["keyword", "left"], + ["keyword", "right"], + ["keyword", "less_rounded"], + ["keyword", "music"], + ["keyword", "movie"], + ["keyword", "clear"], + ["keyword", "persistent"], + ["keyword", "ui"] +] diff --git a/tests/languages/renpy/string_feature.test b/tests/languages/renpy/string_feature.test new file mode 100644 index 0000000000..c055f8900b --- /dev/null +++ b/tests/languages/renpy/string_feature.test @@ -0,0 +1,28 @@ +"# This isn't a comment, since it's part of a string." + +"Since this line contains a string, it continues + even when the line ends." + +$ a = [ "Because of parenthesis, this line also", + "spans more than one line." ] + +'Strings can\'t contain their delimiter, unless you escape it.' + +---------------------------------------------------- + +[ + ["string", "\"# This isn't a comment, since it's part of a string.\""], + + ["string", "\"Since this line contains a string, it continues\n even when the line ends.\""], + + ["tag", "$"], + " a ", + ["operator", "="], + ["punctuation", "["], + ["string", "\"Because of parenthesis, this line also\""], + ["punctuation", ","], + ["string", "\"spans more than one line.\""], + ["punctuation", "]"], + + ["string", "'Strings can\\'t contain their delimiter, unless you escape it.'"] +] \ No newline at end of file diff --git a/tests/languages/renpy/tag_feature.test b/tests/languages/renpy/tag_feature.test new file mode 100644 index 0000000000..f2609e4eff --- /dev/null +++ b/tests/languages/renpy/tag_feature.test @@ -0,0 +1,76 @@ +label +image +menu +hbox +vbox +frame +text +imagemap +imagebutton +bar +vbar +screen +textbutton +buttoscreenn +fixed +grid +input +key +mousearea +side +timer +viewport +window +hotspot +hotbar +self +button +drag +draggroup +tag +mm_menu_frame +nvl +block + + +$ + +---------------------------------------------------- + +[ + ["tag", "label"], + ["tag", "image"], + ["tag", "menu"], + ["tag", "hbox"], + ["tag", "vbox"], + ["tag", "frame"], + ["tag", "text"], + ["tag", "imagemap"], + ["tag", "imagebutton"], + ["tag", "bar"], + ["tag", "vbar"], + ["tag", "screen"], + ["tag", "textbutton"], + ["tag", "buttoscreenn"], + ["tag", "fixed"], + ["tag", "grid"], + ["tag", "input"], + ["tag", "key"], + ["tag", "mousearea"], + ["tag", "side"], + ["tag", "timer"], + ["tag", "viewport"], + ["tag", "window"], + ["tag", "hotspot"], + ["tag", "hotbar"], + ["tag", "self"], + ["tag", "button"], + ["tag", "drag"], + ["tag", "draggroup"], + ["tag", "tag"], + ["tag", "mm_menu_frame"], + ["tag", "nvl"], + ["tag", "block"], + + ["tag", "$"] +] \ No newline at end of file diff --git a/tests/languages/rip/punctuation_feature.test b/tests/languages/rip/punctuation_feature.test new file mode 100644 index 0000000000..a118e5d438 --- /dev/null +++ b/tests/languages/rip/punctuation_feature.test @@ -0,0 +1,28 @@ +.. ... + +` , . : ; = / \ +( ) < > [ ] { } + +---------------------------------------------------- + +[ + ["punctuation", ".."], + ["punctuation", "..."], + + ["punctuation", "`"], + ["punctuation", ","], + ["punctuation", "."], + ["punctuation", ":"], + ["punctuation", ";"], + ["punctuation", "="], + ["punctuation", "/"], + ["punctuation", "\\"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "<"], + ["punctuation", ">"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", "{"], + ["punctuation", "}"] +] diff --git a/tests/languages/rust/namespace_feature.test b/tests/languages/rust/namespace_feature.test index f858e07bbd..e40641ed2d 100644 --- a/tests/languages/rust/namespace_feature.test +++ b/tests/languages/rust/namespace_feature.test @@ -19,6 +19,9 @@ pub static ALLOCATOR: alloc::Tracing = alloc::Tracing::new(); unsafe fn alloc(&self, layout: std::alloc::Layout) -> *mut u8 {} +use crate::cool::function as root_function; +self::cool::function(); + ---------------------------------------------------- [ @@ -178,9 +181,31 @@ unsafe fn alloc(&self, layout: std::alloc::Layout) -> *mut u8 {} ["keyword", "mut"], ["keyword", "u8"], ["punctuation", "{"], - ["punctuation", "}"] + ["punctuation", "}"], + + ["keyword", "use"], + ["keyword", "crate"], + ["module-declaration", [ + ["punctuation", "::"], + "cool", + ["punctuation", "::"] + ]], + "function ", + ["keyword", "as"], + " root_function", + ["punctuation", ";"], + ["keyword", "self"], + ["module-declaration", [ + ["punctuation", "::"], + "cool", + ["punctuation", "::"] + ]], + ["function", "function"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"] ] ---------------------------------------------------- -Checks for namespaces. +Checks for namespaces. \ No newline at end of file diff --git a/tests/languages/sas/number_feature.test b/tests/languages/sas/number_feature.test index 317a3212cc..05473f3ae1 100644 --- a/tests/languages/sas/number_feature.test +++ b/tests/languages/sas/number_feature.test @@ -7,6 +7,9 @@ BadFacex 0c1x 0b0ax +"3132,3334"x +'3132,3334'x + ---------------------------------------------------- [ @@ -17,9 +20,12 @@ BadFacex ["number", "1.4E+2"], "\r\nBadFacex\r\n", ["number", "0c1x"], - ["number", "0b0ax"] + ["number", "0b0ax"], + + ["numeric-constant", "\"3132,3334\"x"], + ["numeric-constant", "'3132,3334'x"] ] ---------------------------------------------------- -Checks for decimal and hexadecimal numbers. +Checks for decimal and hexadecimal numbers. \ No newline at end of file diff --git a/tests/languages/sass/variable-line_feature.test b/tests/languages/sass/variable-line_feature.test index a7f62ffcfb..445c85ca5a 100644 --- a/tests/languages/sass/variable-line_feature.test +++ b/tests/languages/sass/variable-line_feature.test @@ -1,5 +1,6 @@ $width: 5em $foo: $bar + $baz +$foo: $bar - $baz $bar: #{$baz} ---------------------------------------------------- @@ -17,6 +18,13 @@ $bar: #{$baz} ["operator", "+"], ["variable", "$baz"] ]], + ["variable-line", [ + ["variable", "$foo"], + ["punctuation", ":"], + ["variable", "$bar"], + ["operator", "-"], + ["variable", "$baz"] + ]], ["variable-line", [ ["variable", "$bar"], ["punctuation", ":"], @@ -26,4 +34,4 @@ $bar: #{$baz} ---------------------------------------------------- -Checks for variable declarations. \ No newline at end of file +Checks for variable declarations. diff --git a/tests/languages/smali/builtin_feature.test b/tests/languages/smali/builtin_feature.test new file mode 100644 index 0000000000..750063f756 --- /dev/null +++ b/tests/languages/smali/builtin_feature.test @@ -0,0 +1,72 @@ +new-array v0, v0, [I + +.method static constructor ()V + +.field mWifiOnUid:I + +.field public static mWifiRunning:Z = false +.field public static final PI:D = 3.141592653589793 + +.field static final LOG_TAG:Ljava/lang/String; = "CDMA" + +---------------------------------------------------- + +[ + "new-array ", + ["register", "v0"], + ["punctuation", ","], + ["register", "v0"], + ["punctuation", ","], + ["operator", "["], + ["builtin", "I"], + + ["keyword", ".method"], + ["keyword", "static"], + ["keyword", "constructor"], + ["function", ""], + ["punctuation", "("], + ["punctuation", ")"], + ["builtin", "V"], + + ["keyword", ".field"], + ["field", "mWifiOnUid"], + ["punctuation", ":"], + ["builtin", "I"], + + ["keyword", ".field"], + ["keyword", "public"], + ["keyword", "static"], + ["field", "mWifiRunning"], + ["punctuation", ":"], + ["builtin", "Z"], + ["operator", "="], + ["boolean", "false"], + ["keyword", ".field"], + ["keyword", "public"], + ["keyword", "static"], + ["keyword", "final"], + ["field", "PI"], + ["punctuation", ":"], + ["builtin", "D"], + ["operator", "="], + ["number", "3.141592653589793"], + + ["keyword", ".field"], + ["keyword", "static"], + ["keyword", "final"], + ["field", "LOG_TAG"], + ["punctuation", ":"], + ["class-name", [ + ["builtin", "L"], + ["namespace", [ + "java", + ["punctuation", "/"], + "lang", + ["punctuation", "/"] + ]], + ["class-name", "String"] + ]], + ["punctuation", ";"], + ["operator", "="], + ["string", "\"CDMA\""] +] \ No newline at end of file diff --git a/tests/languages/smali/label_feature.test b/tests/languages/smali/label_feature.test new file mode 100644 index 0000000000..d012ef3b01 --- /dev/null +++ b/tests/languages/smali/label_feature.test @@ -0,0 +1,16 @@ +.line 989 +:cond_2b + +goto :goto_1f + +---------------------------------------------------- + +[ + ["keyword", ".line"], + ["number", "989"], + ["punctuation", ":"], + ["label", "cond_2b"], + "\n\ngoto ", + ["punctuation", ":"], + ["label", "goto_1f"] +] \ No newline at end of file diff --git a/tests/languages/smali/register_feature.test b/tests/languages/smali/register_feature.test new file mode 100644 index 0000000000..e0dbb624db --- /dev/null +++ b/tests/languages/smali/register_feature.test @@ -0,0 +1,28 @@ +move v1, p1 + +move v2, p2 + +move-object v4, p3 + +move v5, p4 + +---------------------------------------------------- + +[ + "move ", + ["register", "v1"], + ["punctuation", ","], + ["register", "p1"], + "\n\nmove ", + ["register", "v2"], + ["punctuation", ","], + ["register", "p2"], + "\n\nmove-object ", + ["register", "v4"], + ["punctuation", ","], + ["register", "p3"], + "\n\nmove ", + ["register", "v5"], + ["punctuation", ","], + ["register", "p4"] +] \ No newline at end of file diff --git a/tests/languages/sparql/keyword_feature.test b/tests/languages/sparql/keyword_feature.test index a4a2c48ed0..d818cd6c4b 100644 --- a/tests/languages/sparql/keyword_feature.test +++ b/tests/languages/sparql/keyword_feature.test @@ -102,6 +102,10 @@ UCASE( URI( YEAR( +GRAPH +BASE +PREFIX + ---------------------------------------------------- [ @@ -262,10 +266,13 @@ YEAR( ["keyword", "URI"], ["punctuation", "("], ["keyword", "YEAR"], - ["punctuation", "("] -] + ["punctuation", "("], + ["keyword", "GRAPH"], + ["keyword", "BASE"], + ["keyword", "PREFIX"] +] ---------------------------------------------------- -Checks for all keywords. +Checks for all keywords. \ No newline at end of file diff --git a/tests/languages/splunk-spl/boolean_feature.test b/tests/languages/splunk-spl/boolean_feature.test new file mode 100644 index 0000000000..26a2a8bac0 --- /dev/null +++ b/tests/languages/splunk-spl/boolean_feature.test @@ -0,0 +1,11 @@ +T F +true false + +---------------------------------------------------- + +[ + ["boolean", "T"], + ["boolean", "F"], + ["boolean", "true"], + ["boolean", "false"] +] \ No newline at end of file diff --git a/tests/languages/splunk-spl/property_feature.test b/tests/languages/splunk-spl/property_feature.test new file mode 100644 index 0000000000..dd38832220 --- /dev/null +++ b/tests/languages/splunk-spl/property_feature.test @@ -0,0 +1,9 @@ +host="mailsecure_log" + +---------------------------------------------------- + +[ + ["property", "host"], + ["operator", "="], + ["string", "\"mailsecure_log\""] +] \ No newline at end of file diff --git a/tests/languages/splunk-spl/punctuation_feature.test b/tests/languages/splunk-spl/punctuation_feature.test new file mode 100644 index 0000000000..201cf19194 --- /dev/null +++ b/tests/languages/splunk-spl/punctuation_feature.test @@ -0,0 +1,11 @@ +( ) [ ] , + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"], + ["punctuation", ","] +] \ No newline at end of file diff --git a/tests/languages/sqf/function_feature.test b/tests/languages/sqf/function_feature.test new file mode 100644 index 0000000000..3d897b6b3a --- /dev/null +++ b/tests/languages/sqf/function_feature.test @@ -0,0 +1,4397 @@ +abs +accTime +acos +action +actionIDs +actionKeys +actionKeysImages +actionKeysNames +actionKeysNamesArray +actionName +actionParams +activateAddons +activatedAddons +activateKey +add3DENConnection +add3DENEventHandler +add3DENLayer +addAction +addBackpack +addBackpackCargo +addBackpackCargoGlobal +addBackpackGlobal +addCamShake +addCuratorAddons +addCuratorCameraArea +addCuratorEditableObjects +addCuratorEditingArea +addCuratorPoints +addEditorObject +addEventHandler +addForce +addForceGeneratorRTD +addGoggles +addGroupIcon +addHandgunItem +addHeadgear +addItem +addItemCargo +addItemCargoGlobal +addItemPool +addItemToBackpack +addItemToUniform +addItemToVest +addLiveStats +addMagazine +addMagazineAmmoCargo +addMagazineCargo +addMagazineCargoGlobal +addMagazineGlobal +addMagazinePool +addMagazines +addMagazineTurret +addMenu +addMenuItem +addMissionEventHandler +addMPEventHandler +addMusicEventHandler +addOwnedMine +addPlayerScores +addPrimaryWeaponItem +addPublicVariableEventHandler +addRating +addResources +addScore +addScoreSide +addSecondaryWeaponItem +addSwitchableUnit +addTeamMember +addToRemainsCollector +addTorque +addUniform +addVehicle +addVest +addWaypoint +addWeapon +addWeaponCargo +addWeaponCargoGlobal +addWeaponGlobal +addWeaponItem +addWeaponPool +addWeaponTurret +admin +agent +agents +AGLToASL +aimedAtTarget +aimPos +airDensityCurveRTD +airDensityRTD +airplaneThrottle +airportSide +AISFinishHeal +alive +all3DENEntities +allAirports +allControls +allCurators +allCutLayers +allDead +allDeadMen +allDisplays +allGroups +allMapMarkers +allMines +allMissionObjects +allow3DMode +allowCrewInImmobile +allowCuratorLogicIgnoreAreas +allowDamage +allowDammage +allowFileOperations +allowFleeing +allowGetIn +allowSprint +allPlayers +allSimpleObjects +allSites +allTurrets +allUnits +allUnitsUAV +allVariables +ammo +ammoOnPylon +animate +animateBay +animateDoor +animatePylon +animateSource +animationNames +animationPhase +animationSourcePhase +animationState +append +apply +armoryPoints +arrayIntersect +asin +ASLToAGL +ASLToATL +assert +assignAsCargo +assignAsCargoIndex +assignAsCommander +assignAsDriver +assignAsGunner +assignAsTurret +assignCurator +assignedCargo +assignedCommander +assignedDriver +assignedGunner +assignedItems +assignedTarget +assignedTeam +assignedVehicle +assignedVehicleRole +assignItem +assignTeam +assignToAirport +atan +atan2 +atg +ATLToASL +attachedObject +attachedObjects +attachedTo +attachObject +attachTo +attackEnabled +backpack +backpackCargo +backpackContainer +backpackItems +backpackMagazines +backpackSpaceFor +behaviour +benchmark +binocular +blufor +boundingBox +boundingBoxReal +boundingCenter +briefingName +buildingExit +buildingPos +buldozer_EnableRoadDiag +buldozer_IsEnabledRoadDiag +buldozer_LoadNewRoads +buldozer_reloadOperMap +buttonAction +buttonSetAction +cadetMode +callExtension +camCommand +camCommit +camCommitPrepared +camCommitted +camConstuctionSetParams +camCreate +camDestroy +cameraEffect +cameraEffectEnableHUD +cameraInterest +cameraOn +cameraView +campaignConfigFile +camPreload +camPreloaded +camPrepareBank +camPrepareDir +camPrepareDive +camPrepareFocus +camPrepareFov +camPrepareFovRange +camPreparePos +camPrepareRelPos +camPrepareTarget +camSetBank +camSetDir +camSetDive +camSetFocus +camSetFov +camSetFovRange +camSetPos +camSetRelPos +camSetTarget +camTarget +camUseNVG +canAdd +canAddItemToBackpack +canAddItemToUniform +canAddItemToVest +cancelSimpleTaskDestination +canFire +canMove +canSlingLoad +canStand +canSuspend +canTriggerDynamicSimulation +canUnloadInCombat +canVehicleCargo +captive +captiveNum +cbChecked +cbSetChecked +ceil +channelEnabled +cheatsEnabled +checkAIFeature +checkVisibility +civilian +className +clear3DENAttribute +clear3DENInventory +clearAllItemsFromBackpack +clearBackpackCargo +clearBackpackCargoGlobal +clearForcesRTD +clearGroupIcons +clearItemCargo +clearItemCargoGlobal +clearItemPool +clearMagazineCargo +clearMagazineCargoGlobal +clearMagazinePool +clearOverlay +clearRadio +clearVehicleInit +clearWeaponCargo +clearWeaponCargoGlobal +clearWeaponPool +clientOwner +closeDialog +closeDisplay +closeOverlay +collapseObjectTree +collect3DENHistory +collectiveRTD +combatMode +commandArtilleryFire +commandChat +commander +commandFire +commandFollow +commandFSM +commandGetOut +commandingMenu +commandMove +commandRadio +commandStop +commandSuppressiveFire +commandTarget +commandWatch +comment +commitOverlay +compile +compileFinal +completedFSM +composeText +configClasses +configFile +configHierarchy +configName +configNull +configProperties +configSourceAddonList +configSourceMod +configSourceModList +confirmSensorTarget +connectTerminalToUAV +controlNull +controlsGroupCtrl +copyFromClipboard +copyToClipboard +copyWaypoints +cos +count +countEnemy +countFriendly +countSide +countType +countUnknown +create3DENComposition +create3DENEntity +createAgent +createCenter +createDialog +createDiaryLink +createDiaryRecord +createDiarySubject +createDisplay +createGearDialog +createGroup +createGuardedPoint +createLocation +createMarker +createMarkerLocal +createMenu +createMine +createMissionDisplay +createMPCampaignDisplay +createSimpleObject +createSimpleTask +createSite +createSoundSource +createTask +createTeam +createTrigger +createUnit +createVehicle +createVehicleCrew +createVehicleLocal +crew +ctAddHeader +ctAddRow +ctClear +ctCurSel +ctData +ctFindHeaderRows +ctFindRowHeader +ctHeaderControls +ctHeaderCount +ctRemoveHeaders +ctRemoveRows +ctrlActivate +ctrlAddEventHandler +ctrlAngle +ctrlAutoScrollDelay +ctrlAutoScrollRewind +ctrlAutoScrollSpeed +ctrlChecked +ctrlClassName +ctrlCommit +ctrlCommitted +ctrlCreate +ctrlDelete +ctrlEnable +ctrlEnabled +ctrlFade +ctrlHTMLLoaded +ctrlIDC +ctrlIDD +ctrlMapAnimAdd +ctrlMapAnimClear +ctrlMapAnimCommit +ctrlMapAnimDone +ctrlMapCursor +ctrlMapMouseOver +ctrlMapScale +ctrlMapScreenToWorld +ctrlMapWorldToScreen +ctrlModel +ctrlModelDirAndUp +ctrlModelScale +ctrlParent +ctrlParentControlsGroup +ctrlPosition +ctrlRemoveAllEventHandlers +ctrlRemoveEventHandler +ctrlScale +ctrlSetActiveColor +ctrlSetAngle +ctrlSetAutoScrollDelay +ctrlSetAutoScrollRewind +ctrlSetAutoScrollSpeed +ctrlSetBackgroundColor +ctrlSetChecked +ctrlSetDisabledColor +ctrlSetEventHandler +ctrlSetFade +ctrlSetFocus +ctrlSetFont +ctrlSetFontH1 +ctrlSetFontH1B +ctrlSetFontH2 +ctrlSetFontH2B +ctrlSetFontH3 +ctrlSetFontH3B +ctrlSetFontH4 +ctrlSetFontH4B +ctrlSetFontH5 +ctrlSetFontH5B +ctrlSetFontH6 +ctrlSetFontH6B +ctrlSetFontHeight +ctrlSetFontHeightH1 +ctrlSetFontHeightH2 +ctrlSetFontHeightH3 +ctrlSetFontHeightH4 +ctrlSetFontHeightH5 +ctrlSetFontHeightH6 +ctrlSetFontHeightSecondary +ctrlSetFontP +ctrlSetFontPB +ctrlSetFontSecondary +ctrlSetForegroundColor +ctrlSetModel +ctrlSetModelDirAndUp +ctrlSetModelScale +ctrlSetPixelPrecision +ctrlSetPosition +ctrlSetScale +ctrlSetStructuredText +ctrlSetText +ctrlSetTextColor +ctrlSetTextColorSecondary +ctrlSetTextSecondary +ctrlSetTooltip +ctrlSetTooltipColorBox +ctrlSetTooltipColorShade +ctrlSetTooltipColorText +ctrlShow +ctrlShown +ctrlText +ctrlTextHeight +ctrlTextSecondary +ctrlTextWidth +ctrlType +ctrlVisible +ctRowControls +ctRowCount +ctSetCurSel +ctSetData +ctSetHeaderTemplate +ctSetRowTemplate +ctSetValue +ctValue +curatorAddons +curatorCamera +curatorCameraArea +curatorCameraAreaCeiling +curatorCoef +curatorEditableObjects +curatorEditingArea +curatorEditingAreaType +curatorMouseOver +curatorPoints +curatorRegisteredObjects +curatorSelected +curatorWaypointCost +current3DENOperation +currentChannel +currentCommand +currentMagazine +currentMagazineDetail +currentMagazineDetailTurret +currentMagazineTurret +currentMuzzle +currentNamespace +currentTask +currentTasks +currentThrowable +currentVisionMode +currentWaypoint +currentWeapon +currentWeaponMode +currentWeaponTurret +currentZeroing +cursorObject +cursorTarget +customChat +customRadio +cutFadeOut +cutObj +cutRsc +cutText +damage +date +dateToNumber +daytime +deActivateKey +debriefingText +debugFSM +debugLog +deg +delete3DENEntities +deleteAt +deleteCenter +deleteCollection +deleteEditorObject +deleteGroup +deleteGroupWhenEmpty +deleteIdentity +deleteLocation +deleteMarker +deleteMarkerLocal +deleteRange +deleteResources +deleteSite +deleteStatus +deleteTeam +deleteVehicle +deleteVehicleCrew +deleteWaypoint +detach +detectedMines +diag_activeMissionFSMs +diag_activeScripts +diag_activeSQFScripts +diag_activeSQSScripts +diag_captureFrame +diag_captureFrameToFile +diag_captureSlowFrame +diag_codePerformance +diag_drawMode +diag_dynamicSimulationEnd +diag_enable +diag_enabled +diag_fps +diag_fpsMin +diag_frameNo +diag_lightNewLoad +diag_list +diag_log +diag_logSlowFrame +diag_mergeConfigFile +diag_recordTurretLimits +diag_setLightNew +diag_tickTime +diag_toggle +dialog +diarySubjectExists +didJIP +didJIPOwner +difficulty +difficultyEnabled +difficultyEnabledRTD +difficultyOption +direction +directSay +disableAI +disableCollisionWith +disableConversation +disableDebriefingStats +disableMapIndicators +disableNVGEquipment +disableRemoteSensors +disableSerialization +disableTIEquipment +disableUAVConnectability +disableUserInput +displayAddEventHandler +displayCtrl +displayNull +displayParent +displayRemoveAllEventHandlers +displayRemoveEventHandler +displaySetEventHandler +dissolveTeam +distance +distance2D +distanceSqr +distributionRegion +do3DENAction +doArtilleryFire +doFire +doFollow +doFSM +doGetOut +doMove +doorPhase +doStop +doSuppressiveFire +doTarget +doWatch +drawArrow +drawEllipse +drawIcon +drawIcon3D +drawLine +drawLine3D +drawLink +drawLocation +drawPolygon +drawRectangle +drawTriangle +driver +drop +dynamicSimulationDistance +dynamicSimulationDistanceCoef +dynamicSimulationEnabled +dynamicSimulationSystemEnabled +east +edit3DENMissionAttributes +editObject +editorSetEventHandler +effectiveCommander +emptyPositions +enableAI +enableAIFeature +enableAimPrecision +enableAttack +enableAudioFeature +enableAutoStartUpRTD +enableAutoTrimRTD +enableCamShake +enableCaustics +enableChannel +enableCollisionWith +enableCopilot +enableDebriefingStats +enableDiagLegend +enableDynamicSimulation +enableDynamicSimulationSystem +enableEndDialog +enableEngineArtillery +enableEnvironment +enableFatigue +enableGunLights +enableInfoPanelComponent +enableIRLasers +enableMimics +enablePersonTurret +enableRadio +enableReload +enableRopeAttach +enableSatNormalOnDetail +enableSaving +enableSentences +enableSimulation +enableSimulationGlobal +enableStamina +enableStressDamage +enableTeamSwitch +enableTraffic +enableUAVConnectability +enableUAVWaypoints +enableVehicleCargo +enableVehicleSensor +enableWeaponDisassembly +endl +endLoadingScreen +endMission +engineOn +enginesIsOnRTD +enginesPowerRTD +enginesRpmRTD +enginesTorqueRTD +entities +environmentEnabled +estimatedEndServerTime +estimatedTimeLeft +evalObjectArgument +everyBackpack +everyContainer +exec +execEditorScript +exp +expectedDestination +exportJIPMessages +eyeDirection +eyePos +face +faction +fadeMusic +fadeRadio +fadeSound +fadeSpeech +failMission +fillWeaponsFromPool +find +findCover +findDisplay +findEditorObject +findEmptyPosition +findEmptyPositionReady +findIf +findNearestEnemy +finishMissionInit +finite +fire +fireAtTarget +firstBackpack +flag +flagAnimationPhase +flagOwner +flagSide +flagTexture +fleeing +floor +flyInHeight +flyInHeightASL +fog +fogForecast +fogParams +forceAddUniform +forceAtPositionRTD +forcedMap +forceEnd +forceFlagTexture +forceFollowRoad +forceGeneratorRTD +forceMap +forceRespawn +forceSpeed +forceWalk +forceWeaponFire +forceWeatherChange +forgetTarget +format +formation +formationDirection +formationLeader +formationMembers +formationPosition +formationTask +formatText +formLeader +freeLook +fromEditor +fuel +fullCrew +gearIDCAmmoCount +gearSlotAmmoCount +gearSlotData +get3DENActionState +get3DENAttribute +get3DENCamera +get3DENConnections +get3DENEntity +get3DENEntityID +get3DENGrid +get3DENIconsVisible +get3DENLayerEntities +get3DENLinesVisible +get3DENMissionAttribute +get3DENMouseOver +get3DENSelected +getAimingCoef +getAllEnvSoundControllers +getAllHitPointsDamage +getAllOwnedMines +getAllSoundControllers +getAmmoCargo +getAnimAimPrecision +getAnimSpeedCoef +getArray +getArtilleryAmmo +getArtilleryComputerSettings +getArtilleryETA +getAssignedCuratorLogic +getAssignedCuratorUnit +getBackpackCargo +getBleedingRemaining +getBurningValue +getCameraViewDirection +getCargoIndex +getCenterOfMass +getClientState +getClientStateNumber +getCompatiblePylonMagazines +getConnectedUAV +getContainerMaxLoad +getCursorObjectParams +getCustomAimCoef +getDammage +getDescription +getDir +getDirVisual +getDLCAssetsUsage +getDLCAssetsUsageByName +getDLCs +getDLCUsageTime +getEditorCamera +getEditorMode +getEditorObjectScope +getElevationOffset +getEngineTargetRpmRTD +getEnvSoundController +getFatigue +getFieldManualStartPage +getForcedFlagTexture +getFriend +getFSMVariable +getFuelCargo +getGroupIcon +getGroupIconParams +getGroupIcons +getHideFrom +getHit +getHitIndex +getHitPointDamage +getItemCargo +getMagazineCargo +getMarkerColor +getMarkerPos +getMarkerSize +getMarkerType +getMass +getMissionConfig +getMissionConfigValue +getMissionDLCs +getMissionLayerEntities +getMissionLayers +getModelInfo +getMousePosition +getMusicPlayedTime +getNumber +getObjectArgument +getObjectChildren +getObjectDLC +getObjectMaterials +getObjectProxy +getObjectTextures +getObjectType +getObjectViewDistance +getOxygenRemaining +getPersonUsedDLCs +getPilotCameraDirection +getPilotCameraPosition +getPilotCameraRotation +getPilotCameraTarget +getPlateNumber +getPlayerChannel +getPlayerScores +getPlayerUID +getPlayerUIDOld +getPos +getPosASL +getPosASLVisual +getPosASLW +getPosATL +getPosATLVisual +getPosVisual +getPosWorld +getPylonMagazines +getRelDir +getRelPos +getRemoteSensorsDisabled +getRepairCargo +getResolution +getRotorBrakeRTD +getShadowDistance +getShotParents +getSlingLoad +getSoundController +getSoundControllerResult +getSpeed +getStamina +getStatValue +getSuppression +getTerrainGrid +getTerrainHeightASL +getText +getTotalDLCUsageTime +getTrimOffsetRTD +getUnitLoadout +getUnitTrait +getUserMFDText +getUserMFDValue +getVariable +getVehicleCargo +getWeaponCargo +getWeaponSway +getWingsOrientationRTD +getWingsPositionRTD +getWPPos +glanceAt +globalChat +globalRadio +goggles +group +groupChat +groupFromNetId +groupIconSelectable +groupIconsVisible +groupId +groupOwner +groupRadio +groupSelectedUnits +groupSelectUnit +grpNull +gunner +gusts +halt +handgunItems +handgunMagazine +handgunWeapon +handsHit +hasInterface +hasPilotCamera +hasWeapon +hcAllGroups +hcGroupParams +hcLeader +hcRemoveAllGroups +hcRemoveGroup +hcSelected +hcSelectGroup +hcSetGroup +hcShowBar +hcShownBar +headgear +hideBody +hideObject +hideObjectGlobal +hideSelection +hint +hintC +hintCadet +hintSilent +hmd +hostMission +htmlLoad +HUDMovementLevels +humidity +image +importAllGroups +importance +in +inArea +inAreaArray +incapacitatedState +independent +inflame +inflamed +infoPanel +infoPanelComponentEnabled +infoPanelComponents +infoPanels +inGameUISetEventHandler +inheritsFrom +initAmbientLife +inPolygon +inputAction +inRangeOfArtillery +insertEditorObject +intersect +is3DEN +is3DENMultiplayer +isAbleToBreathe +isAgent +isAimPrecisionEnabled +isArray +isAutoHoverOn +isAutonomous +isAutoStartUpEnabledRTD +isAutotest +isAutoTrimOnRTD +isBleeding +isBurning +isClass +isCollisionLightOn +isCopilotEnabled +isDamageAllowed +isDedicated +isDLCAvailable +isEngineOn +isEqualTo +isEqualType +isEqualTypeAll +isEqualTypeAny +isEqualTypeArray +isEqualTypeParams +isFilePatchingEnabled +isFlashlightOn +isFlatEmpty +isForcedWalk +isFormationLeader +isGroupDeletedWhenEmpty +isHidden +isInRemainsCollector +isInstructorFigureEnabled +isIRLaserOn +isKeyActive +isKindOf +isLaserOn +isLightOn +isLocalized +isManualFire +isMarkedForCollection +isMultiplayer +isMultiplayerSolo +isNil +isNull +isNumber +isObjectHidden +isObjectRTD +isOnRoad +isPipEnabled +isPlayer +isRealTime +isRemoteExecuted +isRemoteExecutedJIP +isServer +isShowing3DIcons +isSimpleObject +isSprintAllowed +isStaminaEnabled +isSteamMission +isStreamFriendlyUIEnabled +isStressDamageEnabled +isText +isTouchingGround +isTurnedOut +isTutHintsEnabled +isUAVConnectable +isUAVConnected +isUIContext +isUniformAllowed +isVehicleCargo +isVehicleRadarOn +isVehicleSensorEnabled +isWalking +isWeaponDeployed +isWeaponRested +itemCargo +items +itemsWithMagazines +join +joinAs +joinAsSilent +joinSilent +joinString +kbAddDatabase +kbAddDatabaseTargets +kbAddTopic +kbHasTopic +kbReact +kbRemoveTopic +kbTell +kbWasSaid +keyImage +keyName +knowsAbout +land +landAt +landResult +language +laserTarget +lbAdd +lbClear +lbColor +lbColorRight +lbCurSel +lbData +lbDelete +lbIsSelected +lbPicture +lbPictureRight +lbSelection +lbSetColor +lbSetColorRight +lbSetCurSel +lbSetData +lbSetPicture +lbSetPictureColor +lbSetPictureColorDisabled +lbSetPictureColorSelected +lbSetPictureRight +lbSetPictureRightColor +lbSetPictureRightColorDisabled +lbSetPictureRightColorSelected +lbSetSelectColor +lbSetSelectColorRight +lbSetSelected +lbSetText +lbSetTextRight +lbSetTooltip +lbSetValue +lbSize +lbSort +lbSortByValue +lbText +lbTextRight +lbValue +leader +leaderboardDeInit +leaderboardGetRows +leaderboardInit +leaderboardRequestRowsFriends +leaderboardRequestRowsGlobal +leaderboardRequestRowsGlobalAroundUser +leaderboardsRequestUploadScore +leaderboardsRequestUploadScoreKeepBest +leaderboardState +leaveVehicle +libraryCredits +libraryDisclaimers +lifeState +lightAttachObject +lightDetachObject +lightIsOn +lightnings +limitSpeed +linearConversion +lineBreak +lineIntersects +lineIntersectsObjs +lineIntersectsSurfaces +lineIntersectsWith +linkItem +list +listObjects +listRemoteTargets +listVehicleSensors +ln +lnbAddArray +lnbAddColumn +lnbAddRow +lnbClear +lnbColor +lnbColorRight +lnbCurSelRow +lnbData +lnbDeleteColumn +lnbDeleteRow +lnbGetColumnsPosition +lnbPicture +lnbPictureRight +lnbSetColor +lnbSetColorRight +lnbSetColumnsPos +lnbSetCurSelRow +lnbSetData +lnbSetPicture +lnbSetPictureColor +lnbSetPictureColorRight +lnbSetPictureColorSelected +lnbSetPictureColorSelectedRight +lnbSetPictureRight +lnbSetText +lnbSetTextRight +lnbSetValue +lnbSize +lnbSort +lnbSortByValue +lnbText +lnbTextRight +lnbValue +load +loadAbs +loadBackpack +loadFile +loadGame +loadIdentity +loadMagazine +loadOverlay +loadStatus +loadUniform +loadVest +local +localize +locationNull +locationPosition +lock +lockCameraTo +lockCargo +lockDriver +locked +lockedCargo +lockedDriver +lockedTurret +lockIdentity +lockTurret +lockWP +log +logEntities +logNetwork +logNetworkTerminate +lookAt +lookAtPos +magazineCargo +magazines +magazinesAllTurrets +magazinesAmmo +magazinesAmmoCargo +magazinesAmmoFull +magazinesDetail +magazinesDetailBackpack +magazinesDetailUniform +magazinesDetailVest +magazinesTurret +magazineTurretAmmo +mapAnimAdd +mapAnimClear +mapAnimCommit +mapAnimDone +mapCenterOnCamera +mapGridPosition +markAsFinishedOnSteam +markerAlpha +markerBrush +markerColor +markerDir +markerPos +markerShape +markerSize +markerText +markerType +max +members +menuAction +menuAdd +menuChecked +menuClear +menuCollapse +menuData +menuDelete +menuEnable +menuEnabled +menuExpand +menuHover +menuPicture +menuSetAction +menuSetCheck +menuSetData +menuSetPicture +menuSetValue +menuShortcut +menuShortcutText +menuSize +menuSort +menuText +menuURL +menuValue +min +mineActive +mineDetectedBy +missionConfigFile +missionDifficulty +missionName +missionNamespace +missionStart +missionVersion +modelToWorld +modelToWorldVisual +modelToWorldVisualWorld +modelToWorldWorld +modParams +moonIntensity +moonPhase +morale +move +move3DENCamera +moveInAny +moveInCargo +moveInCommander +moveInDriver +moveInGunner +moveInTurret +moveObjectToEnd +moveOut +moveTime +moveTo +moveToCompleted +moveToFailed +musicVolume +name +nameSound +nearEntities +nearestBuilding +nearestLocation +nearestLocations +nearestLocationWithDubbing +nearestObject +nearestObjects +nearestTerrainObjects +nearObjects +nearObjectsReady +nearRoads +nearSupplies +nearTargets +needReload +netId +netObjNull +newOverlay +nextMenuItemIndex +nextWeatherChange +nMenuItems +numberOfEnginesRTD +numberToDate +objectCurators +objectFromNetId +objectParent +objNull +objStatus +onBriefingGear +onBriefingGroup +onBriefingNotes +onBriefingPlan +onBriefingTeamSwitch +onCommandModeChanged +onDoubleClick +onEachFrame +onGroupIconClick +onGroupIconOverEnter +onGroupIconOverLeave +onHCGroupSelectionChanged +onMapSingleClick +onPlayerConnected +onPlayerDisconnected +onPreloadFinished +onPreloadStarted +onShowNewObject +onTeamSwitch +openCuratorInterface +openDLCPage +openDSInterface +openMap +openSteamApp +openYoutubeVideo +opfor +orderGetIn +overcast +overcastForecast +owner +param +params +parseNumber +parseSimpleArray +parseText +parsingNamespace +particlesQuality +pi +pickWeaponPool +pitch +pixelGrid +pixelGridBase +pixelGridNoUIScale +pixelH +pixelW +playableSlotsNumber +playableUnits +playAction +playActionNow +player +playerRespawnTime +playerSide +playersNumber +playGesture +playMission +playMove +playMoveNow +playMusic +playScriptedMission +playSound +playSound3D +position +positionCameraToWorld +posScreenToWorld +posWorldToScreen +ppEffectAdjust +ppEffectCommit +ppEffectCommitted +ppEffectCreate +ppEffectDestroy +ppEffectEnable +ppEffectEnabled +ppEffectForceInNVG +precision +preloadCamera +preloadObject +preloadSound +preloadTitleObj +preloadTitleRsc +primaryWeapon +primaryWeaponItems +primaryWeaponMagazine +priority +processDiaryLink +processInitCommands +productVersion +profileName +profileNamespace +profileNameSteam +progressLoadingScreen +progressPosition +progressSetPosition +publicVariable +publicVariableClient +publicVariableServer +pushBack +pushBackUnique +putWeaponPool +queryItemsPool +queryMagazinePool +queryWeaponPool +rad +radioChannelAdd +radioChannelCreate +radioChannelRemove +radioChannelSetCallSign +radioChannelSetLabel +radioVolume +rain +rainbow +random +rank +rankId +rating +rectangular +registeredTasks +registerTask +reload +reloadEnabled +remoteControl +remoteExec +remoteExecCall +remoteExecutedOwner +remove3DENConnection +remove3DENEventHandler +remove3DENLayer +removeAction +removeAll3DENEventHandlers +removeAllActions +removeAllAssignedItems +removeAllContainers +removeAllCuratorAddons +removeAllCuratorCameraAreas +removeAllCuratorEditingAreas +removeAllEventHandlers +removeAllHandgunItems +removeAllItems +removeAllItemsWithMagazines +removeAllMissionEventHandlers +removeAllMPEventHandlers +removeAllMusicEventHandlers +removeAllOwnedMines +removeAllPrimaryWeaponItems +removeAllWeapons +removeBackpack +removeBackpackGlobal +removeCuratorAddons +removeCuratorCameraArea +removeCuratorEditableObjects +removeCuratorEditingArea +removeDrawIcon +removeDrawLinks +removeEventHandler +removeFromRemainsCollector +removeGoggles +removeGroupIcon +removeHandgunItem +removeHeadgear +removeItem +removeItemFromBackpack +removeItemFromUniform +removeItemFromVest +removeItems +removeMagazine +removeMagazineGlobal +removeMagazines +removeMagazinesTurret +removeMagazineTurret +removeMenuItem +removeMissionEventHandler +removeMPEventHandler +removeMusicEventHandler +removeOwnedMine +removePrimaryWeaponItem +removeSecondaryWeaponItem +removeSimpleTask +removeSwitchableUnit +removeTeamMember +removeUniform +removeVest +removeWeapon +removeWeaponAttachmentCargo +removeWeaponCargo +removeWeaponGlobal +removeWeaponTurret +reportRemoteTarget +requiredVersion +resetCamShake +resetSubgroupDirection +resistance +resize +resources +respawnVehicle +restartEditorCamera +reveal +revealMine +reverse +reversedMouseY +roadAt +roadsConnectedTo +roleDescription +ropeAttachedObjects +ropeAttachedTo +ropeAttachEnabled +ropeAttachTo +ropeCreate +ropeCut +ropeDestroy +ropeDetach +ropeEndPosition +ropeLength +ropes +ropeUnwind +ropeUnwound +rotorsForcesRTD +rotorsRpmRTD +round +runInitScript +safeZoneH +safeZoneW +safeZoneWAbs +safeZoneX +safeZoneXAbs +safeZoneY +save3DENInventory +saveGame +saveIdentity +saveJoysticks +saveOverlay +saveProfileNamespace +saveStatus +saveVar +savingEnabled +say +say2D +say3D +score +scoreSide +screenshot +screenToWorld +scriptDone +scriptName +scriptNull +scudState +secondaryWeapon +secondaryWeaponItems +secondaryWeaponMagazine +select +selectBestPlaces +selectDiarySubject +selectedEditorObjects +selectEditorObject +selectionNames +selectionPosition +selectLeader +selectMax +selectMin +selectNoPlayer +selectPlayer +selectRandom +selectRandomWeighted +selectWeapon +selectWeaponTurret +sendAUMessage +sendSimpleCommand +sendTask +sendTaskResult +sendUDPMessage +serverCommand +serverCommandAvailable +serverCommandExecutable +serverName +serverTime +set +set3DENAttribute +set3DENAttributes +set3DENGrid +set3DENIconsVisible +set3DENLayer +set3DENLinesVisible +set3DENLogicType +set3DENMissionAttribute +set3DENMissionAttributes +set3DENModelsVisible +set3DENObjectType +set3DENSelected +setAccTime +setActualCollectiveRTD +setAirplaneThrottle +setAirportSide +setAmmo +setAmmoCargo +setAmmoOnPylon +setAnimSpeedCoef +setAperture +setApertureNew +setArmoryPoints +setAttributes +setAutonomous +setBehaviour +setBleedingRemaining +setBrakesRTD +setCameraInterest +setCamShakeDefParams +setCamShakeParams +setCamUseTI +setCaptive +setCenterOfMass +setCollisionLight +setCombatMode +setCompassOscillation +setConvoySeparation +setCuratorCameraAreaCeiling +setCuratorCoef +setCuratorEditingAreaType +setCuratorWaypointCost +setCurrentChannel +setCurrentTask +setCurrentWaypoint +setCustomAimCoef +setCustomWeightRTD +setDamage +setDammage +setDate +setDebriefingText +setDefaultCamera +setDestination +setDetailMapBlendPars +setDir +setDirection +setDrawIcon +setDriveOnPath +setDropInterval +setDynamicSimulationDistance +setDynamicSimulationDistanceCoef +setEditorMode +setEditorObjectScope +setEffectCondition +setEngineRpmRTD +setFace +setFaceAnimation +setFatigue +setFeatureType +setFlagAnimationPhase +setFlagOwner +setFlagSide +setFlagTexture +setFog +setForceGeneratorRTD +setFormation +setFormationTask +setFormDir +setFriend +setFromEditor +setFSMVariable +setFuel +setFuelCargo +setGroupIcon +setGroupIconParams +setGroupIconsSelectable +setGroupIconsVisible +setGroupId +setGroupIdGlobal +setGroupOwner +setGusts +setHideBehind +setHit +setHitIndex +setHitPointDamage +setHorizonParallaxCoef +setHUDMovementLevels +setIdentity +setImportance +setInfoPanel +setLeader +setLightAmbient +setLightAttenuation +setLightBrightness +setLightColor +setLightDayLight +setLightFlareMaxDistance +setLightFlareSize +setLightIntensity +setLightnings +setLightUseFlare +setLocalWindParams +setMagazineTurretAmmo +setMarkerAlpha +setMarkerAlphaLocal +setMarkerBrush +setMarkerBrushLocal +setMarkerColor +setMarkerColorLocal +setMarkerDir +setMarkerDirLocal +setMarkerPos +setMarkerPosLocal +setMarkerShape +setMarkerShapeLocal +setMarkerSize +setMarkerSizeLocal +setMarkerText +setMarkerTextLocal +setMarkerType +setMarkerTypeLocal +setMass +setMimic +setMousePosition +setMusicEffect +setMusicEventHandler +setName +setNameSound +setObjectArguments +setObjectMaterial +setObjectMaterialGlobal +setObjectProxy +setObjectTexture +setObjectTextureGlobal +setObjectViewDistance +setOvercast +setOwner +setOxygenRemaining +setParticleCircle +setParticleClass +setParticleFire +setParticleParams +setParticleRandom +setPilotCameraDirection +setPilotCameraRotation +setPilotCameraTarget +setPilotLight +setPiPEffect +setPitch +setPlateNumber +setPlayable +setPlayerRespawnTime +setPos +setPosASL +setPosASL2 +setPosASLW +setPosATL +setPosition +setPosWorld +setPylonLoadOut +setPylonsPriority +setRadioMsg +setRain +setRainbow +setRandomLip +setRank +setRectangular +setRepairCargo +setRotorBrakeRTD +setShadowDistance +setShotParents +setSide +setSimpleTaskAlwaysVisible +setSimpleTaskCustomData +setSimpleTaskDescription +setSimpleTaskDestination +setSimpleTaskTarget +setSimpleTaskType +setSimulWeatherLayers +setSize +setSkill +setSlingLoad +setSoundEffect +setSpeaker +setSpeech +setSpeedMode +setStamina +setStaminaScheme +setStatValue +setSuppression +setSystemOfUnits +setTargetAge +setTaskMarkerOffset +setTaskResult +setTaskState +setTerrainGrid +setText +setTimeMultiplier +setTitleEffect +setToneMapping +setToneMappingParams +setTrafficDensity +setTrafficDistance +setTrafficGap +setTrafficSpeed +setTriggerActivation +setTriggerArea +setTriggerStatements +setTriggerText +setTriggerTimeout +setTriggerType +setType +setUnconscious +setUnitAbility +setUnitLoadout +setUnitPos +setUnitPosWeak +setUnitRank +setUnitRecoilCoefficient +setUnitTrait +setUnloadInCombat +setUserActionText +setUserMFDText +setUserMFDValue +setVariable +setVectorDir +setVectorDirAndUp +setVectorUp +setVehicleAmmo +setVehicleAmmoDef +setVehicleArmor +setVehicleCargo +setVehicleId +setVehicleInit +setVehicleLock +setVehiclePosition +setVehicleRadar +setVehicleReceiveRemoteTargets +setVehicleReportOwnPosition +setVehicleReportRemoteTargets +setVehicleTIPars +setVehicleVarName +setVelocity +setVelocityModelSpace +setVelocityTransformation +setViewDistance +setVisibleIfTreeCollapsed +setWantedRpmRTD +setWaves +setWaypointBehaviour +setWaypointCombatMode +setWaypointCompletionRadius +setWaypointDescription +setWaypointForceBehaviour +setWaypointFormation +setWaypointHousePosition +setWaypointLoiterRadius +setWaypointLoiterType +setWaypointName +setWaypointPosition +setWaypointScript +setWaypointSpeed +setWaypointStatements +setWaypointTimeout +setWaypointType +setWaypointVisible +setWeaponReloadingTime +setWind +setWindDir +setWindForce +setWindStr +setWingForceScaleRTD +setWPPos +show3DIcons +showChat +showCinemaBorder +showCommandingMenu +showCompass +showCuratorCompass +showGPS +showHUD +showLegend +showMap +shownArtilleryComputer +shownChat +shownCompass +shownCuratorCompass +showNewEditorObject +shownGPS +shownHUD +shownMap +shownPad +shownRadio +shownScoretable +shownUAVFeed +shownWarrant +shownWatch +showPad +showRadio +showScoretable +showSubtitles +showUAVFeed +showWarrant +showWatch +showWaypoint +showWaypoints +side +sideAmbientLife +sideChat +sideEmpty +sideEnemy +sideFriendly +sideLogic +sideRadio +sideUnknown +simpleTasks +simulationEnabled +simulCloudDensity +simulCloudOcclusion +simulInClouds +simulWeatherSync +sin +size +sizeOf +skill +skillFinal +skipTime +sleep +sliderPosition +sliderRange +sliderSetPosition +sliderSetRange +sliderSetSpeed +sliderSpeed +slingLoadAssistantShown +soldierMagazines +someAmmo +sort +soundVolume +speaker +speed +speedMode +splitString +sqrt +squadParams +stance +startLoadingScreen +stop +stopEngineRTD +stopped +str +sunOrMoon +supportInfo +suppressFor +surfaceIsWater +surfaceNormal +surfaceType +swimInDepth +switchableUnits +switchAction +switchCamera +switchGesture +switchLight +switchMove +synchronizedObjects +synchronizedTriggers +synchronizedWaypoints +synchronizeObjectsAdd +synchronizeObjectsRemove +synchronizeTrigger +synchronizeWaypoint +systemChat +systemOfUnits +tan +targetKnowledge +targets +targetsAggregate +targetsQuery +taskAlwaysVisible +taskChildren +taskCompleted +taskCustomData +taskDescription +taskDestination +taskHint +taskMarkerOffset +taskNull +taskParent +taskResult +taskState +taskType +teamMember +teamMemberNull +teamName +teams +teamSwitch +teamSwitchEnabled +teamType +terminate +terrainIntersect +terrainIntersectASL +terrainIntersectAtASL +text +textLog +textLogFormat +tg +time +timeMultiplier +titleCut +titleFadeOut +titleObj +titleRsc +titleText +toArray +toFixed +toLower +toString +toUpper +triggerActivated +triggerActivation +triggerArea +triggerAttachedVehicle +triggerAttachObject +triggerAttachVehicle +triggerDynamicSimulation +triggerStatements +triggerText +triggerTimeout +triggerTimeoutCurrent +triggerType +turretLocal +turretOwner +turretUnit +tvAdd +tvClear +tvCollapse +tvCollapseAll +tvCount +tvCurSel +tvData +tvDelete +tvExpand +tvExpandAll +tvPicture +tvPictureRight +tvSetColor +tvSetCurSel +tvSetData +tvSetPicture +tvSetPictureColor +tvSetPictureColorDisabled +tvSetPictureColorSelected +tvSetPictureRight +tvSetPictureRightColor +tvSetPictureRightColorDisabled +tvSetPictureRightColorSelected +tvSetSelectColor +tvSetText +tvSetTooltip +tvSetValue +tvSort +tvSortByValue +tvText +tvTooltip +tvValue +type +typeName +typeOf +UAVControl +uiNamespace +uiSleep +unassignCurator +unassignItem +unassignTeam +unassignVehicle +underwater +uniform +uniformContainer +uniformItems +uniformMagazines +unitAddons +unitAimPosition +unitAimPositionVisual +unitBackpack +unitIsUAV +unitPos +unitReady +unitRecoilCoefficient +units +unitsBelowHeight +unlinkItem +unlockAchievement +unregisterTask +updateDrawIcon +updateMenuItem +updateObjectTree +useAIOperMapObstructionTest +useAISteeringComponent +useAudioTimeForMoves +userInputDisabled +vectorAdd +vectorCos +vectorCrossProduct +vectorDiff +vectorDir +vectorDirVisual +vectorDistance +vectorDistanceSqr +vectorDotProduct +vectorFromTo +vectorMagnitude +vectorMagnitudeSqr +vectorModelToWorld +vectorModelToWorldVisual +vectorMultiply +vectorNormalized +vectorUp +vectorUpVisual +vectorWorldToModel +vectorWorldToModelVisual +vehicle +vehicleCargoEnabled +vehicleChat +vehicleRadio +vehicleReceiveRemoteTargets +vehicleReportOwnPosition +vehicleReportRemoteTargets +vehicles +vehicleVarName +velocity +velocityModelSpace +verifySignature +vest +vestContainer +vestItems +vestMagazines +viewDistance +visibleCompass +visibleGPS +visibleMap +visiblePosition +visiblePositionASL +visibleScoretable +visibleWatch +waitUntil +waves +waypointAttachedObject +waypointAttachedVehicle +waypointAttachObject +waypointAttachVehicle +waypointBehaviour +waypointCombatMode +waypointCompletionRadius +waypointDescription +waypointForceBehaviour +waypointFormation +waypointHousePosition +waypointLoiterRadius +waypointLoiterType +waypointName +waypointPosition +waypoints +waypointScript +waypointsEnabledUAV +waypointShow +waypointSpeed +waypointStatements +waypointTimeout +waypointTimeoutCurrent +waypointType +waypointVisible +weaponAccessories +weaponAccessoriesCargo +weaponCargo +weaponDirection +weaponInertia +weaponLowered +weapons +weaponsItems +weaponsItemsCargo +weaponState +weaponsTurret +weightRTD +west +WFSideText +wind +windDir +windRTD +windStr +wingsForcesRTD +worldName +worldSize +worldToModel +worldToModelVisual +worldToScreen + +---------------------------------------------------- + +[ + ["function", "abs"], + ["function", "accTime"], + ["function", "acos"], + ["function", "action"], + ["function", "actionIDs"], + ["function", "actionKeys"], + ["function", "actionKeysImages"], + ["function", "actionKeysNames"], + ["function", "actionKeysNamesArray"], + ["function", "actionName"], + ["function", "actionParams"], + ["function", "activateAddons"], + ["function", "activatedAddons"], + ["function", "activateKey"], + ["function", "add3DENConnection"], + ["function", "add3DENEventHandler"], + ["function", "add3DENLayer"], + ["function", "addAction"], + ["function", "addBackpack"], + ["function", "addBackpackCargo"], + ["function", "addBackpackCargoGlobal"], + ["function", "addBackpackGlobal"], + ["function", "addCamShake"], + ["function", "addCuratorAddons"], + ["function", "addCuratorCameraArea"], + ["function", "addCuratorEditableObjects"], + ["function", "addCuratorEditingArea"], + ["function", "addCuratorPoints"], + ["function", "addEditorObject"], + ["function", "addEventHandler"], + ["function", "addForce"], + ["function", "addForceGeneratorRTD"], + ["function", "addGoggles"], + ["function", "addGroupIcon"], + ["function", "addHandgunItem"], + ["function", "addHeadgear"], + ["function", "addItem"], + ["function", "addItemCargo"], + ["function", "addItemCargoGlobal"], + ["function", "addItemPool"], + ["function", "addItemToBackpack"], + ["function", "addItemToUniform"], + ["function", "addItemToVest"], + ["function", "addLiveStats"], + ["function", "addMagazine"], + ["function", "addMagazineAmmoCargo"], + ["function", "addMagazineCargo"], + ["function", "addMagazineCargoGlobal"], + ["function", "addMagazineGlobal"], + ["function", "addMagazinePool"], + ["function", "addMagazines"], + ["function", "addMagazineTurret"], + ["function", "addMenu"], + ["function", "addMenuItem"], + ["function", "addMissionEventHandler"], + ["function", "addMPEventHandler"], + ["function", "addMusicEventHandler"], + ["function", "addOwnedMine"], + ["function", "addPlayerScores"], + ["function", "addPrimaryWeaponItem"], + ["function", "addPublicVariableEventHandler"], + ["function", "addRating"], + ["function", "addResources"], + ["function", "addScore"], + ["function", "addScoreSide"], + ["function", "addSecondaryWeaponItem"], + ["function", "addSwitchableUnit"], + ["function", "addTeamMember"], + ["function", "addToRemainsCollector"], + ["function", "addTorque"], + ["function", "addUniform"], + ["function", "addVehicle"], + ["function", "addVest"], + ["function", "addWaypoint"], + ["function", "addWeapon"], + ["function", "addWeaponCargo"], + ["function", "addWeaponCargoGlobal"], + ["function", "addWeaponGlobal"], + ["function", "addWeaponItem"], + ["function", "addWeaponPool"], + ["function", "addWeaponTurret"], + ["function", "admin"], + ["function", "agent"], + ["function", "agents"], + ["function", "AGLToASL"], + ["function", "aimedAtTarget"], + ["function", "aimPos"], + ["function", "airDensityCurveRTD"], + ["function", "airDensityRTD"], + ["function", "airplaneThrottle"], + ["function", "airportSide"], + ["function", "AISFinishHeal"], + ["function", "alive"], + ["function", "all3DENEntities"], + ["function", "allAirports"], + ["function", "allControls"], + ["function", "allCurators"], + ["function", "allCutLayers"], + ["function", "allDead"], + ["function", "allDeadMen"], + ["function", "allDisplays"], + ["function", "allGroups"], + ["function", "allMapMarkers"], + ["function", "allMines"], + ["function", "allMissionObjects"], + ["function", "allow3DMode"], + ["function", "allowCrewInImmobile"], + ["function", "allowCuratorLogicIgnoreAreas"], + ["function", "allowDamage"], + ["function", "allowDammage"], + ["function", "allowFileOperations"], + ["function", "allowFleeing"], + ["function", "allowGetIn"], + ["function", "allowSprint"], + ["function", "allPlayers"], + ["function", "allSimpleObjects"], + ["function", "allSites"], + ["function", "allTurrets"], + ["function", "allUnits"], + ["function", "allUnitsUAV"], + ["function", "allVariables"], + ["function", "ammo"], + ["function", "ammoOnPylon"], + ["function", "animate"], + ["function", "animateBay"], + ["function", "animateDoor"], + ["function", "animatePylon"], + ["function", "animateSource"], + ["function", "animationNames"], + ["function", "animationPhase"], + ["function", "animationSourcePhase"], + ["function", "animationState"], + ["function", "append"], + ["function", "apply"], + ["function", "armoryPoints"], + ["function", "arrayIntersect"], + ["function", "asin"], + ["function", "ASLToAGL"], + ["function", "ASLToATL"], + ["function", "assert"], + ["function", "assignAsCargo"], + ["function", "assignAsCargoIndex"], + ["function", "assignAsCommander"], + ["function", "assignAsDriver"], + ["function", "assignAsGunner"], + ["function", "assignAsTurret"], + ["function", "assignCurator"], + ["function", "assignedCargo"], + ["function", "assignedCommander"], + ["function", "assignedDriver"], + ["function", "assignedGunner"], + ["function", "assignedItems"], + ["function", "assignedTarget"], + ["function", "assignedTeam"], + ["function", "assignedVehicle"], + ["function", "assignedVehicleRole"], + ["function", "assignItem"], + ["function", "assignTeam"], + ["function", "assignToAirport"], + ["function", "atan"], + ["function", "atan2"], + ["function", "atg"], + ["function", "ATLToASL"], + ["function", "attachedObject"], + ["function", "attachedObjects"], + ["function", "attachedTo"], + ["function", "attachObject"], + ["function", "attachTo"], + ["function", "attackEnabled"], + ["function", "backpack"], + ["function", "backpackCargo"], + ["function", "backpackContainer"], + ["function", "backpackItems"], + ["function", "backpackMagazines"], + ["function", "backpackSpaceFor"], + ["function", "behaviour"], + ["function", "benchmark"], + ["function", "binocular"], + ["function", "blufor"], + ["function", "boundingBox"], + ["function", "boundingBoxReal"], + ["function", "boundingCenter"], + ["function", "briefingName"], + ["function", "buildingExit"], + ["function", "buildingPos"], + ["function", "buldozer_EnableRoadDiag"], + ["function", "buldozer_IsEnabledRoadDiag"], + ["function", "buldozer_LoadNewRoads"], + ["function", "buldozer_reloadOperMap"], + ["function", "buttonAction"], + ["function", "buttonSetAction"], + ["function", "cadetMode"], + ["function", "callExtension"], + ["function", "camCommand"], + ["function", "camCommit"], + ["function", "camCommitPrepared"], + ["function", "camCommitted"], + ["function", "camConstuctionSetParams"], + ["function", "camCreate"], + ["function", "camDestroy"], + ["function", "cameraEffect"], + ["function", "cameraEffectEnableHUD"], + ["function", "cameraInterest"], + ["function", "cameraOn"], + ["function", "cameraView"], + ["function", "campaignConfigFile"], + ["function", "camPreload"], + ["function", "camPreloaded"], + ["function", "camPrepareBank"], + ["function", "camPrepareDir"], + ["function", "camPrepareDive"], + ["function", "camPrepareFocus"], + ["function", "camPrepareFov"], + ["function", "camPrepareFovRange"], + ["function", "camPreparePos"], + ["function", "camPrepareRelPos"], + ["function", "camPrepareTarget"], + ["function", "camSetBank"], + ["function", "camSetDir"], + ["function", "camSetDive"], + ["function", "camSetFocus"], + ["function", "camSetFov"], + ["function", "camSetFovRange"], + ["function", "camSetPos"], + ["function", "camSetRelPos"], + ["function", "camSetTarget"], + ["function", "camTarget"], + ["function", "camUseNVG"], + ["function", "canAdd"], + ["function", "canAddItemToBackpack"], + ["function", "canAddItemToUniform"], + ["function", "canAddItemToVest"], + ["function", "cancelSimpleTaskDestination"], + ["function", "canFire"], + ["function", "canMove"], + ["function", "canSlingLoad"], + ["function", "canStand"], + ["function", "canSuspend"], + ["function", "canTriggerDynamicSimulation"], + ["function", "canUnloadInCombat"], + ["function", "canVehicleCargo"], + ["function", "captive"], + ["function", "captiveNum"], + ["function", "cbChecked"], + ["function", "cbSetChecked"], + ["function", "ceil"], + ["function", "channelEnabled"], + ["function", "cheatsEnabled"], + ["function", "checkAIFeature"], + ["function", "checkVisibility"], + ["function", "civilian"], + ["function", "className"], + ["function", "clear3DENAttribute"], + ["function", "clear3DENInventory"], + ["function", "clearAllItemsFromBackpack"], + ["function", "clearBackpackCargo"], + ["function", "clearBackpackCargoGlobal"], + ["function", "clearForcesRTD"], + ["function", "clearGroupIcons"], + ["function", "clearItemCargo"], + ["function", "clearItemCargoGlobal"], + ["function", "clearItemPool"], + ["function", "clearMagazineCargo"], + ["function", "clearMagazineCargoGlobal"], + ["function", "clearMagazinePool"], + ["function", "clearOverlay"], + ["function", "clearRadio"], + ["function", "clearVehicleInit"], + ["function", "clearWeaponCargo"], + ["function", "clearWeaponCargoGlobal"], + ["function", "clearWeaponPool"], + ["function", "clientOwner"], + ["function", "closeDialog"], + ["function", "closeDisplay"], + ["function", "closeOverlay"], + ["function", "collapseObjectTree"], + ["function", "collect3DENHistory"], + ["function", "collectiveRTD"], + ["function", "combatMode"], + ["function", "commandArtilleryFire"], + ["function", "commandChat"], + ["function", "commander"], + ["function", "commandFire"], + ["function", "commandFollow"], + ["function", "commandFSM"], + ["function", "commandGetOut"], + ["function", "commandingMenu"], + ["function", "commandMove"], + ["function", "commandRadio"], + ["function", "commandStop"], + ["function", "commandSuppressiveFire"], + ["function", "commandTarget"], + ["function", "commandWatch"], + ["function", "comment"], + ["function", "commitOverlay"], + ["function", "compile"], + ["function", "compileFinal"], + ["function", "completedFSM"], + ["function", "composeText"], + ["function", "configClasses"], + ["function", "configFile"], + ["function", "configHierarchy"], + ["function", "configName"], + ["function", "configNull"], + ["function", "configProperties"], + ["function", "configSourceAddonList"], + ["function", "configSourceMod"], + ["function", "configSourceModList"], + ["function", "confirmSensorTarget"], + ["function", "connectTerminalToUAV"], + ["function", "controlNull"], + ["function", "controlsGroupCtrl"], + ["function", "copyFromClipboard"], + ["function", "copyToClipboard"], + ["function", "copyWaypoints"], + ["function", "cos"], + ["function", "count"], + ["function", "countEnemy"], + ["function", "countFriendly"], + ["function", "countSide"], + ["function", "countType"], + ["function", "countUnknown"], + ["function", "create3DENComposition"], + ["function", "create3DENEntity"], + ["function", "createAgent"], + ["function", "createCenter"], + ["function", "createDialog"], + ["function", "createDiaryLink"], + ["function", "createDiaryRecord"], + ["function", "createDiarySubject"], + ["function", "createDisplay"], + ["function", "createGearDialog"], + ["function", "createGroup"], + ["function", "createGuardedPoint"], + ["function", "createLocation"], + ["function", "createMarker"], + ["function", "createMarkerLocal"], + ["function", "createMenu"], + ["function", "createMine"], + ["function", "createMissionDisplay"], + ["function", "createMPCampaignDisplay"], + ["function", "createSimpleObject"], + ["function", "createSimpleTask"], + ["function", "createSite"], + ["function", "createSoundSource"], + ["function", "createTask"], + ["function", "createTeam"], + ["function", "createTrigger"], + ["function", "createUnit"], + ["function", "createVehicle"], + ["function", "createVehicleCrew"], + ["function", "createVehicleLocal"], + ["function", "crew"], + ["function", "ctAddHeader"], + ["function", "ctAddRow"], + ["function", "ctClear"], + ["function", "ctCurSel"], + ["function", "ctData"], + ["function", "ctFindHeaderRows"], + ["function", "ctFindRowHeader"], + ["function", "ctHeaderControls"], + ["function", "ctHeaderCount"], + ["function", "ctRemoveHeaders"], + ["function", "ctRemoveRows"], + ["function", "ctrlActivate"], + ["function", "ctrlAddEventHandler"], + ["function", "ctrlAngle"], + ["function", "ctrlAutoScrollDelay"], + ["function", "ctrlAutoScrollRewind"], + ["function", "ctrlAutoScrollSpeed"], + ["function", "ctrlChecked"], + ["function", "ctrlClassName"], + ["function", "ctrlCommit"], + ["function", "ctrlCommitted"], + ["function", "ctrlCreate"], + ["function", "ctrlDelete"], + ["function", "ctrlEnable"], + ["function", "ctrlEnabled"], + ["function", "ctrlFade"], + ["function", "ctrlHTMLLoaded"], + ["function", "ctrlIDC"], + ["function", "ctrlIDD"], + ["function", "ctrlMapAnimAdd"], + ["function", "ctrlMapAnimClear"], + ["function", "ctrlMapAnimCommit"], + ["function", "ctrlMapAnimDone"], + ["function", "ctrlMapCursor"], + ["function", "ctrlMapMouseOver"], + ["function", "ctrlMapScale"], + ["function", "ctrlMapScreenToWorld"], + ["function", "ctrlMapWorldToScreen"], + ["function", "ctrlModel"], + ["function", "ctrlModelDirAndUp"], + ["function", "ctrlModelScale"], + ["function", "ctrlParent"], + ["function", "ctrlParentControlsGroup"], + ["function", "ctrlPosition"], + ["function", "ctrlRemoveAllEventHandlers"], + ["function", "ctrlRemoveEventHandler"], + ["function", "ctrlScale"], + ["function", "ctrlSetActiveColor"], + ["function", "ctrlSetAngle"], + ["function", "ctrlSetAutoScrollDelay"], + ["function", "ctrlSetAutoScrollRewind"], + ["function", "ctrlSetAutoScrollSpeed"], + ["function", "ctrlSetBackgroundColor"], + ["function", "ctrlSetChecked"], + ["function", "ctrlSetDisabledColor"], + ["function", "ctrlSetEventHandler"], + ["function", "ctrlSetFade"], + ["function", "ctrlSetFocus"], + ["function", "ctrlSetFont"], + ["function", "ctrlSetFontH1"], + ["function", "ctrlSetFontH1B"], + ["function", "ctrlSetFontH2"], + ["function", "ctrlSetFontH2B"], + ["function", "ctrlSetFontH3"], + ["function", "ctrlSetFontH3B"], + ["function", "ctrlSetFontH4"], + ["function", "ctrlSetFontH4B"], + ["function", "ctrlSetFontH5"], + ["function", "ctrlSetFontH5B"], + ["function", "ctrlSetFontH6"], + ["function", "ctrlSetFontH6B"], + ["function", "ctrlSetFontHeight"], + ["function", "ctrlSetFontHeightH1"], + ["function", "ctrlSetFontHeightH2"], + ["function", "ctrlSetFontHeightH3"], + ["function", "ctrlSetFontHeightH4"], + ["function", "ctrlSetFontHeightH5"], + ["function", "ctrlSetFontHeightH6"], + ["function", "ctrlSetFontHeightSecondary"], + ["function", "ctrlSetFontP"], + ["function", "ctrlSetFontPB"], + ["function", "ctrlSetFontSecondary"], + ["function", "ctrlSetForegroundColor"], + ["function", "ctrlSetModel"], + ["function", "ctrlSetModelDirAndUp"], + ["function", "ctrlSetModelScale"], + ["function", "ctrlSetPixelPrecision"], + ["function", "ctrlSetPosition"], + ["function", "ctrlSetScale"], + ["function", "ctrlSetStructuredText"], + ["function", "ctrlSetText"], + ["function", "ctrlSetTextColor"], + ["function", "ctrlSetTextColorSecondary"], + ["function", "ctrlSetTextSecondary"], + ["function", "ctrlSetTooltip"], + ["function", "ctrlSetTooltipColorBox"], + ["function", "ctrlSetTooltipColorShade"], + ["function", "ctrlSetTooltipColorText"], + ["function", "ctrlShow"], + ["function", "ctrlShown"], + ["function", "ctrlText"], + ["function", "ctrlTextHeight"], + ["function", "ctrlTextSecondary"], + ["function", "ctrlTextWidth"], + ["function", "ctrlType"], + ["function", "ctrlVisible"], + ["function", "ctRowControls"], + ["function", "ctRowCount"], + ["function", "ctSetCurSel"], + ["function", "ctSetData"], + ["function", "ctSetHeaderTemplate"], + ["function", "ctSetRowTemplate"], + ["function", "ctSetValue"], + ["function", "ctValue"], + ["function", "curatorAddons"], + ["function", "curatorCamera"], + ["function", "curatorCameraArea"], + ["function", "curatorCameraAreaCeiling"], + ["function", "curatorCoef"], + ["function", "curatorEditableObjects"], + ["function", "curatorEditingArea"], + ["function", "curatorEditingAreaType"], + ["function", "curatorMouseOver"], + ["function", "curatorPoints"], + ["function", "curatorRegisteredObjects"], + ["function", "curatorSelected"], + ["function", "curatorWaypointCost"], + ["function", "current3DENOperation"], + ["function", "currentChannel"], + ["function", "currentCommand"], + ["function", "currentMagazine"], + ["function", "currentMagazineDetail"], + ["function", "currentMagazineDetailTurret"], + ["function", "currentMagazineTurret"], + ["function", "currentMuzzle"], + ["function", "currentNamespace"], + ["function", "currentTask"], + ["function", "currentTasks"], + ["function", "currentThrowable"], + ["function", "currentVisionMode"], + ["function", "currentWaypoint"], + ["function", "currentWeapon"], + ["function", "currentWeaponMode"], + ["function", "currentWeaponTurret"], + ["function", "currentZeroing"], + ["function", "cursorObject"], + ["function", "cursorTarget"], + ["function", "customChat"], + ["function", "customRadio"], + ["function", "cutFadeOut"], + ["function", "cutObj"], + ["function", "cutRsc"], + ["function", "cutText"], + ["function", "damage"], + ["function", "date"], + ["function", "dateToNumber"], + ["function", "daytime"], + ["function", "deActivateKey"], + ["function", "debriefingText"], + ["function", "debugFSM"], + ["function", "debugLog"], + ["function", "deg"], + ["function", "delete3DENEntities"], + ["function", "deleteAt"], + ["function", "deleteCenter"], + ["function", "deleteCollection"], + ["function", "deleteEditorObject"], + ["function", "deleteGroup"], + ["function", "deleteGroupWhenEmpty"], + ["function", "deleteIdentity"], + ["function", "deleteLocation"], + ["function", "deleteMarker"], + ["function", "deleteMarkerLocal"], + ["function", "deleteRange"], + ["function", "deleteResources"], + ["function", "deleteSite"], + ["function", "deleteStatus"], + ["function", "deleteTeam"], + ["function", "deleteVehicle"], + ["function", "deleteVehicleCrew"], + ["function", "deleteWaypoint"], + ["function", "detach"], + ["function", "detectedMines"], + ["function", "diag_activeMissionFSMs"], + ["function", "diag_activeScripts"], + ["function", "diag_activeSQFScripts"], + ["function", "diag_activeSQSScripts"], + ["function", "diag_captureFrame"], + ["function", "diag_captureFrameToFile"], + ["function", "diag_captureSlowFrame"], + ["function", "diag_codePerformance"], + ["function", "diag_drawMode"], + ["function", "diag_dynamicSimulationEnd"], + ["function", "diag_enable"], + ["function", "diag_enabled"], + ["function", "diag_fps"], + ["function", "diag_fpsMin"], + ["function", "diag_frameNo"], + ["function", "diag_lightNewLoad"], + ["function", "diag_list"], + ["function", "diag_log"], + ["function", "diag_logSlowFrame"], + ["function", "diag_mergeConfigFile"], + ["function", "diag_recordTurretLimits"], + ["function", "diag_setLightNew"], + ["function", "diag_tickTime"], + ["function", "diag_toggle"], + ["function", "dialog"], + ["function", "diarySubjectExists"], + ["function", "didJIP"], + ["function", "didJIPOwner"], + ["function", "difficulty"], + ["function", "difficultyEnabled"], + ["function", "difficultyEnabledRTD"], + ["function", "difficultyOption"], + ["function", "direction"], + ["function", "directSay"], + ["function", "disableAI"], + ["function", "disableCollisionWith"], + ["function", "disableConversation"], + ["function", "disableDebriefingStats"], + ["function", "disableMapIndicators"], + ["function", "disableNVGEquipment"], + ["function", "disableRemoteSensors"], + ["function", "disableSerialization"], + ["function", "disableTIEquipment"], + ["function", "disableUAVConnectability"], + ["function", "disableUserInput"], + ["function", "displayAddEventHandler"], + ["function", "displayCtrl"], + ["function", "displayNull"], + ["function", "displayParent"], + ["function", "displayRemoveAllEventHandlers"], + ["function", "displayRemoveEventHandler"], + ["function", "displaySetEventHandler"], + ["function", "dissolveTeam"], + ["function", "distance"], + ["function", "distance2D"], + ["function", "distanceSqr"], + ["function", "distributionRegion"], + ["function", "do3DENAction"], + ["function", "doArtilleryFire"], + ["function", "doFire"], + ["function", "doFollow"], + ["function", "doFSM"], + ["function", "doGetOut"], + ["function", "doMove"], + ["function", "doorPhase"], + ["function", "doStop"], + ["function", "doSuppressiveFire"], + ["function", "doTarget"], + ["function", "doWatch"], + ["function", "drawArrow"], + ["function", "drawEllipse"], + ["function", "drawIcon"], + ["function", "drawIcon3D"], + ["function", "drawLine"], + ["function", "drawLine3D"], + ["function", "drawLink"], + ["function", "drawLocation"], + ["function", "drawPolygon"], + ["function", "drawRectangle"], + ["function", "drawTriangle"], + ["function", "driver"], + ["function", "drop"], + ["function", "dynamicSimulationDistance"], + ["function", "dynamicSimulationDistanceCoef"], + ["function", "dynamicSimulationEnabled"], + ["function", "dynamicSimulationSystemEnabled"], + ["function", "east"], + ["function", "edit3DENMissionAttributes"], + ["function", "editObject"], + ["function", "editorSetEventHandler"], + ["function", "effectiveCommander"], + ["function", "emptyPositions"], + ["function", "enableAI"], + ["function", "enableAIFeature"], + ["function", "enableAimPrecision"], + ["function", "enableAttack"], + ["function", "enableAudioFeature"], + ["function", "enableAutoStartUpRTD"], + ["function", "enableAutoTrimRTD"], + ["function", "enableCamShake"], + ["function", "enableCaustics"], + ["function", "enableChannel"], + ["function", "enableCollisionWith"], + ["function", "enableCopilot"], + ["function", "enableDebriefingStats"], + ["function", "enableDiagLegend"], + ["function", "enableDynamicSimulation"], + ["function", "enableDynamicSimulationSystem"], + ["function", "enableEndDialog"], + ["function", "enableEngineArtillery"], + ["function", "enableEnvironment"], + ["function", "enableFatigue"], + ["function", "enableGunLights"], + ["function", "enableInfoPanelComponent"], + ["function", "enableIRLasers"], + ["function", "enableMimics"], + ["function", "enablePersonTurret"], + ["function", "enableRadio"], + ["function", "enableReload"], + ["function", "enableRopeAttach"], + ["function", "enableSatNormalOnDetail"], + ["function", "enableSaving"], + ["function", "enableSentences"], + ["function", "enableSimulation"], + ["function", "enableSimulationGlobal"], + ["function", "enableStamina"], + ["function", "enableStressDamage"], + ["function", "enableTeamSwitch"], + ["function", "enableTraffic"], + ["function", "enableUAVConnectability"], + ["function", "enableUAVWaypoints"], + ["function", "enableVehicleCargo"], + ["function", "enableVehicleSensor"], + ["function", "enableWeaponDisassembly"], + ["function", "endl"], + ["function", "endLoadingScreen"], + ["function", "endMission"], + ["function", "engineOn"], + ["function", "enginesIsOnRTD"], + ["function", "enginesPowerRTD"], + ["function", "enginesRpmRTD"], + ["function", "enginesTorqueRTD"], + ["function", "entities"], + ["function", "environmentEnabled"], + ["function", "estimatedEndServerTime"], + ["function", "estimatedTimeLeft"], + ["function", "evalObjectArgument"], + ["function", "everyBackpack"], + ["function", "everyContainer"], + ["function", "exec"], + ["function", "execEditorScript"], + ["function", "exp"], + ["function", "expectedDestination"], + ["function", "exportJIPMessages"], + ["function", "eyeDirection"], + ["function", "eyePos"], + ["function", "face"], + ["function", "faction"], + ["function", "fadeMusic"], + ["function", "fadeRadio"], + ["function", "fadeSound"], + ["function", "fadeSpeech"], + ["function", "failMission"], + ["function", "fillWeaponsFromPool"], + ["function", "find"], + ["function", "findCover"], + ["function", "findDisplay"], + ["function", "findEditorObject"], + ["function", "findEmptyPosition"], + ["function", "findEmptyPositionReady"], + ["function", "findIf"], + ["function", "findNearestEnemy"], + ["function", "finishMissionInit"], + ["function", "finite"], + ["function", "fire"], + ["function", "fireAtTarget"], + ["function", "firstBackpack"], + ["function", "flag"], + ["function", "flagAnimationPhase"], + ["function", "flagOwner"], + ["function", "flagSide"], + ["function", "flagTexture"], + ["function", "fleeing"], + ["function", "floor"], + ["function", "flyInHeight"], + ["function", "flyInHeightASL"], + ["function", "fog"], + ["function", "fogForecast"], + ["function", "fogParams"], + ["function", "forceAddUniform"], + ["function", "forceAtPositionRTD"], + ["function", "forcedMap"], + ["function", "forceEnd"], + ["function", "forceFlagTexture"], + ["function", "forceFollowRoad"], + ["function", "forceGeneratorRTD"], + ["function", "forceMap"], + ["function", "forceRespawn"], + ["function", "forceSpeed"], + ["function", "forceWalk"], + ["function", "forceWeaponFire"], + ["function", "forceWeatherChange"], + ["function", "forgetTarget"], + ["function", "format"], + ["function", "formation"], + ["function", "formationDirection"], + ["function", "formationLeader"], + ["function", "formationMembers"], + ["function", "formationPosition"], + ["function", "formationTask"], + ["function", "formatText"], + ["function", "formLeader"], + ["function", "freeLook"], + ["function", "fromEditor"], + ["function", "fuel"], + ["function", "fullCrew"], + ["function", "gearIDCAmmoCount"], + ["function", "gearSlotAmmoCount"], + ["function", "gearSlotData"], + ["function", "get3DENActionState"], + ["function", "get3DENAttribute"], + ["function", "get3DENCamera"], + ["function", "get3DENConnections"], + ["function", "get3DENEntity"], + ["function", "get3DENEntityID"], + ["function", "get3DENGrid"], + ["function", "get3DENIconsVisible"], + ["function", "get3DENLayerEntities"], + ["function", "get3DENLinesVisible"], + ["function", "get3DENMissionAttribute"], + ["function", "get3DENMouseOver"], + ["function", "get3DENSelected"], + ["function", "getAimingCoef"], + ["function", "getAllEnvSoundControllers"], + ["function", "getAllHitPointsDamage"], + ["function", "getAllOwnedMines"], + ["function", "getAllSoundControllers"], + ["function", "getAmmoCargo"], + ["function", "getAnimAimPrecision"], + ["function", "getAnimSpeedCoef"], + ["function", "getArray"], + ["function", "getArtilleryAmmo"], + ["function", "getArtilleryComputerSettings"], + ["function", "getArtilleryETA"], + ["function", "getAssignedCuratorLogic"], + ["function", "getAssignedCuratorUnit"], + ["function", "getBackpackCargo"], + ["function", "getBleedingRemaining"], + ["function", "getBurningValue"], + ["function", "getCameraViewDirection"], + ["function", "getCargoIndex"], + ["function", "getCenterOfMass"], + ["function", "getClientState"], + ["function", "getClientStateNumber"], + ["function", "getCompatiblePylonMagazines"], + ["function", "getConnectedUAV"], + ["function", "getContainerMaxLoad"], + ["function", "getCursorObjectParams"], + ["function", "getCustomAimCoef"], + ["function", "getDammage"], + ["function", "getDescription"], + ["function", "getDir"], + ["function", "getDirVisual"], + ["function", "getDLCAssetsUsage"], + ["function", "getDLCAssetsUsageByName"], + ["function", "getDLCs"], + ["function", "getDLCUsageTime"], + ["function", "getEditorCamera"], + ["function", "getEditorMode"], + ["function", "getEditorObjectScope"], + ["function", "getElevationOffset"], + ["function", "getEngineTargetRpmRTD"], + ["function", "getEnvSoundController"], + ["function", "getFatigue"], + ["function", "getFieldManualStartPage"], + ["function", "getForcedFlagTexture"], + ["function", "getFriend"], + ["function", "getFSMVariable"], + ["function", "getFuelCargo"], + ["function", "getGroupIcon"], + ["function", "getGroupIconParams"], + ["function", "getGroupIcons"], + ["function", "getHideFrom"], + ["function", "getHit"], + ["function", "getHitIndex"], + ["function", "getHitPointDamage"], + ["function", "getItemCargo"], + ["function", "getMagazineCargo"], + ["function", "getMarkerColor"], + ["function", "getMarkerPos"], + ["function", "getMarkerSize"], + ["function", "getMarkerType"], + ["function", "getMass"], + ["function", "getMissionConfig"], + ["function", "getMissionConfigValue"], + ["function", "getMissionDLCs"], + ["function", "getMissionLayerEntities"], + ["function", "getMissionLayers"], + ["function", "getModelInfo"], + ["function", "getMousePosition"], + ["function", "getMusicPlayedTime"], + ["function", "getNumber"], + ["function", "getObjectArgument"], + ["function", "getObjectChildren"], + ["function", "getObjectDLC"], + ["function", "getObjectMaterials"], + ["function", "getObjectProxy"], + ["function", "getObjectTextures"], + ["function", "getObjectType"], + ["function", "getObjectViewDistance"], + ["function", "getOxygenRemaining"], + ["function", "getPersonUsedDLCs"], + ["function", "getPilotCameraDirection"], + ["function", "getPilotCameraPosition"], + ["function", "getPilotCameraRotation"], + ["function", "getPilotCameraTarget"], + ["function", "getPlateNumber"], + ["function", "getPlayerChannel"], + ["function", "getPlayerScores"], + ["function", "getPlayerUID"], + ["function", "getPlayerUIDOld"], + ["function", "getPos"], + ["function", "getPosASL"], + ["function", "getPosASLVisual"], + ["function", "getPosASLW"], + ["function", "getPosATL"], + ["function", "getPosATLVisual"], + ["function", "getPosVisual"], + ["function", "getPosWorld"], + ["function", "getPylonMagazines"], + ["function", "getRelDir"], + ["function", "getRelPos"], + ["function", "getRemoteSensorsDisabled"], + ["function", "getRepairCargo"], + ["function", "getResolution"], + ["function", "getRotorBrakeRTD"], + ["function", "getShadowDistance"], + ["function", "getShotParents"], + ["function", "getSlingLoad"], + ["function", "getSoundController"], + ["function", "getSoundControllerResult"], + ["function", "getSpeed"], + ["function", "getStamina"], + ["function", "getStatValue"], + ["function", "getSuppression"], + ["function", "getTerrainGrid"], + ["function", "getTerrainHeightASL"], + ["function", "getText"], + ["function", "getTotalDLCUsageTime"], + ["function", "getTrimOffsetRTD"], + ["function", "getUnitLoadout"], + ["function", "getUnitTrait"], + ["function", "getUserMFDText"], + ["function", "getUserMFDValue"], + ["function", "getVariable"], + ["function", "getVehicleCargo"], + ["function", "getWeaponCargo"], + ["function", "getWeaponSway"], + ["function", "getWingsOrientationRTD"], + ["function", "getWingsPositionRTD"], + ["function", "getWPPos"], + ["function", "glanceAt"], + ["function", "globalChat"], + ["function", "globalRadio"], + ["function", "goggles"], + ["function", "group"], + ["function", "groupChat"], + ["function", "groupFromNetId"], + ["function", "groupIconSelectable"], + ["function", "groupIconsVisible"], + ["function", "groupId"], + ["function", "groupOwner"], + ["function", "groupRadio"], + ["function", "groupSelectedUnits"], + ["function", "groupSelectUnit"], + ["function", "grpNull"], + ["function", "gunner"], + ["function", "gusts"], + ["function", "halt"], + ["function", "handgunItems"], + ["function", "handgunMagazine"], + ["function", "handgunWeapon"], + ["function", "handsHit"], + ["function", "hasInterface"], + ["function", "hasPilotCamera"], + ["function", "hasWeapon"], + ["function", "hcAllGroups"], + ["function", "hcGroupParams"], + ["function", "hcLeader"], + ["function", "hcRemoveAllGroups"], + ["function", "hcRemoveGroup"], + ["function", "hcSelected"], + ["function", "hcSelectGroup"], + ["function", "hcSetGroup"], + ["function", "hcShowBar"], + ["function", "hcShownBar"], + ["function", "headgear"], + ["function", "hideBody"], + ["function", "hideObject"], + ["function", "hideObjectGlobal"], + ["function", "hideSelection"], + ["function", "hint"], + ["function", "hintC"], + ["function", "hintCadet"], + ["function", "hintSilent"], + ["function", "hmd"], + ["function", "hostMission"], + ["function", "htmlLoad"], + ["function", "HUDMovementLevels"], + ["function", "humidity"], + ["function", "image"], + ["function", "importAllGroups"], + ["function", "importance"], + ["function", "in"], + ["function", "inArea"], + ["function", "inAreaArray"], + ["function", "incapacitatedState"], + ["function", "independent"], + ["function", "inflame"], + ["function", "inflamed"], + ["function", "infoPanel"], + ["function", "infoPanelComponentEnabled"], + ["function", "infoPanelComponents"], + ["function", "infoPanels"], + ["function", "inGameUISetEventHandler"], + ["function", "inheritsFrom"], + ["function", "initAmbientLife"], + ["function", "inPolygon"], + ["function", "inputAction"], + ["function", "inRangeOfArtillery"], + ["function", "insertEditorObject"], + ["function", "intersect"], + ["function", "is3DEN"], + ["function", "is3DENMultiplayer"], + ["function", "isAbleToBreathe"], + ["function", "isAgent"], + ["function", "isAimPrecisionEnabled"], + ["function", "isArray"], + ["function", "isAutoHoverOn"], + ["function", "isAutonomous"], + ["function", "isAutoStartUpEnabledRTD"], + ["function", "isAutotest"], + ["function", "isAutoTrimOnRTD"], + ["function", "isBleeding"], + ["function", "isBurning"], + ["function", "isClass"], + ["function", "isCollisionLightOn"], + ["function", "isCopilotEnabled"], + ["function", "isDamageAllowed"], + ["function", "isDedicated"], + ["function", "isDLCAvailable"], + ["function", "isEngineOn"], + ["function", "isEqualTo"], + ["function", "isEqualType"], + ["function", "isEqualTypeAll"], + ["function", "isEqualTypeAny"], + ["function", "isEqualTypeArray"], + ["function", "isEqualTypeParams"], + ["function", "isFilePatchingEnabled"], + ["function", "isFlashlightOn"], + ["function", "isFlatEmpty"], + ["function", "isForcedWalk"], + ["function", "isFormationLeader"], + ["function", "isGroupDeletedWhenEmpty"], + ["function", "isHidden"], + ["function", "isInRemainsCollector"], + ["function", "isInstructorFigureEnabled"], + ["function", "isIRLaserOn"], + ["function", "isKeyActive"], + ["function", "isKindOf"], + ["function", "isLaserOn"], + ["function", "isLightOn"], + ["function", "isLocalized"], + ["function", "isManualFire"], + ["function", "isMarkedForCollection"], + ["function", "isMultiplayer"], + ["function", "isMultiplayerSolo"], + ["function", "isNil"], + ["function", "isNull"], + ["function", "isNumber"], + ["function", "isObjectHidden"], + ["function", "isObjectRTD"], + ["function", "isOnRoad"], + ["function", "isPipEnabled"], + ["function", "isPlayer"], + ["function", "isRealTime"], + ["function", "isRemoteExecuted"], + ["function", "isRemoteExecutedJIP"], + ["function", "isServer"], + ["function", "isShowing3DIcons"], + ["function", "isSimpleObject"], + ["function", "isSprintAllowed"], + ["function", "isStaminaEnabled"], + ["function", "isSteamMission"], + ["function", "isStreamFriendlyUIEnabled"], + ["function", "isStressDamageEnabled"], + ["function", "isText"], + ["function", "isTouchingGround"], + ["function", "isTurnedOut"], + ["function", "isTutHintsEnabled"], + ["function", "isUAVConnectable"], + ["function", "isUAVConnected"], + ["function", "isUIContext"], + ["function", "isUniformAllowed"], + ["function", "isVehicleCargo"], + ["function", "isVehicleRadarOn"], + ["function", "isVehicleSensorEnabled"], + ["function", "isWalking"], + ["function", "isWeaponDeployed"], + ["function", "isWeaponRested"], + ["function", "itemCargo"], + ["function", "items"], + ["function", "itemsWithMagazines"], + ["function", "join"], + ["function", "joinAs"], + ["function", "joinAsSilent"], + ["function", "joinSilent"], + ["function", "joinString"], + ["function", "kbAddDatabase"], + ["function", "kbAddDatabaseTargets"], + ["function", "kbAddTopic"], + ["function", "kbHasTopic"], + ["function", "kbReact"], + ["function", "kbRemoveTopic"], + ["function", "kbTell"], + ["function", "kbWasSaid"], + ["function", "keyImage"], + ["function", "keyName"], + ["function", "knowsAbout"], + ["function", "land"], + ["function", "landAt"], + ["function", "landResult"], + ["function", "language"], + ["function", "laserTarget"], + ["function", "lbAdd"], + ["function", "lbClear"], + ["function", "lbColor"], + ["function", "lbColorRight"], + ["function", "lbCurSel"], + ["function", "lbData"], + ["function", "lbDelete"], + ["function", "lbIsSelected"], + ["function", "lbPicture"], + ["function", "lbPictureRight"], + ["function", "lbSelection"], + ["function", "lbSetColor"], + ["function", "lbSetColorRight"], + ["function", "lbSetCurSel"], + ["function", "lbSetData"], + ["function", "lbSetPicture"], + ["function", "lbSetPictureColor"], + ["function", "lbSetPictureColorDisabled"], + ["function", "lbSetPictureColorSelected"], + ["function", "lbSetPictureRight"], + ["function", "lbSetPictureRightColor"], + ["function", "lbSetPictureRightColorDisabled"], + ["function", "lbSetPictureRightColorSelected"], + ["function", "lbSetSelectColor"], + ["function", "lbSetSelectColorRight"], + ["function", "lbSetSelected"], + ["function", "lbSetText"], + ["function", "lbSetTextRight"], + ["function", "lbSetTooltip"], + ["function", "lbSetValue"], + ["function", "lbSize"], + ["function", "lbSort"], + ["function", "lbSortByValue"], + ["function", "lbText"], + ["function", "lbTextRight"], + ["function", "lbValue"], + ["function", "leader"], + ["function", "leaderboardDeInit"], + ["function", "leaderboardGetRows"], + ["function", "leaderboardInit"], + ["function", "leaderboardRequestRowsFriends"], + ["function", "leaderboardRequestRowsGlobal"], + ["function", "leaderboardRequestRowsGlobalAroundUser"], + ["function", "leaderboardsRequestUploadScore"], + ["function", "leaderboardsRequestUploadScoreKeepBest"], + ["function", "leaderboardState"], + ["function", "leaveVehicle"], + ["function", "libraryCredits"], + ["function", "libraryDisclaimers"], + ["function", "lifeState"], + ["function", "lightAttachObject"], + ["function", "lightDetachObject"], + ["function", "lightIsOn"], + ["function", "lightnings"], + ["function", "limitSpeed"], + ["function", "linearConversion"], + ["function", "lineBreak"], + ["function", "lineIntersects"], + ["function", "lineIntersectsObjs"], + ["function", "lineIntersectsSurfaces"], + ["function", "lineIntersectsWith"], + ["function", "linkItem"], + ["function", "list"], + ["function", "listObjects"], + ["function", "listRemoteTargets"], + ["function", "listVehicleSensors"], + ["function", "ln"], + ["function", "lnbAddArray"], + ["function", "lnbAddColumn"], + ["function", "lnbAddRow"], + ["function", "lnbClear"], + ["function", "lnbColor"], + ["function", "lnbColorRight"], + ["function", "lnbCurSelRow"], + ["function", "lnbData"], + ["function", "lnbDeleteColumn"], + ["function", "lnbDeleteRow"], + ["function", "lnbGetColumnsPosition"], + ["function", "lnbPicture"], + ["function", "lnbPictureRight"], + ["function", "lnbSetColor"], + ["function", "lnbSetColorRight"], + ["function", "lnbSetColumnsPos"], + ["function", "lnbSetCurSelRow"], + ["function", "lnbSetData"], + ["function", "lnbSetPicture"], + ["function", "lnbSetPictureColor"], + ["function", "lnbSetPictureColorRight"], + ["function", "lnbSetPictureColorSelected"], + ["function", "lnbSetPictureColorSelectedRight"], + ["function", "lnbSetPictureRight"], + ["function", "lnbSetText"], + ["function", "lnbSetTextRight"], + ["function", "lnbSetValue"], + ["function", "lnbSize"], + ["function", "lnbSort"], + ["function", "lnbSortByValue"], + ["function", "lnbText"], + ["function", "lnbTextRight"], + ["function", "lnbValue"], + ["function", "load"], + ["function", "loadAbs"], + ["function", "loadBackpack"], + ["function", "loadFile"], + ["function", "loadGame"], + ["function", "loadIdentity"], + ["function", "loadMagazine"], + ["function", "loadOverlay"], + ["function", "loadStatus"], + ["function", "loadUniform"], + ["function", "loadVest"], + ["function", "local"], + ["function", "localize"], + ["function", "locationNull"], + ["function", "locationPosition"], + ["function", "lock"], + ["function", "lockCameraTo"], + ["function", "lockCargo"], + ["function", "lockDriver"], + ["function", "locked"], + ["function", "lockedCargo"], + ["function", "lockedDriver"], + ["function", "lockedTurret"], + ["function", "lockIdentity"], + ["function", "lockTurret"], + ["function", "lockWP"], + ["function", "log"], + ["function", "logEntities"], + ["function", "logNetwork"], + ["function", "logNetworkTerminate"], + ["function", "lookAt"], + ["function", "lookAtPos"], + ["function", "magazineCargo"], + ["function", "magazines"], + ["function", "magazinesAllTurrets"], + ["function", "magazinesAmmo"], + ["function", "magazinesAmmoCargo"], + ["function", "magazinesAmmoFull"], + ["function", "magazinesDetail"], + ["function", "magazinesDetailBackpack"], + ["function", "magazinesDetailUniform"], + ["function", "magazinesDetailVest"], + ["function", "magazinesTurret"], + ["function", "magazineTurretAmmo"], + ["function", "mapAnimAdd"], + ["function", "mapAnimClear"], + ["function", "mapAnimCommit"], + ["function", "mapAnimDone"], + ["function", "mapCenterOnCamera"], + ["function", "mapGridPosition"], + ["function", "markAsFinishedOnSteam"], + ["function", "markerAlpha"], + ["function", "markerBrush"], + ["function", "markerColor"], + ["function", "markerDir"], + ["function", "markerPos"], + ["function", "markerShape"], + ["function", "markerSize"], + ["function", "markerText"], + ["function", "markerType"], + ["function", "max"], + ["function", "members"], + ["function", "menuAction"], + ["function", "menuAdd"], + ["function", "menuChecked"], + ["function", "menuClear"], + ["function", "menuCollapse"], + ["function", "menuData"], + ["function", "menuDelete"], + ["function", "menuEnable"], + ["function", "menuEnabled"], + ["function", "menuExpand"], + ["function", "menuHover"], + ["function", "menuPicture"], + ["function", "menuSetAction"], + ["function", "menuSetCheck"], + ["function", "menuSetData"], + ["function", "menuSetPicture"], + ["function", "menuSetValue"], + ["function", "menuShortcut"], + ["function", "menuShortcutText"], + ["function", "menuSize"], + ["function", "menuSort"], + ["function", "menuText"], + ["function", "menuURL"], + ["function", "menuValue"], + ["function", "min"], + ["function", "mineActive"], + ["function", "mineDetectedBy"], + ["function", "missionConfigFile"], + ["function", "missionDifficulty"], + ["function", "missionName"], + ["function", "missionNamespace"], + ["function", "missionStart"], + ["function", "missionVersion"], + ["function", "modelToWorld"], + ["function", "modelToWorldVisual"], + ["function", "modelToWorldVisualWorld"], + ["function", "modelToWorldWorld"], + ["function", "modParams"], + ["function", "moonIntensity"], + ["function", "moonPhase"], + ["function", "morale"], + ["function", "move"], + ["function", "move3DENCamera"], + ["function", "moveInAny"], + ["function", "moveInCargo"], + ["function", "moveInCommander"], + ["function", "moveInDriver"], + ["function", "moveInGunner"], + ["function", "moveInTurret"], + ["function", "moveObjectToEnd"], + ["function", "moveOut"], + ["function", "moveTime"], + ["function", "moveTo"], + ["function", "moveToCompleted"], + ["function", "moveToFailed"], + ["function", "musicVolume"], + ["function", "name"], + ["function", "nameSound"], + ["function", "nearEntities"], + ["function", "nearestBuilding"], + ["function", "nearestLocation"], + ["function", "nearestLocations"], + ["function", "nearestLocationWithDubbing"], + ["function", "nearestObject"], + ["function", "nearestObjects"], + ["function", "nearestTerrainObjects"], + ["function", "nearObjects"], + ["function", "nearObjectsReady"], + ["function", "nearRoads"], + ["function", "nearSupplies"], + ["function", "nearTargets"], + ["function", "needReload"], + ["function", "netId"], + ["function", "netObjNull"], + ["function", "newOverlay"], + ["function", "nextMenuItemIndex"], + ["function", "nextWeatherChange"], + ["function", "nMenuItems"], + ["function", "numberOfEnginesRTD"], + ["function", "numberToDate"], + ["function", "objectCurators"], + ["function", "objectFromNetId"], + ["function", "objectParent"], + ["function", "objNull"], + ["function", "objStatus"], + ["function", "onBriefingGear"], + ["function", "onBriefingGroup"], + ["function", "onBriefingNotes"], + ["function", "onBriefingPlan"], + ["function", "onBriefingTeamSwitch"], + ["function", "onCommandModeChanged"], + ["function", "onDoubleClick"], + ["function", "onEachFrame"], + ["function", "onGroupIconClick"], + ["function", "onGroupIconOverEnter"], + ["function", "onGroupIconOverLeave"], + ["function", "onHCGroupSelectionChanged"], + ["function", "onMapSingleClick"], + ["function", "onPlayerConnected"], + ["function", "onPlayerDisconnected"], + ["function", "onPreloadFinished"], + ["function", "onPreloadStarted"], + ["function", "onShowNewObject"], + ["function", "onTeamSwitch"], + ["function", "openCuratorInterface"], + ["function", "openDLCPage"], + ["function", "openDSInterface"], + ["function", "openMap"], + ["function", "openSteamApp"], + ["function", "openYoutubeVideo"], + ["function", "opfor"], + ["function", "orderGetIn"], + ["function", "overcast"], + ["function", "overcastForecast"], + ["function", "owner"], + ["function", "param"], + ["function", "params"], + ["function", "parseNumber"], + ["function", "parseSimpleArray"], + ["function", "parseText"], + ["function", "parsingNamespace"], + ["function", "particlesQuality"], + ["function", "pi"], + ["function", "pickWeaponPool"], + ["function", "pitch"], + ["function", "pixelGrid"], + ["function", "pixelGridBase"], + ["function", "pixelGridNoUIScale"], + ["function", "pixelH"], + ["function", "pixelW"], + ["function", "playableSlotsNumber"], + ["function", "playableUnits"], + ["function", "playAction"], + ["function", "playActionNow"], + ["function", "player"], + ["function", "playerRespawnTime"], + ["function", "playerSide"], + ["function", "playersNumber"], + ["function", "playGesture"], + ["function", "playMission"], + ["function", "playMove"], + ["function", "playMoveNow"], + ["function", "playMusic"], + ["function", "playScriptedMission"], + ["function", "playSound"], + ["function", "playSound3D"], + ["function", "position"], + ["function", "positionCameraToWorld"], + ["function", "posScreenToWorld"], + ["function", "posWorldToScreen"], + ["function", "ppEffectAdjust"], + ["function", "ppEffectCommit"], + ["function", "ppEffectCommitted"], + ["function", "ppEffectCreate"], + ["function", "ppEffectDestroy"], + ["function", "ppEffectEnable"], + ["function", "ppEffectEnabled"], + ["function", "ppEffectForceInNVG"], + ["function", "precision"], + ["function", "preloadCamera"], + ["function", "preloadObject"], + ["function", "preloadSound"], + ["function", "preloadTitleObj"], + ["function", "preloadTitleRsc"], + ["function", "primaryWeapon"], + ["function", "primaryWeaponItems"], + ["function", "primaryWeaponMagazine"], + ["function", "priority"], + ["function", "processDiaryLink"], + ["function", "processInitCommands"], + ["function", "productVersion"], + ["function", "profileName"], + ["function", "profileNamespace"], + ["function", "profileNameSteam"], + ["function", "progressLoadingScreen"], + ["function", "progressPosition"], + ["function", "progressSetPosition"], + ["function", "publicVariable"], + ["function", "publicVariableClient"], + ["function", "publicVariableServer"], + ["function", "pushBack"], + ["function", "pushBackUnique"], + ["function", "putWeaponPool"], + ["function", "queryItemsPool"], + ["function", "queryMagazinePool"], + ["function", "queryWeaponPool"], + ["function", "rad"], + ["function", "radioChannelAdd"], + ["function", "radioChannelCreate"], + ["function", "radioChannelRemove"], + ["function", "radioChannelSetCallSign"], + ["function", "radioChannelSetLabel"], + ["function", "radioVolume"], + ["function", "rain"], + ["function", "rainbow"], + ["function", "random"], + ["function", "rank"], + ["function", "rankId"], + ["function", "rating"], + ["function", "rectangular"], + ["function", "registeredTasks"], + ["function", "registerTask"], + ["function", "reload"], + ["function", "reloadEnabled"], + ["function", "remoteControl"], + ["function", "remoteExec"], + ["function", "remoteExecCall"], + ["function", "remoteExecutedOwner"], + ["function", "remove3DENConnection"], + ["function", "remove3DENEventHandler"], + ["function", "remove3DENLayer"], + ["function", "removeAction"], + ["function", "removeAll3DENEventHandlers"], + ["function", "removeAllActions"], + ["function", "removeAllAssignedItems"], + ["function", "removeAllContainers"], + ["function", "removeAllCuratorAddons"], + ["function", "removeAllCuratorCameraAreas"], + ["function", "removeAllCuratorEditingAreas"], + ["function", "removeAllEventHandlers"], + ["function", "removeAllHandgunItems"], + ["function", "removeAllItems"], + ["function", "removeAllItemsWithMagazines"], + ["function", "removeAllMissionEventHandlers"], + ["function", "removeAllMPEventHandlers"], + ["function", "removeAllMusicEventHandlers"], + ["function", "removeAllOwnedMines"], + ["function", "removeAllPrimaryWeaponItems"], + ["function", "removeAllWeapons"], + ["function", "removeBackpack"], + ["function", "removeBackpackGlobal"], + ["function", "removeCuratorAddons"], + ["function", "removeCuratorCameraArea"], + ["function", "removeCuratorEditableObjects"], + ["function", "removeCuratorEditingArea"], + ["function", "removeDrawIcon"], + ["function", "removeDrawLinks"], + ["function", "removeEventHandler"], + ["function", "removeFromRemainsCollector"], + ["function", "removeGoggles"], + ["function", "removeGroupIcon"], + ["function", "removeHandgunItem"], + ["function", "removeHeadgear"], + ["function", "removeItem"], + ["function", "removeItemFromBackpack"], + ["function", "removeItemFromUniform"], + ["function", "removeItemFromVest"], + ["function", "removeItems"], + ["function", "removeMagazine"], + ["function", "removeMagazineGlobal"], + ["function", "removeMagazines"], + ["function", "removeMagazinesTurret"], + ["function", "removeMagazineTurret"], + ["function", "removeMenuItem"], + ["function", "removeMissionEventHandler"], + ["function", "removeMPEventHandler"], + ["function", "removeMusicEventHandler"], + ["function", "removeOwnedMine"], + ["function", "removePrimaryWeaponItem"], + ["function", "removeSecondaryWeaponItem"], + ["function", "removeSimpleTask"], + ["function", "removeSwitchableUnit"], + ["function", "removeTeamMember"], + ["function", "removeUniform"], + ["function", "removeVest"], + ["function", "removeWeapon"], + ["function", "removeWeaponAttachmentCargo"], + ["function", "removeWeaponCargo"], + ["function", "removeWeaponGlobal"], + ["function", "removeWeaponTurret"], + ["function", "reportRemoteTarget"], + ["function", "requiredVersion"], + ["function", "resetCamShake"], + ["function", "resetSubgroupDirection"], + ["function", "resistance"], + ["function", "resize"], + ["function", "resources"], + ["function", "respawnVehicle"], + ["function", "restartEditorCamera"], + ["function", "reveal"], + ["function", "revealMine"], + ["function", "reverse"], + ["function", "reversedMouseY"], + ["function", "roadAt"], + ["function", "roadsConnectedTo"], + ["function", "roleDescription"], + ["function", "ropeAttachedObjects"], + ["function", "ropeAttachedTo"], + ["function", "ropeAttachEnabled"], + ["function", "ropeAttachTo"], + ["function", "ropeCreate"], + ["function", "ropeCut"], + ["function", "ropeDestroy"], + ["function", "ropeDetach"], + ["function", "ropeEndPosition"], + ["function", "ropeLength"], + ["function", "ropes"], + ["function", "ropeUnwind"], + ["function", "ropeUnwound"], + ["function", "rotorsForcesRTD"], + ["function", "rotorsRpmRTD"], + ["function", "round"], + ["function", "runInitScript"], + ["function", "safeZoneH"], + ["function", "safeZoneW"], + ["function", "safeZoneWAbs"], + ["function", "safeZoneX"], + ["function", "safeZoneXAbs"], + ["function", "safeZoneY"], + ["function", "save3DENInventory"], + ["function", "saveGame"], + ["function", "saveIdentity"], + ["function", "saveJoysticks"], + ["function", "saveOverlay"], + ["function", "saveProfileNamespace"], + ["function", "saveStatus"], + ["function", "saveVar"], + ["function", "savingEnabled"], + ["function", "say"], + ["function", "say2D"], + ["function", "say3D"], + ["function", "score"], + ["function", "scoreSide"], + ["function", "screenshot"], + ["function", "screenToWorld"], + ["function", "scriptDone"], + ["function", "scriptName"], + ["function", "scriptNull"], + ["function", "scudState"], + ["function", "secondaryWeapon"], + ["function", "secondaryWeaponItems"], + ["function", "secondaryWeaponMagazine"], + ["function", "select"], + ["function", "selectBestPlaces"], + ["function", "selectDiarySubject"], + ["function", "selectedEditorObjects"], + ["function", "selectEditorObject"], + ["function", "selectionNames"], + ["function", "selectionPosition"], + ["function", "selectLeader"], + ["function", "selectMax"], + ["function", "selectMin"], + ["function", "selectNoPlayer"], + ["function", "selectPlayer"], + ["function", "selectRandom"], + ["function", "selectRandomWeighted"], + ["function", "selectWeapon"], + ["function", "selectWeaponTurret"], + ["function", "sendAUMessage"], + ["function", "sendSimpleCommand"], + ["function", "sendTask"], + ["function", "sendTaskResult"], + ["function", "sendUDPMessage"], + ["function", "serverCommand"], + ["function", "serverCommandAvailable"], + ["function", "serverCommandExecutable"], + ["function", "serverName"], + ["function", "serverTime"], + ["function", "set"], + ["function", "set3DENAttribute"], + ["function", "set3DENAttributes"], + ["function", "set3DENGrid"], + ["function", "set3DENIconsVisible"], + ["function", "set3DENLayer"], + ["function", "set3DENLinesVisible"], + ["function", "set3DENLogicType"], + ["function", "set3DENMissionAttribute"], + ["function", "set3DENMissionAttributes"], + ["function", "set3DENModelsVisible"], + ["function", "set3DENObjectType"], + ["function", "set3DENSelected"], + ["function", "setAccTime"], + ["function", "setActualCollectiveRTD"], + ["function", "setAirplaneThrottle"], + ["function", "setAirportSide"], + ["function", "setAmmo"], + ["function", "setAmmoCargo"], + ["function", "setAmmoOnPylon"], + ["function", "setAnimSpeedCoef"], + ["function", "setAperture"], + ["function", "setApertureNew"], + ["function", "setArmoryPoints"], + ["function", "setAttributes"], + ["function", "setAutonomous"], + ["function", "setBehaviour"], + ["function", "setBleedingRemaining"], + ["function", "setBrakesRTD"], + ["function", "setCameraInterest"], + ["function", "setCamShakeDefParams"], + ["function", "setCamShakeParams"], + ["function", "setCamUseTI"], + ["function", "setCaptive"], + ["function", "setCenterOfMass"], + ["function", "setCollisionLight"], + ["function", "setCombatMode"], + ["function", "setCompassOscillation"], + ["function", "setConvoySeparation"], + ["function", "setCuratorCameraAreaCeiling"], + ["function", "setCuratorCoef"], + ["function", "setCuratorEditingAreaType"], + ["function", "setCuratorWaypointCost"], + ["function", "setCurrentChannel"], + ["function", "setCurrentTask"], + ["function", "setCurrentWaypoint"], + ["function", "setCustomAimCoef"], + ["function", "setCustomWeightRTD"], + ["function", "setDamage"], + ["function", "setDammage"], + ["function", "setDate"], + ["function", "setDebriefingText"], + ["function", "setDefaultCamera"], + ["function", "setDestination"], + ["function", "setDetailMapBlendPars"], + ["function", "setDir"], + ["function", "setDirection"], + ["function", "setDrawIcon"], + ["function", "setDriveOnPath"], + ["function", "setDropInterval"], + ["function", "setDynamicSimulationDistance"], + ["function", "setDynamicSimulationDistanceCoef"], + ["function", "setEditorMode"], + ["function", "setEditorObjectScope"], + ["function", "setEffectCondition"], + ["function", "setEngineRpmRTD"], + ["function", "setFace"], + ["function", "setFaceAnimation"], + ["function", "setFatigue"], + ["function", "setFeatureType"], + ["function", "setFlagAnimationPhase"], + ["function", "setFlagOwner"], + ["function", "setFlagSide"], + ["function", "setFlagTexture"], + ["function", "setFog"], + ["function", "setForceGeneratorRTD"], + ["function", "setFormation"], + ["function", "setFormationTask"], + ["function", "setFormDir"], + ["function", "setFriend"], + ["function", "setFromEditor"], + ["function", "setFSMVariable"], + ["function", "setFuel"], + ["function", "setFuelCargo"], + ["function", "setGroupIcon"], + ["function", "setGroupIconParams"], + ["function", "setGroupIconsSelectable"], + ["function", "setGroupIconsVisible"], + ["function", "setGroupId"], + ["function", "setGroupIdGlobal"], + ["function", "setGroupOwner"], + ["function", "setGusts"], + ["function", "setHideBehind"], + ["function", "setHit"], + ["function", "setHitIndex"], + ["function", "setHitPointDamage"], + ["function", "setHorizonParallaxCoef"], + ["function", "setHUDMovementLevels"], + ["function", "setIdentity"], + ["function", "setImportance"], + ["function", "setInfoPanel"], + ["function", "setLeader"], + ["function", "setLightAmbient"], + ["function", "setLightAttenuation"], + ["function", "setLightBrightness"], + ["function", "setLightColor"], + ["function", "setLightDayLight"], + ["function", "setLightFlareMaxDistance"], + ["function", "setLightFlareSize"], + ["function", "setLightIntensity"], + ["function", "setLightnings"], + ["function", "setLightUseFlare"], + ["function", "setLocalWindParams"], + ["function", "setMagazineTurretAmmo"], + ["function", "setMarkerAlpha"], + ["function", "setMarkerAlphaLocal"], + ["function", "setMarkerBrush"], + ["function", "setMarkerBrushLocal"], + ["function", "setMarkerColor"], + ["function", "setMarkerColorLocal"], + ["function", "setMarkerDir"], + ["function", "setMarkerDirLocal"], + ["function", "setMarkerPos"], + ["function", "setMarkerPosLocal"], + ["function", "setMarkerShape"], + ["function", "setMarkerShapeLocal"], + ["function", "setMarkerSize"], + ["function", "setMarkerSizeLocal"], + ["function", "setMarkerText"], + ["function", "setMarkerTextLocal"], + ["function", "setMarkerType"], + ["function", "setMarkerTypeLocal"], + ["function", "setMass"], + ["function", "setMimic"], + ["function", "setMousePosition"], + ["function", "setMusicEffect"], + ["function", "setMusicEventHandler"], + ["function", "setName"], + ["function", "setNameSound"], + ["function", "setObjectArguments"], + ["function", "setObjectMaterial"], + ["function", "setObjectMaterialGlobal"], + ["function", "setObjectProxy"], + ["function", "setObjectTexture"], + ["function", "setObjectTextureGlobal"], + ["function", "setObjectViewDistance"], + ["function", "setOvercast"], + ["function", "setOwner"], + ["function", "setOxygenRemaining"], + ["function", "setParticleCircle"], + ["function", "setParticleClass"], + ["function", "setParticleFire"], + ["function", "setParticleParams"], + ["function", "setParticleRandom"], + ["function", "setPilotCameraDirection"], + ["function", "setPilotCameraRotation"], + ["function", "setPilotCameraTarget"], + ["function", "setPilotLight"], + ["function", "setPiPEffect"], + ["function", "setPitch"], + ["function", "setPlateNumber"], + ["function", "setPlayable"], + ["function", "setPlayerRespawnTime"], + ["function", "setPos"], + ["function", "setPosASL"], + ["function", "setPosASL2"], + ["function", "setPosASLW"], + ["function", "setPosATL"], + ["function", "setPosition"], + ["function", "setPosWorld"], + ["function", "setPylonLoadOut"], + ["function", "setPylonsPriority"], + ["function", "setRadioMsg"], + ["function", "setRain"], + ["function", "setRainbow"], + ["function", "setRandomLip"], + ["function", "setRank"], + ["function", "setRectangular"], + ["function", "setRepairCargo"], + ["function", "setRotorBrakeRTD"], + ["function", "setShadowDistance"], + ["function", "setShotParents"], + ["function", "setSide"], + ["function", "setSimpleTaskAlwaysVisible"], + ["function", "setSimpleTaskCustomData"], + ["function", "setSimpleTaskDescription"], + ["function", "setSimpleTaskDestination"], + ["function", "setSimpleTaskTarget"], + ["function", "setSimpleTaskType"], + ["function", "setSimulWeatherLayers"], + ["function", "setSize"], + ["function", "setSkill"], + ["function", "setSlingLoad"], + ["function", "setSoundEffect"], + ["function", "setSpeaker"], + ["function", "setSpeech"], + ["function", "setSpeedMode"], + ["function", "setStamina"], + ["function", "setStaminaScheme"], + ["function", "setStatValue"], + ["function", "setSuppression"], + ["function", "setSystemOfUnits"], + ["function", "setTargetAge"], + ["function", "setTaskMarkerOffset"], + ["function", "setTaskResult"], + ["function", "setTaskState"], + ["function", "setTerrainGrid"], + ["function", "setText"], + ["function", "setTimeMultiplier"], + ["function", "setTitleEffect"], + ["function", "setToneMapping"], + ["function", "setToneMappingParams"], + ["function", "setTrafficDensity"], + ["function", "setTrafficDistance"], + ["function", "setTrafficGap"], + ["function", "setTrafficSpeed"], + ["function", "setTriggerActivation"], + ["function", "setTriggerArea"], + ["function", "setTriggerStatements"], + ["function", "setTriggerText"], + ["function", "setTriggerTimeout"], + ["function", "setTriggerType"], + ["function", "setType"], + ["function", "setUnconscious"], + ["function", "setUnitAbility"], + ["function", "setUnitLoadout"], + ["function", "setUnitPos"], + ["function", "setUnitPosWeak"], + ["function", "setUnitRank"], + ["function", "setUnitRecoilCoefficient"], + ["function", "setUnitTrait"], + ["function", "setUnloadInCombat"], + ["function", "setUserActionText"], + ["function", "setUserMFDText"], + ["function", "setUserMFDValue"], + ["function", "setVariable"], + ["function", "setVectorDir"], + ["function", "setVectorDirAndUp"], + ["function", "setVectorUp"], + ["function", "setVehicleAmmo"], + ["function", "setVehicleAmmoDef"], + ["function", "setVehicleArmor"], + ["function", "setVehicleCargo"], + ["function", "setVehicleId"], + ["function", "setVehicleInit"], + ["function", "setVehicleLock"], + ["function", "setVehiclePosition"], + ["function", "setVehicleRadar"], + ["function", "setVehicleReceiveRemoteTargets"], + ["function", "setVehicleReportOwnPosition"], + ["function", "setVehicleReportRemoteTargets"], + ["function", "setVehicleTIPars"], + ["function", "setVehicleVarName"], + ["function", "setVelocity"], + ["function", "setVelocityModelSpace"], + ["function", "setVelocityTransformation"], + ["function", "setViewDistance"], + ["function", "setVisibleIfTreeCollapsed"], + ["function", "setWantedRpmRTD"], + ["function", "setWaves"], + ["function", "setWaypointBehaviour"], + ["function", "setWaypointCombatMode"], + ["function", "setWaypointCompletionRadius"], + ["function", "setWaypointDescription"], + ["function", "setWaypointForceBehaviour"], + ["function", "setWaypointFormation"], + ["function", "setWaypointHousePosition"], + ["function", "setWaypointLoiterRadius"], + ["function", "setWaypointLoiterType"], + ["function", "setWaypointName"], + ["function", "setWaypointPosition"], + ["function", "setWaypointScript"], + ["function", "setWaypointSpeed"], + ["function", "setWaypointStatements"], + ["function", "setWaypointTimeout"], + ["function", "setWaypointType"], + ["function", "setWaypointVisible"], + ["function", "setWeaponReloadingTime"], + ["function", "setWind"], + ["function", "setWindDir"], + ["function", "setWindForce"], + ["function", "setWindStr"], + ["function", "setWingForceScaleRTD"], + ["function", "setWPPos"], + ["function", "show3DIcons"], + ["function", "showChat"], + ["function", "showCinemaBorder"], + ["function", "showCommandingMenu"], + ["function", "showCompass"], + ["function", "showCuratorCompass"], + ["function", "showGPS"], + ["function", "showHUD"], + ["function", "showLegend"], + ["function", "showMap"], + ["function", "shownArtilleryComputer"], + ["function", "shownChat"], + ["function", "shownCompass"], + ["function", "shownCuratorCompass"], + ["function", "showNewEditorObject"], + ["function", "shownGPS"], + ["function", "shownHUD"], + ["function", "shownMap"], + ["function", "shownPad"], + ["function", "shownRadio"], + ["function", "shownScoretable"], + ["function", "shownUAVFeed"], + ["function", "shownWarrant"], + ["function", "shownWatch"], + ["function", "showPad"], + ["function", "showRadio"], + ["function", "showScoretable"], + ["function", "showSubtitles"], + ["function", "showUAVFeed"], + ["function", "showWarrant"], + ["function", "showWatch"], + ["function", "showWaypoint"], + ["function", "showWaypoints"], + ["function", "side"], + ["function", "sideAmbientLife"], + ["function", "sideChat"], + ["function", "sideEmpty"], + ["function", "sideEnemy"], + ["function", "sideFriendly"], + ["function", "sideLogic"], + ["function", "sideRadio"], + ["function", "sideUnknown"], + ["function", "simpleTasks"], + ["function", "simulationEnabled"], + ["function", "simulCloudDensity"], + ["function", "simulCloudOcclusion"], + ["function", "simulInClouds"], + ["function", "simulWeatherSync"], + ["function", "sin"], + ["function", "size"], + ["function", "sizeOf"], + ["function", "skill"], + ["function", "skillFinal"], + ["function", "skipTime"], + ["function", "sleep"], + ["function", "sliderPosition"], + ["function", "sliderRange"], + ["function", "sliderSetPosition"], + ["function", "sliderSetRange"], + ["function", "sliderSetSpeed"], + ["function", "sliderSpeed"], + ["function", "slingLoadAssistantShown"], + ["function", "soldierMagazines"], + ["function", "someAmmo"], + ["function", "sort"], + ["function", "soundVolume"], + ["function", "speaker"], + ["function", "speed"], + ["function", "speedMode"], + ["function", "splitString"], + ["function", "sqrt"], + ["function", "squadParams"], + ["function", "stance"], + ["function", "startLoadingScreen"], + ["function", "stop"], + ["function", "stopEngineRTD"], + ["function", "stopped"], + ["function", "str"], + ["function", "sunOrMoon"], + ["function", "supportInfo"], + ["function", "suppressFor"], + ["function", "surfaceIsWater"], + ["function", "surfaceNormal"], + ["function", "surfaceType"], + ["function", "swimInDepth"], + ["function", "switchableUnits"], + ["function", "switchAction"], + ["function", "switchCamera"], + ["function", "switchGesture"], + ["function", "switchLight"], + ["function", "switchMove"], + ["function", "synchronizedObjects"], + ["function", "synchronizedTriggers"], + ["function", "synchronizedWaypoints"], + ["function", "synchronizeObjectsAdd"], + ["function", "synchronizeObjectsRemove"], + ["function", "synchronizeTrigger"], + ["function", "synchronizeWaypoint"], + ["function", "systemChat"], + ["function", "systemOfUnits"], + ["function", "tan"], + ["function", "targetKnowledge"], + ["function", "targets"], + ["function", "targetsAggregate"], + ["function", "targetsQuery"], + ["function", "taskAlwaysVisible"], + ["function", "taskChildren"], + ["function", "taskCompleted"], + ["function", "taskCustomData"], + ["function", "taskDescription"], + ["function", "taskDestination"], + ["function", "taskHint"], + ["function", "taskMarkerOffset"], + ["function", "taskNull"], + ["function", "taskParent"], + ["function", "taskResult"], + ["function", "taskState"], + ["function", "taskType"], + ["function", "teamMember"], + ["function", "teamMemberNull"], + ["function", "teamName"], + ["function", "teams"], + ["function", "teamSwitch"], + ["function", "teamSwitchEnabled"], + ["function", "teamType"], + ["function", "terminate"], + ["function", "terrainIntersect"], + ["function", "terrainIntersectASL"], + ["function", "terrainIntersectAtASL"], + ["function", "text"], + ["function", "textLog"], + ["function", "textLogFormat"], + ["function", "tg"], + ["function", "time"], + ["function", "timeMultiplier"], + ["function", "titleCut"], + ["function", "titleFadeOut"], + ["function", "titleObj"], + ["function", "titleRsc"], + ["function", "titleText"], + ["function", "toArray"], + ["function", "toFixed"], + ["function", "toLower"], + ["function", "toString"], + ["function", "toUpper"], + ["function", "triggerActivated"], + ["function", "triggerActivation"], + ["function", "triggerArea"], + ["function", "triggerAttachedVehicle"], + ["function", "triggerAttachObject"], + ["function", "triggerAttachVehicle"], + ["function", "triggerDynamicSimulation"], + ["function", "triggerStatements"], + ["function", "triggerText"], + ["function", "triggerTimeout"], + ["function", "triggerTimeoutCurrent"], + ["function", "triggerType"], + ["function", "turretLocal"], + ["function", "turretOwner"], + ["function", "turretUnit"], + ["function", "tvAdd"], + ["function", "tvClear"], + ["function", "tvCollapse"], + ["function", "tvCollapseAll"], + ["function", "tvCount"], + ["function", "tvCurSel"], + ["function", "tvData"], + ["function", "tvDelete"], + ["function", "tvExpand"], + ["function", "tvExpandAll"], + ["function", "tvPicture"], + ["function", "tvPictureRight"], + ["function", "tvSetColor"], + ["function", "tvSetCurSel"], + ["function", "tvSetData"], + ["function", "tvSetPicture"], + ["function", "tvSetPictureColor"], + ["function", "tvSetPictureColorDisabled"], + ["function", "tvSetPictureColorSelected"], + ["function", "tvSetPictureRight"], + ["function", "tvSetPictureRightColor"], + ["function", "tvSetPictureRightColorDisabled"], + ["function", "tvSetPictureRightColorSelected"], + ["function", "tvSetSelectColor"], + ["function", "tvSetText"], + ["function", "tvSetTooltip"], + ["function", "tvSetValue"], + ["function", "tvSort"], + ["function", "tvSortByValue"], + ["function", "tvText"], + ["function", "tvTooltip"], + ["function", "tvValue"], + ["function", "type"], + ["function", "typeName"], + ["function", "typeOf"], + ["function", "UAVControl"], + ["function", "uiNamespace"], + ["function", "uiSleep"], + ["function", "unassignCurator"], + ["function", "unassignItem"], + ["function", "unassignTeam"], + ["function", "unassignVehicle"], + ["function", "underwater"], + ["function", "uniform"], + ["function", "uniformContainer"], + ["function", "uniformItems"], + ["function", "uniformMagazines"], + ["function", "unitAddons"], + ["function", "unitAimPosition"], + ["function", "unitAimPositionVisual"], + ["function", "unitBackpack"], + ["function", "unitIsUAV"], + ["function", "unitPos"], + ["function", "unitReady"], + ["function", "unitRecoilCoefficient"], + ["function", "units"], + ["function", "unitsBelowHeight"], + ["function", "unlinkItem"], + ["function", "unlockAchievement"], + ["function", "unregisterTask"], + ["function", "updateDrawIcon"], + ["function", "updateMenuItem"], + ["function", "updateObjectTree"], + ["function", "useAIOperMapObstructionTest"], + ["function", "useAISteeringComponent"], + ["function", "useAudioTimeForMoves"], + ["function", "userInputDisabled"], + ["function", "vectorAdd"], + ["function", "vectorCos"], + ["function", "vectorCrossProduct"], + ["function", "vectorDiff"], + ["function", "vectorDir"], + ["function", "vectorDirVisual"], + ["function", "vectorDistance"], + ["function", "vectorDistanceSqr"], + ["function", "vectorDotProduct"], + ["function", "vectorFromTo"], + ["function", "vectorMagnitude"], + ["function", "vectorMagnitudeSqr"], + ["function", "vectorModelToWorld"], + ["function", "vectorModelToWorldVisual"], + ["function", "vectorMultiply"], + ["function", "vectorNormalized"], + ["function", "vectorUp"], + ["function", "vectorUpVisual"], + ["function", "vectorWorldToModel"], + ["function", "vectorWorldToModelVisual"], + ["function", "vehicle"], + ["function", "vehicleCargoEnabled"], + ["function", "vehicleChat"], + ["function", "vehicleRadio"], + ["function", "vehicleReceiveRemoteTargets"], + ["function", "vehicleReportOwnPosition"], + ["function", "vehicleReportRemoteTargets"], + ["function", "vehicles"], + ["function", "vehicleVarName"], + ["function", "velocity"], + ["function", "velocityModelSpace"], + ["function", "verifySignature"], + ["function", "vest"], + ["function", "vestContainer"], + ["function", "vestItems"], + ["function", "vestMagazines"], + ["function", "viewDistance"], + ["function", "visibleCompass"], + ["function", "visibleGPS"], + ["function", "visibleMap"], + ["function", "visiblePosition"], + ["function", "visiblePositionASL"], + ["function", "visibleScoretable"], + ["function", "visibleWatch"], + ["function", "waitUntil"], + ["function", "waves"], + ["function", "waypointAttachedObject"], + ["function", "waypointAttachedVehicle"], + ["function", "waypointAttachObject"], + ["function", "waypointAttachVehicle"], + ["function", "waypointBehaviour"], + ["function", "waypointCombatMode"], + ["function", "waypointCompletionRadius"], + ["function", "waypointDescription"], + ["function", "waypointForceBehaviour"], + ["function", "waypointFormation"], + ["function", "waypointHousePosition"], + ["function", "waypointLoiterRadius"], + ["function", "waypointLoiterType"], + ["function", "waypointName"], + ["function", "waypointPosition"], + ["function", "waypoints"], + ["function", "waypointScript"], + ["function", "waypointsEnabledUAV"], + ["function", "waypointShow"], + ["function", "waypointSpeed"], + ["function", "waypointStatements"], + ["function", "waypointTimeout"], + ["function", "waypointTimeoutCurrent"], + ["function", "waypointType"], + ["function", "waypointVisible"], + ["function", "weaponAccessories"], + ["function", "weaponAccessoriesCargo"], + ["function", "weaponCargo"], + ["function", "weaponDirection"], + ["function", "weaponInertia"], + ["function", "weaponLowered"], + ["function", "weapons"], + ["function", "weaponsItems"], + ["function", "weaponsItemsCargo"], + ["function", "weaponState"], + ["function", "weaponsTurret"], + ["function", "weightRTD"], + ["function", "west"], + ["function", "WFSideText"], + ["function", "wind"], + ["function", "windDir"], + ["function", "windRTD"], + ["function", "windStr"], + ["function", "wingsForcesRTD"], + ["function", "worldName"], + ["function", "worldSize"], + ["function", "worldToModel"], + ["function", "worldToModelVisual"], + ["function", "worldToScreen"] +] \ No newline at end of file diff --git a/tests/languages/stan/function-arg_feature.test b/tests/languages/stan/function-arg_feature.test new file mode 100644 index 0000000000..ca9ca90c62 --- /dev/null +++ b/tests/languages/stan/function-arg_feature.test @@ -0,0 +1,21 @@ +y = algebra_solver(system, y_guess, theta, x_r, x_i); + +---------------------------------------------------- + +[ + "y ", + ["operator", "="], + ["keyword", "algebra_solver"], + ["punctuation", "("], + ["function-arg", "system"], + ["punctuation", ","], + " y_guess", + ["punctuation", ","], + " theta", + ["punctuation", ","], + " x_r", + ["punctuation", ","], + " x_i", + ["punctuation", ")"], + ["punctuation", ";"] +] \ No newline at end of file diff --git a/tests/languages/tap/subtest_feature.test b/tests/languages/tap/subtest_feature.test new file mode 100644 index 0000000000..235b24be7e --- /dev/null +++ b/tests/languages/tap/subtest_feature.test @@ -0,0 +1,7 @@ +# Subtest + +---------------------------------------------------- + +[ + ["subtest", "# Subtest"] +] \ No newline at end of file diff --git a/tests/languages/tcl/punctuation_feature.test b/tests/languages/tcl/punctuation_feature.test new file mode 100644 index 0000000000..60efd55b8e --- /dev/null +++ b/tests/languages/tcl/punctuation_feature.test @@ -0,0 +1,12 @@ +{ } ( ) [ ] + +---------------------------------------------------- + +[ + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "["], + ["punctuation", "]"] +] \ No newline at end of file diff --git a/tests/languages/textile/tag_feature.test b/tests/languages/textile/tag_feature.test new file mode 100644 index 0000000000..c79bd48456 --- /dev/null +++ b/tests/languages/textile/tag_feature.test @@ -0,0 +1,20 @@ +
+ +---------------------------------------------------- + +[ + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "details" + ]], + ["punctuation", ">"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] +] \ No newline at end of file diff --git a/tests/languages/unrealscript/category_feature.test b/tests/languages/unrealscript/category_feature.test new file mode 100644 index 0000000000..c74a5b4619 --- /dev/null +++ b/tests/languages/unrealscript/category_feature.test @@ -0,0 +1,47 @@ +// MyBool is visible but not editable in UnrealEd +var(MyCategory) editconst bool MyBool; + +// MyBool is visible but not editable in UnrealEd and +// not changeable in script +var(MyCategory) const editconst bool MyBool; + +// MyBool is visible and can be set in UnrealEd but +// not changeable in script +var(MyCategory) const bool MyBool; + +---------------------------------------------------- + +[ + ["comment", "// MyBool is visible but not editable in UnrealEd"], + ["keyword", "var"], + ["punctuation", "("], + ["category", "MyCategory"], + ["punctuation", ")"], + ["keyword", "editconst"], + ["keyword", "bool"], + " MyBool", + ["punctuation", ";"], + + ["comment", "// MyBool is visible but not editable in UnrealEd and"], + ["comment", "// not changeable in script"], + ["keyword", "var"], + ["punctuation", "("], + ["category", "MyCategory"], + ["punctuation", ")"], + ["keyword", "const"], + ["keyword", "editconst"], + ["keyword", "bool"], + " MyBool", + ["punctuation", ";"], + + ["comment", "// MyBool is visible and can be set in UnrealEd but"], + ["comment", "// not changeable in script"], + ["keyword", "var"], + ["punctuation", "("], + ["category", "MyCategory"], + ["punctuation", ")"], + ["keyword", "const"], + ["keyword", "bool"], + " MyBool", + ["punctuation", ";"] +] \ No newline at end of file diff --git a/tests/languages/vala/constant_feature.test b/tests/languages/vala/constant_feature.test new file mode 100644 index 0000000000..49adc66704 --- /dev/null +++ b/tests/languages/vala/constant_feature.test @@ -0,0 +1,7 @@ +FOO + +---------------------------------------------------- + +[ + ["constant", "FOO"] +] diff --git a/tests/languages/vala/regex_feature.test b/tests/languages/vala/regex_feature.test new file mode 100644 index 0000000000..3b1f9440f4 --- /dev/null +++ b/tests/languages/vala/regex_feature.test @@ -0,0 +1,11 @@ +/(\d+\.\d+\.\d+)/ + +---------------------------------------------------- + +[ + ["regex", [ + ["regex-delimiter", "/"], + ["regex-source", "(\\d+\\.\\d+\\.\\d+)"], + ["regex-delimiter", "/"] + ]] +] \ No newline at end of file diff --git a/tests/languages/warpscript/keyword_feature.test b/tests/languages/warpscript/keyword_feature.test new file mode 100644 index 0000000000..3f5dcf92cf --- /dev/null +++ b/tests/languages/warpscript/keyword_feature.test @@ -0,0 +1,49 @@ +BREAK +CHECKMACRO +CONTINUE +CUDF +DEFINED +DEFINEDMACRO +EVAL +FAIL +FOR +FOREACH +FORSTEP +IFT +IFTE +MSGFAIL +NRETURN +RETHROW +RETURN +SWITCH +TRY +UDF +UNTIL +WHILE + +---------------------------------------------------- + +[ + ["keyword", "BREAK"], + ["keyword", "CHECKMACRO"], + ["keyword", "CONTINUE"], + ["keyword", "CUDF"], + ["keyword", "DEFINED"], + ["keyword", "DEFINEDMACRO"], + ["keyword", "EVAL"], + ["keyword", "FAIL"], + ["keyword", "FOR"], + ["keyword", "FOREACH"], + ["keyword", "FORSTEP"], + ["keyword", "IFT"], + ["keyword", "IFTE"], + ["keyword", "MSGFAIL"], + ["keyword", "NRETURN"], + ["keyword", "RETHROW"], + ["keyword", "RETURN"], + ["keyword", "SWITCH"], + ["keyword", "TRY"], + ["keyword", "UDF"], + ["keyword", "UNTIL"], + ["keyword", "WHILE"] +] \ No newline at end of file diff --git a/tests/languages/warpscript/macro_feature.test b/tests/languages/warpscript/macro_feature.test new file mode 100644 index 0000000000..366f8931f4 --- /dev/null +++ b/tests/languages/warpscript/macro_feature.test @@ -0,0 +1,7 @@ +@foo + +---------------------------------------------------- + +[ + ["macro", "@foo"] +] \ No newline at end of file diff --git a/tests/languages/warpscript/variable_feature.test b/tests/languages/warpscript/variable_feature.test new file mode 100644 index 0000000000..05d1f451c3 --- /dev/null +++ b/tests/languages/warpscript/variable_feature.test @@ -0,0 +1,7 @@ +$foo + +---------------------------------------------------- + +[ + ["variable", "$foo"] +] \ No newline at end of file diff --git a/tests/languages/xojo/punctuation_feature.test b/tests/languages/xojo/punctuation_feature.test new file mode 100644 index 0000000000..332a503b4c --- /dev/null +++ b/tests/languages/xojo/punctuation_feature.test @@ -0,0 +1,12 @@ +. , ; : ( ) + +---------------------------------------------------- + +[ + ["punctuation", "."], + ["punctuation", ","], + ["punctuation", ";"], + ["punctuation", ":"], + ["punctuation", "("], + ["punctuation", ")"] +] \ No newline at end of file diff --git a/tests/languages/zig/comment_feature.test b/tests/languages/zig/comment_feature.test new file mode 100644 index 0000000000..828bc18464 --- /dev/null +++ b/tests/languages/zig/comment_feature.test @@ -0,0 +1,21 @@ +// normal comment + +/// A structure for storing a timestamp, with nanosecond precision (this is a +/// multiline doc comment). + +//! This module provides functions for retrieving the current date and +//! time with varying degrees of precision and accuracy. It does not +//! depend on libc, but will use functions from it if available. + +---------------------------------------------------- + +[ + ["comment", "// normal comment"], + + ["comment", "/// A structure for storing a timestamp, with nanosecond precision (this is a"], + ["comment", "/// multiline doc comment)."], + + ["comment", "//! This module provides functions for retrieving the current date and"], + ["comment", "//! time with varying degrees of precision and accuracy. It does not"], + ["comment", "//! depend on libc, but will use functions from it if available."] +] \ No newline at end of file diff --git a/tests/languages/zig/string_feature.test b/tests/languages/zig/string_feature.test new file mode 100644 index 0000000000..7afce3a1a3 --- /dev/null +++ b/tests/languages/zig/string_feature.test @@ -0,0 +1,151 @@ +// source: https://ziglang.org/documentation/master/#String-Literals-and-Character-Literals + +const expect = @import("std").testing.expect; +const mem = @import("std").mem; + +test "string literals" { + const bytes = "hello"; + expect(@TypeOf(bytes) == *const [5:0]u8); + expect(bytes.len == 5); + expect(bytes[1] == 'e'); + expect(bytes[5] == 0); + expect('e' == '\x65'); + expect('\u{1f4a9}' == 128169); + expect('💯' == 128175); + expect(mem.eql(u8, "hello", "h\x65llo")); +} + +const hello_world_in_c = + \\#include + \\ + \\int main(int argc, char **argv) { + \\ printf("hello world\n"); + \\ return 0; + \\} +; + +---------------------------------------------------- + +[ + ["comment", "// source: https://ziglang.org/documentation/master/#String-Literals-and-Character-Literals"], + + ["keyword", "const"], + " expect ", + ["operator", "="], + ["builtin", "@import"], + ["punctuation", "("], + ["string", "\"std\""], + ["punctuation", ")"], + ["punctuation", "."], + "testing", + ["punctuation", "."], + "expect", + ["punctuation", ";"], + ["keyword", "const"], + " mem ", + ["operator", "="], + ["builtin", "@import"], + ["punctuation", "("], + ["string", "\"std\""], + ["punctuation", ")"], + ["punctuation", "."], + "mem", + ["punctuation", ";"], + + ["keyword", "test"], + ["string", "\"string literals\""], + ["punctuation", "{"], + ["keyword", "const"], + " bytes ", + ["operator", "="], + ["string", "\"hello\""], + ["punctuation", ";"], + ["function", "expect"], + ["punctuation", "("], + ["builtin", "@TypeOf"], + ["punctuation", "("], + "bytes", + ["punctuation", ")"], + ["operator", "=="], + ["operator", "*"], + ["keyword", "const"], + ["punctuation", "["], + ["number", "5"], + ["punctuation", ":"], + ["number", "0"], + ["punctuation", "]"], + ["builtin-types", "u8"], + ["punctuation", ")"], + ["punctuation", ";"], + ["function", "expect"], + ["punctuation", "("], + "bytes", + ["punctuation", "."], + "len ", + ["operator", "=="], + ["number", "5"], + ["punctuation", ")"], + ["punctuation", ";"], + ["function", "expect"], + ["punctuation", "("], + "bytes", + ["punctuation", "["], + ["number", "1"], + ["punctuation", "]"], + ["operator", "=="], + ["string", "'e'"], + ["punctuation", ")"], + ["punctuation", ";"], + ["function", "expect"], + ["punctuation", "("], + "bytes", + ["punctuation", "["], + ["number", "5"], + ["punctuation", "]"], + ["operator", "=="], + ["number", "0"], + ["punctuation", ")"], + ["punctuation", ";"], + ["function", "expect"], + ["punctuation", "("], + ["string", "'e'"], + ["operator", "=="], + ["string", "'\\x65'"], + ["punctuation", ")"], + ["punctuation", ";"], + ["function", "expect"], + ["punctuation", "("], + ["string", "'\\u{1f4a9}'"], + ["operator", "=="], + ["number", "128169"], + ["punctuation", ")"], + ["punctuation", ";"], + ["function", "expect"], + ["punctuation", "("], + ["string", "'💯'"], + ["operator", "=="], + ["number", "128175"], + ["punctuation", ")"], + ["punctuation", ";"], + ["function", "expect"], + ["punctuation", "("], + "mem", + ["punctuation", "."], + ["function", "eql"], + ["punctuation", "("], + ["builtin-types", "u8"], + ["punctuation", ","], + ["string", "\"hello\""], + ["punctuation", ","], + ["string", "\"h\\x65llo\""], + ["punctuation", ")"], + ["punctuation", ")"], + ["punctuation", ";"], + ["punctuation", "}"], + + ["keyword", "const"], + " hello_world_in_c ", + ["operator", "="], + ["string", " \\\\#include \n \\\\\n \\\\int main(int argc, char **argv) {\n \\\\ printf(\"hello world\\n\");\n \\\\ return 0;\n \\\\}"], + ["punctuation", ";"] +] \ No newline at end of file diff --git a/tests/pattern-tests.js b/tests/pattern-tests.js index 15272c9002..a64b4e33d8 100644 --- a/tests/pattern-tests.js +++ b/tests/pattern-tests.js @@ -2,7 +2,7 @@ const { assert } = require('chai'); const PrismLoader = require('./helper/prism-loader'); -const { BFS, parseRegex } = require('./helper/util'); +const { BFS, BFSPathToPrismTokenPath, parseRegex } = require('./helper/util'); const { languages } = require('../components.json'); const { visitRegExpAST } = require('regexpp'); @@ -80,19 +80,7 @@ function testPatterns(Prism) { BFS(Prism.languages, path => { const { key, value } = path[path.length - 1]; - - let tokenPath = 'Prism.languages'; - for (const { key } of path) { - if (!key) { - // do nothing - } else if (/^\d+$/.test(key)) { - tokenPath += `[${key}]`; - } else if (/^[a-z]\w*$/i.test(key)) { - tokenPath += `.${key}`; - } else { - tokenPath += `[${JSON.stringify(key)}]`; - } - } + const tokenPath = BFSPathToPrismTokenPath(path); if (Object.prototype.toString.call(value) == '[object RegExp]') { try { diff --git a/tests/run.js b/tests/run.js index 4803dde72b..aba43bfc93 100644 --- a/tests/run.js +++ b/tests/run.js @@ -12,16 +12,16 @@ const testSuite = // load complete test suite : TestDiscovery.loadAllTests(__dirname + "/languages"); -const accept = !!argv.accept; +const acceptEmpty = !!argv.accept; // define tests for all tests in all languages in the test suite -for (const language in testSuite) { - if (!testSuite.hasOwnProperty(language)) { +for (const languageIdentifier in testSuite) { + if (!testSuite.hasOwnProperty(languageIdentifier)) { continue; } - (function (language, testFiles) { - describe("Testing language '" + language + "'", function () { + (function (languageIdentifier, testFiles) { + describe("Testing language '" + languageIdentifier + "'", function () { this.timeout(10000); for (const filePath of testFiles) { @@ -29,12 +29,12 @@ for (const language in testSuite) { it("– should pass test case '" + fileName + "'", function () { if (path.extname(filePath) === '.test') { - TestCase.runTestCase(language, filePath, accept); + TestCase.runTestCase({ languageIdentifier, filePath, acceptEmpty }); } else { - TestCase.runTestsWithHooks(language, require(filePath)); + TestCase.runTestsWithHooks({ languageIdentifier, codes: require(filePath) }); } }); } }); - })(language, testSuite[language]); + })(languageIdentifier, testSuite[languageIdentifier]); } From b219776e2ec6edb543e8738ed51201caf1b94646 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Mon, 16 Nov 2020 16:18:32 +0100 Subject: [PATCH 02/18] Added test to exhaustively cover keyword lists --- tests/coverage.js | 154 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 134 insertions(+), 20 deletions(-) diff --git a/tests/coverage.js b/tests/coverage.js index 7b3155fbca..e108e7e53b 100644 --- a/tests/coverage.js +++ b/tests/coverage.js @@ -16,7 +16,7 @@ describe('Pattern test coverage', function () { /** * @type {Map} * @typedef PatternData - * @property {string} pattern + * @property {RegExp} pattern * @property {string} language * @property {Set} from * @property {RegExpExecArray[]} matches @@ -42,7 +42,7 @@ describe('Pattern test coverage', function () { let data = patterns.get(patternKey); if (!data) { data = { - pattern: String(regex), + pattern: regex, language: path[1].key, from: new Set([tokenPath]), matches: [] @@ -65,9 +65,14 @@ describe('Pattern test coverage', function () { return Prism; } - // This will cause ALL regexes of Prism to be registered in the patterns map. - // (Languages that don't have any tests can't be caught otherwise.) - createInstance(ALL_LANGUAGES); + describe('Register all patterns', function () { + it('all', function () { + this.slow(10 * 1000); + // This will cause ALL regexes of Prism to be registered in the patterns map. + // (Languages that don't have any tests can't be caught otherwise.) + createInstance(ALL_LANGUAGES); + }); + }); describe('Run all language tests', function () { // define tests for all tests in all languages in the test suite @@ -77,7 +82,7 @@ describe('Pattern test coverage', function () { } it(languageIdentifier, function () { - this.timeout(10000); + this.timeout(10 * 1000); for (const filePath of testSuite[languageIdentifier]) { if (path.extname(filePath) === '.test') { @@ -92,26 +97,135 @@ describe('Pattern test coverage', function () { describe('Coverage', function () { for (const language of ALL_LANGUAGES) { - it(`- should cover all patterns in ${language}`, function () { - const untested = [...patterns.values()].filter(d => d.language === language && d.matches.length === 0); - if (untested.length > 0) { + describe(language, function () { + it(`- should cover all patterns`, function () { + const untested = getAllOf(language).filter(d => d.matches.length === 0); + if (untested.length === 0) { + return; + } + + const problems = untested.map(data => { + const { origin, otherOccurrences } = splitOccurrences(data.from); + return [ + `${origin}:\n\t${short(String(data.pattern), 80)}`, + 'This pattern is completely untested. Add test files that match this pattern.', + ...(otherOccurrences.length ? ['Other occurrences of this pattern:', ...otherOccurrences] : []) + ].join('\n'); + }); + assert.fail([ - `${untested.length} pattern(s) in ${language} are untested:\n` + `${problems.length} pattern(s) are untested:\n` + 'You can learn more about writing tests at https://prismjs.com/test-suite.html#writing-tests', - ...untested.map(data => { - const occurrences = [...data.from]; - return [ - `${occurrences[0]}:`, - `\t${data.pattern.length > 80 ? data.pattern.slice(0, 80) + '…' : data.pattern}`, - 'This pattern is completely untested. Add test files that match this pattern.', - ...(occurrences.length > 1 ? ['Other occurrences of this pattern:', ...occurrences.slice(1)] : []) - ].join('\n'); - }) + ...problems ].join('\n\n')); - } + }); + + it(`- should exhaustively cover all keywords in keyword lists`, function () { + const problems = []; + + for (const { pattern, matches, from } of getAllOf(language)) { + if (matches.length === 0) { + // don't report the same pattern twice + continue; + } + + const keywords = getKeywordList(pattern); + if (!keywords) { + continue; + } + const keywordCount = keywords.size; + + matches.forEach(([m]) => { + if (pattern.ignoreCase) { + m = m.toUpperCase(); + } + keywords.delete(m); + }); + + if (keywords.size > 0) { + const { origin, otherOccurrences } = splitOccurrences(from); + problems.push([ + `${origin}:\n\t${short(String(pattern), 80)}`, + `Add test files to test all keywords. The following ${keywords.size}/${keywordCount} keywords are untested:`, + `${[...keywords].map(k => `\t${k}`).join('\n')}`, + ...(otherOccurrences.length ? ['Other occurrences of this pattern:', ...otherOccurrences] : []) + ].join('\n')); + } + } + + if (problems.length === 0) { + return; + } + + assert.fail([ + `${problems.length} keyword list(s) are not exhaustively tested:\n` + + 'You can learn more about writing tests at https://prismjs.com/test-suite.html#writing-tests', + ...problems + ].join('\n\n')); + }); }); } }); + + /** + * @param {string} language + * @returns {PatternData[]} + */ + function getAllOf(language) { + return [...patterns.values()].filter(d => d.language === language); + } + + /** + * @param {string} string + * @param {number} maxLength + * @returns {string} + */ + function short(string, maxLength) { + if (string.length > maxLength) { + return string.slice(0, maxLength - 1) + '…'; + } else { + return string; + } + } + + /** + * If the given pattern string describes a keyword list, all keyword will be returned. Otherwise, `null` will be + * returned. + * + * @param {RegExp} pattern + * @returns {Set | null} + */ + function getKeywordList(pattern) { + // Right now, only keyword lists of the form /\b(?:foo|bar)\b/ are supported. + // In the future, we might want to convert these regexes to NFAs and iterate all words to cover more complex + // keyword lists and even operator and punctuation lists. + + let source = pattern.source.replace(/^\\b|\\b$/g, ''); + if (source.startsWith('(?:') && source.endsWith(')')) { + source = source.slice('(?:'.length, source.length - ')'.length); + } + + if (/^\w+(?:\|\w+)*$/.test(source)) { + if (pattern.ignoreCase) { + source = source.toUpperCase(); + } + return new Set(source.split(/\|/g)); + } else { + return null; + } + } + + /** + * @param {Iterable} occurrences + * @returns {{ origin: string; otherOccurrences: string[] }} + */ + function splitOccurrences(occurrences) { + const all = [...occurrences]; + return { + origin: all[0], + otherOccurrences: all.slice(1), + }; + } }); /** From af3b08097b0b73315ce1900e7854a4b529bdbf48 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Mon, 16 Nov 2020 16:26:09 +0100 Subject: [PATCH 03/18] Added remaining tests and fixed some bugs --- components/prism-gml.js | 2 +- components/prism-gml.min.js | 2 +- components/prism-lisp.js | 161 +++--- components/prism-lisp.min.js | 2 +- components/prism-php.js | 12 - components/prism-php.min.js | 2 +- components/prism-powerquery.js | 98 ++-- components/prism-powerquery.min.js | 2 +- components/prism-purebasic.js | 14 +- components/prism-purebasic.min.js | 2 +- tests/languages/asm6502/opcode_feature.test | 236 ++++++++- tests/languages/bison/number_feature.test | 14 + .../languages/concurnas/keyword_feature.test | 32 +- .../languages/concurnas/operator_feature.test | 42 +- tests/languages/css+haml/css+haml_usage.test | 10 +- tests/languages/ejs+pug/ejs_inclusion.test | 24 + tests/languages/erb+haml/erb_inclusion.test | 39 ++ tests/languages/gml/function_feature.test | 51 ++ tests/languages/gml/keyword_feature.test | 39 ++ tests/languages/gml/number_feature.test | 25 + tests/languages/gml/operator_feature.test | 63 +++ tests/languages/gml/variable_feature.test | 106 ++++ tests/languages/haml/filter_feature.test | 20 + .../languages/hcl/interpolation_feature.test | 423 +++++++++------- tests/languages/hlsl/keyword_feature.test | 12 +- tests/languages/iecst/boolean_feature.test | 11 + .../exports_feature.test | 10 +- .../javascript+haml/javascript_inclusion.test | 4 +- .../jsstacktrace/function_feature.test | 57 ++- .../jsstacktrace/notmycode_feature.test | 40 +- tests/languages/lisp/defun_feature.test | 72 +++ .../livescript+pug/livescript_inclusion.test | 28 ++ tests/languages/php/class-name_feature.test | 32 ++ .../languages/phpdoc/class-name_feature.test | 126 ++++- tests/languages/promql/keyword_feature.test | 43 ++ tests/languages/pug/filter_feature.test | 11 + tests/languages/purebasic/asm_feature.test | 223 ++++++++- .../languages/purescript/keyword_feature.test | 44 +- tests/languages/renpy/property_feature.test | 469 ++++++++++++++++++ tests/languages/ruby+haml/ruby_inclusion.test | 50 ++ tests/languages/sql+sas/sql_inclusion.test | 345 +++++++------ .../textile+haml/textile_inclusion.test | 46 ++ 42 files changed, 2439 insertions(+), 605 deletions(-) create mode 100644 tests/languages/ejs+pug/ejs_inclusion.test create mode 100644 tests/languages/erb+haml/erb_inclusion.test create mode 100644 tests/languages/gml/function_feature.test create mode 100644 tests/languages/gml/keyword_feature.test create mode 100644 tests/languages/gml/number_feature.test create mode 100644 tests/languages/gml/operator_feature.test create mode 100644 tests/languages/gml/variable_feature.test create mode 100644 tests/languages/haml/filter_feature.test create mode 100644 tests/languages/iecst/boolean_feature.test create mode 100644 tests/languages/livescript+pug/livescript_inclusion.test create mode 100644 tests/languages/promql/keyword_feature.test create mode 100644 tests/languages/pug/filter_feature.test create mode 100644 tests/languages/renpy/property_feature.test create mode 100644 tests/languages/ruby+haml/ruby_inclusion.test create mode 100644 tests/languages/textile+haml/textile_inclusion.test diff --git a/components/prism-gml.js b/components/prism-gml.js index 0ea8137ab3..5acc179d3b 100644 --- a/components/prism-gml.js +++ b/components/prism-gml.js @@ -1,7 +1,7 @@ Prism.languages.gamemakerlanguage = Prism.languages.gml = Prism.languages.extend('clike', { 'number': /(?:\b0x[\da-f]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ulf]*/i, 'keyword': /\b(?:if|else|switch|case|default|break|for|repeat|while|do|until|continue|exit|return|globalvar|var|enum)\b/, - 'operator': /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not|with|at|xor)\b/, + 'operator': /--|\+\+|[-+%/=]=?|!=|\*\*?=?|<[<=>]?|>[=>]?|&&?|\^\^?|\|\|?|~|\b(?:or|and|not|with|at|xor)\b/, 'constant': /\b(?:self|other|all|noone|global|local|undefined|pointer_(?:invalid|null)|action_(?:stop|restart|continue|reverse)|pi|GM_build_date|GM_version|timezone_(?:local|utc)|gamespeed_(?:fps|microseconds)|ev_(?:create|destroy|step|alarm|keyboard|mouse|collision|other|draw|draw_(?:begin|end|pre|post)|keypress|keyrelease|trigger|(?:left|right|middle|no)_button|(?:left|right|middle)_press|(?:left|right|middle)_release|mouse_(?:enter|leave|wheel_up|wheel_down)|global_(?:left|right|middle)_button|global_(?:left|right|middle)_press|global_(?:left|right|middle)_release|joystick(?:1|2)_(?:left|right|up|down|button1|button2|button3|button4|button5|button6|button7|button8)|outside|boundary|game_start|game_end|room_start|room_end|no_more_lives|animation_end|end_of_path|no_more_health|user\d|step_(?:normal|begin|end)|gui|gui_begin|gui_end)|vk_(?:nokey|anykey|enter|return|shift|control|alt|escape|space|backspace|tab|pause|printscreen|left|right|up|down|home|end|delete|insert|pageup|pagedown|f\d|numpad\d|divide|multiply|subtract|add|decimal|lshift|lcontrol|lalt|rshift|rcontrol|ralt)|mb_(?:any|none|left|right|middle)|c_(?:aqua|black|blue|dkgray|fuchsia|gray|green|lime|ltgray|maroon|navy|olive|purple|red|silver|teal|white|yellow|orange)|fa_(?:left|center|right|top|middle|bottom|readonly|hidden|sysfile|volumeid|directory|archive)|pr_(?:pointlist|linelist|linestrip|trianglelist|trianglestrip|trianglefan)|bm_(?:complex|normal|add|max|subtract|zero|one|src_colour|inv_src_colour|src_color|inv_src_color|src_alpha|inv_src_alpha|dest_alpha|inv_dest_alpha|dest_colour|inv_dest_colour|dest_color|inv_dest_color|src_alpha_sat)|audio_(?:falloff_(?:none|inverse_distance|inverse_distance_clamped|linear_distance|linear_distance_clamped|exponent_distance|exponent_distance_clamped)|old_system|new_system|mono|stereo|3d)|cr_(?:default|none|arrow|cross|beam|size_nesw|size_ns|size_nwse|size_we|uparrow|hourglass|drag|appstart|handpoint|size_all)|spritespeed_framesper(?:second|gameframe)|asset_(?:object|unknown|sprite|sound|room|path|script|font|timeline|tiles|shader)|ds_type_(?:map|list|stack|queue|grid|priority)|ef_(?:explosion|ring|ellipse|firework|smoke|smokeup|star|spark|flare|cloud|rain|snow)|pt_shape_(?:pixel|disk|square|line|star|circle|ring|sphere|flare|spark|explosion|cloud|smoke|snow)|ps_(?:distr|shape)_(?:linear|gaussian|invgaussian|rectangle|ellipse|diamond|line)|ty_(?:real|string)|dll_(?:cdel|cdecl|stdcall)|matrix_(?:view|projection|world)|os_(?:win32|windows|macosx|ios|android|linux|unknown|winphone|win8native|psvita|ps4|xboxone|ps3|uwp)|browser_(?:not_a_browser|unknown|ie|firefox|chrome|safari|safari_mobile|opera|tizen|windows_store|ie_mobile)|device_ios_(?:unknown|iphone|iphone_retina|ipad|ipad_retina|iphone5|iphone6|iphone6plus)|device_(?:emulator|tablet)|display_(?:landscape|landscape_flipped|portrait|portrait_flipped)|of_challenge_(?:win|lose|tie)|leaderboard_type_(?:number|time_mins_secs)|cmpfunc_(?:never|less|equal|lessequal|greater|notequal|greaterequal|always)|cull_(?:noculling|clockwise|counterclockwise)|lighttype_(?:dir|point)|iap_(?:ev_storeload|ev_product|ev_purchase|ev_consume|ev_restore|storeload_ok|storeload_failed|status_uninitialised|status_unavailable|status_loading|status_available|status_processing|status_restoring|failed|unavailable|available|purchased|canceled|refunded)|fb_login_(?:default|fallback_to_webview|no_fallback_to_webview|forcing_webview|use_system_account|forcing_safari)|phy_joint_(?:anchor_1_x|anchor_1_y|anchor_2_x|anchor_2_y|reaction_force_x|reaction_force_y|reaction_torque|motor_speed|angle|motor_torque|max_motor_torque|translation|speed|motor_force|max_motor_force|length_1|length_2|damping_ratio|frequency|lower_angle_limit|upper_angle_limit|angle_limits|max_length|max_torque|max_force)|phy_debug_render_(?:aabb|collision_pairs|coms|core_shapes|joints|obb|shapes)|phy_particle_flag_(?:water|zombie|wall|spring|elastic|viscous|powder|tensile|colourmixing|colormixing)|phy_particle_group_flag_(?:solid|rigid)|phy_particle_data_flag_(?:typeflags|position|velocity|colour|color|category)|achievement_(?:our_info|friends_info|leaderboard_info|info|filter_(?:all_players|friends_only|favorites_only)|type_challenge|type_score_challenge|pic_loaded|show_(?:ui|profile|leaderboard|achievement|bank|friend_picker|purchase_prompt))|network_(?:socket_(?:tcp|udp|bluetooth)|type_(?:connect|disconnect|data|non_blocking_connect)|config_(?:connect_timeout|use_non_blocking_socket|enable_reliable_udp|disable_reliable_udp))|buffer_(?:fixed|grow|wrap|fast|vbuffer|network|u8|s8|u16|s16|u32|s32|u64|f16|f32|f64|bool|text|string|seek_start|seek_relative|seek_end|generalerror|outofspace|outofbounds|invalidtype)|gp_(?:face\d|shoulderl|shoulderr|shoulderlb|shoulderrb|select|start|stickl|stickr|padu|padd|padl|padr|axislh|axislv|axisrh|axisrv)|ov_(?:friends|community|players|settings|gamegroup|achievements)|lb_sort_(?:none|ascending|descending)|lb_disp_(?:none|numeric|time_sec|time_ms)|ugc_(?:result_success|filetype_(?:community|microtrans)|visibility_(?:public|friends_only|private)|query_RankedBy(?:Vote|PublicationDate|Trend|NumTimesReported|TotalVotesAsc|VotesUp|TextSearch)|query_(?:AcceptedForGameRankedByAcceptanceDate|FavoritedByFriendsRankedByPublicationDate|CreatedByFriendsRankedByPublicationDate|NotYetRated)|sortorder_CreationOrder(?:Desc|Asc)|sortorder_(?:TitleAsc|LastUpdatedDesc|SubscriptionDateDesc|VoteScoreDesc|ForModeration)|list_(?:Published|VotedOn|VotedUp|VotedDown|WillVoteLater|Favorited|Subscribed|UsedOrPlayed|Followed)|match_(?:Items|Items_Mtx|Items_ReadyToUse|Collections|Artwork|Videos|Screenshots|AllGuides|WebGuides|IntegratedGuides|UsableInGame|ControllerBindings))|vertex_usage_(?:position|colour|color|normal|texcoord|textcoord|blendweight|blendindices|psize|tangent|binormal|fog|depth|sample)|vertex_type_(?:float\d|colour|color|ubyte4)|layerelementtype_(?:undefined|background|instance|oldtilemap|sprite|tilemap|particlesystem|tile)|tile_(?:rotate|flip|mirror|index_mask)|input_type|se_(?:chorus|compressor|echo|equalizer|flanger|gargle|none|reverb)|text_type|(?:obj|scr|spr|rm)\w+)\b/, 'variable': /\b(?:x|y|(?:x|y)(?:previous|start)|(?:h|v)speed|direction|speed|friction|gravity|gravity_direction|path_(?:index|position|positionprevious|speed|scale|orientation|endaction)|object_index|id|solid|persistent|mask_index|instance_(?:count|id)|alarm|timeline_(?:index|position|speed|running|loop)|visible|sprite_(?:index|width|height|xoffset|yoffset)|image_(?:number|index|speed|depth|xscale|yscale|angle|alpha|blend)|bbox_(?:left|right|top|bottom)|layer|phy_(?:rotation|(?:position|linear_velocity|speed|com|collision|col_normal)_(?:x|y)|angular_(?:velocity|damping)|position_(?:x|y)previous|speed|linear_damping|bullet|fixed_rotation|active|mass|inertia|dynamic|kinematic|sleeping|collision_points)|working_directory|webgl_enabled|view_(?:(?:y|x|w|h)view|(?:y|x|w|h)port|(?:v|h)(?:speed|border)|visible|surface_id|object|enabled|current|angle)|undefined|transition_(?:steps|kind|color)|temp_directory|show_(?:score|lives|health)|secure_mode|score|room_(?:width|speed|persistent|last|height|first|caption)|room|pointer_(?:null|invalid)|os_(?:version|type|device|browser)|mouse_(?:y|x|lastbutton|button)|lives|keyboard_(?:string|lastkey|lastchar|key)|iap_data|health|gamemaker_(?:version|registered|pro)|game_(?:save|project|display)_(?:id|name)|fps_real|fps|event_(?:type|object|number|action)|error_(?:occurred|last)|display_aa|delta_time|debug_mode|cursor_sprite|current_(?:year|weekday|time|second|month|minute|hour|day)|caption_(?:score|lives|health)|browser_(?:width|height)|background_(?:yscale|y|xscale|x|width|vtiled|vspeed|visible|showcolour|showcolor|index|htiled|hspeed|height|foreground|colour|color|blend|alpha)|async_load|application_surface|argument(?:_relitive|_count|\d)|argument|global|local|self|other)\b/ }); diff --git a/components/prism-gml.min.js b/components/prism-gml.min.js index d8cc6761be..13a4e006cf 100644 --- a/components/prism-gml.min.js +++ b/components/prism-gml.min.js @@ -1 +1 @@ -Prism.languages.gamemakerlanguage=Prism.languages.gml=Prism.languages.extend("clike",{number:/(?:\b0x[\da-f]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ulf]*/i,keyword:/\b(?:if|else|switch|case|default|break|for|repeat|while|do|until|continue|exit|return|globalvar|var|enum)\b/,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not|with|at|xor)\b/,constant:/\b(?:self|other|all|noone|global|local|undefined|pointer_(?:invalid|null)|action_(?:stop|restart|continue|reverse)|pi|GM_build_date|GM_version|timezone_(?:local|utc)|gamespeed_(?:fps|microseconds)|ev_(?:create|destroy|step|alarm|keyboard|mouse|collision|other|draw|draw_(?:begin|end|pre|post)|keypress|keyrelease|trigger|(?:left|right|middle|no)_button|(?:left|right|middle)_press|(?:left|right|middle)_release|mouse_(?:enter|leave|wheel_up|wheel_down)|global_(?:left|right|middle)_button|global_(?:left|right|middle)_press|global_(?:left|right|middle)_release|joystick(?:1|2)_(?:left|right|up|down|button1|button2|button3|button4|button5|button6|button7|button8)|outside|boundary|game_start|game_end|room_start|room_end|no_more_lives|animation_end|end_of_path|no_more_health|user\d|step_(?:normal|begin|end)|gui|gui_begin|gui_end)|vk_(?:nokey|anykey|enter|return|shift|control|alt|escape|space|backspace|tab|pause|printscreen|left|right|up|down|home|end|delete|insert|pageup|pagedown|f\d|numpad\d|divide|multiply|subtract|add|decimal|lshift|lcontrol|lalt|rshift|rcontrol|ralt)|mb_(?:any|none|left|right|middle)|c_(?:aqua|black|blue|dkgray|fuchsia|gray|green|lime|ltgray|maroon|navy|olive|purple|red|silver|teal|white|yellow|orange)|fa_(?:left|center|right|top|middle|bottom|readonly|hidden|sysfile|volumeid|directory|archive)|pr_(?:pointlist|linelist|linestrip|trianglelist|trianglestrip|trianglefan)|bm_(?:complex|normal|add|max|subtract|zero|one|src_colour|inv_src_colour|src_color|inv_src_color|src_alpha|inv_src_alpha|dest_alpha|inv_dest_alpha|dest_colour|inv_dest_colour|dest_color|inv_dest_color|src_alpha_sat)|audio_(?:falloff_(?:none|inverse_distance|inverse_distance_clamped|linear_distance|linear_distance_clamped|exponent_distance|exponent_distance_clamped)|old_system|new_system|mono|stereo|3d)|cr_(?:default|none|arrow|cross|beam|size_nesw|size_ns|size_nwse|size_we|uparrow|hourglass|drag|appstart|handpoint|size_all)|spritespeed_framesper(?:second|gameframe)|asset_(?:object|unknown|sprite|sound|room|path|script|font|timeline|tiles|shader)|ds_type_(?:map|list|stack|queue|grid|priority)|ef_(?:explosion|ring|ellipse|firework|smoke|smokeup|star|spark|flare|cloud|rain|snow)|pt_shape_(?:pixel|disk|square|line|star|circle|ring|sphere|flare|spark|explosion|cloud|smoke|snow)|ps_(?:distr|shape)_(?:linear|gaussian|invgaussian|rectangle|ellipse|diamond|line)|ty_(?:real|string)|dll_(?:cdel|cdecl|stdcall)|matrix_(?:view|projection|world)|os_(?:win32|windows|macosx|ios|android|linux|unknown|winphone|win8native|psvita|ps4|xboxone|ps3|uwp)|browser_(?:not_a_browser|unknown|ie|firefox|chrome|safari|safari_mobile|opera|tizen|windows_store|ie_mobile)|device_ios_(?:unknown|iphone|iphone_retina|ipad|ipad_retina|iphone5|iphone6|iphone6plus)|device_(?:emulator|tablet)|display_(?:landscape|landscape_flipped|portrait|portrait_flipped)|of_challenge_(?:win|lose|tie)|leaderboard_type_(?:number|time_mins_secs)|cmpfunc_(?:never|less|equal|lessequal|greater|notequal|greaterequal|always)|cull_(?:noculling|clockwise|counterclockwise)|lighttype_(?:dir|point)|iap_(?:ev_storeload|ev_product|ev_purchase|ev_consume|ev_restore|storeload_ok|storeload_failed|status_uninitialised|status_unavailable|status_loading|status_available|status_processing|status_restoring|failed|unavailable|available|purchased|canceled|refunded)|fb_login_(?:default|fallback_to_webview|no_fallback_to_webview|forcing_webview|use_system_account|forcing_safari)|phy_joint_(?:anchor_1_x|anchor_1_y|anchor_2_x|anchor_2_y|reaction_force_x|reaction_force_y|reaction_torque|motor_speed|angle|motor_torque|max_motor_torque|translation|speed|motor_force|max_motor_force|length_1|length_2|damping_ratio|frequency|lower_angle_limit|upper_angle_limit|angle_limits|max_length|max_torque|max_force)|phy_debug_render_(?:aabb|collision_pairs|coms|core_shapes|joints|obb|shapes)|phy_particle_flag_(?:water|zombie|wall|spring|elastic|viscous|powder|tensile|colourmixing|colormixing)|phy_particle_group_flag_(?:solid|rigid)|phy_particle_data_flag_(?:typeflags|position|velocity|colour|color|category)|achievement_(?:our_info|friends_info|leaderboard_info|info|filter_(?:all_players|friends_only|favorites_only)|type_challenge|type_score_challenge|pic_loaded|show_(?:ui|profile|leaderboard|achievement|bank|friend_picker|purchase_prompt))|network_(?:socket_(?:tcp|udp|bluetooth)|type_(?:connect|disconnect|data|non_blocking_connect)|config_(?:connect_timeout|use_non_blocking_socket|enable_reliable_udp|disable_reliable_udp))|buffer_(?:fixed|grow|wrap|fast|vbuffer|network|u8|s8|u16|s16|u32|s32|u64|f16|f32|f64|bool|text|string|seek_start|seek_relative|seek_end|generalerror|outofspace|outofbounds|invalidtype)|gp_(?:face\d|shoulderl|shoulderr|shoulderlb|shoulderrb|select|start|stickl|stickr|padu|padd|padl|padr|axislh|axislv|axisrh|axisrv)|ov_(?:friends|community|players|settings|gamegroup|achievements)|lb_sort_(?:none|ascending|descending)|lb_disp_(?:none|numeric|time_sec|time_ms)|ugc_(?:result_success|filetype_(?:community|microtrans)|visibility_(?:public|friends_only|private)|query_RankedBy(?:Vote|PublicationDate|Trend|NumTimesReported|TotalVotesAsc|VotesUp|TextSearch)|query_(?:AcceptedForGameRankedByAcceptanceDate|FavoritedByFriendsRankedByPublicationDate|CreatedByFriendsRankedByPublicationDate|NotYetRated)|sortorder_CreationOrder(?:Desc|Asc)|sortorder_(?:TitleAsc|LastUpdatedDesc|SubscriptionDateDesc|VoteScoreDesc|ForModeration)|list_(?:Published|VotedOn|VotedUp|VotedDown|WillVoteLater|Favorited|Subscribed|UsedOrPlayed|Followed)|match_(?:Items|Items_Mtx|Items_ReadyToUse|Collections|Artwork|Videos|Screenshots|AllGuides|WebGuides|IntegratedGuides|UsableInGame|ControllerBindings))|vertex_usage_(?:position|colour|color|normal|texcoord|textcoord|blendweight|blendindices|psize|tangent|binormal|fog|depth|sample)|vertex_type_(?:float\d|colour|color|ubyte4)|layerelementtype_(?:undefined|background|instance|oldtilemap|sprite|tilemap|particlesystem|tile)|tile_(?:rotate|flip|mirror|index_mask)|input_type|se_(?:chorus|compressor|echo|equalizer|flanger|gargle|none|reverb)|text_type|(?:obj|scr|spr|rm)\w+)\b/,variable:/\b(?:x|y|(?:x|y)(?:previous|start)|(?:h|v)speed|direction|speed|friction|gravity|gravity_direction|path_(?:index|position|positionprevious|speed|scale|orientation|endaction)|object_index|id|solid|persistent|mask_index|instance_(?:count|id)|alarm|timeline_(?:index|position|speed|running|loop)|visible|sprite_(?:index|width|height|xoffset|yoffset)|image_(?:number|index|speed|depth|xscale|yscale|angle|alpha|blend)|bbox_(?:left|right|top|bottom)|layer|phy_(?:rotation|(?:position|linear_velocity|speed|com|collision|col_normal)_(?:x|y)|angular_(?:velocity|damping)|position_(?:x|y)previous|speed|linear_damping|bullet|fixed_rotation|active|mass|inertia|dynamic|kinematic|sleeping|collision_points)|working_directory|webgl_enabled|view_(?:(?:y|x|w|h)view|(?:y|x|w|h)port|(?:v|h)(?:speed|border)|visible|surface_id|object|enabled|current|angle)|undefined|transition_(?:steps|kind|color)|temp_directory|show_(?:score|lives|health)|secure_mode|score|room_(?:width|speed|persistent|last|height|first|caption)|room|pointer_(?:null|invalid)|os_(?:version|type|device|browser)|mouse_(?:y|x|lastbutton|button)|lives|keyboard_(?:string|lastkey|lastchar|key)|iap_data|health|gamemaker_(?:version|registered|pro)|game_(?:save|project|display)_(?:id|name)|fps_real|fps|event_(?:type|object|number|action)|error_(?:occurred|last)|display_aa|delta_time|debug_mode|cursor_sprite|current_(?:year|weekday|time|second|month|minute|hour|day)|caption_(?:score|lives|health)|browser_(?:width|height)|background_(?:yscale|y|xscale|x|width|vtiled|vspeed|visible|showcolour|showcolor|index|htiled|hspeed|height|foreground|colour|color|blend|alpha)|async_load|application_surface|argument(?:_relitive|_count|\d)|argument|global|local|self|other)\b/}); \ No newline at end of file +Prism.languages.gamemakerlanguage=Prism.languages.gml=Prism.languages.extend("clike",{number:/(?:\b0x[\da-f]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ulf]*/i,keyword:/\b(?:if|else|switch|case|default|break|for|repeat|while|do|until|continue|exit|return|globalvar|var|enum)\b/,operator:/--|\+\+|[-+%/=]=?|!=|\*\*?=?|<[<=>]?|>[=>]?|&&?|\^\^?|\|\|?|~|\b(?:or|and|not|with|at|xor)\b/,constant:/\b(?:self|other|all|noone|global|local|undefined|pointer_(?:invalid|null)|action_(?:stop|restart|continue|reverse)|pi|GM_build_date|GM_version|timezone_(?:local|utc)|gamespeed_(?:fps|microseconds)|ev_(?:create|destroy|step|alarm|keyboard|mouse|collision|other|draw|draw_(?:begin|end|pre|post)|keypress|keyrelease|trigger|(?:left|right|middle|no)_button|(?:left|right|middle)_press|(?:left|right|middle)_release|mouse_(?:enter|leave|wheel_up|wheel_down)|global_(?:left|right|middle)_button|global_(?:left|right|middle)_press|global_(?:left|right|middle)_release|joystick(?:1|2)_(?:left|right|up|down|button1|button2|button3|button4|button5|button6|button7|button8)|outside|boundary|game_start|game_end|room_start|room_end|no_more_lives|animation_end|end_of_path|no_more_health|user\d|step_(?:normal|begin|end)|gui|gui_begin|gui_end)|vk_(?:nokey|anykey|enter|return|shift|control|alt|escape|space|backspace|tab|pause|printscreen|left|right|up|down|home|end|delete|insert|pageup|pagedown|f\d|numpad\d|divide|multiply|subtract|add|decimal|lshift|lcontrol|lalt|rshift|rcontrol|ralt)|mb_(?:any|none|left|right|middle)|c_(?:aqua|black|blue|dkgray|fuchsia|gray|green|lime|ltgray|maroon|navy|olive|purple|red|silver|teal|white|yellow|orange)|fa_(?:left|center|right|top|middle|bottom|readonly|hidden|sysfile|volumeid|directory|archive)|pr_(?:pointlist|linelist|linestrip|trianglelist|trianglestrip|trianglefan)|bm_(?:complex|normal|add|max|subtract|zero|one|src_colour|inv_src_colour|src_color|inv_src_color|src_alpha|inv_src_alpha|dest_alpha|inv_dest_alpha|dest_colour|inv_dest_colour|dest_color|inv_dest_color|src_alpha_sat)|audio_(?:falloff_(?:none|inverse_distance|inverse_distance_clamped|linear_distance|linear_distance_clamped|exponent_distance|exponent_distance_clamped)|old_system|new_system|mono|stereo|3d)|cr_(?:default|none|arrow|cross|beam|size_nesw|size_ns|size_nwse|size_we|uparrow|hourglass|drag|appstart|handpoint|size_all)|spritespeed_framesper(?:second|gameframe)|asset_(?:object|unknown|sprite|sound|room|path|script|font|timeline|tiles|shader)|ds_type_(?:map|list|stack|queue|grid|priority)|ef_(?:explosion|ring|ellipse|firework|smoke|smokeup|star|spark|flare|cloud|rain|snow)|pt_shape_(?:pixel|disk|square|line|star|circle|ring|sphere|flare|spark|explosion|cloud|smoke|snow)|ps_(?:distr|shape)_(?:linear|gaussian|invgaussian|rectangle|ellipse|diamond|line)|ty_(?:real|string)|dll_(?:cdel|cdecl|stdcall)|matrix_(?:view|projection|world)|os_(?:win32|windows|macosx|ios|android|linux|unknown|winphone|win8native|psvita|ps4|xboxone|ps3|uwp)|browser_(?:not_a_browser|unknown|ie|firefox|chrome|safari|safari_mobile|opera|tizen|windows_store|ie_mobile)|device_ios_(?:unknown|iphone|iphone_retina|ipad|ipad_retina|iphone5|iphone6|iphone6plus)|device_(?:emulator|tablet)|display_(?:landscape|landscape_flipped|portrait|portrait_flipped)|of_challenge_(?:win|lose|tie)|leaderboard_type_(?:number|time_mins_secs)|cmpfunc_(?:never|less|equal|lessequal|greater|notequal|greaterequal|always)|cull_(?:noculling|clockwise|counterclockwise)|lighttype_(?:dir|point)|iap_(?:ev_storeload|ev_product|ev_purchase|ev_consume|ev_restore|storeload_ok|storeload_failed|status_uninitialised|status_unavailable|status_loading|status_available|status_processing|status_restoring|failed|unavailable|available|purchased|canceled|refunded)|fb_login_(?:default|fallback_to_webview|no_fallback_to_webview|forcing_webview|use_system_account|forcing_safari)|phy_joint_(?:anchor_1_x|anchor_1_y|anchor_2_x|anchor_2_y|reaction_force_x|reaction_force_y|reaction_torque|motor_speed|angle|motor_torque|max_motor_torque|translation|speed|motor_force|max_motor_force|length_1|length_2|damping_ratio|frequency|lower_angle_limit|upper_angle_limit|angle_limits|max_length|max_torque|max_force)|phy_debug_render_(?:aabb|collision_pairs|coms|core_shapes|joints|obb|shapes)|phy_particle_flag_(?:water|zombie|wall|spring|elastic|viscous|powder|tensile|colourmixing|colormixing)|phy_particle_group_flag_(?:solid|rigid)|phy_particle_data_flag_(?:typeflags|position|velocity|colour|color|category)|achievement_(?:our_info|friends_info|leaderboard_info|info|filter_(?:all_players|friends_only|favorites_only)|type_challenge|type_score_challenge|pic_loaded|show_(?:ui|profile|leaderboard|achievement|bank|friend_picker|purchase_prompt))|network_(?:socket_(?:tcp|udp|bluetooth)|type_(?:connect|disconnect|data|non_blocking_connect)|config_(?:connect_timeout|use_non_blocking_socket|enable_reliable_udp|disable_reliable_udp))|buffer_(?:fixed|grow|wrap|fast|vbuffer|network|u8|s8|u16|s16|u32|s32|u64|f16|f32|f64|bool|text|string|seek_start|seek_relative|seek_end|generalerror|outofspace|outofbounds|invalidtype)|gp_(?:face\d|shoulderl|shoulderr|shoulderlb|shoulderrb|select|start|stickl|stickr|padu|padd|padl|padr|axislh|axislv|axisrh|axisrv)|ov_(?:friends|community|players|settings|gamegroup|achievements)|lb_sort_(?:none|ascending|descending)|lb_disp_(?:none|numeric|time_sec|time_ms)|ugc_(?:result_success|filetype_(?:community|microtrans)|visibility_(?:public|friends_only|private)|query_RankedBy(?:Vote|PublicationDate|Trend|NumTimesReported|TotalVotesAsc|VotesUp|TextSearch)|query_(?:AcceptedForGameRankedByAcceptanceDate|FavoritedByFriendsRankedByPublicationDate|CreatedByFriendsRankedByPublicationDate|NotYetRated)|sortorder_CreationOrder(?:Desc|Asc)|sortorder_(?:TitleAsc|LastUpdatedDesc|SubscriptionDateDesc|VoteScoreDesc|ForModeration)|list_(?:Published|VotedOn|VotedUp|VotedDown|WillVoteLater|Favorited|Subscribed|UsedOrPlayed|Followed)|match_(?:Items|Items_Mtx|Items_ReadyToUse|Collections|Artwork|Videos|Screenshots|AllGuides|WebGuides|IntegratedGuides|UsableInGame|ControllerBindings))|vertex_usage_(?:position|colour|color|normal|texcoord|textcoord|blendweight|blendindices|psize|tangent|binormal|fog|depth|sample)|vertex_type_(?:float\d|colour|color|ubyte4)|layerelementtype_(?:undefined|background|instance|oldtilemap|sprite|tilemap|particlesystem|tile)|tile_(?:rotate|flip|mirror|index_mask)|input_type|se_(?:chorus|compressor|echo|equalizer|flanger|gargle|none|reverb)|text_type|(?:obj|scr|spr|rm)\w+)\b/,variable:/\b(?:x|y|(?:x|y)(?:previous|start)|(?:h|v)speed|direction|speed|friction|gravity|gravity_direction|path_(?:index|position|positionprevious|speed|scale|orientation|endaction)|object_index|id|solid|persistent|mask_index|instance_(?:count|id)|alarm|timeline_(?:index|position|speed|running|loop)|visible|sprite_(?:index|width|height|xoffset|yoffset)|image_(?:number|index|speed|depth|xscale|yscale|angle|alpha|blend)|bbox_(?:left|right|top|bottom)|layer|phy_(?:rotation|(?:position|linear_velocity|speed|com|collision|col_normal)_(?:x|y)|angular_(?:velocity|damping)|position_(?:x|y)previous|speed|linear_damping|bullet|fixed_rotation|active|mass|inertia|dynamic|kinematic|sleeping|collision_points)|working_directory|webgl_enabled|view_(?:(?:y|x|w|h)view|(?:y|x|w|h)port|(?:v|h)(?:speed|border)|visible|surface_id|object|enabled|current|angle)|undefined|transition_(?:steps|kind|color)|temp_directory|show_(?:score|lives|health)|secure_mode|score|room_(?:width|speed|persistent|last|height|first|caption)|room|pointer_(?:null|invalid)|os_(?:version|type|device|browser)|mouse_(?:y|x|lastbutton|button)|lives|keyboard_(?:string|lastkey|lastchar|key)|iap_data|health|gamemaker_(?:version|registered|pro)|game_(?:save|project|display)_(?:id|name)|fps_real|fps|event_(?:type|object|number|action)|error_(?:occurred|last)|display_aa|delta_time|debug_mode|cursor_sprite|current_(?:year|weekday|time|second|month|minute|hour|day)|caption_(?:score|lives|health)|browser_(?:width|height)|background_(?:yscale|y|xscale|x|width|vtiled|vspeed|visible|showcolour|showcolor|index|htiled|hspeed|height|foreground|colour|color|blend|alpha)|async_load|application_surface|argument(?:_relitive|_count|\d)|argument|global|local|self|other)\b/}); \ No newline at end of file diff --git a/components/prism-lisp.js b/components/prism-lisp.js index 66b499084f..6cea556177 100644 --- a/components/prism-lisp.js +++ b/components/prism-lisp.js @@ -1,134 +1,133 @@ (function (Prism) { - // Functions to construct regular expressions - // simple form - // e.g. (interactive ... or (interactive) + /** + * Functions to construct regular expressions + * e.g. (interactive ... or (interactive) + * @param {string} name + * @returns {RegExp} + */ function simple_form(name) { - return RegExp('(\\()' + name + '(?=[\\s\\)])'); + return RegExp(/(\()/.source + '(?:' + name + ')' + /(?=[\s\)])/.source); } - // booleans and numbers + /** + * booleans and numbers + * @param {string} pattern + * @returns {RegExp} + */ function primitive(pattern) { - return RegExp('([\\s([])' + pattern + '(?=[\\s)])'); + return RegExp(/([\s([])/.source + '(?:' + pattern + ')' + /(?=[\s)])/.source); } // Patterns in regular expressions // Symbol name. See https://www.gnu.org/software/emacs/manual/html_node/elisp/Symbol-Type.html // & and : are excluded as they are usually used for special purposes - var symbol = '[-+*/_~!@$%^=<>{}\\w]+'; + var symbol = /(?!\d)[-+*/_~!@$%^=<>{}\w]+/.source; // symbol starting with & used in function arguments - var marker = '&' + symbol; + var marker = /&/.source + symbol; // Open parenthesis for look-behind - var par = '(\\()'; - var endpar = '(?=\\))'; + var par = /(\()/.source; + var endpar = /(?=\))/.source; // End the pattern with look-ahead space - var space = '(?=\\s)'; + var space = /(?=\s)/.source; + var nestedPar = /(?:[^()]|\((?:[^()]|\((?:[^()]|\((?:[^()]|\((?:[^()]|\([^()]*\))*\))*\))*\))*\))*/.source; var language = { // Three or four semicolons are considered a heading. // See https://www.gnu.org/software/emacs/manual/html_node/elisp/Comment-Tips.html - heading: { + 'heading': { pattern: /;;;.*/, alias: ['comment', 'title'] }, - comment: /;.*/, - string: { + 'comment': /;.*/, + 'string': { pattern: /"(?:[^"\\]|\\.)*"/, greedy: true, inside: { - argument: /[-A-Z]+(?=[.,\s])/, - symbol: RegExp('`' + symbol + "'") + 'argument': /[-A-Z]+(?=[.,\s])/, + 'symbol': RegExp('`' + symbol + "'") } }, 'quoted-symbol': { - pattern: RegExp("#?'" + symbol), + pattern: RegExp(/#?'/.source + symbol), alias: ['variable', 'symbol'] }, 'lisp-property': { - pattern: RegExp(':' + symbol), + pattern: RegExp(/:/.source + symbol), alias: 'property' }, - splice: { - pattern: RegExp(',@?' + symbol), + 'splice': { + pattern: RegExp(/,@?/.source + symbol), alias: ['symbol', 'variable'] }, - keyword: [ + 'keyword': [ { - pattern: RegExp( - par + - '(?:(?:lexical-)?let\\*?|(?:cl-)?letf|if|when|while|unless|cons|cl-loop|and|or|not|cond|setq|error|message|null|require|provide|use-package)' + - space - ), + pattern: RegExp(par + /(?:(?:lexical-)?let\*?|(?:cl-)?letf|if|when|while|unless|cons|cl-loop|and|or|not|cond|setq|error|message|null|require|provide|use-package)/.source + space), lookbehind: true }, { - pattern: RegExp( - par + '(?:for|do|collect|return|finally|append|concat|in|by)' + space - ), + pattern: RegExp(par + /(?:for|do|collect|return|finally|append|concat|in|by)/.source + space), lookbehind: true }, ], - declare: { - pattern: simple_form('declare'), + 'declare': { + pattern: simple_form(/declare/.source), lookbehind: true, alias: 'keyword' }, - interactive: { - pattern: simple_form('interactive'), + 'interactive': { + pattern: simple_form(/interactive/.source), lookbehind: true, alias: 'keyword' }, - boolean: { - pattern: primitive('(?:t|nil)'), + 'boolean': { + pattern: primitive(/t|nil/.source), lookbehind: true }, - number: { - pattern: primitive('[-+]?\\d+(?:\\.\\d*)?'), + 'number': { + pattern: primitive(/[-+]?\d+(?:\.\d*)?/.source), lookbehind: true }, - defvar: { - pattern: RegExp(par + 'def(?:var|const|custom|group)\\s+' + symbol), + 'defvar': { + pattern: RegExp(par + /def(?:var|const|custom|group)\s+/.source + symbol), lookbehind: true, inside: { - keyword: /^def[a-z]+/, - variable: RegExp(symbol) + 'keyword': /^def[a-z]+/, + 'variable': RegExp(symbol) } }, - defun: { - pattern: RegExp( - par + - '(?:cl-)?(?:defun\\*?|defmacro)\\s+' + - symbol + - '\\s+\\([\\s\\S]*?\\)' - ), + 'defun': { + pattern: RegExp(par + /(?:cl-)?(?:defun\*?|defmacro)\s+/.source + symbol + /\s+\(/.source + nestedPar + /\)/.source), lookbehind: true, + greedy: true, inside: { - keyword: /^(?:cl-)?def\S+/, + 'keyword': /^(?:cl-)?def\S+/, // See below, this property needs to be defined later so that it can // reference the language object. - arguments: null, - function: { - pattern: RegExp('(^\\s)' + symbol), + 'arguments': null, + 'function': { + pattern: RegExp(/(^\s)/.source + symbol), lookbehind: true }, - punctuation: /[()]/ + 'punctuation': /[()]/ } }, - lambda: { + 'lambda': { pattern: RegExp(par + 'lambda\\s+\\(\\s*(?:&?' + symbol + '(?:\\s+&?' + symbol + ')*\\s*)?\\)'), lookbehind: true, + greedy: true, inside: { - keyword: /^lambda/, + 'keyword': /^lambda/, // See below, this property needs to be defined later so that it can // reference the language object. - arguments: null, - punctuation: /[()]/ + 'arguments': null, + 'punctuation': /[()]/ } }, - car: { + 'car': { pattern: RegExp(par + symbol), lookbehind: true }, - punctuation: [ + 'punctuation': [ // open paren, brackets, and close paren /(?:['`,]?\(|[)\[\]])/, // cons @@ -141,48 +140,42 @@ var arg = { 'lisp-marker': RegExp(marker), - rest: { - argument: { - pattern: RegExp(symbol), - alias: 'variable' - }, - varform: { - pattern: RegExp(par + symbol + '\\s+\\S[\\s\\S]*' + endpar), - lookbehind: true, - inside: { - string: language.string, - boolean: language.boolean, - number: language.number, - symbol: language.symbol, - punctuation: /[()]/ - } - } - } + 'varform': { + pattern: RegExp(/\(/.source + symbol + /\s+(?=\S)/.source + nestedPar + /\)/.source), + lookbehind: true, + inside: language + }, + 'argument': { + pattern: RegExp(/(^|[\s(])/.source + symbol), + lookbehind: true, + alias: 'variable' + }, + rest: language }; - var forms = '\\S+(?:\\s+\\S+)*'; + var forms = /\S+(?:\s+\S+)*/.source; var arglist = { - pattern: RegExp(par + '[\\s\\S]*' + endpar), + pattern: RegExp(par + nestedPar + endpar), lookbehind: true, inside: { 'rest-vars': { - pattern: RegExp('&(?:rest|body)\\s+' + forms), + pattern: RegExp(/&(?:rest|body)\s+/.source + forms), inside: arg }, 'other-marker-vars': { - pattern: RegExp('&(?:optional|aux)\\s+' + forms), + pattern: RegExp(/&(?:optional|aux)\s+/.source + forms), inside: arg }, - keys: { - pattern: RegExp('&key\\s+' + forms + '(?:\\s+&allow-other-keys)?'), + 'keys': { + pattern: RegExp(/&key\s+/.source + forms + /(?:\s+&allow-other-keys)?/.source), inside: arg }, - argument: { + 'argument': { pattern: RegExp(symbol), alias: 'variable' }, - punctuation: /[()]/ + 'punctuation': /[()]/ } }; diff --git a/components/prism-lisp.min.js b/components/prism-lisp.min.js index 886db79e73..e888ae64b7 100644 --- a/components/prism-lisp.min.js +++ b/components/prism-lisp.min.js @@ -1 +1 @@ -!function(e){function n(e){return RegExp("(\\()"+e+"(?=[\\s\\)])")}function a(e){return RegExp("([\\s([])"+e+"(?=[\\s)])")}var t="[-+*/_~!@$%^=<>{}\\w]+",r="(\\()",s="(?=\\))",i="(?=\\s)",o={heading:{pattern:/;;;.*/,alias:["comment","title"]},comment:/;.*/,string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0,inside:{argument:/[-A-Z]+(?=[.,\s])/,symbol:RegExp("`"+t+"'")}},"quoted-symbol":{pattern:RegExp("#?'"+t),alias:["variable","symbol"]},"lisp-property":{pattern:RegExp(":"+t),alias:"property"},splice:{pattern:RegExp(",@?"+t),alias:["symbol","variable"]},keyword:[{pattern:RegExp(r+"(?:(?:lexical-)?let\\*?|(?:cl-)?letf|if|when|while|unless|cons|cl-loop|and|or|not|cond|setq|error|message|null|require|provide|use-package)"+i),lookbehind:!0},{pattern:RegExp(r+"(?:for|do|collect|return|finally|append|concat|in|by)"+i),lookbehind:!0}],declare:{pattern:n("declare"),lookbehind:!0,alias:"keyword"},interactive:{pattern:n("interactive"),lookbehind:!0,alias:"keyword"},boolean:{pattern:a("(?:t|nil)"),lookbehind:!0},number:{pattern:a("[-+]?\\d+(?:\\.\\d*)?"),lookbehind:!0},defvar:{pattern:RegExp(r+"def(?:var|const|custom|group)\\s+"+t),lookbehind:!0,inside:{keyword:/^def[a-z]+/,variable:RegExp(t)}},defun:{pattern:RegExp(r+"(?:cl-)?(?:defun\\*?|defmacro)\\s+"+t+"\\s+\\([\\s\\S]*?\\)"),lookbehind:!0,inside:{keyword:/^(?:cl-)?def\S+/,arguments:null,function:{pattern:RegExp("(^\\s)"+t),lookbehind:!0},punctuation:/[()]/}},lambda:{pattern:RegExp(r+"lambda\\s+\\(\\s*(?:&?"+t+"(?:\\s+&?"+t+")*\\s*)?\\)"),lookbehind:!0,inside:{keyword:/^lambda/,arguments:null,punctuation:/[()]/}},car:{pattern:RegExp(r+t),lookbehind:!0},punctuation:[/(?:['`,]?\(|[)\[\]])/,{pattern:/(\s)\.(?=\s)/,lookbehind:!0}]},l={"lisp-marker":RegExp("&[-+*/_~!@$%^=<>{}\\w]+"),rest:{argument:{pattern:RegExp(t),alias:"variable"},varform:{pattern:RegExp(r+t+"\\s+\\S[\\s\\S]*"+s),lookbehind:!0,inside:{string:o.string,boolean:o.boolean,number:o.number,symbol:o.symbol,punctuation:/[()]/}}}},p="\\S+(?:\\s+\\S+)*",d={pattern:RegExp(r+"[\\s\\S]*"+s),lookbehind:!0,inside:{"rest-vars":{pattern:RegExp("&(?:rest|body)\\s+"+p),inside:l},"other-marker-vars":{pattern:RegExp("&(?:optional|aux)\\s+"+p),inside:l},keys:{pattern:RegExp("&key\\s+"+p+"(?:\\s+&allow-other-keys)?"),inside:l},argument:{pattern:RegExp(t),alias:"variable"},punctuation:/[()]/}};o.lambda.inside.arguments=d,o.defun.inside.arguments=e.util.clone(d),o.defun.inside.arguments.inside.sublist=d,e.languages.lisp=o,e.languages.elisp=o,e.languages.emacs=o,e.languages["emacs-lisp"]=o}(Prism); \ No newline at end of file +!function(e){function n(e){return RegExp("(\\()(?:"+e+")(?=[\\s\\)])")}function a(e){return RegExp("([\\s([])(?:"+e+")(?=[\\s)])")}var t="(?!\\d)[-+*/_~!@$%^=<>{}\\w]+",r="(\\()",i="(?=\\s)",s="(?:[^()]|\\((?:[^()]|\\((?:[^()]|\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\))*\\))*\\))*",o={heading:{pattern:/;;;.*/,alias:["comment","title"]},comment:/;.*/,string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0,inside:{argument:/[-A-Z]+(?=[.,\s])/,symbol:RegExp("`"+t+"'")}},"quoted-symbol":{pattern:RegExp("#?'"+t),alias:["variable","symbol"]},"lisp-property":{pattern:RegExp(":"+t),alias:"property"},splice:{pattern:RegExp(",@?"+t),alias:["symbol","variable"]},keyword:[{pattern:RegExp(r+"(?:(?:lexical-)?let\\*?|(?:cl-)?letf|if|when|while|unless|cons|cl-loop|and|or|not|cond|setq|error|message|null|require|provide|use-package)"+i),lookbehind:!0},{pattern:RegExp(r+"(?:for|do|collect|return|finally|append|concat|in|by)"+i),lookbehind:!0}],declare:{pattern:n("declare"),lookbehind:!0,alias:"keyword"},interactive:{pattern:n("interactive"),lookbehind:!0,alias:"keyword"},boolean:{pattern:a("t|nil"),lookbehind:!0},number:{pattern:a("[-+]?\\d+(?:\\.\\d*)?"),lookbehind:!0},defvar:{pattern:RegExp(r+"def(?:var|const|custom|group)\\s+"+t),lookbehind:!0,inside:{keyword:/^def[a-z]+/,variable:RegExp(t)}},defun:{pattern:RegExp(r+"(?:cl-)?(?:defun\\*?|defmacro)\\s+"+t+"\\s+\\("+s+"\\)"),lookbehind:!0,greedy:!0,inside:{keyword:/^(?:cl-)?def\S+/,arguments:null,function:{pattern:RegExp("(^\\s)"+t),lookbehind:!0},punctuation:/[()]/}},lambda:{pattern:RegExp(r+"lambda\\s+\\(\\s*(?:&?"+t+"(?:\\s+&?"+t+")*\\s*)?\\)"),lookbehind:!0,greedy:!0,inside:{keyword:/^lambda/,arguments:null,punctuation:/[()]/}},car:{pattern:RegExp(r+t),lookbehind:!0},punctuation:[/(?:['`,]?\(|[)\[\]])/,{pattern:/(\s)\.(?=\s)/,lookbehind:!0}]},l={"lisp-marker":RegExp("&(?!\\d)[-+*/_~!@$%^=<>{}\\w]+"),varform:{pattern:RegExp("\\("+t+"\\s+(?=\\S)"+s+"\\)"),lookbehind:!0,inside:o},argument:{pattern:RegExp("(^|[\\s(])"+t),lookbehind:!0,alias:"variable"},rest:o},p="\\S+(?:\\s+\\S+)*",d={pattern:RegExp(r+s+"(?=\\))"),lookbehind:!0,inside:{"rest-vars":{pattern:RegExp("&(?:rest|body)\\s+"+p),inside:l},"other-marker-vars":{pattern:RegExp("&(?:optional|aux)\\s+"+p),inside:l},keys:{pattern:RegExp("&key\\s+"+p+"(?:\\s+&allow-other-keys)?"),inside:l},argument:{pattern:RegExp(t),alias:"variable"},punctuation:/[()]/}};o.lambda.inside.arguments=d,o.defun.inside.arguments=e.util.clone(d),o.defun.inside.arguments.inside.sublist=d,e.languages.lisp=o,e.languages.elisp=o,e.languages.emacs=o,e.languages["emacs-lisp"]=o}(Prism); \ No newline at end of file diff --git a/components/prism-php.js b/components/prism-php.js index aec6f52a6a..a90abdd723 100644 --- a/components/prism-php.js +++ b/components/prism-php.js @@ -46,24 +46,12 @@ greedy: true, lookbehind: true }, - { - pattern: /([(,?]\s*[a-z0-9_|]\|\s*)(?:null|false)\b(?=\s*\$)/i, - alias: 'type-hint', - greedy: true, - lookbehind: true - }, { pattern: /(\)\s*:\s*\??\s*)\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b/i, alias: 'return-type', greedy: true, lookbehind: true }, - { - pattern: /(\)\s*:\s*\??\s*[a-z0-9_|]\|\s*)(?:null|false)\b/i, - alias: 'return-type', - greedy: true, - lookbehind: true - }, { pattern: /\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|iterable|(?:null|false)(?=\s*\|))\b/i, alias: 'type-declaration', diff --git a/components/prism-php.min.js b/components/prism-php.min.js index c9ffca7d15..73a24b919a 100644 --- a/components/prism-php.min.js +++ b/components/prism-php.min.js @@ -1 +1 @@ -!function(a){var e=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,t=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/,/\b(?:null)\b/i],i=/\b0b[01]+\b|\b0x[\da-f]+\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,n=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,s=/[{}\[\](),:;]/;a.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:e,variable:/\$+(?:\w+\b|(?={))/i,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},keyword:[{pattern:/(\(\s*)\b(?:bool|boolean|int|integer|float|string|object|array)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:bool|int|float|string|object|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*[a-z0-9_|]\|\s*)(?:null|false)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*\??\s*)\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*\??\s*[a-z0-9_|]\|\s*)(?:null|false)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|iterable|(?:null|false)(?=\s*\|))\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:null|false)\b/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},/\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|match|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i],"argument-name":/\b[a-z_]\w*(?=\s*:(?!:))/i,"class-name":[{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*\??\s*)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*\??\s*)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,function:/\w+\s*(?=\()/,property:{pattern:/(->)[\w]+/,lookbehind:!0},number:i,operator:n,punctuation:s};var l={pattern:/{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)*)/,lookbehind:!0,inside:a.languages.php},r=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:l}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:l}}];a.languages.insertBefore("php","variable",{string:r}),a.languages.insertBefore("php","variable",{attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=]$)/,lookbehind:!0,inside:{comment:e,string:r,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,number:i,operator:n,punctuation:s}},delimiter:{pattern:/^#\[|]$/,alias:"punctuation"}}}}),a.hooks.add("before-tokenize",function(e){if(/<\?/.test(e.code)){a.languages["markup-templating"].buildPlaceholders(e,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/gi)}}),a.hooks.add("after-tokenize",function(e){a.languages["markup-templating"].tokenizePlaceholders(e,"php")})}(Prism); \ No newline at end of file +!function(a){var e=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,t=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/,/\b(?:null)\b/i],i=/\b0b[01]+\b|\b0x[\da-f]+\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,n=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,s=/[{}\[\](),:;]/;a.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:e,variable:/\$+(?:\w+\b|(?={))/i,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},keyword:[{pattern:/(\(\s*)\b(?:bool|boolean|int|integer|float|string|object|array)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:bool|int|float|string|object|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*\??\s*)\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|iterable|(?:null|false)(?=\s*\|))\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:null|false)\b/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},/\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|match|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i],"argument-name":/\b[a-z_]\w*(?=\s*:(?!:))/i,"class-name":[{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*\??\s*)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*\??\s*)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,function:/\w+\s*(?=\()/,property:{pattern:/(->)[\w]+/,lookbehind:!0},number:i,operator:n,punctuation:s};var l={pattern:/{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)*)/,lookbehind:!0,inside:a.languages.php},r=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:l}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:l}}];a.languages.insertBefore("php","variable",{string:r}),a.languages.insertBefore("php","variable",{attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=]$)/,lookbehind:!0,inside:{comment:e,string:r,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,number:i,operator:n,punctuation:s}},delimiter:{pattern:/^#\[|]$/,alias:"punctuation"}}}}),a.hooks.add("before-tokenize",function(e){if(/<\?/.test(e.code)){a.languages["markup-templating"].buildPlaceholders(e,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/gi)}}),a.hooks.add("after-tokenize",function(e){a.languages["markup-templating"].tokenizePlaceholders(e,"php")})}(Prism); \ No newline at end of file diff --git a/components/prism-powerquery.js b/components/prism-powerquery.js index 7abf0ad572..00ddd2903b 100644 --- a/components/prism-powerquery.js +++ b/components/prism-powerquery.js @@ -1,55 +1,55 @@ // https://docs.microsoft.com/en-us/powerquery-m/power-query-m-language-specification Prism.languages.powerquery = { - 'comment': { - pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:\/\/).*)/, - lookbehind: true - }, - 'quoted-identifier': { - pattern: /#"(?:[^"\r\n]|"")*"(?!")/, - greedy: true, - alias: 'variable' - }, - 'string': { - pattern: /"(?:[^"\r\n]|"")*"(?!")/, - greedy: true - }, - 'constant': [ - /\bDay\.(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)\b/, - /\bTraceLevel\.(?:Critical|Error|Information|Verbose|Warning)\b/, - /\bOccurrence\.(?:First|Last|All)\b/, - /\bOrder\.(?:Ascending|Descending)\b/, - /\bRoundingMode\.(?:AwayFromZero|Down|ToEven|TowardZero|Up)\b/, - /\bMissingField\.(?:Error|Ignore|UseNull)\b/, - /\bQuoteStyle\.(?:Csv|None)\b/, - /\bJoinKind\.(?:Inner|LeftOuter|RightOuter|FullOuter|LeftAnti|RightAnti)\b/, - /\bGroupKind\.(?:Global|Local)\b/, - /\bExtraValues\.(?:List|Ignore|Error)\b/, - /\bJoinAlgorithm\.(?:Dynamic|PairwiseHash|SortMerge|LeftHash|RightHash|LeftIndex|RightIndex)\b/, - /\bJoinSide\.(?:Left|Right)\b/, - /\bPrecision\.(?:Double|Decimal)\b/, - /\bRelativePosition\.From(?:End|Start)\b/, - /\bTextEncoding\.(?:Ascii|BigEndianUnicode|Unicode|Utf8|Utf16|Windows)\b/, - /\b(?:Any|Binary|Date|DateTime|DateTimeZone|Duration|Int8|Int16|Int32|Int64|Function|List|Logical|None|Number|Record|Table|Text|Time)\.Type\b/, - /\bnull\b/ - ], - 'boolean': /\b(?:true|false)\b/, - 'keyword': /\b(?:and|as|each|else|error|if|in|is|let|meta|not|nullable|optional|or|otherwise|section|shared|then|try|type)\b|#(?:binary|date|datetime|datetimezone|duration|infinity|nan|sections|shared|table|time)\b/, - 'function': { - pattern: /(^|[^#\w.])(?!\d)[\w.]+(?=\s*\()/, - lookbehind: true - }, - 'data-type': { - pattern: /\b(?:any|anynonnull|binary|date|datetime|datetimezone|duration|function|list|logical|none|number|record|table|text|time|type)\b/, - alias: 'variable' - }, - 'number': { - pattern: /\b0x[\da-f]+\b|(?:[+-]?(?:\b\d+\.)?\b\d+|[+-]\.\d+|(^|[^.])\B\.\d+)(?:e[+-]?\d+)?\b/i, - lookbehind: true - }, - 'operator': /[-+*\/&?@^]|<(?:=>?|>)?|>=?|=>?|\.\.\.?/, - 'punctuation': /[,;\[\](){}]/ + 'comment': { + pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:\/\/).*)/, + lookbehind: true + }, + 'quoted-identifier': { + pattern: /#"(?:[^"\r\n]|"")*"(?!")/, + greedy: true, + alias: 'variable' + }, + 'string': { + pattern: /"(?:[^"\r\n]|"")*"(?!")/, + greedy: true + }, + 'constant': [ + /\bDay\.(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)\b/, + /\bTraceLevel\.(?:Critical|Error|Information|Verbose|Warning)\b/, + /\bOccurrence\.(?:First|Last|All)\b/, + /\bOrder\.(?:Ascending|Descending)\b/, + /\bRoundingMode\.(?:AwayFromZero|Down|ToEven|TowardZero|Up)\b/, + /\bMissingField\.(?:Error|Ignore|UseNull)\b/, + /\bQuoteStyle\.(?:Csv|None)\b/, + /\bJoinKind\.(?:Inner|LeftOuter|RightOuter|FullOuter|LeftAnti|RightAnti)\b/, + /\bGroupKind\.(?:Global|Local)\b/, + /\bExtraValues\.(?:List|Ignore|Error)\b/, + /\bJoinAlgorithm\.(?:Dynamic|PairwiseHash|SortMerge|LeftHash|RightHash|LeftIndex|RightIndex)\b/, + /\bJoinSide\.(?:Left|Right)\b/, + /\bPrecision\.(?:Double|Decimal)\b/, + /\bRelativePosition\.From(?:End|Start)\b/, + /\bTextEncoding\.(?:Ascii|BigEndianUnicode|Unicode|Utf8|Utf16|Windows)\b/, + /\b(?:Any|Binary|Date|DateTime|DateTimeZone|Duration|Int8|Int16|Int32|Int64|Function|List|Logical|None|Number|Record|Table|Text|Time)\.Type\b/, + /\bnull\b/ + ], + 'boolean': /\b(?:true|false)\b/, + 'keyword': /\b(?:and|as|each|else|error|if|in|is|let|meta|not|nullable|optional|or|otherwise|section|shared|then|try|type)\b|#(?:binary|date|datetime|datetimezone|duration|infinity|nan|sections|shared|table|time)\b/, + 'function': { + pattern: /(^|[^#\w.])(?!\d)[\w.]+(?=\s*\()/, + lookbehind: true + }, + 'data-type': { + pattern: /\b(?:any|anynonnull|binary|date|datetime|datetimezone|duration|function|list|logical|none|number|record|table|text|time)\b/, + alias: 'variable' + }, + 'number': { + pattern: /\b0x[\da-f]+\b|(?:[+-]?(?:\b\d+\.)?\b\d+|[+-]\.\d+|(^|[^.])\B\.\d+)(?:e[+-]?\d+)?\b/i, + lookbehind: true + }, + 'operator': /[-+*\/&?@^]|<(?:=>?|>)?|>=?|=>?|\.\.\.?/, + 'punctuation': /[,;\[\](){}]/ }; Prism.languages.pq = Prism.languages['powerquery']; -Prism.languages.mscript = Prism.languages['powerquery'] \ No newline at end of file +Prism.languages.mscript = Prism.languages['powerquery'] diff --git a/components/prism-powerquery.min.js b/components/prism-powerquery.min.js index e6ef36d1c7..c03ccd6bf6 100644 --- a/components/prism-powerquery.min.js +++ b/components/prism-powerquery.min.js @@ -1 +1 @@ -Prism.languages.powerquery={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:\/\/).*)/,lookbehind:!0},"quoted-identifier":{pattern:/#"(?:[^"\r\n]|"")*"(?!")/,greedy:!0,alias:"variable"},string:{pattern:/"(?:[^"\r\n]|"")*"(?!")/,greedy:!0},constant:[/\bDay\.(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)\b/,/\bTraceLevel\.(?:Critical|Error|Information|Verbose|Warning)\b/,/\bOccurrence\.(?:First|Last|All)\b/,/\bOrder\.(?:Ascending|Descending)\b/,/\bRoundingMode\.(?:AwayFromZero|Down|ToEven|TowardZero|Up)\b/,/\bMissingField\.(?:Error|Ignore|UseNull)\b/,/\bQuoteStyle\.(?:Csv|None)\b/,/\bJoinKind\.(?:Inner|LeftOuter|RightOuter|FullOuter|LeftAnti|RightAnti)\b/,/\bGroupKind\.(?:Global|Local)\b/,/\bExtraValues\.(?:List|Ignore|Error)\b/,/\bJoinAlgorithm\.(?:Dynamic|PairwiseHash|SortMerge|LeftHash|RightHash|LeftIndex|RightIndex)\b/,/\bJoinSide\.(?:Left|Right)\b/,/\bPrecision\.(?:Double|Decimal)\b/,/\bRelativePosition\.From(?:End|Start)\b/,/\bTextEncoding\.(?:Ascii|BigEndianUnicode|Unicode|Utf8|Utf16|Windows)\b/,/\b(?:Any|Binary|Date|DateTime|DateTimeZone|Duration|Int8|Int16|Int32|Int64|Function|List|Logical|None|Number|Record|Table|Text|Time)\.Type\b/,/\bnull\b/],boolean:/\b(?:true|false)\b/,keyword:/\b(?:and|as|each|else|error|if|in|is|let|meta|not|nullable|optional|or|otherwise|section|shared|then|try|type)\b|#(?:binary|date|datetime|datetimezone|duration|infinity|nan|sections|shared|table|time)\b/,function:{pattern:/(^|[^#\w.])(?!\d)[\w.]+(?=\s*\()/,lookbehind:!0},"data-type":{pattern:/\b(?:any|anynonnull|binary|date|datetime|datetimezone|duration|function|list|logical|none|number|record|table|text|time|type)\b/,alias:"variable"},number:{pattern:/\b0x[\da-f]+\b|(?:[+-]?(?:\b\d+\.)?\b\d+|[+-]\.\d+|(^|[^.])\B\.\d+)(?:e[+-]?\d+)?\b/i,lookbehind:!0},operator:/[-+*\/&?@^]|<(?:=>?|>)?|>=?|=>?|\.\.\.?/,punctuation:/[,;\[\](){}]/},Prism.languages.pq=Prism.languages.powerquery,Prism.languages.mscript=Prism.languages.powerquery; \ No newline at end of file +Prism.languages.powerquery={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:\/\/).*)/,lookbehind:!0},"quoted-identifier":{pattern:/#"(?:[^"\r\n]|"")*"(?!")/,greedy:!0,alias:"variable"},string:{pattern:/"(?:[^"\r\n]|"")*"(?!")/,greedy:!0},constant:[/\bDay\.(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)\b/,/\bTraceLevel\.(?:Critical|Error|Information|Verbose|Warning)\b/,/\bOccurrence\.(?:First|Last|All)\b/,/\bOrder\.(?:Ascending|Descending)\b/,/\bRoundingMode\.(?:AwayFromZero|Down|ToEven|TowardZero|Up)\b/,/\bMissingField\.(?:Error|Ignore|UseNull)\b/,/\bQuoteStyle\.(?:Csv|None)\b/,/\bJoinKind\.(?:Inner|LeftOuter|RightOuter|FullOuter|LeftAnti|RightAnti)\b/,/\bGroupKind\.(?:Global|Local)\b/,/\bExtraValues\.(?:List|Ignore|Error)\b/,/\bJoinAlgorithm\.(?:Dynamic|PairwiseHash|SortMerge|LeftHash|RightHash|LeftIndex|RightIndex)\b/,/\bJoinSide\.(?:Left|Right)\b/,/\bPrecision\.(?:Double|Decimal)\b/,/\bRelativePosition\.From(?:End|Start)\b/,/\bTextEncoding\.(?:Ascii|BigEndianUnicode|Unicode|Utf8|Utf16|Windows)\b/,/\b(?:Any|Binary|Date|DateTime|DateTimeZone|Duration|Int8|Int16|Int32|Int64|Function|List|Logical|None|Number|Record|Table|Text|Time)\.Type\b/,/\bnull\b/],boolean:/\b(?:true|false)\b/,keyword:/\b(?:and|as|each|else|error|if|in|is|let|meta|not|nullable|optional|or|otherwise|section|shared|then|try|type)\b|#(?:binary|date|datetime|datetimezone|duration|infinity|nan|sections|shared|table|time)\b/,function:{pattern:/(^|[^#\w.])(?!\d)[\w.]+(?=\s*\()/,lookbehind:!0},"data-type":{pattern:/\b(?:any|anynonnull|binary|date|datetime|datetimezone|duration|function|list|logical|none|number|record|table|text|time)\b/,alias:"variable"},number:{pattern:/\b0x[\da-f]+\b|(?:[+-]?(?:\b\d+\.)?\b\d+|[+-]\.\d+|(^|[^.])\B\.\d+)(?:e[+-]?\d+)?\b/i,lookbehind:!0},operator:/[-+*\/&?@^]|<(?:=>?|>)?|>=?|=>?|\.\.\.?/,punctuation:/[,;\[\](){}]/},Prism.languages.pq=Prism.languages.powerquery,Prism.languages.mscript=Prism.languages.powerquery; \ No newline at end of file diff --git a/components/prism-purebasic.js b/components/prism-purebasic.js index c2b9622c93..856881de0a 100644 --- a/components/prism-purebasic.js +++ b/components/prism-purebasic.js @@ -29,22 +29,26 @@ Prism.languages.insertBefore('purebasic', 'keyword', { }, // Anonymous label references, i.e.: jmp @b 'label-reference-anonymous': { - pattern: /(\s*!\s*j[a-z]+\s+)@[fb]/i, + pattern: /(!\s*j[a-z]+\s+)@[fb]/i, lookbehind: true, alias: 'fasm-label' }, // Named label reference, i.e.: jne label1 'label-reference-addressed': { - pattern: /(\s*!\s*j[a-z]+\s+)[A-Z._?$@][\w.?$@~#]*/i, + pattern: /(!\s*j[a-z]+\s+)[A-Z._?$@][\w.?$@~#]*/i, lookbehind: true, alias: 'fasm-label' }, + 'keyword': [ + /\b(?:extern|global)[^;\r\n]*/i, + /\b(?:CPU|FLOAT|DEFAULT).*/ + ], 'function': { pattern: /^(\s*!\s*)[\da-z]+(?=\s|$)/im, lookbehind: true }, 'function-inline': { - pattern: /(\s*:\s*)[\da-z]+(?=\s)/i, + pattern: /(:\s*)[\da-z]+(?=\s)/i, lookbehind: true, alias: 'function' }, @@ -53,10 +57,6 @@ Prism.languages.insertBefore('purebasic', 'keyword', { lookbehind: true, alias: 'fasm-label' }, - 'keyword': [ - /(?:extern|global)[^;\r\n]*/i, - /(?:CPU|FLOAT|DEFAULT).*/ - ], 'register': /\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(?:bp|sp|si|di)|[cdefgs]s|mm\d+)\b/i, 'number': /(?:\b|-|(?=\$))(?:0[hx][\da-f]*\.?[\da-f]+(?:p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|\d*\.?\d+(?:\.?e[+-]?\d+)?[dt]?)\b/i, 'operator': /[\[\]*+\-/%<>=&|$!,.:]/ diff --git a/components/prism-purebasic.min.js b/components/prism-purebasic.min.js index 377ee4c3a6..05922f4851 100644 --- a/components/prism-purebasic.min.js +++ b/components/prism-purebasic.min.js @@ -1 +1 @@ -Prism.languages.purebasic=Prism.languages.extend("clike",{comment:/;.*/,keyword:/\b(?:declarecdll|declaredll|compilerselect|compilercase|compilerdefault|compilerendselect|compilererror|enableexplicit|disableexplicit|not|and|or|xor|calldebugger|debuglevel|enabledebugger|disabledebugger|restore|read|includepath|includebinary|threaded|runtime|with|endwith|structureunion|endstructureunion|align|newlist|newmap|interface|endinterface|extends|enumeration|endenumeration|swap|foreach|continue|fakereturn|goto|gosub|return|break|module|endmodule|declaremodule|enddeclaremodule|declare|declarec|prototype|prototypec|enableasm|disableasm|dim|redim|data|datasection|enddatasection|to|procedurereturn|debug|default|case|select|endselect|as|import|endimport|importc|compilerif|compilerelse|compilerendif|compilerelseif|end|structure|endstructure|while|wend|for|next|step|if|else|elseif|endif|repeat|until|procedure|proceduredll|procedurec|procedurecdll|endprocedure|protected|shared|static|global|define|includefile|xincludefile|macro|endmacro)\b/i,function:/\b\w+(?:\.\w+)?\s*(?=\()/,number:/(?:\$[\da-f]+|\b-?\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/(?:@\*?|\?|\*)\w+|-[>-]?|\+\+?|!=?|<>?=?|==?|&&?|\|?\||[~^%?*/@]/}),Prism.languages.insertBefore("purebasic","keyword",{tag:/#\w+/,asm:{pattern:/(^\s*)!.*/m,lookbehind:!0,alias:"tag",inside:{comment:/;.*/,string:{pattern:/(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"label-reference-anonymous":{pattern:/(\s*!\s*j[a-z]+\s+)@[fb]/i,lookbehind:!0,alias:"fasm-label"},"label-reference-addressed":{pattern:/(\s*!\s*j[a-z]+\s+)[A-Z._?$@][\w.?$@~#]*/i,lookbehind:!0,alias:"fasm-label"},function:{pattern:/^(\s*!\s*)[\da-z]+(?=\s|$)/im,lookbehind:!0},"function-inline":{pattern:/(\s*:\s*)[\da-z]+(?=\s)/i,lookbehind:!0,alias:"function"},label:{pattern:/^(\s*!\s*)[A-Za-z._?$@][\w.?$@~#]*(?=:)/m,lookbehind:!0,alias:"fasm-label"},keyword:[/(?:extern|global)[^;\r\n]*/i,/(?:CPU|FLOAT|DEFAULT).*/],register:/\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(?:bp|sp|si|di)|[cdefgs]s|mm\d+)\b/i,number:/(?:\b|-|(?=\$))(?:0[hx][\da-f]*\.?[\da-f]+(?:p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|\d*\.?\d+(?:\.?e[+-]?\d+)?[dt]?)\b/i,operator:/[\[\]*+\-/%<>=&|$!,.:]/}}}),delete Prism.languages.purebasic["class-name"],delete Prism.languages.purebasic.boolean,Prism.languages.pbfasm=Prism.languages.purebasic; \ No newline at end of file +Prism.languages.purebasic=Prism.languages.extend("clike",{comment:/;.*/,keyword:/\b(?:declarecdll|declaredll|compilerselect|compilercase|compilerdefault|compilerendselect|compilererror|enableexplicit|disableexplicit|not|and|or|xor|calldebugger|debuglevel|enabledebugger|disabledebugger|restore|read|includepath|includebinary|threaded|runtime|with|endwith|structureunion|endstructureunion|align|newlist|newmap|interface|endinterface|extends|enumeration|endenumeration|swap|foreach|continue|fakereturn|goto|gosub|return|break|module|endmodule|declaremodule|enddeclaremodule|declare|declarec|prototype|prototypec|enableasm|disableasm|dim|redim|data|datasection|enddatasection|to|procedurereturn|debug|default|case|select|endselect|as|import|endimport|importc|compilerif|compilerelse|compilerendif|compilerelseif|end|structure|endstructure|while|wend|for|next|step|if|else|elseif|endif|repeat|until|procedure|proceduredll|procedurec|procedurecdll|endprocedure|protected|shared|static|global|define|includefile|xincludefile|macro|endmacro)\b/i,function:/\b\w+(?:\.\w+)?\s*(?=\()/,number:/(?:\$[\da-f]+|\b-?\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/(?:@\*?|\?|\*)\w+|-[>-]?|\+\+?|!=?|<>?=?|==?|&&?|\|?\||[~^%?*/@]/}),Prism.languages.insertBefore("purebasic","keyword",{tag:/#\w+/,asm:{pattern:/(^\s*)!.*/m,lookbehind:!0,alias:"tag",inside:{comment:/;.*/,string:{pattern:/(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"label-reference-anonymous":{pattern:/(!\s*j[a-z]+\s+)@[fb]/i,lookbehind:!0,alias:"fasm-label"},"label-reference-addressed":{pattern:/(!\s*j[a-z]+\s+)[A-Z._?$@][\w.?$@~#]*/i,lookbehind:!0,alias:"fasm-label"},keyword:[/\b(?:extern|global)[^;\r\n]*/i,/\b(?:CPU|FLOAT|DEFAULT).*/],function:{pattern:/^(\s*!\s*)[\da-z]+(?=\s|$)/im,lookbehind:!0},"function-inline":{pattern:/(:\s*)[\da-z]+(?=\s)/i,lookbehind:!0,alias:"function"},label:{pattern:/^(\s*!\s*)[A-Za-z._?$@][\w.?$@~#]*(?=:)/m,lookbehind:!0,alias:"fasm-label"},register:/\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(?:bp|sp|si|di)|[cdefgs]s|mm\d+)\b/i,number:/(?:\b|-|(?=\$))(?:0[hx][\da-f]*\.?[\da-f]+(?:p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|\d*\.?\d+(?:\.?e[+-]?\d+)?[dt]?)\b/i,operator:/[\[\]*+\-/%<>=&|$!,.:]/}}}),delete Prism.languages.purebasic["class-name"],delete Prism.languages.purebasic.boolean,Prism.languages.pbfasm=Prism.languages.purebasic; \ No newline at end of file diff --git a/tests/languages/asm6502/opcode_feature.test b/tests/languages/asm6502/opcode_feature.test index 75e7b42806..c395332019 100644 --- a/tests/languages/asm6502/opcode_feature.test +++ b/tests/languages/asm6502/opcode_feature.test @@ -1,17 +1,233 @@ -LDA -BNE -inx +adc +and +asl +bcc +bcs +beq +bit +bmi +bne +bpl +brk +bvc +bvs clc +cld +cli +clv +cmp +cpx +cpy +dec +dex +dey +eor +inc +inx +iny +jmp +jsr +lda +ldx +ldy +lsr +nop +ora +pha +php +pla +plp +rol +ror +rti +rts +sbc +sec +sed +sei +sta +stx +sty +tax +tay +tsx +txa +txs +tya +ADC +AND +ASL +BCC +BCS +BEQ +BIT +BMI +BNE +BPL +BRK +BVC +BVS +CLC +CLD +CLI +CLV +CMP +CPX +CPY +DEC +DEX +DEY +EOR +INC +INX +INY +JMP +JSR +LDA +LDX +LDY +LSR +NOP +ORA +PHA +PHP +PLA +PLP +ROL +ROR +RTI +RTS +SBC +SEC +SED +SEI +STA +STX +STY +TAX +TAY +TSX +TXA +TXS +TYA -------------------------------------- +---------------------------------------------------- [ - ["opcode", "LDA"], - ["opcode", "BNE"], - ["opcode", "inx"], - ["opcode", "clc"] + ["opcode", "adc"], + ["opcode", "and"], + ["opcode", "asl"], + ["opcode", "bcc"], + ["opcode", "bcs"], + ["opcode", "beq"], + ["opcode", "bit"], + ["opcode", "bmi"], + ["opcode", "bne"], + ["opcode", "bpl"], + ["opcode", "brk"], + ["opcode", "bvc"], + ["opcode", "bvs"], + ["opcode", "clc"], + ["opcode", "cld"], + ["opcode", "cli"], + ["opcode", "clv"], + ["opcode", "cmp"], + ["opcode", "cpx"], + ["opcode", "cpy"], + ["opcode", "dec"], + ["opcode", "dex"], + ["opcode", "dey"], + ["opcode", "eor"], + ["opcode", "inc"], + ["opcode", "inx"], + ["opcode", "iny"], + ["opcode", "jmp"], + ["opcode", "jsr"], + ["opcode", "lda"], + ["opcode", "ldx"], + ["opcode", "ldy"], + ["opcode", "lsr"], + ["opcode", "nop"], + ["opcode", "ora"], + ["opcode", "pha"], + ["opcode", "php"], + ["opcode", "pla"], + ["opcode", "plp"], + ["opcode", "rol"], + ["opcode", "ror"], + ["opcode", "rti"], + ["opcode", "rts"], + ["opcode", "sbc"], + ["opcode", "sec"], + ["opcode", "sed"], + ["opcode", "sei"], + ["opcode", "sta"], + ["opcode", "stx"], + ["opcode", "sty"], + ["opcode", "tax"], + ["opcode", "tay"], + ["opcode", "tsx"], + ["opcode", "txa"], + ["opcode", "txs"], + ["opcode", "tya"], + ["opcode", "ADC"], + ["opcode", "AND"], + ["opcode", "ASL"], + ["opcode", "BCC"], + ["opcode", "BCS"], + ["opcode", "BEQ"], + ["opcode", "BIT"], + ["opcode", "BMI"], + ["opcode", "BNE"], + ["opcode", "BPL"], + ["opcode", "BRK"], + ["opcode", "BVC"], + ["opcode", "BVS"], + ["opcode", "CLC"], + ["opcode", "CLD"], + ["opcode", "CLI"], + ["opcode", "CLV"], + ["opcode", "CMP"], + ["opcode", "CPX"], + ["opcode", "CPY"], + ["opcode", "DEC"], + ["opcode", "DEX"], + ["opcode", "DEY"], + ["opcode", "EOR"], + ["opcode", "INC"], + ["opcode", "INX"], + ["opcode", "INY"], + ["opcode", "JMP"], + ["opcode", "JSR"], + ["opcode", "LDA"], + ["opcode", "LDX"], + ["opcode", "LDY"], + ["opcode", "LSR"], + ["opcode", "NOP"], + ["opcode", "ORA"], + ["opcode", "PHA"], + ["opcode", "PHP"], + ["opcode", "PLA"], + ["opcode", "PLP"], + ["opcode", "ROL"], + ["opcode", "ROR"], + ["opcode", "RTI"], + ["opcode", "RTS"], + ["opcode", "SBC"], + ["opcode", "SEC"], + ["opcode", "SED"], + ["opcode", "SEI"], + ["opcode", "STA"], + ["opcode", "STX"], + ["opcode", "STY"], + ["opcode", "TAX"], + ["opcode", "TAY"], + ["opcode", "TSX"], + ["opcode", "TXA"], + ["opcode", "TXS"], + ["opcode", "TYA"] ] -------------------------------------- +---------------------------------------------------- -Check for opcodes +Check for opcodes \ No newline at end of file diff --git a/tests/languages/bison/number_feature.test b/tests/languages/bison/number_feature.test index ddbacff94b..41ad5e22c6 100644 --- a/tests/languages/bison/number_feature.test +++ b/tests/languages/bison/number_feature.test @@ -1,3 +1,9 @@ +%% +42 +0 +0xBadFace +%% + 42 0 0xBadFace @@ -5,6 +11,14 @@ ---------------------------------------------------- [ + ["bison", [ + ["punctuation", "%%"], + ["number", "42"], + ["number", "0"], + ["number", "0xBadFace"], + ["punctuation", "%%"] + ]], + ["number", "42"], ["number", "0"], ["number", "0xBadFace"] diff --git a/tests/languages/concurnas/keyword_feature.test b/tests/languages/concurnas/keyword_feature.test index cdf3fdb9d3..77653fd026 100644 --- a/tests/languages/concurnas/keyword_feature.test +++ b/tests/languages/concurnas/keyword_feature.test @@ -1,20 +1,20 @@ -as +abstract +actor +also +annotation assert async await -band bool boolean -bor break -bxor byte case catch changed char +class closed -comp constant continue def @@ -23,6 +23,7 @@ del double elif else +enum every extends false @@ -39,14 +40,11 @@ in init inject int -is -isnot lambda local long loop match -mod new nodefault null @@ -63,6 +61,7 @@ pre private protected provide +provider public return shared @@ -74,6 +73,7 @@ super sync this throw +trait trans transient true @@ -90,23 +90,23 @@ with ---------------------------------------------------- [ - ["operator", "as"], + ["keyword", "abstract"], + ["keyword", "actor"], + ["keyword", "also"], + ["keyword", "annotation"], ["keyword", "assert"], ["keyword", "async"], ["keyword", "await"], - ["operator", "band"], ["keyword", "bool"], ["keyword", "boolean"], - ["operator", "bor"], ["keyword", "break"], - ["operator", "bxor"], ["keyword", "byte"], ["keyword", "case"], ["keyword", "catch"], ["keyword", "changed"], ["keyword", "char"], + ["keyword", "class"], ["keyword", "closed"], - ["operator", "comp"], ["keyword", "constant"], ["keyword", "continue"], ["keyword", "def"], @@ -115,6 +115,7 @@ with ["keyword", "double"], ["keyword", "elif"], ["keyword", "else"], + ["keyword", "enum"], ["keyword", "every"], ["keyword", "extends"], ["keyword", "false"], @@ -131,14 +132,11 @@ with ["keyword", "init"], ["keyword", "inject"], ["keyword", "int"], - ["operator", "is"], - ["operator", "isnot"], ["keyword", "lambda"], ["keyword", "local"], ["keyword", "long"], ["keyword", "loop"], ["keyword", "match"], - ["operator", "mod"], ["keyword", "new"], ["keyword", "nodefault"], ["keyword", "null"], @@ -155,6 +153,7 @@ with ["keyword", "private"], ["keyword", "protected"], ["keyword", "provide"], + ["keyword", "provider"], ["keyword", "public"], ["keyword", "return"], ["keyword", "shared"], @@ -166,6 +165,7 @@ with ["keyword", "sync"], ["keyword", "this"], ["keyword", "throw"], + ["keyword", "trait"], ["keyword", "trans"], ["keyword", "transient"], ["keyword", "true"], diff --git a/tests/languages/concurnas/operator_feature.test b/tests/languages/concurnas/operator_feature.test index 41e009a889..63b516f925 100644 --- a/tests/languages/concurnas/operator_feature.test +++ b/tests/languages/concurnas/operator_feature.test @@ -4,27 +4,47 @@ &== &<> isnot is as +comp / /= * *= mod mod= < <== > >== and or -bor bxor +band bor bxor ^ ---------------------------------------------------- [ - ["operator", "+"], ["operator", "++"], ["operator", "+="], - ["operator", "-"], ["operator", "--"], ["operator", "-="], - ["operator", "="], ["operator", "=="], ["operator", "<>"], - ["operator", "&=="], ["operator", "&<>"], + ["operator", "+"], + ["operator", "++"], + ["operator", "+="], + ["operator", "-"], + ["operator", "--"], + ["operator", "-="], + ["operator", "="], + ["operator", "=="], + ["operator", "<>"], + ["operator", "&=="], + ["operator", "&<>"], ["operator", "isnot"], - ["operator", "is"], ["operator", "as"], - ["operator", "/"], ["operator", "/="], ["operator", "*"], ["operator", "*="], - ["operator", "mod"], ["operator", "mod="], - ["operator", "<"], ["operator", "<=="], ["operator", ">"], ["operator", ">=="], - ["operator", "and"], ["operator", "or"], - ["operator", "bor"], ["operator", "bxor"], + ["operator", "is"], + ["operator", "as"], + ["operator", "comp"], + ["operator", "/"], + ["operator", "/="], + ["operator", "*"], + ["operator", "*="], + ["operator", "mod"], + ["operator", "mod="], + ["operator", "<"], + ["operator", "<=="], + ["operator", ">"], + ["operator", ">=="], + ["operator", "and"], + ["operator", "or"], + ["operator", "band"], + ["operator", "bor"], + ["operator", "bxor"], ["operator", "^"] ] diff --git a/tests/languages/css+haml/css+haml_usage.test b/tests/languages/css+haml/css+haml_usage.test index c90047f28f..03753fd6ae 100644 --- a/tests/languages/css+haml/css+haml_usage.test +++ b/tests/languages/css+haml/css+haml_usage.test @@ -16,11 +16,11 @@ ]], ["punctuation", "~"], ["filter-css", [ - ["filter-name", ":css"], - ["selector", ".test"], - ["punctuation", "{"], - ["punctuation", "}"] - ]] + ["filter-name", ":css"], + ["selector", ".test"], + ["punctuation", "{"], + ["punctuation", "}"] + ]] ] ---------------------------------------------------- diff --git a/tests/languages/ejs+pug/ejs_inclusion.test b/tests/languages/ejs+pug/ejs_inclusion.test new file mode 100644 index 0000000000..cfdfee3e99 --- /dev/null +++ b/tests/languages/ejs+pug/ejs_inclusion.test @@ -0,0 +1,24 @@ +:ejs + <% var foo = '', bar = false; %> + +---------------------------------------------------- + +[ + ["filter-ejs", [ + ["filter-name", ":ejs"], + ["language-javascript", [ + ["operator", "<"], + ["operator", "%"], + ["keyword", "var"], + " foo ", + ["operator", "="], + ["string", "''"], + ["punctuation", ","], + " bar ", + ["operator", "="], + ["boolean", "false"], + ["punctuation", ";"] + ]], + ["delimiter", "%>"] + ]] +] \ No newline at end of file diff --git a/tests/languages/erb+haml/erb_inclusion.test b/tests/languages/erb+haml/erb_inclusion.test new file mode 100644 index 0000000000..b62cc2653e --- /dev/null +++ b/tests/languages/erb+haml/erb_inclusion.test @@ -0,0 +1,39 @@ +:erb + <%= render @products || "empty_list" %> + +~ + :erb + <%= render @products || "empty_list" %> + +---------------------------------------------------- + +[ + ["filter-erb", [ + ["filter-name", ":erb"], + ["operator", "<"], + ["operator", "%"], + ["operator", "="], + " render ", + ["variable", "@products"], + ["operator", "||"], + ["string", [ + "\"empty_list\"" + ]], + ["operator", "%"], + ["operator", ">"] + ]], + ["punctuation", "~"], + ["filter-erb", [ + ["filter-name", ":erb"], + ["operator", "<"], + ["operator", "%"], + ["operator", "="], + " render ", + ["variable", "@products"], + ["operator", "||"], + ["string", [ + "\"empty_list\"" + ]], + ["delimiter", "%>"] + ]] +] \ No newline at end of file diff --git a/tests/languages/gml/function_feature.test b/tests/languages/gml/function_feature.test new file mode 100644 index 0000000000..7763645950 --- /dev/null +++ b/tests/languages/gml/function_feature.test @@ -0,0 +1,51 @@ +buff = buffer_create(16384, buffer_grow, 2); +ini_open("Save.ini"); +var str = ini_read_string("Save", "Slot1", ""); +buffer_base64_decode_ext(buff, str, 0); +ini_close(); + +---------------------------------------------------- + +[ + "buff ", + ["operator", "="], + ["function", "buffer_create"], + ["punctuation", "("], + ["number", "16384"], + ["punctuation", ","], + ["constant", "buffer_grow"], + ["punctuation", ","], + ["number", "2"], + ["punctuation", ")"], + ["punctuation", ";"], + ["function", "ini_open"], + ["punctuation", "("], + ["string", "\"Save.ini\""], + ["punctuation", ")"], + ["punctuation", ";"], + ["keyword", "var"], + " str ", + ["operator", "="], + ["function", "ini_read_string"], + ["punctuation", "("], + ["string", "\"Save\""], + ["punctuation", ","], + ["string", "\"Slot1\""], + ["punctuation", ","], + ["string", "\"\""], + ["punctuation", ")"], + ["punctuation", ";"], + ["function", "buffer_base64_decode_ext"], + ["punctuation", "("], + "buff", + ["punctuation", ","], + " str", + ["punctuation", ","], + ["number", "0"], + ["punctuation", ")"], + ["punctuation", ";"], + ["function", "ini_close"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"] +] \ No newline at end of file diff --git a/tests/languages/gml/keyword_feature.test b/tests/languages/gml/keyword_feature.test new file mode 100644 index 0000000000..7fd7996dde --- /dev/null +++ b/tests/languages/gml/keyword_feature.test @@ -0,0 +1,39 @@ +if +else +switch +case +default +break +for +repeat +while +do +until +continue +exit +return +globalvar +var +enum + +---------------------------------------------------- + +[ + ["keyword", "if"], + ["keyword", "else"], + ["keyword", "switch"], + ["keyword", "case"], + ["keyword", "default"], + ["keyword", "break"], + ["keyword", "for"], + ["keyword", "repeat"], + ["keyword", "while"], + ["keyword", "do"], + ["keyword", "until"], + ["keyword", "continue"], + ["keyword", "exit"], + ["keyword", "return"], + ["keyword", "globalvar"], + ["keyword", "var"], + ["keyword", "enum"] +] \ No newline at end of file diff --git a/tests/languages/gml/number_feature.test b/tests/languages/gml/number_feature.test new file mode 100644 index 0000000000..b64ccda69d --- /dev/null +++ b/tests/languages/gml/number_feature.test @@ -0,0 +1,25 @@ +0 +123 +123.456 +123. +.456 +1e5 +1.2e-5f + +0xFF +0xFFul + +---------------------------------------------------- + +[ + ["number", "0"], + ["number", "123"], + ["number", "123.456"], + ["number", "123."], + ["number", ".456"], + ["number", "1e5"], + ["number", "1.2e-5f"], + + ["number", "0xFF"], + ["number", "0xFFul"] +] \ No newline at end of file diff --git a/tests/languages/gml/operator_feature.test b/tests/languages/gml/operator_feature.test new file mode 100644 index 0000000000..55227c8d88 --- /dev/null +++ b/tests/languages/gml/operator_feature.test @@ -0,0 +1,63 @@ ++ - % * ** / ++= -= %= *= **= /= +>> << ++ -- + += +== != <> +< <= => > + +& | ^ ~ +&& || ^^ + +or +and +not +with +at +xor + +---------------------------------------------------- + +[ + ["operator", "+"], + ["operator", "-"], + ["operator", "%"], + ["operator", "*"], + ["operator", "**"], + ["operator", "/"], + ["operator", "+="], + ["operator", "-="], + ["operator", "%="], + ["operator", "*="], + ["operator", "**="], + ["operator", "/="], + ["operator", ">>"], + ["operator", "<<"], + ["operator", "++"], + ["operator", "--"], + + ["operator", "="], + ["operator", "=="], + ["operator", "!="], + ["operator", "<>"], + ["operator", "<"], + ["operator", "<="], + ["operator", "="], + ["operator", ">"], + ["operator", ">"], + + ["operator", "&"], + ["operator", "|"], + ["operator", "^"], + ["operator", "~"], + ["operator", "&&"], + ["operator", "||"], + ["operator", "^^"], + + ["operator", "or"], + ["operator", "and"], + ["operator", "not"], + ["operator", "with"], + ["operator", "at"], + ["operator", "xor"] +] diff --git a/tests/languages/gml/variable_feature.test b/tests/languages/gml/variable_feature.test new file mode 100644 index 0000000000..80f33470e1 --- /dev/null +++ b/tests/languages/gml/variable_feature.test @@ -0,0 +1,106 @@ +if browser_height > window_get_height() || browser_width > window_get_width() + { + var xx, yy; + if browser_width > window_get_width() + { + xx = (browser_width - window_get_width()) / 2; + } + else + { + xx = 0; + } + if browser_height > window_get_height() + { + yy = (browser_height - window_get_height()) / 2; + } + else + { + yy = 0; + } + window_set_position(xx, yy); + } + +---------------------------------------------------- + +[ + ["keyword", "if"], + ["variable", "browser_height"], + ["operator", ">"], + ["function", "window_get_height"], + ["punctuation", "("], + ["punctuation", ")"], + ["operator", "||"], + ["variable", "browser_width"], + ["operator", ">"], + ["function", "window_get_width"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["keyword", "var"], + " xx", + ["punctuation", ","], + " yy", + ["punctuation", ";"], + ["keyword", "if"], + ["variable", "browser_width"], + ["operator", ">"], + ["function", "window_get_width"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + "\n\t\txx ", + ["operator", "="], + ["punctuation", "("], + ["variable", "browser_width"], + ["operator", "-"], + ["function", "window_get_width"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ")"], + ["operator", "/"], + ["number", "2"], + ["punctuation", ";"], + ["punctuation", "}"], + ["keyword", "else"], + ["punctuation", "{"], + "\n\t\txx ", + ["operator", "="], + ["number", "0"], + ["punctuation", ";"], + ["punctuation", "}"], + ["keyword", "if"], + ["variable", "browser_height"], + ["operator", ">"], + ["function", "window_get_height"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + "\n\t\tyy ", + ["operator", "="], + ["punctuation", "("], + ["variable", "browser_height"], + ["operator", "-"], + ["function", "window_get_height"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ")"], + ["operator", "/"], + ["number", "2"], + ["punctuation", ";"], + ["punctuation", "}"], + ["keyword", "else"], + ["punctuation", "{"], + "\n\t\tyy ", + ["operator", "="], + ["number", "0"], + ["punctuation", ";"], + ["punctuation", "}"], + ["function", "window_set_position"], + ["punctuation", "("], + "xx", + ["punctuation", ","], + " yy", + ["punctuation", ")"], + ["punctuation", ";"], + ["punctuation", "}"] +] \ No newline at end of file diff --git a/tests/languages/haml/filter_feature.test b/tests/languages/haml/filter_feature.test new file mode 100644 index 0000000000..a839b68e63 --- /dev/null +++ b/tests/languages/haml/filter_feature.test @@ -0,0 +1,20 @@ +:some-language + some code + +~ + :some-language + some code + +---------------------------------------------------- + +[ + ["filter", [ + ["filter-name", ":some-language"], + "\n\tsome code\n" + ]], + ["punctuation", "~"], + ["filter", [ + ["filter-name", ":some-language"], + "\n\t\tsome code" + ]] +] \ No newline at end of file diff --git a/tests/languages/hcl/interpolation_feature.test b/tests/languages/hcl/interpolation_feature.test index fc2b9b79f6..cb47c557ca 100644 --- a/tests/languages/hcl/interpolation_feature.test +++ b/tests/languages/hcl/interpolation_feature.test @@ -8,197 +8,244 @@ "${replace(var.sub_domain, ".", "\\\\\\\\.")}" "${filepath.foo}" +// keywords +"${terraform}" +"${var}" +"${self}" +"${count}" +"${module}" +"${path}" +"${data}" +"${local}" + ---------------------------------------------------- [ - ["string", - [ - "\"", - [ - "interpolation", - [ - ["punctuation", "$"], - ["punctuation", "{"], - ["keyword", "data"], - ["punctuation", "."], - ["type", "aws_availability_zones"], - ["punctuation", "."], - "available", - ["punctuation", "."], - "names", - ["punctuation", "["], - ["number", "0"], - ["punctuation", "]"], - ["punctuation", "}"] - ] - ], - "\"" - ] - ], - ["string", - [ - "\"", - [ - "interpolation", - [ - ["punctuation", "$"], - ["punctuation", "{"], - "aws_db_subnet_group", - ["punctuation", "."], - "default", - ["punctuation", "."], - "id", - ["punctuation", "}"] - ] - ], - "\"" - ] - ], - ["string", - [ - "\"", - [ - "interpolation", - [ - ["punctuation", "$"], - ["punctuation", "{"], - ["keyword", "var"], - ["punctuation", "."], - ["type", "something"], - ["punctuation", "?"], - ["number", "1"], - ["punctuation", ":"], - ["number", "0"], - ["punctuation", "}"] - ] - ], - "\"" - ] - ], - ["string", - [ - "\"", - [ - "interpolation", - [ - ["punctuation", "$"], - ["punctuation", "{"], - ["keyword", "var"], - ["punctuation", "."], - ["type", "num"], - ["punctuation", "?"], - ["number", "1.02"], - ["punctuation", ":"], - ["number", "0"], - ["punctuation", "}"] - ] - ], - "\"" - ] - ], - ["string", - [ - "\"", - [ - "interpolation", - [ - ["punctuation", "$"], - ["punctuation", "{"], - ["function", "length"], - ["punctuation", "("], - ["keyword", "var"], - ["punctuation", "."], - ["type", "hostnames"], - ["punctuation", ")"], - ["punctuation", "}"] - ] - ], - "\"" - ] - ], - ["string", - [ - "\"", - [ - "interpolation", - [ - ["punctuation", "$"], - ["punctuation", "{"], - ["function", "format"], - ["punctuation", "("], - ["string", "\"web-%03d\""], - ["punctuation", ","], - ["keyword", "count"], - ["punctuation", "."], - ["type", "index"], - ["punctuation", "+"], - ["number", "1"], - ["punctuation", ")"], - ["punctuation", "}"] - ] - ], - "\"" - ] - ], - ["string", - [ - "\"", - [ - "interpolation", - [ - ["punctuation", "$"], - ["punctuation", "{"], - ["function", "file"], - ["punctuation", "("], - ["string", "\"templates/web_init.tpl\""], - ["punctuation", ")"], - ["punctuation", "}"] - ] - ], - "\"" - ] - ], - ["string", - [ - "\"", - [ - "interpolation", - [ - ["punctuation", "$"], - ["punctuation", "{"], - ["function", "replace"], - ["punctuation", "("], - ["keyword", "var"], - ["punctuation", "."], - ["type", "sub_domain"], - ["punctuation", ","], - ["string", "\".\""], - ["punctuation", ","], - ["string", "\"\\\\\\\\\\\\\\\\.\""], - ["punctuation", ")"], - ["punctuation", "}"] - ] - ], - "\"" - ] - ], - ["string", - [ - "\"", - [ - "interpolation", - [ - ["punctuation", "$"], - ["punctuation", "{"], - "filepath", - ["punctuation", "."], - "foo", - ["punctuation", "}"] - ] - ], - "\"" - ] - ] + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "data"], + ["punctuation", "."], + ["type", "aws_availability_zones"], + ["punctuation", "."], + "available", + ["punctuation", "."], + "names", + ["punctuation", "["], + ["number", "0"], + ["punctuation", "]"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + "aws_db_subnet_group", + ["punctuation", "."], + "default", + ["punctuation", "."], + "id", + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "var"], + ["punctuation", "."], + ["type", "something"], + ["punctuation", "?"], + ["number", "1"], + ["punctuation", ":"], + ["number", "0"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "var"], + ["punctuation", "."], + ["type", "num"], + ["punctuation", "?"], + ["number", "1.02"], + ["punctuation", ":"], + ["number", "0"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["function", "length"], + ["punctuation", "("], + ["keyword", "var"], + ["punctuation", "."], + ["type", "hostnames"], + ["punctuation", ")"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["function", "format"], + ["punctuation", "("], + ["string", "\"web-%03d\""], + ["punctuation", ","], + ["keyword", "count"], + ["punctuation", "."], + ["type", "index"], + ["punctuation", "+"], + ["number", "1"], + ["punctuation", ")"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["function", "file"], + ["punctuation", "("], + ["string", "\"templates/web_init.tpl\""], + ["punctuation", ")"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["function", "replace"], + ["punctuation", "("], + ["keyword", "var"], + ["punctuation", "."], + ["type", "sub_domain"], + ["punctuation", ","], + ["string", "\".\""], + ["punctuation", ","], + ["string", "\"\\\\\\\\\\\\\\\\.\""], + ["punctuation", ")"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + "filepath", + ["punctuation", "."], + "foo", + ["punctuation", "}"] + ]], + "\"" + ]], + + ["comment", "// keywords"], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "terraform"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "var"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "self"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "count"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "module"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "path"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "data"], + ["punctuation", "}"] + ]], + "\"" + ]], + ["string", [ + "\"", + ["interpolation", [ + ["punctuation", "$"], + ["punctuation", "{"], + ["keyword", "local"], + ["punctuation", "}"] + ]], + "\"" + ]] ] ---------------------------------------------------- diff --git a/tests/languages/hlsl/keyword_feature.test b/tests/languages/hlsl/keyword_feature.test index 9af9d38290..ac396e63ce 100644 --- a/tests/languages/hlsl/keyword_feature.test +++ b/tests/languages/hlsl/keyword_feature.test @@ -20,7 +20,7 @@ discard do dynamic_cast else -enum +enum; explicit export extern @@ -70,7 +70,7 @@ stateblock_state static static_cast string -struct +struct; switch tbuffer technique @@ -376,7 +376,8 @@ uint4x4 ["keyword", "dynamic_cast"], ["keyword", "else"], ["keyword", "enum"], - ["class-name", "explicit"], + ["punctuation", ";"], + ["keyword", "explicit"], ["keyword", "export"], ["keyword", "extern"], ["keyword", "for"], @@ -426,7 +427,8 @@ uint4x4 ["keyword", "static_cast"], ["keyword", "string"], ["keyword", "struct"], - ["class-name", "switch"], + ["punctuation", ";"], + ["keyword", "switch"], ["keyword", "tbuffer"], ["keyword", "technique"], ["keyword", "technique10"], @@ -708,4 +710,4 @@ uint4x4 ---------------------------------------------------- -Checks for keywords. +Checks for keywords. \ No newline at end of file diff --git a/tests/languages/iecst/boolean_feature.test b/tests/languages/iecst/boolean_feature.test new file mode 100644 index 0000000000..2ac4e43b57 --- /dev/null +++ b/tests/languages/iecst/boolean_feature.test @@ -0,0 +1,11 @@ +TRUE +FALSE +NULL + +---------------------------------------------------- + +[ + ["boolean", "TRUE"], + ["boolean", "FALSE"], + ["boolean", "NULL"] +] \ No newline at end of file diff --git a/tests/languages/javascript!+js-extras/exports_feature.test b/tests/languages/javascript!+js-extras/exports_feature.test index 67b7647bbb..82db3552f8 100644 --- a/tests/languages/javascript!+js-extras/exports_feature.test +++ b/tests/languages/javascript!+js-extras/exports_feature.test @@ -12,6 +12,7 @@ export {d} export {d,} export {d as Foo, b as Bar} export {d as Foo, b as Bar,} +export default const foo = 9; ---------------------------------------------------- @@ -147,5 +148,12 @@ export {d as Foo, b as Bar,} ["maybe-class-name", "Bar"], ["punctuation", ","], ["punctuation", "}"] - ]] + ]], + ["keyword", "export"], + ["keyword", "default"], + ["keyword", "const"], + " foo ", + ["operator", "="], + ["number", "9"], + ["punctuation", ";"] ] \ No newline at end of file diff --git a/tests/languages/javascript+haml/javascript_inclusion.test b/tests/languages/javascript+haml/javascript_inclusion.test index 2420e60f12..84e2c92436 100644 --- a/tests/languages/javascript+haml/javascript_inclusion.test +++ b/tests/languages/javascript+haml/javascript_inclusion.test @@ -3,7 +3,7 @@ ~ :javascript - 0xBadFace + 0xBadFace ---------------------------------------------------- @@ -21,4 +21,4 @@ ---------------------------------------------------- -Checks for JavaScript filter in Haml. The tilde serves only as a separator. \ No newline at end of file +Checks for JavaScript filter in Haml. The tilde serves only as a separator. diff --git a/tests/languages/jsstacktrace/function_feature.test b/tests/languages/jsstacktrace/function_feature.test index 2b5b51ce0f..649019650e 100644 --- a/tests/languages/jsstacktrace/function_feature.test +++ b/tests/languages/jsstacktrace/function_feature.test @@ -1,26 +1,53 @@ Some text at foo.bar + at DenoError (deno/js/errors.ts:22:5) + at new (_http_common.js:159:16) ---------------------------------------------------- [ ["error-message", "Some text"], - [ - "stack-frame", - [ - ["keyword", "at"], - [ - "function", - [ - "foo", - [ "punctuation", "." ], - "bar" - ] - ] - ] - ] + ["stack-frame", [ + ["keyword", "at"], + ["function", [ + "foo", + ["punctuation", "."], + "bar" + ]] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["function", [ + "DenoError" + ]], + ["punctuation", "("], + ["filename", "deno/js/errors.ts"], + ["line-number", [ + ["punctuation", ":"], + "22", + ["punctuation", ":"], + "5" + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["keyword", "at"], + ["keyword", "new"], + ["function", [ + "" + ]], + ["punctuation", "("], + ["filename", "_http_common.js"], + ["line-number", [ + ["punctuation", ":"], + "159", + ["punctuation", ":"], + "16" + ]], + ["punctuation", ")"] + ]] ] ---------------------------------------------------- -Checks basic a basic error message. +Checks basic a basic error message. \ No newline at end of file diff --git a/tests/languages/jsstacktrace/notmycode_feature.test b/tests/languages/jsstacktrace/notmycode_feature.test index 8f3aba22c3..47bb406e1a 100644 --- a/tests/languages/jsstacktrace/notmycode_feature.test +++ b/tests/languages/jsstacktrace/notmycode_feature.test @@ -1,18 +1,44 @@ Some text + at new Foo (foo.js:3:7) at processTicksAndRejections (internal/process/task_queues.js:98:32) +Foo + at throwsA (:1:23) + at :1:13 + ---------------------------------------------------- [ ["error-message", "Some text"], - [ - "stack-frame", - [ - ["not-my-code", "\tat processTicksAndRejections (internal/process/task_queues.js:98:32)"] - ] - ] + ["stack-frame", [ + ["keyword", "at"], + ["keyword", "new"], + ["function", [ + "Foo" + ]], + ["punctuation", "("], + ["filename", "foo.js"], + ["line-number", [ + ["punctuation", ":"], + "3", + ["punctuation", ":"], + "7" + ]], + ["punctuation", ")"] + ]], + ["stack-frame", [ + ["not-my-code", "\tat processTicksAndRejections (internal/process/task_queues.js:98:32)"] + ]], + + ["error-message", "Foo"], + ["stack-frame", [ + ["not-my-code", " at throwsA (:1:23)"] + ]], + ["stack-frame", [ + ["not-my-code", " at :1:13"] + ]] ] ---------------------------------------------------- -Checks greying out internal / library code stack trace frames +Checks greying out internal / library code stack trace frames \ No newline at end of file diff --git a/tests/languages/lisp/defun_feature.test b/tests/languages/lisp/defun_feature.test index ac1609cf4a..0cb51235a6 100644 --- a/tests/languages/lisp/defun_feature.test +++ b/tests/languages/lisp/defun_feature.test @@ -19,6 +19,12 @@ (or (apply 'cl-member thing thing-list :allow-other-keys t rest) (if need (error "Thing not found")))) +(defun foo (a b &optional (c 3 c-supplied-p)) + (list a b c c-supplied-p)) + +(defun foo (&key ((:apple a)) ((:box b) 0) ((:charlie c) 0 c-supplied-p)) + (list a b c c-supplied-p)) + ---------------------------------------------------- [ @@ -212,6 +218,72 @@ ["punctuation", ")"], ["punctuation", ")"], ["punctuation", ")"], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "foo"], + ["punctuation", "("], + ["arguments", [ + ["argument", "a"], + ["argument", "b"], + ["other-marker-vars", [ + ["lisp-marker", "&optional"], + ["varform", [ + ["punctuation", "("], + ["car", "c"], + ["number", "3"], + " c-supplied-p", + ["punctuation", ")"] + ]] + ]] + ]], + ["punctuation", ")"] + ]], + ["punctuation", "("], + ["car", "list"], + " a b c c-supplied-p", + ["punctuation", ")"], + ["punctuation", ")"], + + ["punctuation", "("], + ["defun", [ + ["keyword", "defun"], + ["function", "foo"], + ["punctuation", "("], + ["arguments", [ + ["keys", [ + ["lisp-marker", "&key"], + ["punctuation", "("], + ["punctuation", "("], + ["lisp-property", ":apple"], + ["argument", "a"], + ["punctuation", ")"], + ["punctuation", ")"], + ["punctuation", "("], + ["punctuation", "("], + ["lisp-property", ":box"], + ["argument", "b"], + ["punctuation", ")"], + ["number", "0"], + ["punctuation", ")"], + ["punctuation", "("], + ["punctuation", "("], + ["lisp-property", ":charlie"], + ["argument", "c"], + ["punctuation", ")"], + ["number", "0"], + ["argument", "c-supplied-p"], + ["punctuation", ")"] + ]] + ]], + ["punctuation", ")"] + ]], + ["punctuation", "("], + ["car", "list"], + " a b c c-supplied-p", + ["punctuation", ")"], ["punctuation", ")"] ] diff --git a/tests/languages/livescript+pug/livescript_inclusion.test b/tests/languages/livescript+pug/livescript_inclusion.test new file mode 100644 index 0000000000..5e3dd6e890 --- /dev/null +++ b/tests/languages/livescript+pug/livescript_inclusion.test @@ -0,0 +1,28 @@ +:livescript + "#foo #{ if /test/ == 'test' then 3 else 4}" + +---------------------------------------------------- + +[ + ["filter-livescript", [ + ["filter-name", ":livescript"], + ["interpolated-string", [ + ["string", "\""], + ["variable", "#foo"], + ["string", " "], + ["interpolation", [ + ["interpolation-punctuation", "#{"], + ["keyword", "if"], + ["regex", "/test/"], + ["operator", "=="], + ["string", "'test'"], + ["keyword", "then"], + ["number", "3"], + ["keyword", "else"], + ["number", "4"], + ["interpolation-punctuation", "}"] + ]], + ["string", "\""] + ]] + ]] +] \ No newline at end of file diff --git a/tests/languages/php/class-name_feature.test b/tests/languages/php/class-name_feature.test index 8b3b824811..cb915e4c95 100644 --- a/tests/languages/php/class-name_feature.test +++ b/tests/languages/php/class-name_feature.test @@ -16,6 +16,9 @@ function f($variable): ?Foo {} function f(Foo|Bar $variable): Foo|Bar {} +function f(Foo|false $variable): Foo|Bar {} +function f(Foo|null $variable): Foo|Bar {} + function f(\Package\Foo|\Package\Bar $variable): \Package\Foo|\Package\Bar {} class Foo extends Bar implements Baz {} @@ -134,6 +137,35 @@ class Foo extends \Package\Bar implements App\Baz {} ["punctuation", "{"], ["punctuation", "}"], + ["keyword", "function"], + ["function", "f"], + ["punctuation", "("], + ["class-name", "Foo"], + ["operator", "|"], + ["keyword", "false"], + ["variable", "$variable"], + ["punctuation", ")"], + ["punctuation", ":"], + ["class-name", "Foo"], + ["operator", "|"], + ["class-name", "Bar"], + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "function"], + ["function", "f"], + ["punctuation", "("], + ["class-name", "Foo"], + ["operator", "|"], + ["keyword", "null"], + ["variable", "$variable"], + ["punctuation", ")"], + ["punctuation", ":"], + ["class-name", "Foo"], + ["operator", "|"], + ["class-name", "Bar"], + ["punctuation", "{"], + ["punctuation", "}"], + ["keyword", "function"], ["function", "f"], ["punctuation", "("], diff --git a/tests/languages/phpdoc/class-name_feature.test b/tests/languages/phpdoc/class-name_feature.test index b55784be3a..284f742123 100644 --- a/tests/languages/phpdoc/class-name_feature.test +++ b/tests/languages/phpdoc/class-name_feature.test @@ -5,6 +5,26 @@ * @throws \foo\MyException if something bad happens */ +/** + * @param callback $parameter + * @param resource $parameter + * @param boolean $parameter + * @param integer $parameter + * @param double $parameter + * @param object $parameter + * @param string $parameter + * @param array $parameter + * @param false $parameter + * @param float $parameter + * @param mixed $parameter + * @param bool $parameter + * @param null $parameter + * @param self $parameter + * @param true $parameter + * @param void $parameter + * @param int $parameter + */ + ---------------------------------------------------- [ @@ -37,9 +57,111 @@ ["punctuation", "\\"], "MyException" ]], - " if something bad happens\n */" + " if something bad happens\n */\n\n/**\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "callback"] + ]], + ["parameter", "$parameter"], + "\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "resource"] + ]], + ["parameter", "$parameter"], + "\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "boolean"] + ]], + ["parameter", "$parameter"], + "\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "integer"] + ]], + ["parameter", "$parameter"], + "\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "double"] + ]], + ["parameter", "$parameter"], + "\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "object"] + ]], + ["parameter", "$parameter"], + "\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "string"] + ]], + ["parameter", "$parameter"], + "\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "array"] + ]], + ["parameter", "$parameter"], + "\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "false"] + ]], + ["parameter", "$parameter"], + "\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "float"] + ]], + ["parameter", "$parameter"], + "\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "mixed"] + ]], + ["parameter", "$parameter"], + "\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "bool"] + ]], + ["parameter", "$parameter"], + "\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "null"] + ]], + ["parameter", "$parameter"], + "\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "self"] + ]], + ["parameter", "$parameter"], + "\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "true"] + ]], + ["parameter", "$parameter"], + "\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "void"] + ]], + ["parameter", "$parameter"], + "\n * ", + ["keyword", "@param"], + ["class-name", [ + ["keyword", "int"] + ]], + ["parameter", "$parameter"], + "\n */" ] ---------------------------------------------------- -Checks for class names. +Checks for class names. \ No newline at end of file diff --git a/tests/languages/promql/keyword_feature.test b/tests/languages/promql/keyword_feature.test new file mode 100644 index 0000000000..0d2fb81d87 --- /dev/null +++ b/tests/languages/promql/keyword_feature.test @@ -0,0 +1,43 @@ +sum +min +max +avg +group +stddev +stdvar +count +count_values +bottomk +topk +quantile +on +ignoring +group_right +group_left +by +without +offset + +---------------------------------------------------- + +[ + ["keyword", "sum"], + ["keyword", "min"], + ["keyword", "max"], + ["keyword", "avg"], + ["keyword", "group"], + ["keyword", "stddev"], + ["keyword", "stdvar"], + ["keyword", "count"], + ["keyword", "count_values"], + ["keyword", "bottomk"], + ["keyword", "topk"], + ["keyword", "quantile"], + ["keyword", "on"], + ["keyword", "ignoring"], + ["keyword", "group_right"], + ["keyword", "group_left"], + ["keyword", "by"], + ["keyword", "without"], + ["keyword", "offset"] +] \ No newline at end of file diff --git a/tests/languages/pug/filter_feature.test b/tests/languages/pug/filter_feature.test new file mode 100644 index 0000000000..8bd87b9cf2 --- /dev/null +++ b/tests/languages/pug/filter_feature.test @@ -0,0 +1,11 @@ +:language + code + +---------------------------------------------------- + +[ + ["filter", [ + ["filter-name", ":language"], + "\n\tcode" + ]] +] \ No newline at end of file diff --git a/tests/languages/purebasic/asm_feature.test b/tests/languages/purebasic/asm_feature.test index 713aa418eb..71f1bab51b 100644 --- a/tests/languages/purebasic/asm_feature.test +++ b/tests/languages/purebasic/asm_feature.test @@ -12,6 +12,39 @@ Procedure.i XorTwoBlocks2(*buffer1, *buffer2, length) ProcedureReturn 0 EndProcedure +!jne label1 +!jmp @b +!EXTERN printf +!DEFAULT rel + +; source: http://www.jose.it-berater.org/smfforum/index.php?topic=5091.0 +Procedure PopCount64(x.q) + !mov rax, [p.v_x] + !mov rdx, rax + !shr rdx, 1 + !and rdx, [popcount64_v55] + !sub rax, rdx + ;x = (x & $3333333333333333) + ((x >> 2) & $3333333333333333) + !mov rdx, rax ;x + !and rax, [popcount64_v33] + !shr rdx, 2 + !and rdx, [popcount64_v33] + !add rax, rdx + ;x = (x + (x >> 4)) & $0f0f0f0f0f0f0f0f0f0f + !mov rdx, rax + !shr rdx, 4 + !add rax, rdx + !and rax, [popcount64_v0f] + ;x * $0101010101010101 >> 56 + !imul rax, [popcount64_v01] + !shr rax, 56 + ProcedureReturn + !popcount64_v01: dq 0x0101010101010101 + !popcount64_v0f: dq 0x0f0f0f0f0f0f0f0f + !popcount64_v33: dq 0x3333333333333333 + !popcount64_v55: dq 0x5555555555555555 +EndProcedure + ---------------------------------------------------- [ @@ -114,5 +147,193 @@ EndProcedure ["comment", "; jumb back to first anonymous label behind"], ["keyword", "ProcedureReturn"], ["number", "0"], + ["keyword", "EndProcedure"], + + ["asm", [ + ["operator", "!"], + ["function", "jne"], + ["label-reference-addressed", "label1"] + ]], + ["asm", [ + ["operator", "!"], + ["function", "jmp"], + ["label-reference-anonymous", "@b"] + ]], + ["asm", [ + ["operator", "!"], + ["keyword", "EXTERN printf"] + ]], + ["asm", [ + ["operator", "!"], + ["keyword", "DEFAULT rel"] + ]], + + ["comment", "; source: http://www.jose.it-berater.org/smfforum/index.php?topic=5091.0"], + ["keyword", "Procedure"], + ["function", "PopCount64"], + ["punctuation", "("], + "x", + ["punctuation", "."], + "q", + ["punctuation", ")"], + ["asm", [ + ["operator", "!"], + ["function", "mov"], + ["register", "rax"], + ["operator", ","], + ["operator", "["], + "p", + ["operator", "."], + "v_x", + ["operator", "]"] + ]], + ["asm", [ + ["operator", "!"], + ["function", "mov"], + ["register", "rdx"], + ["operator", ","], + ["register", "rax"] + ]], + ["asm", [ + ["operator", "!"], + ["function", "shr"], + ["register", "rdx"], + ["operator", ","], + ["number", "1"] + ]], + ["asm", [ + ["operator", "!"], + ["function", "and"], + ["register", "rdx"], + ["operator", ","], + ["operator", "["], + "popcount64_v55", + ["operator", "]"] + ]], + ["asm", [ + ["operator", "!"], + ["function", "sub"], + ["register", "rax"], + ["operator", ","], + ["register", "rdx"] + ]], + ["comment", ";x = (x & $3333333333333333) + ((x >> 2) & $3333333333333333)"], + ["asm", [ + ["operator", "!"], + ["function", "mov"], + ["register", "rdx"], + ["operator", ","], + ["register", "rax"] + ]], + ["comment", ";x"], + ["asm", [ + ["operator", "!"], + ["function", "and"], + ["register", "rax"], + ["operator", ","], + ["operator", "["], + "popcount64_v33", + ["operator", "]"] + ]], + ["asm", [ + ["operator", "!"], + ["function", "shr"], + ["register", "rdx"], + ["operator", ","], + ["number", "2"] + ]], + ["asm", [ + ["operator", "!"], + ["function", "and"], + ["register", "rdx"], + ["operator", ","], + ["operator", "["], + "popcount64_v33", + ["operator", "]"] + ]], + ["asm", [ + ["operator", "!"], + ["function", "add"], + ["register", "rax"], + ["operator", ","], + ["register", "rdx"] + ]], + ["comment", ";x = (x + (x >> 4)) & $0f0f0f0f0f0f0f0f0f0f"], + ["asm", [ + ["operator", "!"], + ["function", "mov"], + ["register", "rdx"], + ["operator", ","], + ["register", "rax"] + ]], + ["asm", [ + ["operator", "!"], + ["function", "shr"], + ["register", "rdx"], + ["operator", ","], + ["number", "4"] + ]], + ["asm", [ + ["operator", "!"], + ["function", "add"], + ["register", "rax"], + ["operator", ","], + ["register", "rdx"] + ]], + ["asm", [ + ["operator", "!"], + ["function", "and"], + ["register", "rax"], + ["operator", ","], + ["operator", "["], + "popcount64_v0f", + ["operator", "]"] + ]], + ["comment", ";x * $0101010101010101 >> 56"], + ["asm", [ + ["operator", "!"], + ["function", "imul"], + ["register", "rax"], + ["operator", ","], + ["operator", "["], + "popcount64_v01", + ["operator", "]"] + ]], + ["asm", [ + ["operator", "!"], + ["function", "shr"], + ["register", "rax"], + ["operator", ","], + ["number", "56"] + ]], + ["keyword", "ProcedureReturn"], + ["asm", [ + ["operator", "!"], + ["label", "popcount64_v01"], + ["operator", ":"], + ["function-inline", "dq"], + ["number", "0x0101010101010101"] + ]], + ["asm", [ + ["operator", "!"], + ["label", "popcount64_v0f"], + ["operator", ":"], + ["function-inline", "dq"], + ["number", "0x0f0f0f0f0f0f0f0f"] + ]], + ["asm", [ + ["operator", "!"], + ["label", "popcount64_v33"], + ["operator", ":"], + ["function-inline", "dq"], + ["number", "0x3333333333333333"] + ]], + ["asm", [ + ["operator", "!"], + ["label", "popcount64_v55"], + ["operator", ":"], + ["function-inline", "dq"], + ["number", "0x5555555555555555"] + ]], ["keyword", "EndProcedure"] -] \ No newline at end of file +] diff --git a/tests/languages/purescript/keyword_feature.test b/tests/languages/purescript/keyword_feature.test index 339da635eb..23acb983c2 100644 --- a/tests/languages/purescript/keyword_feature.test +++ b/tests/languages/purescript/keyword_feature.test @@ -5,6 +5,7 @@ data derive do else +forall if in infixl @@ -22,28 +23,29 @@ where ---------------------------------------------------- [ - ["keyword", "ado"], - ["keyword", "case"], - ["keyword", "class"], - ["keyword", "data"], - ["keyword", "derive"], - ["keyword", "do"], - ["keyword", "else"], - ["keyword", "if"], - ["keyword", "in"], - ["keyword", "infixl"], - ["keyword", "infixr"], - ["keyword", "instance"], - ["keyword", "let"], - ["keyword", "module"], - ["keyword", "newtype"], - ["keyword", "of"], - ["keyword", "primitive"], - ["keyword", "then"], - ["keyword", "type"], - ["keyword", "where"] + ["keyword", "ado"], + ["keyword", "case"], + ["keyword", "class"], + ["keyword", "data"], + ["keyword", "derive"], + ["keyword", "do"], + ["keyword", "else"], + ["keyword", "forall"], + ["keyword", "if"], + ["keyword", "in"], + ["keyword", "infixl"], + ["keyword", "infixr"], + ["keyword", "instance"], + ["keyword", "let"], + ["keyword", "module"], + ["keyword", "newtype"], + ["keyword", "of"], + ["keyword", "primitive"], + ["keyword", "then"], + ["keyword", "type"], + ["keyword", "where"] ] ---------------------------------------------------- -Checks for all keywords. +Checks for all keywords. \ No newline at end of file diff --git a/tests/languages/renpy/property_feature.test b/tests/languages/renpy/property_feature.test new file mode 100644 index 0000000000..196cfff2c1 --- /dev/null +++ b/tests/languages/renpy/property_feature.test @@ -0,0 +1,469 @@ +insensitive +idle +hover +selected_idle +selected_hover +background +position +alt +xpos +ypos +pos +xanchor +yanchor +anchor +xalign +yalign +align +xcenter +ycenter +xofsset +yoffset +ymaximum +maximum +xmaximum +xminimum +yminimum +minimum +xsize +ysizexysize +xfill +yfill +area +antialias +black_color +bold +caret +color +first_indent +font +size +italic +justify +kerning +language +layout +line_leading +line_overlap_split +line_spacing +min_width +newline_indent +outlines +rest_indent +ruby_style +slow_cps +slow_cps_multiplier +strikethrough +text_align +underline +hyperlink_functions +vertical +hinting +foreground +left_margin +xmargin +top_margin +bottom_margin +ymargin +left_padding +right_padding +xpadding +top_padding +bottom_padding +ypadding +size_group +child +hover_sound +activate_sound +mouse +focus_mask +keyboard_focus +bar_vertical +bar_invert +bar_resizing +left_gutter +right_gutter +top_gutter +bottom_gutter +left_bar +right_bar +top_bar +bottom_bar +thumb +thumb_shadow +thumb_offset +unscrollable +spacing +first_spacing +box_reverse +box_wrap +order_reverse +fit_first +ysize +thumbnail_width +thumbnail_height +help +text_ypos +text_xpos +idle_color +hover_color +selected_idle_color +selected_hover_color +insensitive_color +alpha +insensitive_background +hover_background +zorder +value +width +xadjustment +xanchoraround +xaround +xinitial +xoffset +xzoom +yadjustment +yanchoraround +yaround +yinitial +yzoom +zoom +ground +height +text_style +text_y_fudge +selected_insensitive +has_sound +has_music +has_voice +focus +hovered +image_style +length +minwidth +mousewheel +offset +prefix +radius +range +right_margin +rotate +rotate_pad +developer +screen_width +screen_height +window_title +name +version +windows_icon +default_fullscreen +default_text_cps +default_afm_time +main_menu_music +sample_sound +enter_sound +exit_sound +save_directory +enter_transition +exit_transition +intra_transition +main_game_transition +game_main_transition +end_splash_transition +end_game_transition +after_load_transition +window_show_transition +window_hide_transition +adv_nvl_transition +nvl_adv_transition +enter_yesno_transition +exit_yesno_transition +enter_replay_transition +exit_replay_transition +say_attribute_transition +directory_name +executable_name +include_update +window_icon +modal +google_play_key +google_play_salt +drag_name +drag_handle +draggable +dragged +droppable +dropped +narrator_menu +action +default_afm_enable +version_name +version_tuple +inside +fadeout +fadein +layers +layer_clipping +linear +scrollbars +side_xpos +side_ypos +side_spacing +edgescroll +drag_joined +drag_raise +drop_shadow +drop_shadow_color +subpixel +easein +easeout +time +crop +auto +update +get_installed_packages +can_update +UpdateVersion +Update +overlay_functions +translations +window_left_padding +show_side_image +show_two_window + +---------------------------------------------------- + +[ + ["property", "insensitive"], + ["property", "idle"], + ["property", "hover"], + ["property", "selected_idle"], + ["property", "selected_hover"], + ["property", "background"], + ["property", "position"], + ["property", "alt"], + ["property", "xpos"], + ["property", "ypos"], + ["property", "pos"], + ["property", "xanchor"], + ["property", "yanchor"], + ["property", "anchor"], + ["property", "xalign"], + ["property", "yalign"], + ["property", "align"], + ["property", "xcenter"], + ["property", "ycenter"], + ["property", "xofsset"], + ["property", "yoffset"], + ["property", "ymaximum"], + ["property", "maximum"], + ["property", "xmaximum"], + ["property", "xminimum"], + ["property", "yminimum"], + ["property", "minimum"], + ["property", "xsize"], + ["property", "ysizexysize"], + ["property", "xfill"], + ["property", "yfill"], + ["property", "area"], + ["property", "antialias"], + ["property", "black_color"], + ["property", "bold"], + ["property", "caret"], + ["property", "color"], + ["property", "first_indent"], + ["property", "font"], + ["property", "size"], + ["property", "italic"], + ["property", "justify"], + ["property", "kerning"], + ["property", "language"], + ["property", "layout"], + ["property", "line_leading"], + ["property", "line_overlap_split"], + ["property", "line_spacing"], + ["property", "min_width"], + ["property", "newline_indent"], + ["property", "outlines"], + ["property", "rest_indent"], + ["property", "ruby_style"], + ["property", "slow_cps"], + ["property", "slow_cps_multiplier"], + ["property", "strikethrough"], + ["property", "text_align"], + ["property", "underline"], + ["property", "hyperlink_functions"], + ["property", "vertical"], + ["property", "hinting"], + ["property", "foreground"], + ["property", "left_margin"], + ["property", "xmargin"], + ["property", "top_margin"], + ["property", "bottom_margin"], + ["property", "ymargin"], + ["property", "left_padding"], + ["property", "right_padding"], + ["property", "xpadding"], + ["property", "top_padding"], + ["property", "bottom_padding"], + ["property", "ypadding"], + ["property", "size_group"], + ["property", "child"], + ["property", "hover_sound"], + ["property", "activate_sound"], + ["property", "mouse"], + ["property", "focus_mask"], + ["property", "keyboard_focus"], + ["property", "bar_vertical"], + ["property", "bar_invert"], + ["property", "bar_resizing"], + ["property", "left_gutter"], + ["property", "right_gutter"], + ["property", "top_gutter"], + ["property", "bottom_gutter"], + ["property", "left_bar"], + ["property", "right_bar"], + ["property", "top_bar"], + ["property", "bottom_bar"], + ["property", "thumb"], + ["property", "thumb_shadow"], + ["property", "thumb_offset"], + ["property", "unscrollable"], + ["property", "spacing"], + ["property", "first_spacing"], + ["property", "box_reverse"], + ["property", "box_wrap"], + ["property", "order_reverse"], + ["property", "fit_first"], + ["property", "ysize"], + ["property", "thumbnail_width"], + ["property", "thumbnail_height"], + ["property", "help"], + ["property", "text_ypos"], + ["property", "text_xpos"], + ["property", "idle_color"], + ["property", "hover_color"], + ["property", "selected_idle_color"], + ["property", "selected_hover_color"], + ["property", "insensitive_color"], + ["property", "alpha"], + ["property", "insensitive_background"], + ["property", "hover_background"], + ["property", "zorder"], + ["property", "value"], + ["property", "width"], + ["property", "xadjustment"], + ["property", "xanchoraround"], + ["property", "xaround"], + ["property", "xinitial"], + ["property", "xoffset"], + ["property", "xzoom"], + ["property", "yadjustment"], + ["property", "yanchoraround"], + ["property", "yaround"], + ["property", "yinitial"], + ["property", "yzoom"], + ["property", "zoom"], + ["property", "ground"], + ["property", "height"], + ["property", "text_style"], + ["property", "text_y_fudge"], + ["property", "selected_insensitive"], + ["property", "has_sound"], + ["property", "has_music"], + ["property", "has_voice"], + ["property", "focus"], + ["property", "hovered"], + ["property", "image_style"], + ["property", "length"], + ["property", "minwidth"], + ["property", "mousewheel"], + ["property", "offset"], + ["property", "prefix"], + ["property", "radius"], + ["property", "range"], + ["property", "right_margin"], + ["property", "rotate"], + ["property", "rotate_pad"], + ["property", "developer"], + ["property", "screen_width"], + ["property", "screen_height"], + ["property", "window_title"], + ["property", "name"], + ["property", "version"], + ["property", "windows_icon"], + ["property", "default_fullscreen"], + ["property", "default_text_cps"], + ["property", "default_afm_time"], + ["property", "main_menu_music"], + ["property", "sample_sound"], + ["property", "enter_sound"], + ["property", "exit_sound"], + ["property", "save_directory"], + ["property", "enter_transition"], + ["property", "exit_transition"], + ["property", "intra_transition"], + ["property", "main_game_transition"], + ["property", "game_main_transition"], + ["property", "end_splash_transition"], + ["property", "end_game_transition"], + ["property", "after_load_transition"], + ["property", "window_show_transition"], + ["property", "window_hide_transition"], + ["property", "adv_nvl_transition"], + ["property", "nvl_adv_transition"], + ["property", "enter_yesno_transition"], + ["property", "exit_yesno_transition"], + ["property", "enter_replay_transition"], + ["property", "exit_replay_transition"], + ["property", "say_attribute_transition"], + ["property", "directory_name"], + ["property", "executable_name"], + ["property", "include_update"], + ["property", "window_icon"], + ["property", "modal"], + ["property", "google_play_key"], + ["property", "google_play_salt"], + ["property", "drag_name"], + ["property", "drag_handle"], + ["property", "draggable"], + ["property", "dragged"], + ["property", "droppable"], + ["property", "dropped"], + ["property", "narrator_menu"], + ["property", "action"], + ["property", "default_afm_enable"], + ["property", "version_name"], + ["property", "version_tuple"], + ["property", "inside"], + ["property", "fadeout"], + ["property", "fadein"], + ["property", "layers"], + ["property", "layer_clipping"], + ["property", "linear"], + ["property", "scrollbars"], + ["property", "side_xpos"], + ["property", "side_ypos"], + ["property", "side_spacing"], + ["property", "edgescroll"], + ["property", "drag_joined"], + ["property", "drag_raise"], + ["property", "drop_shadow"], + ["property", "drop_shadow_color"], + ["property", "subpixel"], + ["property", "easein"], + ["property", "easeout"], + ["property", "time"], + ["property", "crop"], + ["property", "auto"], + ["property", "update"], + ["property", "get_installed_packages"], + ["property", "can_update"], + ["property", "UpdateVersion"], + ["property", "Update"], + ["property", "overlay_functions"], + ["property", "translations"], + ["property", "window_left_padding"], + ["property", "show_side_image"], + ["property", "show_two_window"] +] \ No newline at end of file diff --git a/tests/languages/ruby+haml/ruby_inclusion.test b/tests/languages/ruby+haml/ruby_inclusion.test new file mode 100644 index 0000000000..1ac8462c9a --- /dev/null +++ b/tests/languages/ruby+haml/ruby_inclusion.test @@ -0,0 +1,50 @@ +:ruby + def circumference + Math::PI * radius ** 2 + end + +~ + :ruby + def circumference + Math::PI * radius ** 2 + end + +---------------------------------------------------- + +[ + ["filter-ruby", [ + ["filter-name", ":ruby"], + ["keyword", "def"], + ["method-definition", [ + ["function", "circumference"] + ]], + ["constant", "Math"], + ["punctuation", ":"], + ["punctuation", ":"], + ["constant", "PI"], + ["operator", "*"], + " radius ", + ["operator", "*"], + ["operator", "*"], + ["number", "2"], + ["keyword", "end"] + ]], + ["punctuation", "~"], + ["filter-ruby", [ + ["filter-name", ":ruby"], + ["keyword", "def"], + ["method-definition", [ + ["function", "circumference"] + ]], + ["constant", "Math"], + ["punctuation", ":"], + ["punctuation", ":"], + ["constant", "PI"], + ["operator", "*"], + " radius ", + ["operator", "*"], + ["operator", "*"], + ["number", "2"], + ["keyword", "end"] + ]] +] \ No newline at end of file diff --git a/tests/languages/sql+sas/sql_inclusion.test b/tests/languages/sql+sas/sql_inclusion.test index 4b4bd553c1..0abf80271a 100644 --- a/tests/languages/sql+sas/sql_inclusion.test +++ b/tests/languages/sql+sas/sql_inclusion.test @@ -38,196 +38,215 @@ proc sql; select * form proclib.jobs(pw=red); title +proc sql; + connect to oracle as ora2 (user=user-id password=password); + select * from connection to ora2 (select lname, fname, state from staff); + disconnect from ora2; +quit; + ---------------------------------------------------- [ ["step", "proc sql"], ["punctuation", ";"], - ["proc-sql", - [ - ["sql", - [ - ["keyword", "select"], - ["operator", "*"], - ["keyword", "from"], - " proclib", - ["punctuation", "."], - "paylist", - ["punctuation", ";"] - ] - ] - ] - ], + ["proc-sql", [ + ["sql", [ + ["keyword", "select"], + ["operator", "*"], + ["keyword", "from"], + " proclib", + ["punctuation", "."], + "paylist", + ["punctuation", ";"] + ]] + ]], ["step", "proc print"], ["punctuation", ";"], + ["step", "proc sql"], - ["proc-args", - [ - ["arg", "outobs"], - ["operator", "="], - ["number", "10"], + ["proc-args", [ + ["arg", "outobs"], + ["operator", "="], + ["number", "10"], + ["punctuation", ";"] + ]], + ["proc-sql", [ + ["global-statements", "title"], + ["string", "'Proclib.Payroll'"], + ["punctuation", ";"], + ["sql", [ + ["keyword", "select"], + ["operator", "*"], + ["keyword", "from"], + " proclib", + ["punctuation", "."], + "payroll", ["punctuation", ";"] - ] - ], - ["proc-sql", - [ - ["global-statements", "title"], - ["string", "'Proclib.Payroll'"], - ["punctuation", ";"], - ["sql", - [ - ["keyword", "select"], - ["operator", "*"], - ["keyword", "from"], - " proclib", - ["punctuation", "."], - "payroll", - ["punctuation", ";"] - ] - ], - ["global-statements", "title"], - ["punctuation", ";"] - ] - ], + ]], + ["global-statements", "title"], + ["punctuation", ";"] + ]], ["step", "quit"], ["punctuation", ";"], + ["step", "proc sql"], ["punctuation", ";"], - ["proc-sql", - [ - ["sql", - [ - ["keyword", "select"], - " BookingDate", - ["punctuation", ","], - "\r\n\tReleaseDate", - ["punctuation", ","], - "\r\n\tReleaseCode\r\n\t", - ["keyword", "from"], - " SASclass", - ["punctuation", "."], - "Bookings", - ["punctuation", ";"] - ] - ] - ] - ], + ["proc-sql", [ + ["sql", [ + ["keyword", "select"], + " BookingDate", + ["punctuation", ","], + "\r\n\tReleaseDate", + ["punctuation", ","], + "\r\n\tReleaseCode\r\n\t", + ["keyword", "from"], + " SASclass", + ["punctuation", "."], + "Bookings", + ["punctuation", ";"] + ]] + ]], ["step", "quit"], ["punctuation", ";"], + ["step", "proc sql"], ["punctuation", ";"], - ["proc-sql", - [ - ["sql", - [ - ["keyword", "select"], - " BookingDate", - ["punctuation", ","], - "\r\n\tReleaseDate", - ["punctuation", ","], - "\r\n\tReleaseCode\r\n\t", - ["keyword", "from"], - " SASclass", - ["punctuation", "."], - "Bookings", - ["punctuation", ";"] - ] - ] - ] - ], + ["proc-sql", [ + ["sql", [ + ["keyword", "select"], + " BookingDate", + ["punctuation", ","], + "\r\n\tReleaseDate", + ["punctuation", ","], + "\r\n\tReleaseCode\r\n\t", + ["keyword", "from"], + " SASclass", + ["punctuation", "."], + "Bookings", + ["punctuation", ";"] + ]] + ]], ["step", "quit"], ["punctuation", ";"], + ["keyword", "libname"], " proclib ", ["string", "'SAS-library'"], ["punctuation", ";"], ["step", "proc sql"], ["punctuation", ";"], - ["proc-sql", - [ - ["sql", - [ - ["keyword", "create"], - ["keyword", "view"], - " proclib", - ["punctuation", "."], - "jobs", - ["punctuation", "("], - "pw", - ["operator", "-"], - "red", - ["punctuation", ")"], - ["keyword", "as"], - ["keyword", "select"], - " Jobcode", - ["punctuation", ","], - ["function", "count"], - ["punctuation", "("], - "jobcode", - ["punctuation", ")"], - ["keyword", "as"], - " number label", - ["operator", "="], - ["string", "'Number'"], - ["punctuation", ","], - ["function", "avg"], - ["punctuation", "("], - ["keyword", "int"], - ["punctuation", "("], - "today", - ["punctuation", "("], - ["punctuation", ")"], - ["operator", "-"], - "birth", - ["operator", "/"], - ["number", "365.25"], - ["punctuation", ")"], - ["punctuation", ")"], - ["keyword", "as"], - " avgage\r\n\t\t\tformat", - ["operator", "="], - ["number", "2."], - " label", - ["operator", "="], - ["string", "'Average Salary'"], - ["keyword", "from"], - " Payroll\r\n\t", - ["keyword", "group"], - ["keyword", "by"], - " Jobcode\r\n\t", - ["keyword", "having"], - " avage ge ", - ["number", "30"], - ["punctuation", ";"] - ] - ], - ["global-statements", "title1"], - ["string", "'Current Summary Information for Each Job category'"], - ["punctuation", ";"], - ["global-statements", "title2"], - ["string", "'Average Age Greater Than or Equal to 30'"], - ["punctuation", ";"], - ["sql", - [ - ["keyword", "select"], - ["operator", "*"], - " form proclib", - ["punctuation", "."], - "jobs", - ["punctuation", "("], - "pw", - ["operator", "="], - "red", - ["punctuation", ")"], - ["punctuation", ";"] - ] - ], - ["global-statements", "title"] - ] - ] + ["proc-sql", [ + ["sql", [ + ["keyword", "create"], + ["keyword", "view"], + " proclib", + ["punctuation", "."], + "jobs", + ["punctuation", "("], + "pw", + ["operator", "-"], + "red", + ["punctuation", ")"], + ["keyword", "as"], + ["keyword", "select"], + " Jobcode", + ["punctuation", ","], + ["function", "count"], + ["punctuation", "("], + "jobcode", + ["punctuation", ")"], + ["keyword", "as"], + " number label", + ["operator", "="], + ["string", "'Number'"], + ["punctuation", ","], + ["function", "avg"], + ["punctuation", "("], + ["keyword", "int"], + ["punctuation", "("], + "today", + ["punctuation", "("], + ["punctuation", ")"], + ["operator", "-"], + "birth", + ["operator", "/"], + ["number", "365.25"], + ["punctuation", ")"], + ["punctuation", ")"], + ["keyword", "as"], + " avgage\r\n\t\t\tformat", + ["operator", "="], + ["number", "2."], + " label", + ["operator", "="], + ["string", "'Average Salary'"], + ["keyword", "from"], + " Payroll\r\n\t", + ["keyword", "group"], + ["keyword", "by"], + " Jobcode\r\n\t", + ["keyword", "having"], + " avage ge ", + ["number", "30"], + ["punctuation", ";"] + ]], + ["global-statements", "title1"], + ["string", "'Current Summary Information for Each Job category'"], + ["punctuation", ";"], + ["global-statements", "title2"], + ["string", "'Average Age Greater Than or Equal to 30'"], + ["punctuation", ";"], + ["sql", [ + ["keyword", "select"], + ["operator", "*"], + " form proclib", + ["punctuation", "."], + "jobs", + ["punctuation", "("], + "pw", + ["operator", "="], + "red", + ["punctuation", ")"], + ["punctuation", ";"] + ]], + ["global-statements", "title"] + ]], + ["step", "proc sql"], + ["punctuation", ";"], + ["proc-sql", [ + "\r\n\tconnect to oracle as ora2 ", + ["punctuation", "("], + "user=user-id password=password", + ["punctuation", ")"], + ["punctuation", ";"], + ["sql", [ + ["keyword", "select"], + ["operator", "*"], + ["keyword", "from"], + " connection ", + ["keyword", "to"], + " ora2 ", + ["punctuation", "("], + ["keyword", "select"], + " lname", + ["punctuation", ","], + " fname", + ["punctuation", ","], + " state ", + ["keyword", "from"], + " staff", + ["punctuation", ")"], + ["punctuation", ";"] + ]], + ["sql-statements", "disconnect from"], + " ora2", + ["punctuation", ";"] + ]], + ["step", "quit"], + ["punctuation", ";"] ] ---------------------------------------------------- Checks that SQL captures SAS language elements and leverages -SQL language support for nested SQL. +SQL language support for nested SQL. \ No newline at end of file diff --git a/tests/languages/textile+haml/textile_inclusion.test b/tests/languages/textile+haml/textile_inclusion.test new file mode 100644 index 0000000000..8ac18c4b1d --- /dev/null +++ b/tests/languages/textile+haml/textile_inclusion.test @@ -0,0 +1,46 @@ +:textile +
+ +~ + :textile +
+ +---------------------------------------------------- + +[ + ["filter-textile", [ + ["filter-name", ":textile"], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "div" + ]], + ["punctuation", ">"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]], + ["punctuation", "~"], + ["filter-textile", [ + ["filter-name", ":textile"], + ["tag", [ + ["tag", [ + ["punctuation", "<"], + "div" + ]], + ["punctuation", ">"] + ]], + ["tag", [ + ["tag", [ + ["punctuation", ""] + ]] + ]] +] \ No newline at end of file From 1174aa3af6c624c0e419ce585c2397c0600e42d0 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Mon, 16 Nov 2020 16:28:58 +0100 Subject: [PATCH 04/18] Removed unnecessary `lookbehind: true` --- components/prism-lisp.js | 1 - components/prism-lisp.min.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/components/prism-lisp.js b/components/prism-lisp.js index 6cea556177..1451b53c72 100644 --- a/components/prism-lisp.js +++ b/components/prism-lisp.js @@ -142,7 +142,6 @@ 'lisp-marker': RegExp(marker), 'varform': { pattern: RegExp(/\(/.source + symbol + /\s+(?=\S)/.source + nestedPar + /\)/.source), - lookbehind: true, inside: language }, 'argument': { diff --git a/components/prism-lisp.min.js b/components/prism-lisp.min.js index e888ae64b7..fc5e90f6a5 100644 --- a/components/prism-lisp.min.js +++ b/components/prism-lisp.min.js @@ -1 +1 @@ -!function(e){function n(e){return RegExp("(\\()(?:"+e+")(?=[\\s\\)])")}function a(e){return RegExp("([\\s([])(?:"+e+")(?=[\\s)])")}var t="(?!\\d)[-+*/_~!@$%^=<>{}\\w]+",r="(\\()",i="(?=\\s)",s="(?:[^()]|\\((?:[^()]|\\((?:[^()]|\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\))*\\))*\\))*",o={heading:{pattern:/;;;.*/,alias:["comment","title"]},comment:/;.*/,string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0,inside:{argument:/[-A-Z]+(?=[.,\s])/,symbol:RegExp("`"+t+"'")}},"quoted-symbol":{pattern:RegExp("#?'"+t),alias:["variable","symbol"]},"lisp-property":{pattern:RegExp(":"+t),alias:"property"},splice:{pattern:RegExp(",@?"+t),alias:["symbol","variable"]},keyword:[{pattern:RegExp(r+"(?:(?:lexical-)?let\\*?|(?:cl-)?letf|if|when|while|unless|cons|cl-loop|and|or|not|cond|setq|error|message|null|require|provide|use-package)"+i),lookbehind:!0},{pattern:RegExp(r+"(?:for|do|collect|return|finally|append|concat|in|by)"+i),lookbehind:!0}],declare:{pattern:n("declare"),lookbehind:!0,alias:"keyword"},interactive:{pattern:n("interactive"),lookbehind:!0,alias:"keyword"},boolean:{pattern:a("t|nil"),lookbehind:!0},number:{pattern:a("[-+]?\\d+(?:\\.\\d*)?"),lookbehind:!0},defvar:{pattern:RegExp(r+"def(?:var|const|custom|group)\\s+"+t),lookbehind:!0,inside:{keyword:/^def[a-z]+/,variable:RegExp(t)}},defun:{pattern:RegExp(r+"(?:cl-)?(?:defun\\*?|defmacro)\\s+"+t+"\\s+\\("+s+"\\)"),lookbehind:!0,greedy:!0,inside:{keyword:/^(?:cl-)?def\S+/,arguments:null,function:{pattern:RegExp("(^\\s)"+t),lookbehind:!0},punctuation:/[()]/}},lambda:{pattern:RegExp(r+"lambda\\s+\\(\\s*(?:&?"+t+"(?:\\s+&?"+t+")*\\s*)?\\)"),lookbehind:!0,greedy:!0,inside:{keyword:/^lambda/,arguments:null,punctuation:/[()]/}},car:{pattern:RegExp(r+t),lookbehind:!0},punctuation:[/(?:['`,]?\(|[)\[\]])/,{pattern:/(\s)\.(?=\s)/,lookbehind:!0}]},l={"lisp-marker":RegExp("&(?!\\d)[-+*/_~!@$%^=<>{}\\w]+"),varform:{pattern:RegExp("\\("+t+"\\s+(?=\\S)"+s+"\\)"),lookbehind:!0,inside:o},argument:{pattern:RegExp("(^|[\\s(])"+t),lookbehind:!0,alias:"variable"},rest:o},p="\\S+(?:\\s+\\S+)*",d={pattern:RegExp(r+s+"(?=\\))"),lookbehind:!0,inside:{"rest-vars":{pattern:RegExp("&(?:rest|body)\\s+"+p),inside:l},"other-marker-vars":{pattern:RegExp("&(?:optional|aux)\\s+"+p),inside:l},keys:{pattern:RegExp("&key\\s+"+p+"(?:\\s+&allow-other-keys)?"),inside:l},argument:{pattern:RegExp(t),alias:"variable"},punctuation:/[()]/}};o.lambda.inside.arguments=d,o.defun.inside.arguments=e.util.clone(d),o.defun.inside.arguments.inside.sublist=d,e.languages.lisp=o,e.languages.elisp=o,e.languages.emacs=o,e.languages["emacs-lisp"]=o}(Prism); \ No newline at end of file +!function(e){function n(e){return RegExp("(\\()(?:"+e+")(?=[\\s\\)])")}function a(e){return RegExp("([\\s([])(?:"+e+")(?=[\\s)])")}var t="(?!\\d)[-+*/_~!@$%^=<>{}\\w]+",r="(\\()",i="(?=\\s)",s="(?:[^()]|\\((?:[^()]|\\((?:[^()]|\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\))*\\))*\\))*",l={heading:{pattern:/;;;.*/,alias:["comment","title"]},comment:/;.*/,string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0,inside:{argument:/[-A-Z]+(?=[.,\s])/,symbol:RegExp("`"+t+"'")}},"quoted-symbol":{pattern:RegExp("#?'"+t),alias:["variable","symbol"]},"lisp-property":{pattern:RegExp(":"+t),alias:"property"},splice:{pattern:RegExp(",@?"+t),alias:["symbol","variable"]},keyword:[{pattern:RegExp(r+"(?:(?:lexical-)?let\\*?|(?:cl-)?letf|if|when|while|unless|cons|cl-loop|and|or|not|cond|setq|error|message|null|require|provide|use-package)"+i),lookbehind:!0},{pattern:RegExp(r+"(?:for|do|collect|return|finally|append|concat|in|by)"+i),lookbehind:!0}],declare:{pattern:n("declare"),lookbehind:!0,alias:"keyword"},interactive:{pattern:n("interactive"),lookbehind:!0,alias:"keyword"},boolean:{pattern:a("t|nil"),lookbehind:!0},number:{pattern:a("[-+]?\\d+(?:\\.\\d*)?"),lookbehind:!0},defvar:{pattern:RegExp(r+"def(?:var|const|custom|group)\\s+"+t),lookbehind:!0,inside:{keyword:/^def[a-z]+/,variable:RegExp(t)}},defun:{pattern:RegExp(r+"(?:cl-)?(?:defun\\*?|defmacro)\\s+"+t+"\\s+\\("+s+"\\)"),lookbehind:!0,greedy:!0,inside:{keyword:/^(?:cl-)?def\S+/,arguments:null,function:{pattern:RegExp("(^\\s)"+t),lookbehind:!0},punctuation:/[()]/}},lambda:{pattern:RegExp(r+"lambda\\s+\\(\\s*(?:&?"+t+"(?:\\s+&?"+t+")*\\s*)?\\)"),lookbehind:!0,greedy:!0,inside:{keyword:/^lambda/,arguments:null,punctuation:/[()]/}},car:{pattern:RegExp(r+t),lookbehind:!0},punctuation:[/(?:['`,]?\(|[)\[\]])/,{pattern:/(\s)\.(?=\s)/,lookbehind:!0}]},o={"lisp-marker":RegExp("&(?!\\d)[-+*/_~!@$%^=<>{}\\w]+"),varform:{pattern:RegExp("\\("+t+"\\s+(?=\\S)"+s+"\\)"),inside:l},argument:{pattern:RegExp("(^|[\\s(])"+t),lookbehind:!0,alias:"variable"},rest:l},p="\\S+(?:\\s+\\S+)*",d={pattern:RegExp(r+s+"(?=\\))"),lookbehind:!0,inside:{"rest-vars":{pattern:RegExp("&(?:rest|body)\\s+"+p),inside:o},"other-marker-vars":{pattern:RegExp("&(?:optional|aux)\\s+"+p),inside:o},keys:{pattern:RegExp("&key\\s+"+p+"(?:\\s+&allow-other-keys)?"),inside:o},argument:{pattern:RegExp(t),alias:"variable"},punctuation:/[()]/}};l.lambda.inside.arguments=d,l.defun.inside.arguments=e.util.clone(d),l.defun.inside.arguments.inside.sublist=d,e.languages.lisp=l,e.languages.elisp=l,e.languages.emacs=l,e.languages["emacs-lisp"]=l}(Prism); \ No newline at end of file From 5c3b93e4e83ba9fa149a7324e829d5fbc061cf3d Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Sun, 29 Nov 2020 14:59:24 +0100 Subject: [PATCH 05/18] Extracted shared logic into functions --- tests/coverage.js | 17 ++-------- tests/helper/test-case.js | 59 ++++++++++++++++++++++++---------- tests/helper/test-discovery.js | 28 ++++++++-------- tests/run.js | 34 +++++++------------- 4 files changed, 71 insertions(+), 67 deletions(-) diff --git a/tests/coverage.js b/tests/coverage.js index e108e7e53b..481173e765 100644 --- a/tests/coverage.js +++ b/tests/coverage.js @@ -2,7 +2,6 @@ const TestDiscovery = require("./helper/test-discovery"); const TestCase = require("./helper/test-case"); -const path = require("path"); const PrismLoader = require("./helper/prism-loader"); const { BFS, BFSPathToPrismTokenPath } = require("./helper/util"); const { assert } = require("chai"); @@ -11,8 +10,6 @@ const ALL_LANGUAGES = [...Object.keys(components.languages).filter(k => k !== 'm describe('Pattern test coverage', function () { - const testSuite = TestDiscovery.loadAllTests(__dirname + "/languages"); - /** * @type {Map} * @typedef PatternData @@ -76,20 +73,12 @@ describe('Pattern test coverage', function () { describe('Run all language tests', function () { // define tests for all tests in all languages in the test suite - for (const languageIdentifier in testSuite) { - if (!testSuite.hasOwnProperty(languageIdentifier)) { - continue; - } - + for (const [languageIdentifier, files] of TestDiscovery.loadAllTests()) { it(languageIdentifier, function () { this.timeout(10 * 1000); - for (const filePath of testSuite[languageIdentifier]) { - if (path.extname(filePath) === '.test') { - TestCase.runTestCase({ languageIdentifier, filePath, createInstance }); - } else { - TestCase.runTestsWithHooks({ languageIdentifier, codes: require(filePath), createInstance }); - } + for (const filePath of files) { + TestCase.run({ languageIdentifier, filePath, createInstance }); } }); } diff --git a/tests/helper/test-case.js b/tests/helper/test-case.js index a881c24ae9..d2d6b98a66 100644 --- a/tests/helper/test-case.js +++ b/tests/helper/test-case.js @@ -1,6 +1,7 @@ "use strict"; const fs = require("fs"); +const path = require("path"); const { assert } = require("chai"); const PrismLoader = require("./prism-loader"); const TokenStreamTransformer = require("./token-stream-transformer"); @@ -30,11 +31,40 @@ const TokenStreamTransformer = require("./token-stream-transformer"); * If the file contains more than three parts, the remaining parts are just ignored. * If the file however does not contain at least two parts (so no expected token stream), * the test case will later be marked as failed. - * - * + */ + +/** + * @typedef {import("./prism-loader").PrismInstance} PrismInstance */ module.exports = { + /** + * Runs the given test file and asserts the result. + * + * This function will determine what kind of test files the given file is and call the appropriate method to run the + * test. + * + * @param {RunOptions} options + * @returns {void} + * + * @typedef RunOptions + * @property {string} languageIdentifier + * @property {string} filePath + * @property {boolean} [acceptEmpty=false] If `true`, then the current token stream will be added to all `.test` + * files that do not contain an expected token stream. + * @property {(languages: string[]) => PrismInstance} [createInstance] + */ + run(options) { + if (path.extname(options.filePath) === '.test') { + this.runTestCase(options); + } else { + this.runTestsWithHooks({ + ...options, + codes: require(options.filePath) + }); + } + }, + /** * Runs the given test case file and asserts the result * @@ -47,18 +77,15 @@ module.exports = { * * The languages will be loaded in the order they were provided. * - * @param {object} param0 - * @param {string} param0.languageIdentifier - * @param {string} param0.filePath - * @param {boolean} [param0.acceptEmpty] - * @param {(languages: string[]) => import("./prism-loader").PrismInstance} [param0.createInstance] + * @param {RunOptions} param0 */ runTestCase({ languageIdentifier, filePath, acceptEmpty, createInstance }) { const testCase = this.parseTestCaseFile(filePath); const usedLanguages = this.parseLanguageNames(languageIdentifier); - createInstance = createInstance || PrismLoader.createInstance.bind(PrismLoader); - const Prism = createInstance(usedLanguages.languages); + const Prism = createInstance + ? createInstance(usedLanguages.languages) + : PrismLoader.createInstance(usedLanguages.languages); // the first language is the main language to highlight const simplifiedTokenStream = this.simpleTokenize(Prism, testCase.code, usedLanguages.mainLanguage); @@ -119,10 +146,10 @@ module.exports = { * * The `before-tokenize` and `after-tokenize` hooks will also be executed. * - * @param {import('../../components/prism-core')} Prism The Prism instance which will tokenize `code`. + * @param {PrismInstance} Prism The Prism instance which will tokenize `code`. * @param {string} code The code to tokenize. * @param {string} language The language id. - * @returns {Array>} + * @returns {Array} */ simpleTokenize(Prism, code, language) { const env = { @@ -223,16 +250,14 @@ module.exports = { * * Code is provided as the key and expected result as the value. * - * @param {object} param0 - * @param {string} param0.languageIdentifier - * @param {object} param0.codes - * @param {(languages: string[]) => import("./prism-loader").PrismInstance} [param0.createInstance] + * @param {RunOptions & { codes: Object }} param0 */ runTestsWithHooks({ languageIdentifier, codes, createInstance }) { const usedLanguages = this.parseLanguageNames(languageIdentifier); - createInstance = createInstance || PrismLoader.createInstance.bind(PrismLoader); - const Prism = createInstance(usedLanguages.languages); + const Prism = createInstance + ? createInstance(usedLanguages.languages) + : PrismLoader.createInstance(usedLanguages.languages); // the first language is the main language to highlight diff --git a/tests/helper/test-discovery.js b/tests/helper/test-discovery.js index 99896bde7d..cddf0a1f06 100644 --- a/tests/helper/test-discovery.js +++ b/tests/helper/test-discovery.js @@ -4,20 +4,21 @@ const fs = require("fs"); const path = require("path"); +const LANGUAGES_DIR = path.join(__dirname, '..', 'languages'); + module.exports = { /** * Loads the list of all available tests * - * @param {string} rootDir - * @returns {Object} + * @returns {Map} */ - loadAllTests(rootDir) { - /** @type {Object.} */ - const testSuite = {}; + loadAllTests() { + /** @type {Map.} */ + const testSuite = new Map(); - for (const language of this.getAllDirectories(rootDir)) { - testSuite[language] = this.getAllFiles(path.join(rootDir, language)); + for (const language of this.getAllDirectories(LANGUAGES_DIR)) { + testSuite.set(language, this.getAllFiles(path.join(LANGUAGES_DIR, language))); } return testSuite; @@ -26,16 +27,15 @@ module.exports = { /** * Loads the list of available tests that match the given languages * - * @param {string} rootDir * @param {string|string[]} languages - * @returns {Object} + * @returns {Map} */ - loadSomeTests(rootDir, languages) { - /** @type {Object.} */ - const testSuite = {}; + loadSomeTests(languages) { + /** @type {Map} */ + const testSuite = new Map(); - for (const language of this.getSomeDirectories(rootDir, languages)) { - testSuite[language] = this.getAllFiles(path.join(rootDir, language)); + for (const language of this.getSomeDirectories(LANGUAGES_DIR, languages)) { + testSuite.set(language, this.getAllFiles(path.join(LANGUAGES_DIR, language))); } return testSuite; diff --git a/tests/run.js b/tests/run.js index aba43bfc93..f0f399dcd2 100644 --- a/tests/run.js +++ b/tests/run.js @@ -8,33 +8,23 @@ const { argv } = require("yargs"); const testSuite = (argv.language) - ? TestDiscovery.loadSomeTests(__dirname + "/languages", argv.language) + ? TestDiscovery.loadSomeTests(argv.language) // load complete test suite - : TestDiscovery.loadAllTests(__dirname + "/languages"); + : TestDiscovery.loadAllTests(); const acceptEmpty = !!argv.accept; // define tests for all tests in all languages in the test suite -for (const languageIdentifier in testSuite) { - if (!testSuite.hasOwnProperty(languageIdentifier)) { - continue; - } +for (const [languageIdentifier, files] of testSuite) { + describe("Testing language '" + languageIdentifier + "'", function () { + this.timeout(10 * 1000); - (function (languageIdentifier, testFiles) { - describe("Testing language '" + languageIdentifier + "'", function () { - this.timeout(10000); + for (const filePath of files) { + const fileName = path.basename(filePath, path.extname(filePath)); - for (const filePath of testFiles) { - const fileName = path.basename(filePath, path.extname(filePath)); - - it("– should pass test case '" + fileName + "'", function () { - if (path.extname(filePath) === '.test') { - TestCase.runTestCase({ languageIdentifier, filePath, acceptEmpty }); - } else { - TestCase.runTestsWithHooks({ languageIdentifier, codes: require(filePath) }); - } - }); - } - }); - })(languageIdentifier, testSuite[languageIdentifier]); + it("– should pass test case '" + fileName + "'", function () { + TestCase.run({ languageIdentifier, filePath, acceptEmpty }); + }); + } + }); } From 2ac57886e8f13943ae05c1b6117709f30401d4f7 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Sun, 29 Nov 2020 15:16:22 +0100 Subject: [PATCH 06/18] Added test for untested DataWeave keywords --- components/prism-dataweave.js | 2 +- components/prism-dataweave.min.js | 2 +- .../languages/dataweave/keywords_feature.test | 19 ++++++++++++++----- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/components/prism-dataweave.js b/components/prism-dataweave.js index 0b03834d0a..caddfef3e0 100644 --- a/components/prism-dataweave.js +++ b/components/prism-dataweave.js @@ -30,12 +30,12 @@ pattern: /\/(?:[^\\\/\r\n]|\\[^\r\n])+\//, greedy: true }, + 'keyword': /\b(?:match|input|output|ns|type|update|null|if|else|using|unless|at|is|as|case|do|fun|var|not|and|or)\b/, 'function': /\b[A-Za-z_]\w*(?=\s*\()/i, 'number': /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i, 'punctuation': /[{}[\];(),.:@]/, 'operator': /<<|>>|->|[<>~=]=?|!=|--?-?|\+\+?|\!|\?/, 'boolean': /\b(?:true|false)\b/, - 'keyword': /\b(?:match|input|output|ns|type|update|null|if|else|using|unless|at|is|as|case|do|fun|var|not|and|or)\b/ }; }(Prism)); diff --git a/components/prism-dataweave.min.js b/components/prism-dataweave.min.js index c04dd1c984..3f25c5b7ca 100644 --- a/components/prism-dataweave.min.js +++ b/components/prism-dataweave.min.js @@ -1 +1 @@ -Prism.languages.dataweave={url:/\b[A-Za-z]+:\/\/[\w/:.?=&-]+|\burn:[\w:.?=&-]+/,property:{pattern:/(?:\w+#)?(?:"(?:\\.|[^\\"\r\n])*"|\w+)(?=\s*[:@])/,greedy:!0},string:{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},"mime-type":/\b(?:text|audio|video|application|multipart|image)\/[\w+-]+/,date:{pattern:/\|[\w:+-]+\|/,greedy:!0},comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],regex:{pattern:/\/(?:[^\\\/\r\n]|\\[^\r\n])+\//,greedy:!0},function:/\b[A-Za-z_]\w*(?=\s*\()/i,number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\];(),.:@]/,operator:/<<|>>|->|[<>~=]=?|!=|--?-?|\+\+?|\!|\?/,boolean:/\b(?:true|false)\b/,keyword:/\b(?:match|input|output|ns|type|update|null|if|else|using|unless|at|is|as|case|do|fun|var|not|and|or)\b/}; \ No newline at end of file +Prism.languages.dataweave={url:/\b[A-Za-z]+:\/\/[\w/:.?=&-]+|\burn:[\w:.?=&-]+/,property:{pattern:/(?:\w+#)?(?:"(?:\\.|[^\\"\r\n])*"|\w+)(?=\s*[:@])/,greedy:!0},string:{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},"mime-type":/\b(?:text|audio|video|application|multipart|image)\/[\w+-]+/,date:{pattern:/\|[\w:+-]+\|/,greedy:!0},comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],regex:{pattern:/\/(?:[^\\\/\r\n]|\\[^\r\n])+\//,greedy:!0},keyword:/\b(?:match|input|output|ns|type|update|null|if|else|using|unless|at|is|as|case|do|fun|var|not|and|or)\b/,function:/\b[A-Za-z_]\w*(?=\s*\()/i,number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\];(),.:@]/,operator:/<<|>>|->|[<>~=]=?|!=|--?-?|\+\+?|\!|\?/,boolean:/\b(?:true|false)\b/}; \ No newline at end of file diff --git a/tests/languages/dataweave/keywords_feature.test b/tests/languages/dataweave/keywords_feature.test index e936104b63..09a4a8aab5 100644 --- a/tests/languages/dataweave/keywords_feature.test +++ b/tests/languages/dataweave/keywords_feature.test @@ -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"], - " \npayload ", + "\npayload ", ["keyword", "match"], ["punctuation", "{"], @@ -118,7 +122,12 @@ payload match { ["keyword", "as"], " String\n", - ["punctuation", "}"] + ["punctuation", "}"], + + ["keyword", "null"], + ["keyword", "unless"], + ["keyword", "using"] ] + ---------------------------------------------------- -Check for keywords \ No newline at end of file +Check for keywords From 6ef6ee8a1e54a386b3b9ec3cd2c5ccc3ea34df09 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Tue, 4 May 2021 17:09:16 +0200 Subject: [PATCH 07/18] Update PHP language test --- tests/languages/php/class-name_feature.test | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/languages/php/class-name_feature.test b/tests/languages/php/class-name_feature.test index cb915e4c95..4ac2b251f1 100644 --- a/tests/languages/php/class-name_feature.test +++ b/tests/languages/php/class-name_feature.test @@ -63,7 +63,7 @@ class Foo extends \Package\Bar implements App\Baz {} ["punctuation", ";"], ["keyword", "function"], - ["function", "f"], + ["function-definition", "f"], ["punctuation", "("], ["class-name", "Foo"], ["variable", "$variable"], @@ -74,7 +74,7 @@ class Foo extends \Package\Bar implements App\Baz {} ["punctuation", "}"], ["keyword", "function"], - ["function", "f"], + ["function-definition", "f"], ["punctuation", "("], ["class-name", [ ["punctuation", "\\"], @@ -91,7 +91,7 @@ class Foo extends \Package\Bar implements App\Baz {} ["punctuation", "}"], ["keyword", "function"], - ["function", "f"], + ["function-definition", "f"], ["punctuation", "("], ["class-name", [ ["punctuation", "\\"], @@ -112,7 +112,7 @@ class Foo extends \Package\Bar implements App\Baz {} ["punctuation", "}"], ["keyword", "function"], - ["function", "f"], + ["function-definition", "f"], ["punctuation", "("], ["variable", "$variable"], ["punctuation", ")"], @@ -123,7 +123,7 @@ class Foo extends \Package\Bar implements App\Baz {} ["punctuation", "}"], ["keyword", "function"], - ["function", "f"], + ["function-definition", "f"], ["punctuation", "("], ["class-name", "Foo"], ["operator", "|"], @@ -138,7 +138,7 @@ class Foo extends \Package\Bar implements App\Baz {} ["punctuation", "}"], ["keyword", "function"], - ["function", "f"], + ["function-definition", "f"], ["punctuation", "("], ["class-name", "Foo"], ["operator", "|"], @@ -151,8 +151,9 @@ class Foo extends \Package\Bar implements App\Baz {} ["class-name", "Bar"], ["punctuation", "{"], ["punctuation", "}"], + ["keyword", "function"], - ["function", "f"], + ["function-definition", "f"], ["punctuation", "("], ["class-name", "Foo"], ["operator", "|"], @@ -167,7 +168,7 @@ class Foo extends \Package\Bar implements App\Baz {} ["punctuation", "}"], ["keyword", "function"], - ["function", "f"], + ["function-definition", "f"], ["punctuation", "("], ["class-name", [ ["punctuation", "\\"], @@ -202,7 +203,7 @@ class Foo extends \Package\Bar implements App\Baz {} ["punctuation", "}"], ["keyword", "class"], - ["class-name", "Foo"], + ["class-name-definition", "Foo"], ["keyword", "extends"], ["class-name", "Bar"], ["keyword", "implements"], @@ -211,7 +212,7 @@ class Foo extends \Package\Bar implements App\Baz {} ["punctuation", "}"], ["keyword", "class"], - ["class-name", "Foo"], + ["class-name-definition", "Foo"], ["keyword", "extends"], ["class-name", [ ["punctuation", "\\"], From 654b1808b358915f4849c564c078e912e68bc8e4 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Tue, 4 May 2021 17:33:28 +0200 Subject: [PATCH 08/18] More tests --- tests/languages/cfscript/type_feature.test | 4 +- tests/languages/idris/keyword_feature.test | 94 ++++++++++++-- tests/languages/log/level_feature.test | 14 ++- tests/languages/qsharp/keyword_feature.test | 129 ++++++++++++++++++++ tests/languages/qsharp/string_feature.test | 39 ++++++ 5 files changed, 267 insertions(+), 13 deletions(-) create mode 100644 tests/languages/qsharp/keyword_feature.test create mode 100644 tests/languages/qsharp/string_feature.test diff --git a/tests/languages/cfscript/type_feature.test b/tests/languages/cfscript/type_feature.test index b87a21a8a6..120ab7b911 100644 --- a/tests/languages/cfscript/type_feature.test +++ b/tests/languages/cfscript/type_feature.test @@ -10,7 +10,7 @@ string struct uuid void -xml +xml= ---------------------------------------------------- @@ -27,7 +27,7 @@ xml ["type", "struct"], ["type", "uuid"], ["type", "void"], - ["keyword", "xml"] + ["type", "xml"], ["operator", "="] ] ---------------------------------------------------- diff --git a/tests/languages/idris/keyword_feature.test b/tests/languages/idris/keyword_feature.test index 6a3c0f72d4..476bc8d128 100644 --- a/tests/languages/idris/keyword_feature.test +++ b/tests/languages/idris/keyword_feature.test @@ -1,17 +1,93 @@ -case data do else if implementation -in infixl infixr interface let -module of then where +Type +case +class +codata +constructor +corecord +data +do +dsl +else +export +if +implementation +implicit +import +impossible +in +infix +infixl +infixr +instance +interface +let +module +mutual +namespace +of +parameters +partial +postulate +private +proof +public +quoteGoal +record +rewrite +syntax +then +total +using +where +with ---------------------------------------------------- [ - ["keyword", "case"], ["keyword", "data"], ["keyword", "do"], - ["keyword", "else"], ["keyword", "if"], ["keyword", "implementation"], - ["keyword", "in"], ["keyword", "infixl"], ["keyword", "infixr"], - ["keyword", "interface"], ["keyword", "let"], ["keyword", "module"], - ["keyword", "of"], ["keyword", "then"], ["keyword", "where"] + ["keyword", "Type"], + ["keyword", "case"], + ["keyword", "class"], + ["keyword", "codata"], + ["keyword", "constructor"], + ["keyword", "corecord"], + ["keyword", "data"], + ["keyword", "do"], + ["keyword", "dsl"], + ["keyword", "else"], + ["keyword", "export"], + ["keyword", "if"], + ["keyword", "implementation"], + ["keyword", "implicit"], + ["keyword", "import"], + ["keyword", "impossible"], + ["keyword", "in"], + ["keyword", "infix"], + ["keyword", "infixl"], + ["keyword", "infixr"], + ["keyword", "instance"], + ["keyword", "interface"], + ["keyword", "let"], + ["keyword", "module"], + ["keyword", "mutual"], + ["keyword", "namespace"], + ["keyword", "of"], + ["keyword", "parameters"], + ["keyword", "partial"], + ["keyword", "postulate"], + ["keyword", "private"], + ["keyword", "proof"], + ["keyword", "public"], + ["keyword", "quoteGoal"], + ["keyword", "record"], + ["keyword", "rewrite"], + ["keyword", "syntax"], + ["keyword", "then"], + ["keyword", "total"], + ["keyword", "using"], + ["keyword", "where"], + ["keyword", "with"] ] ---------------------------------------------------- -Checks for some keywords. \ No newline at end of file +Checks for some keywords. diff --git a/tests/languages/log/level_feature.test b/tests/languages/log/level_feature.test index ab47dbb8db..0ea1163dbd 100644 --- a/tests/languages/log/level_feature.test +++ b/tests/languages/log/level_feature.test @@ -11,19 +11,24 @@ SEVERE WARN WARNING +WRN DISPLAY INFO +INF NOTICE STATUS +DBG DEBUG FINE FINER FINEST TRACE +TRC VERBOSE +VRB ---------------------------------------------------- @@ -41,17 +46,22 @@ VERBOSE ["level", "WARN"], ["level", "WARNING"], + ["level", "WRN"], ["level", "DISPLAY"], ["level", "INFO"], + ["level", "INF"], ["level", "NOTICE"], ["level", "STATUS"], + ["level", "DBG"], ["level", "DEBUG"], ["level", "FINE"], ["level", "FINER"], ["level", "FINEST"], ["level", "TRACE"], - ["level", "VERBOSE"] -] \ No newline at end of file + ["level", "TRC"], + ["level", "VERBOSE"], + ["level", "VRB"] +] diff --git a/tests/languages/qsharp/keyword_feature.test b/tests/languages/qsharp/keyword_feature.test new file mode 100644 index 0000000000..ec67ccfcd2 --- /dev/null +++ b/tests/languages/qsharp/keyword_feature.test @@ -0,0 +1,129 @@ +// type +Adj +BigInt +Bool +Ctl +Double +false +Int +One +Pauli +PauliI +PauliX +PauliY +PauliZ +Qubit +Range +Result +String +true +Unit +Zero + +// other +Adjoint +adjoint +apply +as +auto +body +borrow +borrowing +Controlled +controlled +distribute +elif +else +fail +fixup +for +function +if +in +internal +intrinsic +invert +is +let +mutable +namespace +new +newtype +open +operation +repeat +return +self +set +until +use +using +while +within + +---------------------------------------------------- + +[ + ["comment", "// type"], + ["keyword", "Adj"], + ["keyword", "BigInt"], + ["keyword", "Bool"], + ["keyword", "Ctl"], + ["keyword", "Double"], + ["keyword", "false"], + ["keyword", "Int"], + ["keyword", "One"], + ["keyword", "Pauli"], + ["keyword", "PauliI"], + ["keyword", "PauliX"], + ["keyword", "PauliY"], + ["keyword", "PauliZ"], + ["keyword", "Qubit"], + ["keyword", "Range"], + ["keyword", "Result"], + ["keyword", "String"], + ["keyword", "true"], + ["keyword", "Unit"], + ["keyword", "Zero"], + + ["comment", "// other"], + ["keyword", "Adjoint"], + ["keyword", "adjoint"], + ["keyword", "apply"], + ["keyword", "as"], + ["keyword", "auto"], + ["keyword", "body"], + ["keyword", "borrow"], + ["keyword", "borrowing"], + ["keyword", "Controlled"], + ["keyword", "controlled"], + ["keyword", "distribute"], + ["keyword", "elif"], + ["keyword", "else"], + ["keyword", "fail"], + ["keyword", "fixup"], + ["keyword", "for"], + ["keyword", "function"], + ["keyword", "if"], + ["keyword", "in"], + ["keyword", "internal"], + ["keyword", "intrinsic"], + ["keyword", "invert"], + ["keyword", "is"], + ["keyword", "let"], + ["keyword", "mutable"], + ["keyword", "namespace"], + ["keyword", "new"], + ["keyword", "newtype"], + ["keyword", "open"], + ["keyword", "operation"], + ["keyword", "repeat"], + ["keyword", "return"], + ["keyword", "self"], + ["keyword", "set"], + ["keyword", "until"], + ["keyword", "use"], + ["keyword", "using"], + ["keyword", "while"], + ["keyword", "within"] +] diff --git a/tests/languages/qsharp/string_feature.test b/tests/languages/qsharp/string_feature.test new file mode 100644 index 0000000000..146080fd29 --- /dev/null +++ b/tests/languages/qsharp/string_feature.test @@ -0,0 +1,39 @@ +"" +"foo" +"foo\"\n" + +$"" +$"foo" +$"\"" +$"foo{1+1}baz" + +---------------------------------------------------- + +[ + ["string", "\"\""], + ["string", "\"foo\""], + ["string", "\"foo\\\"\\n\""], + + ["interpolation-string", [ + ["string", "$\"\""] + ]], + ["interpolation-string", [ + ["string", "$\"foo\""] + ]], + ["interpolation-string", [ + ["string", "$\"\\\"\""] + ]], + ["interpolation-string", [ + ["string", "$\"foo"], + ["interpolation", [ + ["punctuation", "{"], + ["expression", [ + ["number", "1"], + ["operator", "+"], + ["number", "1"] + ]], + ["punctuation", "}"] + ]], + ["string", "baz\""] + ]] +] From f1eee9a16f3a58856d742d13cc242f5a23d1f887 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Tue, 4 May 2021 17:33:42 +0200 Subject: [PATCH 09/18] TypeScript: Removed duplicate keywords --- components/prism-typescript.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/prism-typescript.js b/components/prism-typescript.js index 30fdf2cf76..4153ea4ffa 100644 --- a/components/prism-typescript.js +++ b/components/prism-typescript.js @@ -12,7 +12,7 @@ // The keywords TypeScript adds to JavaScript Prism.languages.typescript.keyword.push( - /\b(?:abstract|as|declare|implements|is|keyof|readonly|require)\b/, + /\b(?:abstract|declare|is|keyof|readonly|require)\b/, // keywords that have to be followed by an identifier /\b(?:asserts|infer|interface|module|namespace|type)(?!\s*[^\s_${}*a-zA-Z\xA0-\uFFFF])/ ); From 0a3e9ac84cb33c9c4b8af3fde75f418aed3f3108 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Tue, 4 May 2021 17:37:37 +0200 Subject: [PATCH 10/18] URI: More tests and fixed IPv4 addresses --- components/prism-uri.js | 2 +- tests/languages/uri/authority_feature.test | 25 ++++++++++++++++++++-- tests/languages/uri/full.test | 6 ++++-- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/components/prism-uri.js b/components/prism-uri.js index cdbf8dba3b..5831c7dd3b 100644 --- a/components/prism-uri.js +++ b/components/prism-uri.js @@ -80,7 +80,7 @@ Prism.languages.uri = { 'ipv6-address': /^[\s\S]+/ } }, - 'ipv4-address': /^(?:(?:[03-9]\d?|[12]\d{0,2})\.){3}(?:[03-9]\d?|[12]{0,2})$/ + 'ipv4-address': /^(?:(?:[03-9]\d?|[12]\d{0,2})\.){3}(?:[03-9]\d?|[12]\d{0,2})$/ } } } diff --git a/tests/languages/uri/authority_feature.test b/tests/languages/uri/authority_feature.test index 48679b14d8..0d37c29fee 100644 --- a/tests/languages/uri/authority_feature.test +++ b/tests/languages/uri/authority_feature.test @@ -1,6 +1,7 @@ https://john.doe@www.example.com:123/forum/questions ftp://ftp.is.co.za/rfc/rfc1808.txt ldap://[2001:db8::7]/ +https://[v1.foo]/ //192.0.2.16:80/ //example.com/path/resource.txt @@ -63,9 +64,29 @@ ldap://[2001:db8::7]/ ["path-separator", "/"] ]], + ["scheme", [ + "https", + ["scheme-delimiter", ":"] + ]], ["authority", [ ["authority-delimiter", "//"], - ["host", ["192.0.2.16"]], + ["host", [ + ["ip-literal", [ + ["ip-literal-delimiter", "["], + ["ipv-future", "v1.foo"], + ["ip-literal-delimiter", "]"] + ]] + ]] + ]], + ["path", [ + ["path-separator", "/"] + ]], + + ["authority", [ + ["authority-delimiter", "//"], + ["host", [ + ["ipv4-address", "192.0.2.16"] + ]], ["port-segment", [ ["port-delimiter", ":"], ["port", "80"] @@ -85,4 +106,4 @@ ldap://[2001:db8::7]/ ["path-separator", "/"], "resource.txt" ]] -] \ No newline at end of file +] diff --git a/tests/languages/uri/full.test b/tests/languages/uri/full.test index 277c039cc1..c4877b2aa3 100644 --- a/tests/languages/uri/full.test +++ b/tests/languages/uri/full.test @@ -93,7 +93,9 @@ https://example.com/path/resource.txt#fragment ]], ["authority", [ ["authority-delimiter", "//"], - ["host", ["192.0.2.16"]], + ["host", [ + ["ipv4-address", "192.0.2.16"] + ]], ["port-segment", [ ["port-delimiter", ":"], ["port", "80"] @@ -121,4 +123,4 @@ https://example.com/path/resource.txt#fragment ["fragment-delimiter", "#"], "fragment" ]] -] \ No newline at end of file +] From ca021874fa8b071d200de3210e5e667cef9b12ef Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Tue, 4 May 2021 18:11:53 +0200 Subject: [PATCH 11/18] Added more tests --- tests/languages/coq/attribute_feature.test | 24 +++- tests/languages/dart/class-name_feature.test | 123 +++++++++++++++--- .../languages/false/non-standard_feature.test | 13 ++ .../kumir/system-variable_feature.test | 7 + tests/languages/kumir/type_feature.test | 12 +- tests/languages/log/email_feature.test | 10 ++ tests/languages/log/mac-address_feature.test | 7 + .../languages/openqasm/function_feature.test | 23 ++++ .../openqasm/punctuation_feature.test | 18 +++ tests/languages/v/attribute_feature.test | 59 +++++++++ 10 files changed, 273 insertions(+), 23 deletions(-) create mode 100644 tests/languages/false/non-standard_feature.test create mode 100644 tests/languages/kumir/system-variable_feature.test create mode 100644 tests/languages/log/email_feature.test create mode 100644 tests/languages/log/mac-address_feature.test create mode 100644 tests/languages/openqasm/function_feature.test create mode 100644 tests/languages/openqasm/punctuation_feature.test create mode 100644 tests/languages/v/attribute_feature.test diff --git a/tests/languages/coq/attribute_feature.test b/tests/languages/coq/attribute_feature.test index a4636681ea..7d727fc1a0 100644 --- a/tests/languages/coq/attribute_feature.test +++ b/tests/languages/coq/attribute_feature.test @@ -6,6 +6,16 @@ #[canonical=yes, canonical=no] #[ export ] +(* legacy *) +Cumulative +Global +Local +Monomorphic +NonCumulative +Polymorphic +Private +Program + ---------------------------------------------------- [ @@ -69,5 +79,15 @@ ["punctuation", "#["], " export ", ["punctuation", "]"] - ]] -] \ No newline at end of file + ]], + + ["comment", "(* legacy *)"], + ["attribute", "Cumulative"], + ["attribute", "Global"], + ["attribute", "Local"], + ["attribute", "Monomorphic"], + ["attribute", "NonCumulative"], + ["attribute", "Polymorphic"], + ["attribute", "Private"], + ["attribute", "Program"] +] diff --git a/tests/languages/dart/class-name_feature.test b/tests/languages/dart/class-name_feature.test index f13f8cdb8b..f97d9ab6f6 100644 --- a/tests/languages/dart/class-name_feature.test +++ b/tests/languages/dart/class-name_feature.test @@ -9,6 +9,18 @@ class Foo with ns.Bar { } +class MyWidget extends SingleChildStatelessWidget { + MyWidget({Key key, Widget child}): super(key: key, child: child); + + @override + Widget buildWithChild(BuildContext context, Widget child) { + return SomethingWidget(child: child); + } +} + +var copy = Foo.Bar.from(foo); +ID foo = something(); + ---------------------------------------------------- [ @@ -30,13 +42,10 @@ class Foo with ns.Bar { ["keyword", "this"], ["punctuation", "."], "bar", - ["punctuation", ")"], - ["punctuation", ";"], + ["punctuation", ")"], + ["punctuation", ";"], - ["keyword", "final"], - ["class-name", ["Bar"]], - " bar", - ["punctuation", ";"], + ["keyword", "final"], ["class-name", ["Bar"]], " bar", ["punctuation", ";"], ["class-name", ["Baz"]], ["generics", [ @@ -62,28 +71,102 @@ class Foo with ns.Bar { " bat", ["punctuation", ")"], ["punctuation", "{"], + ["keyword", "return"], - ["class-name", [ - "Baz" + ["class-name", ["Baz"]], + ["generics", [ + ["punctuation", "<"], + ["class-name", [ + ["namespace", [ + "ns", + ["punctuation", "."] + ]], + "Bat" + ]], + ["punctuation", ">"] ]], - ["generics", [ - ["punctuation", "<"], - ["class-name", [ - ["namespace", [ - "ns", - ["punctuation", "."] - ]], - "Bat" - ]], - ["punctuation", ">"] - ]], ["punctuation", "("], "bat", ["punctuation", ")"], ["punctuation", ";"], + + ["punctuation", "}"], + + ["punctuation", "}"], + + ["keyword", "class"], + ["class-name", ["MyWidget"]], + ["keyword", "extends"], + ["class-name", ["SingleChildStatelessWidget"]], + ["punctuation", "{"], + + ["class-name", ["MyWidget"]], + ["punctuation", "("], + ["punctuation", "{"], + ["class-name", ["Key"]], + " key", + ["punctuation", ","], + ["class-name", ["Widget"]], + " child", + ["punctuation", "}"], + ["punctuation", ")"], + ["punctuation", ":"], + ["keyword", "super"], + ["punctuation", "("], + "key", + ["punctuation", ":"], + " key", + ["punctuation", ","], + " child", + ["punctuation", ":"], + " child", + ["punctuation", ")"], + ["punctuation", ";"], + + ["metadata", "@override"], + + ["class-name", ["Widget"]], + ["function", "buildWithChild"], + ["punctuation", "("], + ["class-name", ["BuildContext"]], + " context", + ["punctuation", ","], + ["class-name", ["Widget"]], + " child", + ["punctuation", ")"], + ["punctuation", "{"], + + ["keyword", "return"], + ["class-name", ["SomethingWidget"]], + ["punctuation", "("], + "child", + ["punctuation", ":"], + " child", + ["punctuation", ")"], + ["punctuation", ";"], + ["punctuation", "}"], - ["punctuation", "}"] + ["punctuation", "}"], + + ["keyword", "var"], + " copy ", + ["operator", "="], + ["class-name", ["Foo.Bar"]], + ["punctuation", "."], + ["function", "from"], + ["punctuation", "("], + "foo", + ["punctuation", ")"], + ["punctuation", ";"], + + ["class-name", ["ID"]], + " foo ", + ["operator", "="], + ["function", "something"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", ";"] ] ---------------------------------------------------- diff --git a/tests/languages/false/non-standard_feature.test b/tests/languages/false/non-standard_feature.test new file mode 100644 index 0000000000..b26e5d9cd8 --- /dev/null +++ b/tests/languages/false/non-standard_feature.test @@ -0,0 +1,13 @@ +( ) < B D O ® + +---------------------------------------------------- + +[ + ["non-standard", "("], + ["non-standard", ")"], + ["non-standard", "<"], + ["non-standard", "B"], + ["non-standard", "D"], + ["non-standard", "O"], + ["non-standard", "®"] +] diff --git a/tests/languages/kumir/system-variable_feature.test b/tests/languages/kumir/system-variable_feature.test new file mode 100644 index 0000000000..2321dce2a4 --- /dev/null +++ b/tests/languages/kumir/system-variable_feature.test @@ -0,0 +1,7 @@ +знач + +---------------------------------------------------- + +[ + ["system-variable", "знач"] +] diff --git a/tests/languages/kumir/type_feature.test b/tests/languages/kumir/type_feature.test index d5e6731f14..02ad78ee0f 100644 --- a/tests/languages/kumir/type_feature.test +++ b/tests/languages/kumir/type_feature.test @@ -4,6 +4,11 @@ цел таб целтаб +компл +сканкод +файл +цвет + ---------------------------------------------------- [ @@ -11,7 +16,12 @@ ["type", "цел"], ["type", "цел таб"], ["type", "цел таб"], - ["type", "целтаб"] + ["type", "целтаб"], + + ["type", "компл"], + ["type", "сканкод"], + ["type", "файл"], + ["type", "цвет"] ] ---------------------------------------------------- diff --git a/tests/languages/log/email_feature.test b/tests/languages/log/email_feature.test new file mode 100644 index 0000000000..5feef31082 --- /dev/null +++ b/tests/languages/log/email_feature.test @@ -0,0 +1,10 @@ +foo.bar@mail.com ... + +---------------------------------------------------- + +[ + ["email", "foo.bar@mail.com"], + ["punctuation", "."], + ["punctuation", "."], + ["punctuation", "."] +] diff --git a/tests/languages/log/mac-address_feature.test b/tests/languages/log/mac-address_feature.test new file mode 100644 index 0000000000..bb3634657a --- /dev/null +++ b/tests/languages/log/mac-address_feature.test @@ -0,0 +1,7 @@ +01:23:45:67:89:ab + +---------------------------------------------------- + +[ + ["mac-address", "01:23:45:67:89:ab"] +] diff --git a/tests/languages/openqasm/function_feature.test b/tests/languages/openqasm/function_feature.test new file mode 100644 index 0000000000..cf018998fc --- /dev/null +++ b/tests/languages/openqasm/function_feature.test @@ -0,0 +1,23 @@ +sin( +cos( +tan( +exp( +ln( +sqrt( +rotl( +rotr( +popcount( + +---------------------------------------------------- + +[ + ["function", "sin"], ["punctuation", "("], + ["function", "cos"], ["punctuation", "("], + ["function", "tan"], ["punctuation", "("], + ["function", "exp"], ["punctuation", "("], + ["function", "ln"], ["punctuation", "("], + ["function", "sqrt"], ["punctuation", "("], + ["function", "rotl"], ["punctuation", "("], + ["function", "rotr"], ["punctuation", "("], + ["function", "popcount"], ["punctuation", "("] +] diff --git a/tests/languages/openqasm/punctuation_feature.test b/tests/languages/openqasm/punctuation_feature.test new file mode 100644 index 0000000000..462695fdef --- /dev/null +++ b/tests/languages/openqasm/punctuation_feature.test @@ -0,0 +1,18 @@ +( ) { } [ ] +; , : . + +---------------------------------------------------- + +[ + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"], + ["punctuation", "["], + ["punctuation", "]"], + + ["punctuation", ";"], + ["punctuation", ","], + ["punctuation", ":"], + ["punctuation", "."] +] diff --git a/tests/languages/v/attribute_feature.test b/tests/languages/v/attribute_feature.test new file mode 100644 index 0000000000..877e2b8664 --- /dev/null +++ b/tests/languages/v/attribute_feature.test @@ -0,0 +1,59 @@ +[deprecated] +[unsafe_fn] +[typedef] +[live] +[inline] +[flag] +[ref_only] +[windows_stdcall] +[direct_array_access] + +---------------------------------------------------- + +[ + ["attribute", [ + ["punctuation", "["], + ["keyword", "deprecated"], + ["punctuation", "]"] + ]], + ["attribute", [ + ["punctuation", "["], + ["keyword", "unsafe_fn"], + ["punctuation", "]"] + ]], + ["attribute", [ + ["punctuation", "["], + ["keyword", "typedef"], + ["punctuation", "]"] + ]], + ["attribute", [ + ["punctuation", "["], + ["keyword", "live"], + ["punctuation", "]"] + ]], + ["attribute", [ + ["punctuation", "["], + ["keyword", "inline"], + ["punctuation", "]"] + ]], + ["attribute", [ + ["punctuation", "["], + ["keyword", "flag"], + ["punctuation", "]"] + ]], + ["attribute", [ + ["punctuation", "["], + ["keyword", "ref_only"], + ["punctuation", "]"] + ]], + ["attribute", [ + ["punctuation", "["], + ["keyword", "windows_stdcall"], + ["punctuation", "]"] + ]], + ["attribute", [ + ["punctuation", "["], + ["keyword", "direct_array_access"], + ["punctuation", "]"] + ]] +] From 5a9cb178c3159eabdcb59486e810cd9c5d8b8a07 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Tue, 4 May 2021 18:12:08 +0200 Subject: [PATCH 12/18] Idris: Fixed import statement --- components/prism-idris.js | 7 +++++-- tests/languages/idris/import_statement_feature.test | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/components/prism-idris.js b/components/prism-idris.js index 5924baa6dd..82a473f5aa 100644 --- a/components/prism-idris.js +++ b/components/prism-idris.js @@ -3,11 +3,14 @@ Prism.languages.idris = Prism.languages.extend('haskell', { pattern: /(?:(?:--|\|\|\|).*$|{-[\s\S]*?-})/m, }, 'keyword': /\b(?:Type|case|class|codata|constructor|corecord|data|do|dsl|else|export|if|implementation|implicit|import|impossible|in|infix|infixl|infixr|instance|interface|let|module|mutual|namespace|of|parameters|partial|postulate|private|proof|public|quoteGoal|record|rewrite|syntax|then|total|using|where|with)\b/, + 'builtin': undefined +}); + +Prism.languages.insertBefore('idris', 'keyword', { 'import-statement': { - pattern: /(^\s*)import\s+(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*/m, + pattern: /(^\s*import\s+)(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*/m, lookbehind: true }, - 'builtin': undefined }); Prism.languages.idr = Prism.languages.idris; diff --git a/tests/languages/idris/import_statement_feature.test b/tests/languages/idris/import_statement_feature.test index 6d647d9234..28feefdaba 100644 --- a/tests/languages/idris/import_statement_feature.test +++ b/tests/languages/idris/import_statement_feature.test @@ -1,10 +1,11 @@ import Foo +import Maths.NumOps ---------------------------------------------------- [ - ["keyword", "import"], - ["constant", "Foo"] + ["keyword", "import"], ["import-statement", "Foo"], + ["keyword", "import"], ["import-statement", "Maths.NumOps"] ] ---------------------------------------------------- From a5fb1effa5d50574ea3f6584cf8b46264467c915 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Tue, 4 May 2021 18:13:00 +0200 Subject: [PATCH 13/18] Rebuild --- components/prism-idris.min.js | 2 +- components/prism-typescript.min.js | 2 +- components/prism-uri.min.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/prism-idris.min.js b/components/prism-idris.min.js index da0ab48bc4..326ba706d6 100644 --- a/components/prism-idris.min.js +++ b/components/prism-idris.min.js @@ -1 +1 @@ -Prism.languages.idris=Prism.languages.extend("haskell",{comment:{pattern:/(?:(?:--|\|\|\|).*$|{-[\s\S]*?-})/m},keyword:/\b(?:Type|case|class|codata|constructor|corecord|data|do|dsl|else|export|if|implementation|implicit|import|impossible|in|infix|infixl|infixr|instance|interface|let|module|mutual|namespace|of|parameters|partial|postulate|private|proof|public|quoteGoal|record|rewrite|syntax|then|total|using|where|with)\b/,"import-statement":{pattern:/(^\s*)import\s+(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*/m,lookbehind:!0},builtin:void 0}),Prism.languages.idr=Prism.languages.idris; \ No newline at end of file +Prism.languages.idris=Prism.languages.extend("haskell",{comment:{pattern:/(?:(?:--|\|\|\|).*$|{-[\s\S]*?-})/m},keyword:/\b(?:Type|case|class|codata|constructor|corecord|data|do|dsl|else|export|if|implementation|implicit|import|impossible|in|infix|infixl|infixr|instance|interface|let|module|mutual|namespace|of|parameters|partial|postulate|private|proof|public|quoteGoal|record|rewrite|syntax|then|total|using|where|with)\b/,builtin:void 0}),Prism.languages.insertBefore("idris","keyword",{"import-statement":{pattern:/(^\s*import\s+)(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*/m,lookbehind:!0}}),Prism.languages.idr=Prism.languages.idris; \ No newline at end of file diff --git a/components/prism-typescript.min.js b/components/prism-typescript.min.js index 84d1d37dd9..bb25410cb1 100644 --- a/components/prism-typescript.min.js +++ b/components/prism-typescript.min.js @@ -1 +1 @@ -!function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|as|declare|implements|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)(?!\s*[^\s_${}*a-zA-Z\xA0-\uFFFF])/),delete e.languages.typescript.parameter;var s=e.languages.extend("typescript",{});delete s["class-name"],e.languages.typescript["class-name"].inside=s,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:s}}}}),e.languages.ts=e.languages.typescript}(Prism); \ No newline at end of file +!function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)(?!\s*[^\s_${}*a-zA-Z\xA0-\uFFFF])/),delete e.languages.typescript.parameter;var s=e.languages.extend("typescript",{});delete s["class-name"],e.languages.typescript["class-name"].inside=s,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:s}}}}),e.languages.ts=e.languages.typescript}(Prism); \ No newline at end of file diff --git a/components/prism-uri.min.js b/components/prism-uri.min.js index aecc7c8ff0..c6479c0593 100644 --- a/components/prism-uri.min.js +++ b/components/prism-uri.min.js @@ -1 +1 @@ -Prism.languages.uri={scheme:{pattern:/^[a-z][a-z0-9+.-]*:/im,greedy:!0,inside:{"scheme-delimiter":/:$/}},fragment:{pattern:/#[\w\-.~!$&'()*+,;=%:@/?]*/,inside:{"fragment-delimiter":/^#/}},query:{pattern:/\?[\w\-.~!$&'()*+,;=%:@/?]*/,inside:{"query-delimiter":{pattern:/^\?/,greedy:!0},"pair-delimiter":/[&;]/,pair:{pattern:/^[^=][\s\S]*/,inside:{key:/^[^=]+/,value:{pattern:/(^=)[\s\S]+/,lookbehind:!0}}}}},authority:{pattern:RegExp("^//(?:[\\w\\-.~!$&'()*+,;=%:]*@)?(?:\\[(?:[0-9a-fA-F:.]{2,48}|v[0-9a-fA-F]+\\.[\\w\\-.~!$&'()*+,;=]+)\\]|[\\w\\-.~!$&'()*+,;=%]*)(?::\\d*)?","m"),inside:{"authority-delimiter":/^\/\//,"user-info-segment":{pattern:/^[\w\-.~!$&'()*+,;=%:]*@/,inside:{"user-info-delimiter":/@$/,"user-info":/^[\w\-.~!$&'()*+,;=%:]+/}},"port-segment":{pattern:/:\d*$/,inside:{"port-delimiter":/^:/,port:/^\d+/}},host:{pattern:/[\s\S]+/,inside:{"ip-literal":{pattern:/^\[[\s\S]+\]$/,inside:{"ip-literal-delimiter":/^\[|\]$/,"ipv-future":/^v[\s\S]+/,"ipv6-address":/^[\s\S]+/}},"ipv4-address":/^(?:(?:[03-9]\d?|[12]\d{0,2})\.){3}(?:[03-9]\d?|[12]{0,2})$/}}}},path:{pattern:/^[\w\-.~!$&'()*+,;=%:@/]+/m,inside:{"path-separator":/\//}}},Prism.languages.url=Prism.languages.uri; \ No newline at end of file +Prism.languages.uri={scheme:{pattern:/^[a-z][a-z0-9+.-]*:/im,greedy:!0,inside:{"scheme-delimiter":/:$/}},fragment:{pattern:/#[\w\-.~!$&'()*+,;=%:@/?]*/,inside:{"fragment-delimiter":/^#/}},query:{pattern:/\?[\w\-.~!$&'()*+,;=%:@/?]*/,inside:{"query-delimiter":{pattern:/^\?/,greedy:!0},"pair-delimiter":/[&;]/,pair:{pattern:/^[^=][\s\S]*/,inside:{key:/^[^=]+/,value:{pattern:/(^=)[\s\S]+/,lookbehind:!0}}}}},authority:{pattern:RegExp("^//(?:[\\w\\-.~!$&'()*+,;=%:]*@)?(?:\\[(?:[0-9a-fA-F:.]{2,48}|v[0-9a-fA-F]+\\.[\\w\\-.~!$&'()*+,;=]+)\\]|[\\w\\-.~!$&'()*+,;=%]*)(?::\\d*)?","m"),inside:{"authority-delimiter":/^\/\//,"user-info-segment":{pattern:/^[\w\-.~!$&'()*+,;=%:]*@/,inside:{"user-info-delimiter":/@$/,"user-info":/^[\w\-.~!$&'()*+,;=%:]+/}},"port-segment":{pattern:/:\d*$/,inside:{"port-delimiter":/^:/,port:/^\d+/}},host:{pattern:/[\s\S]+/,inside:{"ip-literal":{pattern:/^\[[\s\S]+\]$/,inside:{"ip-literal-delimiter":/^\[|\]$/,"ipv-future":/^v[\s\S]+/,"ipv6-address":/^[\s\S]+/}},"ipv4-address":/^(?:(?:[03-9]\d?|[12]\d{0,2})\.){3}(?:[03-9]\d?|[12]\d{0,2})$/}}}},path:{pattern:/^[\w\-.~!$&'()*+,;=%:@/]+/m,inside:{"path-separator":/\//}}},Prism.languages.url=Prism.languages.uri; \ No newline at end of file From bacc314a09f317e3226dca4fd958ba95e61e52b6 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Tue, 4 May 2021 18:23:17 +0200 Subject: [PATCH 14/18] ICU message format: Added more tests --- .../arg-skeleton_feature.test | 36 +++++++++++++++++-- .../plural-style_feature.test | 18 +++++++++- .../icu-message-format/string_feature.test | 36 +++++++++++++++++++ 3 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 tests/languages/icu-message-format/string_feature.test diff --git a/tests/languages/icu-message-format/arg-skeleton_feature.test b/tests/languages/icu-message-format/arg-skeleton_feature.test index c198ea362b..c822826fce 100644 --- a/tests/languages/icu-message-format/arg-skeleton_feature.test +++ b/tests/languages/icu-message-format/arg-skeleton_feature.test @@ -1,5 +1,9 @@ At {1,time,::jmm} on {1,date,::dMMMM}, there was {2} on planet {3,number,integer}. +{foo,spellout} +{foo,ordinal} +{foo,duration} + ---------------------------------------------------- [ @@ -47,5 +51,33 @@ At {1,time,::jmm} on {1,date,::dMMMM}, there was {2} on planet {3,number,integer ]], ["argument-delimiter", "}"] ]], - "." -] \ No newline at end of file + ".\r\n\r\n", + + ["argument", [ + ["argument-delimiter", "{"], + ["content", [ + ["argument-name", "foo"], + ["punctuation", ","], + ["arg-type", "spellout"] + ]], + ["argument-delimiter", "}"] + ]], + ["argument", [ + ["argument-delimiter", "{"], + ["content", [ + ["argument-name", "foo"], + ["punctuation", ","], + ["arg-type", "ordinal"] + ]], + ["argument-delimiter", "}"] + ]], + ["argument", [ + ["argument-delimiter", "{"], + ["content", [ + ["argument-name", "foo"], + ["punctuation", ","], + ["arg-type", "duration"] + ]], + ["argument-delimiter", "}"] + ]] +] diff --git a/tests/languages/icu-message-format/plural-style_feature.test b/tests/languages/icu-message-format/plural-style_feature.test index 516f1bda4d..8c3478b7fd 100644 --- a/tests/languages/icu-message-format/plural-style_feature.test +++ b/tests/languages/icu-message-format/plural-style_feature.test @@ -20,6 +20,8 @@ https://unicode-org.github.io/icu/userguide/format_parse/messages/ =2 {{host} invites {guest} and one other person to their party.} other {{host} invites {guest} and # other people to their party.}}}} +{num_guests, selectordinal, foo} + ---------------------------------------------------- [ @@ -371,5 +373,19 @@ https://unicode-org.github.io/icu/userguide/format_parse/messages/ ]] ]], ["argument-delimiter", "}"] + ]], + + ["argument", [ + ["argument-delimiter", "{"], + ["content", [ + ["argument-name", "num_guests"], + ["punctuation", ","], + ["keyword", "selectordinal"], + ["punctuation", ","], + ["plural-style", [ + ["selector", ["foo"]] + ]] + ]], + ["argument-delimiter", "}"] ]] -] \ No newline at end of file +] diff --git a/tests/languages/icu-message-format/string_feature.test b/tests/languages/icu-message-format/string_feature.test new file mode 100644 index 0000000000..8fb783ec88 --- /dev/null +++ b/tests/languages/icu-message-format/string_feature.test @@ -0,0 +1,36 @@ +foo '{1}' {1} '' {1} + +foo {foo, '{1}'} + +---------------------------------------------------- + +[ + "foo ", + ["string", ["'{1}'"]], + ["argument", [ + ["argument-delimiter", "{"], + ["content", [ + ["argument-name", "1"] + ]], + ["argument-delimiter", "}"] + ]], + ["escape", "''"], + ["argument", [ + ["argument-delimiter", "{"], + ["content", [ + ["argument-name", "1"] + ]], + ["argument-delimiter", "}"] + ]], + + "\r\n\r\nfoo ", + ["argument", [ + ["argument-delimiter", "{"], + ["content", [ + ["argument-name", "foo"], + ["punctuation", ","], + ["arg-style-text", "'{1}'"] + ]], + ["argument-delimiter", "}"] + ]] +] From 0e1dd36c04523f1e09b95dd8d50efb226754a70f Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Tue, 4 May 2021 18:34:45 +0200 Subject: [PATCH 15/18] PHP: Removed unnecessary patterns --- components/prism-php.js | 16 ++-------------- components/prism-php.min.js | 2 +- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/components/prism-php.js b/components/prism-php.js index 584f666eeb..50ab37ff60 100644 --- a/components/prism-php.js +++ b/components/prism-php.js @@ -66,12 +66,6 @@ greedy: true, lookbehind: true }, - { - pattern: /([(,?]\s*[a-z0-9_|]\|\s*)(?:null|false)\b(?=\s*\$)/i, - alias: 'type-hint', - greedy: true, - lookbehind: true - }, { pattern: /(\)\s*:\s*(?:\?\s*)?)\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b/i, alias: 'return-type', @@ -79,18 +73,12 @@ lookbehind: true }, { - pattern: /(\)\s*:\s*(?:\?\s*)?[a-z0-9_|]\|\s*)(?:null|false)\b/i, - alias: 'return-type', - greedy: true, - lookbehind: true - }, - { - pattern: /\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|iterable|(?:null|false)(?=\s*\|))\b/i, + pattern: /\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|iterable)\b/i, alias: 'type-declaration', greedy: true }, { - pattern: /(\|\s*)(?:null|false)\b/i, + pattern: /(\|\s*)(?:null|false)\b|\b(?:null|false)(?=\s*\|)/i, alias: 'type-declaration', greedy: true, lookbehind: true diff --git a/components/prism-php.min.js b/components/prism-php.min.js index 9733bd4da1..8e6b6392e1 100644 --- a/components/prism-php.min.js +++ b/components/prism-php.min.js @@ -1 +1 @@ -!function(a){var e=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,t=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],i=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,n=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,s=/[{}\[\](),:;]/;a.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:e,variable:/\$+(?:\w+\b|(?={))/i,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:bool|boolean|int|integer|float|string|object|array)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:bool|int|float|string|object|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*[a-z0-9_|]\|\s*)(?:null|false)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?[a-z0-9_|]\|\s*)(?:null|false)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|iterable|(?:null|false)(?=\s*\|))\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:null|false)\b/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|match|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s+)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,function:/\b\w+(?=\s*\()/,property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:i,operator:n,punctuation:s};var l={pattern:/{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:a.languages.php},r=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:l}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:l}}];a.languages.insertBefore("php","variable",{string:r,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=]$)/,lookbehind:!0,inside:{comment:e,string:r,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,number:i,operator:n,punctuation:s}},delimiter:{pattern:/^#\[|]$/,alias:"punctuation"}}}}),a.hooks.add("before-tokenize",function(e){if(/<\?/.test(e.code)){a.languages["markup-templating"].buildPlaceholders(e,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/gi)}}),a.hooks.add("after-tokenize",function(e){a.languages["markup-templating"].tokenizePlaceholders(e,"php")})}(Prism); \ No newline at end of file +!function(a){var e=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,t=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],i=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,n=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,s=/[{}\[\](),:;]/;a.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:e,variable:/\$+(?:\w+\b|(?={))/i,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:bool|boolean|int|integer|float|string|object|array)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:bool|int|float|string|object|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|iterable)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:null|false)\b|\b(?:null|false)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|match|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s+)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,function:/\b\w+(?=\s*\()/,property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:i,operator:n,punctuation:s};var l={pattern:/{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:a.languages.php},r=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:l}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:l}}];a.languages.insertBefore("php","variable",{string:r,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=]$)/,lookbehind:!0,inside:{comment:e,string:r,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,number:i,operator:n,punctuation:s}},delimiter:{pattern:/^#\[|]$/,alias:"punctuation"}}}}),a.hooks.add("before-tokenize",function(e){if(/<\?/.test(e.code)){a.languages["markup-templating"].buildPlaceholders(e,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/gi)}}),a.hooks.add("after-tokenize",function(e){a.languages["markup-templating"].tokenizePlaceholders(e,"php")})}(Prism); \ No newline at end of file From 83d25c22341fd716e99a31831edb5f5ef212392e Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Tue, 4 May 2021 18:43:06 +0200 Subject: [PATCH 16/18] Added more tests --- tests/languages/nevod/full.test | 283 +++++++++++++++++++++ tests/languages/nevod/package_feature.test | 79 ++++++ tests/languages/nevod/pattern_feature.test | 282 ++++++++++++++++++++ tests/languages/nevod/search_feature.test | 95 +++++++ 4 files changed, 739 insertions(+) create mode 100644 tests/languages/nevod/full.test create mode 100644 tests/languages/nevod/package_feature.test create mode 100644 tests/languages/nevod/pattern_feature.test create mode 100644 tests/languages/nevod/search_feature.test diff --git a/tests/languages/nevod/full.test b/tests/languages/nevod/full.test new file mode 100644 index 0000000000..e65b9719c3 --- /dev/null +++ b/tests/languages/nevod/full.test @@ -0,0 +1,283 @@ +@namespace Basic +{ + @search @pattern Url(Domain, Path, Query, Anchor) = + Method + Domain:Url.Domain + ?Port + ?Path:Url.Path + + ?Query:Url.Query + ?Anchor:Url.Anchor + @where { + Method = {'http', 'https' , 'ftp', 'mailto', 'file', 'data', + 'irc'} + '://'; + Domain = Word + [1+ '.' + Word + [0+ {Word, '_', '-'}]]; + Port = ':' + Num; + Path = ?'/' + [0+ {Word, '/', '_', '+', '-', '%', '.'}]; + + Query = '?' + ?(Param + [0+ '&' + Param]) + @where + { + Param = Identifier + '=' + Identifier + @where + { + Identifier = {Alpha, AlphaNum, '_'} + [0+ {Word, '_'}]; + }; + }; + + Anchor(Value) = '#' + Value:{Word}; + }; +} + +---------------------------------------------------- + +[ + ["keyword", "@namespace"], + ["namespace", "Basic"], + + ["operator", "{"], + + ["keyword", "@search"], + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "Url"], + ["fields", [ + ["punctuation", "("], + ["field-name", "Domain"], + ["punctuation", ","], + ["field-name", "Path"], + ["punctuation", ","], + ["field-name", "Query"], + ["punctuation", ","], + ["field-name", "Anchor"], + ["punctuation", ")"] + ]] + ]], + ["operator", "="], + + ["name", "Method"], + ["operator", "+"], + ["field-capture", [ + ["field-name", "Domain"], + ["colon", ":"] + ]], + ["name", "Url.Domain"], + ["operator", "+"], + ["operator", "?"], + ["name", "Port"], + ["operator", "+"], + ["operator", "?"], + ["field-capture", [ + ["field-name", "Path"], + ["colon", ":"] + ]], + ["name", "Url.Path"], + ["operator", "+"], + + ["operator", "?"], + ["field-capture", [ + ["field-name", "Query"], + ["colon", ":"] + ]], + ["name", "Url.Query"], + ["operator", "+"], + ["operator", "?"], + ["field-capture", [ + ["field-name", "Anchor"], + ["colon", ":"] + ]], + ["name", "Url.Anchor"], + + ["keyword", "@where"], + ["operator", "{"], + + ["pattern", [ + ["pattern-name", "Method"] + ]], + ["operator", "="], + ["operator", "{"], + ["string", ["'http'"]], + ["punctuation", ","], + ["string", ["'https'"]], + ["punctuation", ","], + ["string", ["'ftp'"]], + ["punctuation", ","], + ["string", ["'mailto'"]], + ["punctuation", ","], + ["string", ["'file'"]], + ["punctuation", ","], + ["string", ["'data'"]], + ["punctuation", ","], + + ["string", ["'irc'"]], + ["operator", "}"], + ["operator", "+"], + ["string", ["'://'"]], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "Domain"] + ]], + ["operator", "="], + ["standard-pattern", [ + ["standard-pattern-name", "Word"] + ]], + ["operator", "+"], + ["operator", "["], + ["quantifier", "1+"], + ["string", ["'.'"]], + ["operator", "+"], + ["standard-pattern", [ + ["standard-pattern-name", "Word"] + ]], + ["operator", "+"], + ["operator", "["], + ["quantifier", "0+"], + ["operator", "{"], + ["standard-pattern", [ + ["standard-pattern-name", "Word"] + ]], + ["punctuation", ","], + ["string", ["'_'"]], + ["punctuation", ","], + ["string", ["'-'"]], + ["operator", "}"], + ["operator", "]"], + ["operator", "]"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "Port"] + ]], + ["operator", "="], + ["string", ["':'"]], + ["operator", "+"], + ["standard-pattern", [ + ["standard-pattern-name", "Num"] + ]], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "Path"] + ]], + ["operator", "="], + ["operator", "?"], + ["string", ["'/'"]], + ["operator", "+"], + ["operator", "["], + ["quantifier", "0+"], + ["operator", "{"], + ["standard-pattern", [ + ["standard-pattern-name", "Word"] + ]], + ["punctuation", ","], + ["string", ["'/'"]], + ["punctuation", ","], + ["string", ["'_'"]], + ["punctuation", ","], + ["string", ["'+'"]], + ["punctuation", ","], + ["string", ["'-'"]], + ["punctuation", ","], + ["string", ["'%'"]], + ["punctuation", ","], + ["string", ["'.'"]], + ["operator", "}"], + ["operator", "]"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "Query"] + ]], + ["operator", "="], + ["string", ["'?'"]], + ["operator", "+"], + ["operator", "?"], + ["punctuation", "("], + ["name", "Param"], + ["operator", "+"], + ["operator", "["], + ["quantifier", "0+"], + ["string", ["'&'"]], + ["operator", "+"], + ["name", "Param"], + ["operator", "]"], + ["punctuation", ")"], + + ["keyword", "@where"], + + ["operator", "{"], + + ["pattern", [ + ["pattern-name", "Param"] + ]], + ["operator", "="], + ["name", "Identifier"], + ["operator", "+"], + ["string", ["'='"]], + ["operator", "+"], + ["name", "Identifier"], + + ["keyword", "@where"], + + ["operator", "{"], + + ["pattern", [ + ["pattern-name", "Identifier"] + ]], + ["operator", "="], + ["operator", "{"], + ["standard-pattern", [ + ["standard-pattern-name", "Alpha"] + ]], + ["punctuation", ","], + ["standard-pattern", [ + ["standard-pattern-name", "Alpha"] + ]], + ["standard-pattern", [ + ["standard-pattern-name", "Num"] + ]], + ["punctuation", ","], + ["string", ["'_'"]], + ["operator", "}"], + ["operator", "+"], + ["operator", "["], + ["quantifier", "0+"], + ["operator", "{"], + ["standard-pattern", [ + ["standard-pattern-name", "Word"] + ]], + ["punctuation", ","], + ["string", ["'_'"]], + ["operator", "}"], + ["operator", "]"], + ["punctuation", ";"], + + ["operator", "}"], + ["punctuation", ";"], + + ["operator", "}"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "Anchor"], + ["fields", [ + ["punctuation", "("], + ["field-name", "Value"], + ["punctuation", ")"] + ]] + ]], + ["operator", "="], + ["string", ["'#'"]], + ["operator", "+"], + ["field-capture", [ + ["field-name", "Value"], + ["colon", ":"] + ]], + ["operator", "{"], + ["standard-pattern", [ + ["standard-pattern-name", "Word"] + ]], + ["operator", "}"], + ["punctuation", ";"], + + ["operator", "}"], + ["punctuation", ";"], + + ["operator", "}"] +] diff --git a/tests/languages/nevod/package_feature.test b/tests/languages/nevod/package_feature.test new file mode 100644 index 0000000000..bc6b83b379 --- /dev/null +++ b/tests/languages/nevod/package_feature.test @@ -0,0 +1,79 @@ +@namespace Basic +{ + @search @pattern GUID = Word(8) + [3 '-' + Word(4)] + '-' + Word(12); +} + +@require "GUID.np"; + +@namespace Basic +{ + @search @pattern GUID-in-Braces = '{' + GUID + '}'; +} + +---------------------------------------------------- + +[ + ["keyword", "@namespace"], + ["namespace", "Basic"], + + ["operator", "{"], + + ["keyword", "@search"], + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "GUID"] + ]], + ["operator", "="], + ["standard-pattern", [ + ["standard-pattern-name", "Word"], + ["punctuation", "("], + ["quantifier", "8"], + ["punctuation", ")"] + ]], + ["operator", "+"], + ["operator", "["], + ["quantifier", "3"], + ["string", ["'-'"]], + ["operator", "+"], + ["standard-pattern", [ + ["standard-pattern-name", "Word"], + ["punctuation", "("], + ["quantifier", "4"], + ["punctuation", ")"] + ]], + ["operator", "]"], + ["operator", "+"], + ["string", ["'-'"]], + ["operator", "+"], + ["standard-pattern", [ + ["standard-pattern-name", "Word"], + ["punctuation", "("], + ["quantifier", "12"], + ["punctuation", ")"] + ]], + ["punctuation", ";"], + + ["operator", "}"], + + ["keyword", "@require"], ["string", ["\"GUID.np\""]], ["punctuation", ";"], + + ["keyword", "@namespace"], + ["namespace", "Basic"], + + ["operator", "{"], + + ["keyword", "@search"], + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "GUID-in-Braces"] + ]], + ["operator", "="], + ["string", ["'{'"]], + ["operator", "+"], + ["name", "GUID"], + ["operator", "+"], + ["string", ["'}'"]], + ["punctuation", ";"], + + ["operator", "}"] +] diff --git a/tests/languages/nevod/pattern_feature.test b/tests/languages/nevod/pattern_feature.test new file mode 100644 index 0000000000..91d3924dc5 --- /dev/null +++ b/tests/languages/nevod/pattern_feature.test @@ -0,0 +1,282 @@ +P = "text"; +P = Alpha; +P2 = P1; P1 = Word; +P = A + B; +P = {A, B}; +P = [1+ A]; + +#P = "text"; + +@pattern P = Alpha; +@search @pattern P = Alpha; +@pattern P = W @where { @pattern W = Word; }; +@pattern #P = W + S @where { @pattern #W = Word; @pattern S = Space; }; + +#P(X, Y) = X: A ... Y: B; +#P(X) = A .. X .. B; +#P1(X, Y) = P2(X: Q, Y: S); +#P(X) = X: Word ... X; +#P(X, Y) = {X: Punct + X, Y: Symbol + Y}; + +---------------------------------------------------- + +[ + ["pattern", [ + ["pattern-name", "P"] + ]], + ["operator", "="], + ["string", ["\"text\""]], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "P"] + ]], + ["operator", "="], + ["standard-pattern", [ + ["standard-pattern-name", "Alpha"] + ]], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "P2"] + ]], + ["operator", "="], + ["name", "P1"], + ["punctuation", ";"], + ["pattern", [ + ["pattern-name", "P1"] + ]], + ["operator", "="], + ["standard-pattern", [ + ["standard-pattern-name", "Word"] + ]], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "P"] + ]], + ["operator", "="], + ["name", "A"], + ["operator", "+"], + ["name", "B"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "P"] + ]], + ["operator", "="], + ["operator", "{"], + ["name", "A"], + ["punctuation", ","], + ["name", "B"], + ["operator", "}"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "P"] + ]], + ["operator", "="], + ["operator", "["], + ["quantifier", "1+"], + ["name", "A"], + ["operator", "]"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "#P"] + ]], + ["operator", "="], + ["string", ["\"text\""]], + ["punctuation", ";"], + + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "P"] + ]], + ["operator", "="], + ["standard-pattern", [ + ["standard-pattern-name", "Alpha"] + ]], + ["punctuation", ";"], + + ["keyword", "@search"], + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "P"] + ]], + ["operator", "="], + ["standard-pattern", [ + ["standard-pattern-name", "Alpha"] + ]], + ["punctuation", ";"], + + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "P"] + ]], + ["operator", "="], + ["name", "W"], + ["keyword", "@where"], + ["operator", "{"], + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "W"] + ]], + ["operator", "="], + ["standard-pattern", [ + ["standard-pattern-name", "Word"] + ]], + ["punctuation", ";"], + ["operator", "}"], + ["punctuation", ";"], + + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "#P"] + ]], + ["operator", "="], + ["name", "W"], + ["operator", "+"], + ["name", "S"], + ["keyword", "@where"], + ["operator", "{"], + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "#W"] + ]], + ["operator", "="], + ["standard-pattern", [ + ["standard-pattern-name", "Word"] + ]], + ["punctuation", ";"], + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "S"] + ]], + ["operator", "="], + ["standard-pattern", [ + ["standard-pattern-name", "Space"] + ]], + ["punctuation", ";"], + ["operator", "}"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "#P"], + ["fields", [ + ["punctuation", "("], + ["field-name", "X"], + ["punctuation", ","], + ["field-name", "Y"], + ["punctuation", ")"] + ]] + ]], + ["operator", "="], + ["field-capture", [ + ["field-name", "X"], + ["colon", ":"] + ]], + ["name", "A"], + ["operator", "..."], + ["field-capture", [ + ["field-name", "Y"], + ["colon", ":"] + ]], + ["name", "B"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "#P"], + ["fields", [ + ["punctuation", "("], + ["field-name", "X"], + ["punctuation", ")"] + ]] + ]], + ["operator", "="], + ["name", "A"], + ["operator", ".."], + ["name", "X"], + ["operator", ".."], + ["name", "B"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "#P1"], + ["fields", [ + ["punctuation", "("], + ["field-name", "X"], + ["punctuation", ","], + ["field-name", "Y"], + ["punctuation", ")"] + ]] + ]], + ["operator", "="], + ["name", "P2"], + ["punctuation", "("], + ["field-capture", [ + ["field-name", "X"], + ["colon", ":"], + ["field-name", "Q"], + ", ", + ["field-name", "Y"], + ["colon", ":"], + ["field-name", "S"] + ]], + ["punctuation", ")"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "#P"], + ["fields", [ + ["punctuation", "("], + ["field-name", "X"], + ["punctuation", ")"] + ]] + ]], + ["operator", "="], + ["field-capture", [ + ["field-name", "X"], + ["colon", ":"] + ]], + ["standard-pattern", [ + ["standard-pattern-name", "Word"] + ]], + ["operator", "..."], + ["name", "X"], + ["punctuation", ";"], + + ["pattern", [ + ["pattern-name", "#P"], + ["fields", [ + ["punctuation", "("], + ["field-name", "X"], + ["punctuation", ","], + ["field-name", "Y"], + ["punctuation", ")"] + ]] + ]], + ["operator", "="], + ["operator", "{"], + ["field-capture", [ + ["field-name", "X"], + ["colon", ":"] + ]], + ["standard-pattern", [ + ["standard-pattern-name", "Punct"] + ]], + ["operator", "+"], + ["name", "X"], + ["punctuation", ","], + ["field-capture", [ + ["field-name", "Y"], + ["colon", ":"] + ]], + ["standard-pattern", [ + ["standard-pattern-name", "Symbol"] + ]], + ["operator", "+"], + ["name", "Y"], + ["operator", "}"], + ["punctuation", ";"] +] diff --git a/tests/languages/nevod/search_feature.test b/tests/languages/nevod/search_feature.test new file mode 100644 index 0000000000..c3dcf45207 --- /dev/null +++ b/tests/languages/nevod/search_feature.test @@ -0,0 +1,95 @@ +@namespace Basic +{ + @search @pattern GUID-in-Braces = '{' + GUID + '}'; +} + +@search Basic.GUID; +@search Basic.GUID-in-Braces; + +@namespace Basic +{ + @pattern GUID-in-Braces = '{' + GUID + '}'; +} + +@require "GUID.np"; + +@search Basic.*; + +@namespace Basic +{ + @pattern GUID-in-Braces = '{' + GUID + '}'; +} + +---------------------------------------------------- + +[ + ["keyword", "@namespace"], + ["namespace", "Basic"], + + ["operator", "{"], + + ["keyword", "@search"], + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "GUID-in-Braces"] + ]], + ["operator", "="], + ["string", ["'{'"]], + ["operator", "+"], + ["name", "GUID"], + ["operator", "+"], + ["string", ["'}'"]], + ["punctuation", ";"], + + ["operator", "}"], + + ["keyword", "@search"], + ["search", "Basic.GUID"], + ["punctuation", ";"], + + ["keyword", "@search"], + ["search", "Basic.GUID-in-Braces"], + ["punctuation", ";"], + + ["keyword", "@namespace"], + ["namespace", "Basic"], + + ["operator", "{"], + + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "GUID-in-Braces"] + ]], + ["operator", "="], + ["string", ["'{'"]], + ["operator", "+"], + ["name", "GUID"], + ["operator", "+"], + ["string", ["'}'"]], + ["punctuation", ";"], + + ["operator", "}"], + + ["keyword", "@require"], ["string", ["\"GUID.np\""]], ["punctuation", ";"], + + ["keyword", "@search"], ["search", "Basic.*"], ["punctuation", ";"], + + ["keyword", "@namespace"], + ["namespace", "Basic"], + + ["operator", "{"], + + ["keyword", "@pattern"], + ["pattern", [ + ["pattern-name", "GUID-in-Braces"] + ]], + ["operator", "="], + ["string", ["'{'"]], + ["operator", "+"], + ["name", "GUID"], + ["operator", "+"], + ["string", ["'}'"]], + ["punctuation", ";"], + + ["operator", "}"] +] From 5b35f1ac0843fbf95701917d59b9c6b021a1197b Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Tue, 4 May 2021 18:43:54 +0200 Subject: [PATCH 17/18] Fixed linting errors --- components/prism-lisp.js | 2 ++ tests/coverage.js | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/components/prism-lisp.js b/components/prism-lisp.js index 1451b53c72..97bdfc114f 100644 --- a/components/prism-lisp.js +++ b/components/prism-lisp.js @@ -2,6 +2,7 @@ /** * Functions to construct regular expressions * e.g. (interactive ... or (interactive) + * * @param {string} name * @returns {RegExp} */ @@ -10,6 +11,7 @@ } /** * booleans and numbers + * * @param {string} pattern * @returns {RegExp} */ diff --git a/tests/coverage.js b/tests/coverage.js index 481173e765..dcb8f6b0fc 100644 --- a/tests/coverage.js +++ b/tests/coverage.js @@ -1,11 +1,11 @@ -"use strict"; - -const TestDiscovery = require("./helper/test-discovery"); -const TestCase = require("./helper/test-case"); -const PrismLoader = require("./helper/prism-loader"); -const { BFS, BFSPathToPrismTokenPath } = require("./helper/util"); -const { assert } = require("chai"); -const components = require("../components.json"); +'use strict'; + +const TestDiscovery = require('./helper/test-discovery'); +const TestCase = require('./helper/test-case'); +const PrismLoader = require('./helper/prism-loader'); +const { BFS, BFSPathToPrismTokenPath } = require('./helper/util'); +const { assert } = require('chai'); +const components = require('../components.json'); const ALL_LANGUAGES = [...Object.keys(components.languages).filter(k => k !== 'meta')]; From a23014b6881bfdbc0039df5e4e05c7207fbf8d4b Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Mon, 17 May 2021 16:45:27 +0200 Subject: [PATCH 18/18] Resolved remaining conflicts --- components/prism-php.js | 2 +- tests/languages/php/class-name_feature.test | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/prism-php.js b/components/prism-php.js index 3e5daf078b..99e73393e3 100644 --- a/components/prism-php.js +++ b/components/prism-php.js @@ -5,7 +5,7 @@ * * Supports PHP 5.3 - 8.0 */ - (function (Prism) { +(function (Prism) { var comment = /\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/; var constant = [ { diff --git a/tests/languages/php/class-name_feature.test b/tests/languages/php/class-name_feature.test index 4ac2b251f1..bf5319919a 100644 --- a/tests/languages/php/class-name_feature.test +++ b/tests/languages/php/class-name_feature.test @@ -35,7 +35,7 @@ class Foo extends \Package\Bar implements App\Baz {} ["class-name", "Foo"], ["operator", "::"], - ["function", "bar"], + ["function", ["bar"]], ["punctuation", "("], ["punctuation", ")"], ["punctuation", ";"], @@ -45,7 +45,7 @@ class Foo extends \Package\Bar implements App\Baz {} "Foo" ]], ["operator", "::"], - ["function", "bar"], + ["function", ["bar"]], ["punctuation", "("], ["punctuation", ")"], ["punctuation", ";"], @@ -57,7 +57,7 @@ class Foo extends \Package\Bar implements App\Baz {} "Foo" ]], ["operator", "::"], - ["function", "bar"], + ["function", ["bar"]], ["punctuation", "("], ["punctuation", ")"], ["punctuation", ";"],