Skip to content

Commit

Permalink
feat: upgrade oniguruma-to-js
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Sep 4, 2024
1 parent a8d973b commit e6f5cf2
Show file tree
Hide file tree
Showing 351 changed files with 3,600 additions and 2,337 deletions.
231 changes: 231 additions & 0 deletions foo.md

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
"prepare": "simple-git-hooks"
},
"devDependencies": {
"@antfu/eslint-config": "^3.0.0",
"@antfu/eslint-config": "^3.2.0",
"@antfu/ni": "^0.23.0",
"@antfu/utils": "^0.7.10",
"@iconify-json/svg-spinners": "^1.2.0",
"@shikijs/core": "^1.15.2",
"@shikijs/core": "^1.16.1",
"@types/adm-zip": "^0.5.5",
"@types/cson": "^7.20.3",
"@types/js-yaml": "^4.0.9",
"@types/json-stable-stringify": "^1.0.36",
"@types/node": "^22.5.2",
"@types/node": "^22.5.3",
"@types/semver": "^7.5.8",
"@vitest/expect": "^2.0.5",
"adm-zip": "^0.5.16",
Expand All @@ -46,7 +46,7 @@
"lint-staged": "^15.2.10",
"octokit": "^4.0.2",
"ofetch": "^1.3.4",
"oniguruma-to-js": "^0.3.0",
"oniguruma-to-js": "^0.3.1",
"p-limit": "^6.1.0",
"pnpm": "^9.9.0",
"rimraf": "^6.0.1",
Expand All @@ -55,10 +55,10 @@
"simple-git-hooks": "^2.11.1",
"typescript": "^5.5.4",
"unbuild": "^2.0.0",
"vite": "^5.4.2",
"vite": "^5.4.3",
"vitest": "^2.0.5",
"vue-tsc": "^2.1.4",
"yaml": "^2.5.0"
"vue-tsc": "^2.1.6",
"yaml": "^2.5.1"
},
"simple-git-hooks": {
"pre-commit": "npx lint-staged"
Expand Down
2 changes: 1 addition & 1 deletion packages/tm-grammars/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -2135,7 +2135,7 @@ SOFTWARE.

=========================================================================================================
Files: cue.json
License: https://raw.githubusercontent.com/cue-sh/vscode-cue/master/LICENSE
License: https://raw.githubusercontent.com/cue-lang/vscode-cue/master/LICENSE
SPDX: MIT
---------------------------------------------------------------------------------------------------------
MIT License
Expand Down
240 changes: 120 additions & 120 deletions packages/tm-grammars/README.md

Large diffs are not rendered by default.

231 changes: 231 additions & 0 deletions packages/tm-grammars/grammar-syntaxes.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions packages/tm-grammars/grammars/abap.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"name": "storage.modifier.method.abap"
}
},
"match": "(?i)(?<=\\s)(USING)\\s+([a-z_\\/][a-z_0-9\\/=\\>]*)+(?=\\s+|\\.)"
"match": "(?i)(?<=\\s)(USING)\\s+([a-z_\\/][a-z_0-9\\/=>]*)+(?=\\s+|\\.)"
},
{
"begin": "(?=[A-Za-z_][A-Za-z0-9_]*)",
Expand Down Expand Up @@ -191,7 +191,7 @@
]
},
{
"begin": "(?i)^\\s*(FORM)\\s([a-z_\\/][a-z_0-9\\/\\-\\?]*)",
"begin": "(?i)^\\s*(FORM)\\s([a-z_\\/][a-z_0-9\\/\\-?]*)",
"beginCaptures": {
"1": {
"name": "storage.type.block.abap"
Expand Down Expand Up @@ -268,15 +268,15 @@
]
},
"arithmetic_operator": {
"match": "(?i)(?<=\\s)(\\+|\\-|\\*|\\*\\*|\\/|%|DIV|MOD|BIT-AND|BIT-OR|BIT-XOR|BIT-NOT)(?=\\s)",
"match": "(?i)(?<=\\s)(\\+|-|\\*|\\*\\*|\\/|%|DIV|MOD|BIT-AND|BIT-OR|BIT-XOR|BIT-NOT)(?=\\s)",
"name": "keyword.control.simple.abap"
},
"builtin_functions": {
"match": "(?i)(?<=\\s)(abs|sign|ceil|floor|trunc|frac|acos|asin|atan|cos|sin|tan|cosh|sinh|tanh|exp|log|log10|sqrt|strlen|xstrlen|charlen|lines|numofchar|dbmaxlen|round|rescale|nmax|nmin|cmax|cmin|boolc|boolx|xsdbool|contains|contains_any_of|contains_any_not_of|matches|line_exists|ipow|char_off|count|count_any_of|count_any_not_of|distance|condense|concat_lines_of|escape|find|find_end|find_any_of|find_any_not_of|insert|match|repeat|replace|reverse|segment|shift_left|shift_right|substring|substring_after|substring_from|substring_before|substring_to|to_upper|to_lower|to_mixed|from_mixed|translate|bit-set|line_index)(?=\\()",
"name": "entity.name.function.builtin.abap"
},
"comparison_operator": {
"match": "(?i)(?<=\\s)(<|>|<\\=|>\\=|\\=|<>|eq|ne|lt|le|gt|ge|cs|cp|co|cn|ca|na|ns|np|byte-co|byte-cn|byte-ca|byte-na|byte-cs|byte-ns|o|z|m)(?=\\s)",
"match": "(?i)(?<=\\s)(<|>|<=|>=|=|<>|eq|ne|lt|le|gt|ge|cs|cp|co|cn|ca|na|ns|np|byte-co|byte-cn|byte-ca|byte-na|byte-cs|byte-ns|o|z|m)(?=\\s)",
"name": "keyword.control.simple.abap"
},
"control_keywords": {
Expand Down
18 changes: 9 additions & 9 deletions packages/tm-grammars/grammars/actionscript-3.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
],
"repository": {
"arithmetic_operators": {
"match": "(\\+|\\-|/|%|(?<!:)\\*)",
"match": "(\\+|-|/|%|(?<!:)\\*)",
"name": "keyword.operator.actionscript.3"
},
"array_access_operators": {
Expand Down Expand Up @@ -358,7 +358,7 @@
]
},
"functions": {
"begin": "\\b(function)\\b(?:\\s+\\b(get|set)\\b\\s+)?\\s*([a-zA-Z0-9_\\$]+\\b)?",
"begin": "\\b(function)\\b(?:\\s+\\b(get|set)\\b\\s+)?\\s*([a-zA-Z0-9_$]+\\b)?",
"beginCaptures": {
"1": {
"name": "storage.type.function.actionscript.3"
Expand Down Expand Up @@ -391,7 +391,7 @@
}
},
"comment": "Following convention, let's guess that anything in all caps/digits (possible underscores) is a constant.",
"match": "\\b([A-Z\\$][A-Z0-9_]+)\\b"
"match": "\\b([A-Z$][A-Z0-9_]+)\\b"
},
"guess_type": {
"captures": {
Expand All @@ -400,7 +400,7 @@
}
},
"comment": "Following convention, let's guess that any word starting with one or more capital letters (that contains at least some lower-case letters so that constants aren't detected) refers to a class/type. May be fully-qualified.",
"match": "\\b((?:[A-Za-z0-9_\\$]+\\.)*[A-Z][A-Z0-9]*[a-z]+[A-Za-z0-9_\\$]*)\\b"
"match": "\\b((?:[A-Za-z0-9_$]+\\.)*[A-Z][A-Z0-9]*[a-z]+[A-Za-z0-9_$]*)\\b"
},
"implements": {
"captures": {
Expand All @@ -426,7 +426,7 @@
"name": "support.type.actionscript.3"
}
},
"match": "(^|\\s+|;)\\b(import)\\b\\s+([A-Za-z0-9\\$_\\.]+(?:\\.\\*)?)\\s*(?=;|$)",
"match": "(^|\\s+|;)\\b(import)\\b\\s+([A-Za-z0-9$_\\.]+(?:\\.\\*)?)\\s*(?=;|$)",
"name": "meta.import.actionscript.3"
},
"interface": {
Expand Down Expand Up @@ -642,7 +642,7 @@
"name": "storage.modifier.actionscript.3"
}
},
"match": "((\\w+)\\s+)?(namespace)\\s+(?:[A-Za-z0-9_\\$]+)",
"match": "((\\w+)\\s+)?(namespace)\\s+(?:[A-Za-z0-9_$]+)",
"name": "meta.namespace_declaration.actionscript.3"
},
"numbers": {
Expand Down Expand Up @@ -772,7 +772,7 @@
"name": "meta.package_name.actionscript.3"
},
"parameters": {
"begin": "(\\.\\.\\.)?\\s*([A-Za-z\\_\\$][A-Za-z0-9_\\$]*)(?:\\s*(\\:)\\s*(?:(?:([A-Za-z\\$][A-Za-z0-9_\\$]+(?:\\.[A-Za-z\\$][A-Za-z0-9_\\$]+)*)(?:\\.<([A-Za-z\\$][A-Za-z0-9_\\$]+(?:\\.[A-Za-z\\$][A-Za-z0-9_\\$]+)*)>)?)|(\\*)))?(?:\\s*(=))?",
"begin": "(\\.\\.\\.)?\\s*([A-Za-z_$][A-Za-z0-9_$]*)(?:\\s*(:)\\s*(?:(?:([A-Za-z$][A-Za-z0-9_$]+(?:\\.[A-Za-z$][A-Za-z0-9_$]+)*)(?:\\.<([A-Za-z$][A-Za-z0-9_$]+(?:\\.[A-Za-z$][A-Za-z0-9_$]+)*)>)?)|(\\*)))?(?:\\s*(=))?",
"beginCaptures": {
"1": {
"name": "keyword.operator.actionscript.3"
Expand Down Expand Up @@ -881,7 +881,7 @@
"name": "support.type.actionscript.3"
}
},
"match": "(\\:)\\s*(?:([A-Za-z\\$][A-Za-z0-9_\\$]+(?:\\.[A-Za-z\\$][A-Za-z0-9_\\$]+)*)(?:\\.<([A-Za-z\\$][A-Za-z0-9_\\$]+(?:\\.[A-Za-z\\$][A-Za-z0-9_\\$]+)*)>)?)|(\\*)"
"match": "(:)\\s*(?:([A-Za-z$][A-Za-z0-9_$]+(?:\\.[A-Za-z$][A-Za-z0-9_$]+)*)(?:\\.<([A-Za-z$][A-Za-z0-9_$]+(?:\\.[A-Za-z$][A-Za-z0-9_$]+)*)>)?)|(\\*)"
},
"strings": {
"patterns": [
Expand Down Expand Up @@ -944,7 +944,7 @@
"name": "keyword.operator.actionscript.3"
}
},
"match": "((static)\\s+)?((\\w+)\\s+)?((static)\\s+)?(const|var)\\s+(?:[A-Za-z0-9_\\$]+)(?:\\s*(:))?",
"match": "((static)\\s+)?((\\w+)\\s+)?((static)\\s+)?(const|var)\\s+(?:[A-Za-z0-9_$]+)(?:\\s*(:))?",
"name": "meta.variable_declaration.actionscript.3"
},
"vector_creation_operators": {
Expand Down
12 changes: 6 additions & 6 deletions packages/tm-grammars/grammars/ada.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
]
}
},
"match": "(?i)\\b([^(=>)]*)\\s*(=>)\\s*([^,\\)]+)",
"match": "(?i)\\b([^(=>)]*)\\s*(=>)\\s*([^,)]+)",
"name": "meta.definition.array.aggregate.component.ada"
},
"array_dimensions": {
Expand Down Expand Up @@ -534,7 +534,7 @@
]
}
},
"match": "(?i)(\\d(?:(_)?\\d)*#)[0-9a-f](?:(_)?[0-9a-f])*(?:(\\.)[0-9a-f](?:(_)?[0-9a-f])*)?(#)([eE](?:\\+|\\-)?\\d(?:_?\\d)*)?",
"match": "(?i)(\\d(?:(_)?\\d)*#)[0-9a-f](?:(_)?[0-9a-f])*(?:(\\.)[0-9a-f](?:(_)?[0-9a-f])*)?(#)([eE](?:\\+|-)?\\d(?:_?\\d)*)?",
"name": "constant.numeric.ada"
},
"basic_declaration": {
Expand Down Expand Up @@ -941,7 +941,7 @@
]
}
},
"match": "(?i)\\b((?:\\w|\\d|_)+)\\s*(=>)\\s*([^,\\)])+\\b"
"match": "(?i)\\b((?:\\w|\\d|_)+)\\s*(=>)\\s*([^,)])+\\b"
},
{
"include": "#expression"
Expand All @@ -967,7 +967,7 @@
]
}
},
"match": "\\d(?:(_)?\\d)*(?:(\\.)\\d(?:(_)?\\d)*)?([eE](?:\\+|\\-)?\\d(?:_?\\d)*)?",
"match": "\\d(?:(_)?\\d)*(?:(\\.)\\d(?:(_)?\\d)*)?([eE](?:\\+|-)?\\d(?:_?\\d)*)?",
"name": "constant.numeric.ada"
},
"declarative_item": {
Expand Down Expand Up @@ -1330,7 +1330,7 @@
"name": "punctuation.ada"
}
},
"match": "([eE])(\\+|\\-)?\\d(?:(_)?\\d)*"
"match": "([eE])(\\+|-)?\\d(?:(_)?\\d)*"
},
"expression": {
"name": "meta.expression.ada",
Expand Down Expand Up @@ -2312,7 +2312,7 @@
]
}
},
"match": "(?i)\\b(others)\\s*(=>)\\s*([^,\\)]+)"
"match": "(?i)\\b(others)\\s*(=>)\\s*([^,)]+)"
},
{
"include": "#expression"
Expand Down
28 changes: 14 additions & 14 deletions packages/tm-grammars/grammars/angular-expression.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"name": "entity.name.function.pipe.ng"
}
},
"match": "((?<!\\|)\\|(?!\\|))\\s?([a-zA-Z0-9\\-\\_\\$]*)"
"match": "((?<!\\|)\\|(?!\\|))\\s?([a-zA-Z0-9\\-_$]*)"
},
{
"match": "(?<!\\.|\\$)\\b(let)\\b(?!\\$)",
Expand Down Expand Up @@ -114,7 +114,7 @@
]
},
{
"match": "\\*=|(?<!\\()\\/=|%=|\\+=|\\-=",
"match": "\\*=|(?<!\\()\\/=|%=|\\+=|-=",
"name": "keyword.operator.assignment.compound.ts"
},
{
Expand All @@ -134,15 +134,15 @@
"name": "keyword.operator.relational.ts"
},
{
"match": "\\!|&&|\\?\\?|\\|\\|",
"match": "!|&&|\\?\\?|\\|\\|",
"name": "keyword.operator.logical.ts"
},
{
"match": "\\&|~|\\^|\\|",
"name": "keyword.operator.bitwise.ts"
},
{
"match": "\\=",
"match": "=",
"name": "keyword.operator.assignment.ts"
},
{
Expand Down Expand Up @@ -171,8 +171,8 @@
]
},
"functionCall": {
"begin": "(?=(\\??\\.\\s*)?([_$A-Za-z][_$0-9A-Za-z]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
"end": "(?<=\\))(?!(\\??\\.\\s*)?([_$A-Za-z][_$0-9A-Za-z]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
"begin": "(?=(\\??\\.\\s*)?([_$A-Za-z][_$0-9A-Za-z]*)\\s*(<([^<>]|<[^<>]+>)+>\\s*)?\\()",
"end": "(?<=\\))(?!(\\??\\.\\s*)?([_$A-Za-z][_$0-9A-Za-z]*)\\s*(<([^<>]|<[^<>]+>)+>\\s*)?\\()",
"patterns": [
{
"match": "\\?",
Expand All @@ -187,13 +187,13 @@
"name": "entity.name.function.ts"
},
{
"begin": "\\<",
"begin": "<",
"beginCaptures": {
"0": {
"name": "punctuation.definition.typeparameters.begin.ts"
}
},
"end": "\\>",
"end": ">",
"endCaptures": {
"0": {
"name": "punctuation.definition.typeparameters.end.ts"
Expand Down Expand Up @@ -273,7 +273,7 @@
"name": "entity.name.function.ts"
}
},
"match": "(?:([?!]?\\.)\\s*)?([_$A-Za-z][_$0-9A-Za-z]*)(?=\\s*=\\s*((async\\s+)|(function\\s*[(<])|(function\\s+)|([_$A-Za-z][_$0-9A-Za-z]*\\s*=>)|((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)))"
"match": "(?:([?!]?\\.)\\s*)?([_$A-Za-z][_$0-9A-Za-z]*)(?=\\s*=\\s*((async\\s+)|(function\\s*[(<])|(function\\s+)|([_$A-Za-z][_$0-9A-Za-z]*\\s*=>)|((<([^<>]|<[^<>]+>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)))"
},
{
"captures": {
Expand Down Expand Up @@ -454,7 +454,7 @@
"name": "keyword.operator.optional.ts"
}
},
"match": "(?:\\s*\\b(readonly)\\s+)?(?:\\s*\\b(public|private|protected)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$A-Za-z][_$0-9A-Za-z]*)\\s*(\\??)(?=\\s*(=\\s*((async\\s+)|(function\\s*[(<])|(function\\s+)|([_$A-Za-z][_$0-9A-Za-z]*\\s*=>)|((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)))|(:\\s*((<)|([(]\\s*(([)])|(\\.\\.\\.)|([_$0-9A-Za-z]+\\s*(([:,?=])|([)]\\s*=>))))))))"
"match": "(?:\\s*\\b(readonly)\\s+)?(?:\\s*\\b(public|private|protected)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$A-Za-z][_$0-9A-Za-z]*)\\s*(\\??)(?=\\s*(=\\s*((async\\s+)|(function\\s*[(<])|(function\\s+)|([_$A-Za-z][_$0-9A-Za-z]*\\s*=>)|((<([^<>]|<[^<>]+>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)))|(:\\s*((<)|([(]\\s*(([)])|(\\.\\.\\.)|([_$0-9A-Za-z]+\\s*(([:,?=])|([)]\\s*=>))))))))"
},
{
"captures": {
Expand Down Expand Up @@ -501,7 +501,7 @@
]
},
"punctuationAccessor": {
"match": "\\?\\.|\\!\\.|\\.",
"match": "\\?\\.|!\\.|\\.",
"name": "punctuation.accessor.ts"
},
"punctuationComma": {
Expand Down Expand Up @@ -634,7 +634,7 @@
"name": "keyword.operator.type.annotation.ts"
}
},
"end": "(?=$|[,);\\}\\]]|\\/\\/|\")|(?==[^>])|(?<=[\\}>\\]\\)]|[_$A-Za-z])\\s*(?=\\{)",
"end": "(?=$|[,);}\\]]|\\/\\/|\")|(?==[^>])|(?<=[}>\\])]|[_$A-Za-z])\\s*(?=\\{)",
"name": "meta.type.annotation.ts",
"patterns": [
{
Expand All @@ -654,7 +654,7 @@
"name": "keyword.control.new.ts"
}
},
"match": "(?<!\\.|\\$)\\b(new)\\b(?=\\s*\\<)",
"match": "(?<!\\.|\\$)\\b(new)\\b(?=\\s*<)",
"name": "meta.type.constructor.ts"
},
{
Expand All @@ -673,7 +673,7 @@
]
},
{
"begin": "(?<=\\>)\\s*(?=\\()",
"begin": "(?<=>)\\s*(?=\\()",
"end": "(?<=\\))",
"include": "#typeofOperator",
"name": "meta.type.function.ts",
Expand Down
Loading

0 comments on commit e6f5cf2

Please sign in to comment.