Skip to content

Commit fc87512

Browse files
authored
feat: bump oniguruma-to-es for grammar support and perf (#842)
1 parent 1da0bc8 commit fc87512

File tree

4 files changed

+24
-19
lines changed

4 files changed

+24
-19
lines changed

docs/references/engine-js-compat.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
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 Sunday, November 17, 2024
5+
> Generated on Friday, November 22, 2024
66
>
7-
> Version `1.23.0`
7+
> Version `1.23.1`
88
>
99
> Runtime: Node.js v22.11.0
1010
@@ -13,8 +13,8 @@ Compatibility reference of all built-in grammars with the [JavaScript RegExp eng
1313
| | Count |
1414
| :-------------- | ---------------------------: |
1515
| Total Languages | 215 |
16-
| Supported | [192](#supported-languages) |
17-
| Mismatched | [10](#mismatched-languages) |
16+
| Supported | [193](#supported-languages) |
17+
| Mismatched | [9](#mismatched-languages) |
1818
| Unsupported | [13](#unsupported-languages) |
1919

2020
## Supported Languages
@@ -129,6 +129,7 @@ In some edge cases, it's not guaranteed that the the highlighting will be 100% t
129129
| marko | ✅ OK | 926 | - | |
130130
| matlab | ✅ OK | 88 | - | |
131131
| mdx | ✅ OK | 197 | - | |
132+
| mermaid | ✅ OK | 129 | - | |
132133
| mipsasm | ✅ OK | 17 | - | |
133134
| mojo | ✅ OK | 213 | - | |
134135
| move | ✅ OK | 120 | - | |
@@ -235,7 +236,6 @@ Languages that do not throw with the JavaScript RegExp engine, but will produce
235236
| haskell | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=haskell) | 157 | - | 39 |
236237
| kotlin | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=kotlin) | 58 | - | 1953 |
237238
| kusto | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=kusto) | 60 | - | 40 |
238-
| mermaid | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=mermaid) | 129 | - | 38 |
239239
| nginx | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=nginx) | 378 | - | 4 |
240240
| php | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=php) | 1131 | - | 605 |
241241
| po | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=po) | 23 | - | 423 |
@@ -254,7 +254,7 @@ Languages that throw with the JavaScript RegExp engine, either because they cont
254254
| rst | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=rst) | 1855 | 2 | 62 |
255255
| hack | ❌ Error | 947 | 1 | 114 |
256256
| purescript | ❌ Error | 72 | 1 | 42 |
257-
| cpp | ❌ Error | 510 | 2 | 8 |
257+
| cpp | ❌ Error | 510 | 2 | 27 |
258258
| csharp | ❌ Error | 306 | 3 | 204 |
259259
| markdown | ❌ Error | 115 | 3 | 857 |
260260
| swift | ❌ Error | 326 | 3 | 40 |

packages/engine-javascript/src/index.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,13 @@ export function defaultJavaScriptRegexConstructor(pattern: string, options?: Oni
5454
return toRegExp(
5555
pattern,
5656
{
57-
accuracy: 'loose',
5857
global: true,
5958
hasIndices: true,
60-
tmGrammar: true,
59+
rules: {
60+
allowOrphanBackrefs: true,
61+
allowUnhandledGAnchors: true,
62+
asciiWordBoundaries: true,
63+
},
6164
...options,
6265
},
6366
)

pnpm-lock.yaml

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

pnpm-workspace.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ catalog:
5353
minimist: ^1.2.8
5454
monaco-editor-core: ^0.52.0
5555
ofetch: ^1.4.1
56-
oniguruma-to-es: 0.4.1
56+
oniguruma-to-es: 0.6.0
5757
picocolors: ^1.1.1
5858
pinia: ^2.2.6
5959
pnpm: ^9.13.2

0 commit comments

Comments
 (0)