Skip to content

Commit

Permalink
feat: bump oniguruma-to-es for grammar support and perf
Browse files Browse the repository at this point in the history
  • Loading branch information
slevithan committed Nov 22, 2024
1 parent 1da0bc8 commit 5d2df10
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
12 changes: 6 additions & 6 deletions docs/references/engine-js-compat.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

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

> Generated on Sunday, November 17, 2024
> Generated on Friday, November 22, 2024
>
> Version `1.23.0`
> Version `1.23.1`
>
> Runtime: Node.js v22.11.0
Expand All @@ -13,8 +13,8 @@ Compatibility reference of all built-in grammars with the [JavaScript RegExp eng
| | Count |
| :-------------- | ---------------------------: |
| Total Languages | 215 |
| Supported | [192](#supported-languages) |
| Mismatched | [10](#mismatched-languages) |
| Supported | [193](#supported-languages) |
| Mismatched | [9](#mismatched-languages) |
| Unsupported | [13](#unsupported-languages) |

## Supported Languages
Expand Down Expand Up @@ -129,6 +129,7 @@ In some edge cases, it's not guaranteed that the the highlighting will be 100% t
| marko | ✅ OK | 926 | - | |
| matlab | ✅ OK | 88 | - | |
| mdx | ✅ OK | 197 | - | |
| mermaid | ✅ OK | 129 | - | |
| mipsasm | ✅ OK | 17 | - | |
| mojo | ✅ OK | 213 | - | |
| move | ✅ OK | 120 | - | |
Expand Down Expand Up @@ -235,7 +236,6 @@ Languages that do not throw with the JavaScript RegExp engine, but will produce
| haskell | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=haskell) | 157 | - | 39 |
| kotlin | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=kotlin) | 58 | - | 1953 |
| kusto | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=kusto) | 60 | - | 40 |
| mermaid | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=mermaid) | 129 | - | 38 |
| nginx | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=nginx) | 378 | - | 4 |
| php | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=php) | 1131 | - | 605 |
| po | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=po) | 23 | - | 423 |
Expand All @@ -254,7 +254,7 @@ Languages that throw with the JavaScript RegExp engine, either because they cont
| rst | [🚧 Mismatch](https://textmate-grammars-themes.netlify.app/?grammar=rst) | 1855 | 2 | 62 |
| hack | ❌ Error | 947 | 1 | 114 |
| purescript | ❌ Error | 72 | 1 | 42 |
| cpp | ❌ Error | 510 | 2 | 8 |
| cpp | ❌ Error | 510 | 2 | 27 |
| csharp | ❌ Error | 306 | 3 | 204 |
| markdown | ❌ Error | 115 | 3 | 857 |
| swift | ❌ Error | 326 | 3 | 40 |
Expand Down
7 changes: 5 additions & 2 deletions packages/engine-javascript/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,13 @@ export function defaultJavaScriptRegexConstructor(pattern: string, options?: Oni
return toRegExp(
pattern,
{
accuracy: 'loose',
global: true,
hasIndices: true,
tmGrammar: true,
rules: {
allowOrphanBackrefs: true,
allowUnhandledGAnchors: true,
asciiWordBoundaries: true,
},
...options,
},
)
Expand Down
22 changes: 12 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ catalog:
minimist: ^1.2.8
monaco-editor-core: ^0.52.0
ofetch: ^1.4.1
oniguruma-to-es: 0.4.1
oniguruma-to-es: 0.6.0
picocolors: ^1.1.1
pinia: ^2.2.6
pnpm: ^9.13.2
Expand Down

0 comments on commit 5d2df10

Please sign in to comment.