Skip to content

Commit 5a26f77

Browse files
authoredDec 19, 2024··
feat: update js engine and grammars (#869)
1 parent c489859 commit 5a26f77

File tree

8 files changed

+2613
-521
lines changed

8 files changed

+2613
-521
lines changed
 

‎docs/references/engine-js-compat.md

+30-30
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Compatibility reference of all built-in grammars with the [JavaScript RegExp engine](/guide/regex-engines#javascript-regexp-engine-experimental).
44

5-
> Generated on Monday, December 16, 2024
5+
> Generated on Thursday, December 19, 2024
66
>
77
> Version `1.24.2`
88
>
@@ -13,8 +13,8 @@ Compatibility reference of all built-in grammars with the [JavaScript RegExp eng
1313
| | Count |
1414
| :-------------- | --------------------------: |
1515
| Total Languages | 218 |
16-
| Supported | [199](#supported-languages) |
17-
| Mismatched | [13](#mismatched-languages) |
16+
| Supported | [206](#supported-languages) |
17+
| Mismatched | [6](#mismatched-languages) |
1818
| Unsupported | [6](#unsupported-languages) |
1919

2020
## Supported Languages
@@ -39,6 +39,7 @@ In some edge cases, it's not guaranteed that the highlighting will be 100% the s
3939
| ballerina | ✅ OK | 230 | - | |
4040
| bash | ✅ OK | 148 | - | |
4141
| bat | ✅ OK | 58 | - | |
42+
| beancount | ✅ OK | 39 | - | |
4243
| berry | ✅ OK | 18 | - | |
4344
| bibtex | ✅ OK | 19 | - | |
4445
| bicep | ✅ OK | 27 | - | |
@@ -74,7 +75,7 @@ In some edge cases, it's not guaranteed that the highlighting will be 100% the s
7475
| elixir | ✅ OK | 708 | - | |
7576
| elm | ✅ OK | 244 | - | |
7677
| emacs-lisp | ✅ OK | 153 | - | 22 |
77-
| erb | ✅ OK | 1312 | - | |
78+
| erb | ✅ OK | 1786 | - | |
7879
| erlang | ✅ OK | 147 | - | |
7980
| fennel | ✅ OK | 31 | - | |
8081
| fish | ✅ OK | 25 | - | |
@@ -83,8 +84,8 @@ In some edge cases, it's not guaranteed that the highlighting will be 100% the s
8384
| fortran-free-form | ✅ OK | 328 | - | |
8485
| fsharp | ✅ OK | 239 | - | |
8586
| fsl | ✅ OK | 30 | - | |
86-
| gdresource | ✅ OK | 159 | - | |
87-
| gdscript | ✅ OK | 95 | - | |
87+
| gdresource | ✅ OK | 158 | - | |
88+
| gdscript | ✅ OK | 94 | - | |
8889
| gdshader | ✅ OK | 39 | - | |
8990
| genie | ✅ OK | 20 | - | |
9091
| gherkin | ✅ OK | 19 | - | |
@@ -98,6 +99,7 @@ In some edge cases, it's not guaranteed that the highlighting will be 100% the s
9899
| groovy | ✅ OK | 133 | - | |
99100
| haml | ✅ OK | 562 | - | |
100101
| handlebars | ✅ OK | 699 | - | |
102+
| haskell | ✅ OK | 157 | - | |
101103
| haxe | ✅ OK | 174 | - | |
102104
| hcl | ✅ OK | 67 | - | |
103105
| hjson | ✅ OK | 57 | - | |
@@ -120,6 +122,7 @@ In some edge cases, it's not guaranteed that the highlighting will be 100% the s
120122
| jssm | ✅ OK | 30 | - | |
121123
| jsx | ✅ OK | 376 | - | |
122124
| julia | ✅ OK | 1168 | - | |
125+
| kotlin | ✅ OK | 58 | - | |
123126
| latex | ✅ OK | 283 | - | |
124127
| lean | ✅ OK | 32 | - | |
125128
| less | ✅ OK | 280 | - | |
@@ -131,6 +134,7 @@ In some edge cases, it's not guaranteed that the highlighting will be 100% the s
131134
| make | ✅ OK | 51 | - | |
132135
| marko | ✅ OK | 926 | - | |
133136
| matlab | ✅ OK | 88 | - | |
137+
| mdc | ✅ OK | 783 | - | |
134138
| mdx | ✅ OK | 197 | - | |
135139
| mermaid | ✅ OK | 134 | - | |
136140
| mipsasm | ✅ OK | 17 | - | |
@@ -146,26 +150,29 @@ In some edge cases, it's not guaranteed that the highlighting will be 100% the s
146150
| ocaml | ✅ OK | 178 | - | |
147151
| pascal | ✅ OK | 23 | - | |
148152
| perl | ✅ OK | 941 | - | |
153+
| php | ✅ OK | 1131 | - | |
149154
| plsql | ✅ OK | 45 | - | |
150155
| postcss | ✅ OK | 49 | - | |
151156
| powerquery | ✅ OK | 30 | - | |
152157
| powershell | ✅ OK | 88 | - | |
153-
| prisma | ✅ OK | 26 | - | |
158+
| prisma | ✅ OK | 28 | - | |
154159
| prolog | ✅ OK | 26 | - | |
155160
| proto | ✅ OK | 33 | - | |
161+
| pug | ✅ OK | 686 | - | |
156162
| puppet | ✅ OK | 61 | - | |
157163
| python | ✅ OK | 218 | - | |
158164
| qml | ✅ OK | 408 | - | |
159165
| qmldir | ✅ OK | 7 | - | |
160166
| qss | ✅ OK | 31 | - | |
161167
| r | ✅ OK | 71 | - | |
162-
| racket | ✅ OK | 69 | - | 8 |
168+
| racket | ✅ OK | 69 | - | |
163169
| raku | ✅ OK | 52 | - | |
164170
| reg | ✅ OK | 9 | - | |
165171
| regexp | ✅ OK | 34 | - | |
166172
| rel | ✅ OK | 17 | - | |
167173
| riscv | ✅ OK | 36 | - | |
168-
| ruby | ✅ OK | 1307 | - | |
174+
| rst | ✅ OK | 2031 | - | |
175+
| ruby | ✅ OK | 1781 | - | |
169176
| rust | ✅ OK | 89 | - | |
170177
| sas | ✅ OK | 101 | - | |
171178
| sass | ✅ OK | 69 | - | |
@@ -199,7 +206,7 @@ In some edge cases, it's not guaranteed that the highlighting will be 100% the s
199206
| tsv | ✅ OK | 1 | - | |
200207
| tsx | ✅ OK | 376 | - | |
201208
| turtle | ✅ OK | 15 | - | |
202-
| twig | ✅ OK | 1984 | - | |
209+
| twig | ✅ OK | 2426 | - | |
203210
| typescript | ✅ OK | 363 | - | |
204211
| typespec | ✅ OK | 80 | - | |
205212
| typst | ✅ OK | 78 | - | |
@@ -235,31 +242,24 @@ In some edge cases, it's not guaranteed that the highlighting will be 100% the s
235242

236243
Languages that do not throw with the JavaScript RegExp engine, but will produce different results than the WASM engine. Please use with caution.
237244

238-
| Language | Highlight Match | Patterns Parsable | Patterns Failed | Diff |
239-
| --------- | :----------------------------------------------------------------------------- | ----------------: | --------------: | ---: |
240-
| apex | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=apex) | 187 | - | 236 |
241-
| beancount | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=beancount) | 39 | - | 171 |
242-
| cpp | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=cpp) | 512 | - | 8 |
243-
| haskell | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=haskell) | 157 | - | 39 |
244-
| kotlin | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=kotlin) | 58 | - | 1953 |
245-
| kusto | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=kusto) | 60 | - | 40 |
246-
| markdown | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=markdown) | 118 | - | 915 |
247-
| mdc | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=mdc) | 783 | - | 702 |
248-
| nginx | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=nginx) | 378 | - | 4 |
249-
| php | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=php) | 1131 | - | 605 |
250-
| po | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=po) | 23 | - | 423 |
251-
| pug | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=pug) | 686 | - | 164 |
252-
| rst | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=rst) | 1857 | - | 62 |
245+
| Language | Highlight Match | Patterns Parsable | Patterns Failed | Diff |
246+
| -------- | :---------------------------------------------------------------------------- | ----------------: | --------------: | ---: |
247+
| apex | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=apex) | 187 | - | 33 |
248+
| cpp | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=cpp) | 512 | - | 8 |
249+
| kusto | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=kusto) | 60 | - | 40 |
250+
| markdown | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=markdown) | 118 | - | 100 |
251+
| nginx | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=nginx) | 378 | - | 122 |
252+
| po | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=po) | 23 | - | 114 |
253253

254254
## Unsupported Languages
255255

256-
Languages that throw with the JavaScript RegExp engine, either because they contain syntax we can't polyfill yet or because the grammar contains an invalid Oniguruma regex (that would also fail when using the WASM engine, but silently). You can try these languages with the `forgiving` option to skip errors, but usually it's best to use the Oniguruma engine instead.
256+
Languages that throw with the JavaScript RegExp engine, either because they contain syntax we can't polyfill yet or because the grammar contains an invalid Oniguruma regex (that would also fail when using the WASM engine, but silently). You can try these languages with the `forgiving` option to skip errors.
257257

258258
| Language | Highlight Match | Patterns Parsable | Patterns Failed | Diff |
259259
| ---------- | :-------------- | ----------------: | --------------: | ---: |
260260
| ada | ✅ OK | 201 | 1 | |
261261
| hack | ❌ Error | 947 | 1 | 114 |
262-
| purescript | ❌ Error | 72 | 1 | 42 |
263-
| csharp | ❌ Error | 306 | 3 | 204 |
264-
| swift | ❌ Error | 326 | 3 | 40 |
265-
| razor | ❌ Error | 952 | 5 | 22 |
262+
| purescript | ❌ Error | 72 | 1 | |
263+
| csharp | ❌ Error | 306 | 3 | 148 |
264+
| swift | ❌ Error | 326 | 3 | 8 |
265+
| razor | ❌ Error | 952 | 5 | 14 |

‎packages/engine-javascript/src/index.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@ export function defaultJavaScriptRegexConstructor(pattern: string, options?: Oni
5757
global: true,
5858
hasIndices: true,
5959
rules: {
60+
// Needed since TextMate grammars merge backrefs across patterns
6061
allowOrphanBackrefs: true,
61-
// Dropping unhandled `\G` anchors without erroring allows more grammars to pass but also
62-
// allows some false positive and negative matches. It's mostly because this is true that
63-
// the JS engine is marked as experimental
62+
// Removing `\G` anchors in cases when they're not supported for emulation allows
63+
// supporting more grammars, but also allows some mismatches
6464
allowUnhandledGAnchors: true,
6565
// Improves search performance for generated regexes
6666
asciiWordBoundaries: true,
67+
// Follow `vscode-oniguruma` which enables this Oniguruma option by default
68+
captureGroup: true,
6769
},
6870
...options,
6971
},

‎packages/engine-javascript/test/__records__/beancount.js.json

+2,481-329
Large diffs are not rendered by default.

‎packages/engine-javascript/test/__records__/markdown.js.json

+78-136
Original file line numberDiff line numberDiff line change
@@ -1254,98 +1254,69 @@
12541254
0,
12551255
0
12561256
],
1257-
"result": {
1258-
"index": 0,
1259-
"captureIndices": [
1260-
{
1261-
"start": 9,
1262-
"end": 9,
1263-
"length": 0
1264-
},
1265-
{
1266-
"start": 4294967295,
1267-
"end": 4294967295,
1268-
"length": 0
1269-
},
1270-
{
1271-
"start": 4294967295,
1272-
"end": 4294967295,
1273-
"length": 0
1274-
},
1275-
{
1276-
"start": 4294967295,
1277-
"end": 4294967295,
1278-
"length": 0
1279-
},
1280-
{
1281-
"start": 9,
1282-
"end": 9,
1283-
"length": 0
1284-
}
1285-
]
1286-
}
1257+
"result": null
12871258
},
12881259
{
1289-
"id": "VLAAL1CWJq",
1260+
"id": "pMnsbeoMVl",
12901261
"patterns": [
1291-
"((^|\\G)([ ]{2,4}|\\t))|(^[ \\t]*$)"
1262+
"(^|\\￿)[ ]{0,3}([\\*\\-_])([ ]{0,2}\\2){2,}[ \\t]*$\\n?",
1263+
"(?:^|\\￿)[ ]{0,3}(#{1,6}\\s+(.*?)(\\s+#{1,6})?\\s*)$",
1264+
"(^|\\￿)[ ]{0,3}(>) ?",
1265+
"(^|\\￿)([ ]{0,3})([*+-])([ \\t])",
1266+
"(^|\\￿)([ ]{0,3})(\\d+[\\.)])([ \\t])",
1267+
"(^|\\￿)(\\s*)(`{3,}|~{3,})\\s*(?i:(markdown|md)((\\s+|:|,|\\{|\\?)[^`]*)?$)",
1268+
"(^|\\￿)(\\s*)(`{3,}|~{3,})\\s*(?=([^`]*)?$)",
1269+
"(^|\\￿)([ ]{4}|\\t)",
1270+
"\\s*(\\[)([^]]+?)(\\])(:)[ \\t]*(?:(<)((?:\\\\[<>]|[^<>\\n])*)(>)|(\\S+?))[ \\t]*(?:((\\().+?(\\)))|((\").+?(\"))|((').+?(')))?\\s*$",
1271+
"(^|\\￿)\\s*(<!--)",
1272+
"(^|\\￿)(\\|)(?=[^|].+\\|\\s*$)",
1273+
"(^|\\￿)[ ]{0,3}(?=[^ \\t\\n])"
12921274
],
12931275
"args": [
12941276
"and this\n",
1295-
9,
1277+
0,
12961278
0
12971279
],
12981280
"result": {
1299-
"index": 0,
1281+
"index": 11,
13001282
"captureIndices": [
13011283
{
1302-
"start": 9,
1303-
"end": 9,
1304-
"length": 0
1305-
},
1306-
{
1307-
"start": 4294967295,
1308-
"end": 4294967295,
1309-
"length": 0
1310-
},
1311-
{
1312-
"start": 4294967295,
1313-
"end": 4294967295,
1314-
"length": 0
1315-
},
1316-
{
1317-
"start": 4294967295,
1318-
"end": 4294967295,
1284+
"start": 0,
1285+
"end": 0,
13191286
"length": 0
13201287
},
13211288
{
1322-
"start": 9,
1323-
"end": 9,
1289+
"start": 0,
1290+
"end": 0,
13241291
"length": 0
13251292
}
13261293
]
13271294
}
13281295
},
13291296
{
1330-
"id": "kzn3K4ovBN",
1297+
"id": "3O5Mw8yMa3",
13311298
"patterns": [
1332-
"(^|\\G)[ ]{0,3}([\\*\\-_])([ ]{0,2}\\2){2,}[ \\t]*$\\n?",
1333-
"(?:^|\\G)[ ]{0,3}(#{1,6}\\s+(.*?)(\\s+#{1,6})?\\s*)$",
1334-
"(^|\\G)[ ]{0,3}(>) ?",
1335-
"(^|\\G)([ ]{0,3})([*+-])([ \\t])",
1336-
"(^|\\G)([ ]{0,3})(\\d+[\\.)])([ \\t])",
1337-
"(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(markdown|md)((\\s+|:|,|\\{|\\?)[^`]*)?$)",
1338-
"(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?=([^`]*)?$)",
1339-
"(^|\\G)([ ]{4}|\\t)",
1340-
"\\s*(\\[)([^]]+?)(\\])(:)[ \\t]*(?:(<)((?:\\\\[<>]|[^<>\\n])*)(>)|(\\S+?))[ \\t]*(?:((\\().+?(\\)))|((\").+?(\"))|((').+?(')))?\\s*$",
1341-
"(^|\\G)\\s*(<!--)",
1342-
"(^|\\G)(\\|)(?=[^|].+\\|\\s*$)",
1343-
"(^|\\G)[ ]{0,3}(?=[^ \\t\\n])",
1344-
"(^|\\G)(?=\\S)(?![*+->]\\s|\\d+\\.\\s)"
1299+
"&(?!([a-zA-Z0-9]+|#\\d+|#x[0-9a-fA-F]+);)",
1300+
"<(?![a-zA-Z/?$!])",
1301+
"(?<open>(\\*\\*(?=\\w)|(?<!\\w)\\*\\*|(?<!\\w)\\b__))(?=\\S)(?=(<[^>]*+>|(?<raw>`+)([^`]|(?!(?<!`)\\k<raw>(?!`))`)*+\\k<raw>|\\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+|\\[((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+\\](([ ]?\\[[^\\]]*+\\])|(\\([ \\t]*+<?(.*?)>?[ \\t]*+((?<title>['\"])(.*?)\\k<title>)?\\))))|(?!(?<=\\S)\\k<open>).)++(?<=\\S)(?=__\\b|\\*\\*)\\k<open>)",
1302+
"(?<open>(\\*(?=\\w)|(?<!\\w)\\*|(?<!\\w)\\b_))(?=\\S)(?=(<[^>]*+>|(?<raw>`+)([^`]|(?!(?<!`)\\k<raw>(?!`))`)*+\\k<raw>|\\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+|\\[((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+\\](([ ]?\\[[^\\]]*+\\])|(\\([ \\t]*+<?(.*?)>?[ \\t]*+((?<title>['\"])(.*?)\\k<title>)?\\))))|\\k<open>\\k<open>|(?!(?<=\\S)\\k<open>).)++(?<=\\S)(?=_\\b|\\*)\\k<open>)",
1303+
"(`+)((?:[^`]|(?!(?<!`)\\1(?!`))`)*+)(\\1)",
1304+
"(?<!\\\\)(~{2,})((?:[^~]|(?!(?<![~\\\\])\\1(?!~))~)*+)(\\1)",
1305+
"\\\\[-`*_#+.!(){}\\[\\]\\\\>]",
1306+
"(!\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])(\\()[ \\t]*((<)((?:\\\\[<>]|[^<>\\n])*)(>)|((?<url>(?>[^\\s()]+)|\\(\\g<url>*\\))*))[ \\t]*(?:((\\().+?(\\)))|((\").+?(\"))|((').+?(')))?\\s*(\\))",
1307+
"(!\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])[ ]?(\\[)(.*?)(\\])",
1308+
"(<)((?:mailto:)?[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)(>)",
1309+
"(<)((?:https?|ftp)://.*?)(>)",
1310+
"(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])(\\()[ \\t]*((<)((?:\\\\[<>]|[^<>\\n])*)(>)|((?<url>(?>[^\\s()]+)|\\(\\g<url>*\\))*))[ \\t]*(?:((\\()[^()]*(\\)))|((\")[^\"]*(\"))|((')[^']*(')))?\\s*(\\))",
1311+
"(?<![\\]\\\\])(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])(\\[)([^\\]]*+)(\\])",
1312+
"(?<![\\]\\\\])(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])[ ]?(\\[)(\\])",
1313+
"(?<![\\]\\\\])(\\[)((?:[^\\s\\[\\]\\\\]|\\\\[\\[\\]])+?)((?<!\\\\)\\])",
1314+
"^(={3,})(?=[ \\t]*$\\n?)",
1315+
"^(-{3,})(?=[ \\t]*$\\n?)"
13451316
],
13461317
"args": [
13471318
"and this\n",
1348-
9,
1319+
0,
13491320
0
13501321
],
13511322
"result": null
@@ -1873,98 +1844,69 @@
18731844
0,
18741845
0
18751846
],
1876-
"result": {
1877-
"index": 0,
1878-
"captureIndices": [
1879-
{
1880-
"start": 9,
1881-
"end": 9,
1882-
"length": 0
1883-
},
1884-
{
1885-
"start": 4294967295,
1886-
"end": 4294967295,
1887-
"length": 0
1888-
},
1889-
{
1890-
"start": 4294967295,
1891-
"end": 4294967295,
1892-
"length": 0
1893-
},
1894-
{
1895-
"start": 4294967295,
1896-
"end": 4294967295,
1897-
"length": 0
1898-
},
1899-
{
1900-
"start": 9,
1901-
"end": 9,
1902-
"length": 0
1903-
}
1904-
]
1905-
}
1847+
"result": null
19061848
},
19071849
{
1908-
"id": "VLAAL1CWJq",
1850+
"id": "pMnsbeoMVl",
19091851
"patterns": [
1910-
"((^|\\G)([ ]{2,4}|\\t))|(^[ \\t]*$)"
1852+
"(^|\\￿)[ ]{0,3}([\\*\\-_])([ ]{0,2}\\2){2,}[ \\t]*$\\n?",
1853+
"(?:^|\\￿)[ ]{0,3}(#{1,6}\\s+(.*?)(\\s+#{1,6})?\\s*)$",
1854+
"(^|\\￿)[ ]{0,3}(>) ?",
1855+
"(^|\\￿)([ ]{0,3})([*+-])([ \\t])",
1856+
"(^|\\￿)([ ]{0,3})(\\d+[\\.)])([ \\t])",
1857+
"(^|\\￿)(\\s*)(`{3,}|~{3,})\\s*(?i:(markdown|md)((\\s+|:|,|\\{|\\?)[^`]*)?$)",
1858+
"(^|\\￿)(\\s*)(`{3,}|~{3,})\\s*(?=([^`]*)?$)",
1859+
"(^|\\￿)([ ]{4}|\\t)",
1860+
"\\s*(\\[)([^]]+?)(\\])(:)[ \\t]*(?:(<)((?:\\\\[<>]|[^<>\\n])*)(>)|(\\S+?))[ \\t]*(?:((\\().+?(\\)))|((\").+?(\"))|((').+?(')))?\\s*$",
1861+
"(^|\\￿)\\s*(<!--)",
1862+
"(^|\\￿)(\\|)(?=[^|].+\\|\\s*$)",
1863+
"(^|\\￿)[ ]{0,3}(?=[^ \\t\\n])"
19111864
],
19121865
"args": [
19131866
"and this\n",
1914-
9,
1867+
0,
19151868
0
19161869
],
19171870
"result": {
1918-
"index": 0,
1871+
"index": 11,
19191872
"captureIndices": [
19201873
{
1921-
"start": 9,
1922-
"end": 9,
1923-
"length": 0
1924-
},
1925-
{
1926-
"start": 4294967295,
1927-
"end": 4294967295,
1928-
"length": 0
1929-
},
1930-
{
1931-
"start": 4294967295,
1932-
"end": 4294967295,
1933-
"length": 0
1934-
},
1935-
{
1936-
"start": 4294967295,
1937-
"end": 4294967295,
1874+
"start": 0,
1875+
"end": 0,
19381876
"length": 0
19391877
},
19401878
{
1941-
"start": 9,
1942-
"end": 9,
1879+
"start": 0,
1880+
"end": 0,
19431881
"length": 0
19441882
}
19451883
]
19461884
}
19471885
},
19481886
{
1949-
"id": "kzn3K4ovBN",
1887+
"id": "3O5Mw8yMa3",
19501888
"patterns": [
1951-
"(^|\\G)[ ]{0,3}([\\*\\-_])([ ]{0,2}\\2){2,}[ \\t]*$\\n?",
1952-
"(?:^|\\G)[ ]{0,3}(#{1,6}\\s+(.*?)(\\s+#{1,6})?\\s*)$",
1953-
"(^|\\G)[ ]{0,3}(>) ?",
1954-
"(^|\\G)([ ]{0,3})([*+-])([ \\t])",
1955-
"(^|\\G)([ ]{0,3})(\\d+[\\.)])([ \\t])",
1956-
"(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(markdown|md)((\\s+|:|,|\\{|\\?)[^`]*)?$)",
1957-
"(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?=([^`]*)?$)",
1958-
"(^|\\G)([ ]{4}|\\t)",
1959-
"\\s*(\\[)([^]]+?)(\\])(:)[ \\t]*(?:(<)((?:\\\\[<>]|[^<>\\n])*)(>)|(\\S+?))[ \\t]*(?:((\\().+?(\\)))|((\").+?(\"))|((').+?(')))?\\s*$",
1960-
"(^|\\G)\\s*(<!--)",
1961-
"(^|\\G)(\\|)(?=[^|].+\\|\\s*$)",
1962-
"(^|\\G)[ ]{0,3}(?=[^ \\t\\n])",
1963-
"(^|\\G)(?=\\S)(?![*+->]\\s|\\d+\\.\\s)"
1889+
"&(?!([a-zA-Z0-9]+|#\\d+|#x[0-9a-fA-F]+);)",
1890+
"<(?![a-zA-Z/?$!])",
1891+
"(?<open>(\\*\\*(?=\\w)|(?<!\\w)\\*\\*|(?<!\\w)\\b__))(?=\\S)(?=(<[^>]*+>|(?<raw>`+)([^`]|(?!(?<!`)\\k<raw>(?!`))`)*+\\k<raw>|\\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+|\\[((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+\\](([ ]?\\[[^\\]]*+\\])|(\\([ \\t]*+<?(.*?)>?[ \\t]*+((?<title>['\"])(.*?)\\k<title>)?\\))))|(?!(?<=\\S)\\k<open>).)++(?<=\\S)(?=__\\b|\\*\\*)\\k<open>)",
1892+
"(?<open>(\\*(?=\\w)|(?<!\\w)\\*|(?<!\\w)\\b_))(?=\\S)(?=(<[^>]*+>|(?<raw>`+)([^`]|(?!(?<!`)\\k<raw>(?!`))`)*+\\k<raw>|\\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+|\\[((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+\\](([ ]?\\[[^\\]]*+\\])|(\\([ \\t]*+<?(.*?)>?[ \\t]*+((?<title>['\"])(.*?)\\k<title>)?\\))))|\\k<open>\\k<open>|(?!(?<=\\S)\\k<open>).)++(?<=\\S)(?=_\\b|\\*)\\k<open>)",
1893+
"(`+)((?:[^`]|(?!(?<!`)\\1(?!`))`)*+)(\\1)",
1894+
"(?<!\\\\)(~{2,})((?:[^~]|(?!(?<![~\\\\])\\1(?!~))~)*+)(\\1)",
1895+
"\\\\[-`*_#+.!(){}\\[\\]\\\\>]",
1896+
"(!\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])(\\()[ \\t]*((<)((?:\\\\[<>]|[^<>\\n])*)(>)|((?<url>(?>[^\\s()]+)|\\(\\g<url>*\\))*))[ \\t]*(?:((\\().+?(\\)))|((\").+?(\"))|((').+?(')))?\\s*(\\))",
1897+
"(!\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])[ ]?(\\[)(.*?)(\\])",
1898+
"(<)((?:mailto:)?[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)(>)",
1899+
"(<)((?:https?|ftp)://.*?)(>)",
1900+
"(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])(\\()[ \\t]*((<)((?:\\\\[<>]|[^<>\\n])*)(>)|((?<url>(?>[^\\s()]+)|\\(\\g<url>*\\))*))[ \\t]*(?:((\\()[^()]*(\\)))|((\")[^\"]*(\"))|((')[^']*(')))?\\s*(\\))",
1901+
"(?<![\\]\\\\])(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])(\\[)([^\\]]*+)(\\])",
1902+
"(?<![\\]\\\\])(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])[ ]?(\\[)(\\])",
1903+
"(?<![\\]\\\\])(\\[)((?:[^\\s\\[\\]\\\\]|\\\\[\\[\\]])+?)((?<!\\\\)\\])",
1904+
"^(={3,})(?=[ \\t]*$\\n?)",
1905+
"^(-{3,})(?=[ \\t]*$\\n?)"
19641906
],
19651907
"args": [
19661908
"and this\n",
1967-
9,
1909+
0,
19681910
0
19691911
],
19701912
"result": null

‎packages/engine-javascript/test/verify.test.ts

-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ describe('verify', async () => {
2323
if (name === 'markdown')
2424
continue
2525

26-
// TODO: https://github.com/shikijs/shiki/pull/866
27-
if (name === 'beancount')
28-
continue
29-
3026
describe(`record: ${name}`, async () => {
3127
const executions = JSON.parse(await fs.readFile(file, 'utf-8')) as Execution[]
3228
let i = 0

‎pnpm-lock.yaml

+16-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pnpm-workspace.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ catalog:
5454
monaco-editor-core: ^0.52.2
5555
ofetch: ^1.4.1
5656
ohash: ^1.1.4
57-
oniguruma-to-es: 0.7.0
57+
oniguruma-to-es: 0.8.0
5858
picocolors: ^1.1.1
5959
pinia: ^2.3.0
6060
pnpm: ^9.15.0
@@ -72,7 +72,7 @@ catalog:
7272
shiki-legacy: npm:shiki@^0.14.7
7373
simple-git-hooks: ^2.11.1
7474
taze: ^0.18.0
75-
tm-grammars: ^1.21.6
75+
tm-grammars: ^1.21.8
7676
tm-themes: ^1.9.5
7777
twoslash: ^0.2.12
7878
twoslash-vue: ^0.2.12

‎scripts/report-engine-js-compat.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ async function run() {
242242
'',
243243
'## Unsupported Languages',
244244
'',
245-
'Languages that throw with the JavaScript RegExp engine, either because they contain syntax we can\'t polyfill yet or because the grammar contains an invalid Oniguruma regex (that would also fail when using the WASM engine, but silently). You can try these languages with the `forgiving` option to skip errors, but usually it\'s best to use the Oniguruma engine instead.',
245+
'Languages that throw with the JavaScript RegExp engine, either because they contain syntax we can\'t polyfill yet or because the grammar contains an invalid Oniguruma regex (that would also fail when using the WASM engine, but silently). You can try these languages with the `forgiving` option to skip errors.',
246246
'',
247247
createTable(reportError),
248248
].join('\n')

0 commit comments

Comments
 (0)
Please sign in to comment.