diff --git a/README.md b/README.md index 8bf01f0..ee5d4ce 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,9 @@ type OnigurumaToEsOptions = { hasIndices?: boolean; maxRecursionDepth?: number | null; overrides?: { + allowAllSearchStartAnchors?: boolean; allowOrphanBackrefs?: boolean; + asciiWordBoundaries?: boolean; }; target?: 'auto' | 'ES2025' | 'ES2024' | 'ES2018'; verbose?: boolean; @@ -209,11 +211,12 @@ Using a high limit has a small impact on performance. Generally, this is only a ### `overrides` -Advanced options that take precedence over standard error checking and flags. +Advanced options that take precedence over standard error checking and flags when enabled. -- `allowOrphanBackrefs`: Useful with TextMate grammars that merge backreferences across `begin` and `end` patterns. - `allowAllSearchStartAnchors`: Silences errors for unsupported uses of the search-start anchor `\G`. - Oniguruma-To-ES uses a variety of strategies to accurately emulate many common uses of `\G`. When using this option, if a `\G` is found that doesn't have a known emulation strategy, the `\G` is simply removed and JavaScript's `y` (`sticky`) flag is added. This might lead to some false positives and negatives, but is useful for non-critical matching like syntax highlighting when having some mismatches is better than not working. +- `allowOrphanBackrefs`: Useful with TextMate grammars that merge backreferences across `begin` and `end` patterns. +- `asciiWordBoundaries`: ASCII-only `\b` and `\B`. ### `target` diff --git a/demo/demo.js b/demo/demo.js index 1534e1a..a6269bc 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -21,8 +21,9 @@ const state = { hasIndices: getValue('option-hasIndices'), maxRecursionDepth: getValue('option-maxRecursionDepth'), overrides: { - allowOrphanBackrefs: getValue('option-allowOrphanBackrefs'), allowAllSearchStartAnchors: getValue('option-allowAllSearchStartAnchors'), + allowOrphanBackrefs: getValue('option-allowOrphanBackrefs'), + asciiWordBoundaries: getValue('option-asciiWordBoundaries'), }, target: getValue('option-target'), verbose: getValue('option-verbose'), diff --git a/demo/index.html b/demo/index.html index f405684..fc365d5 100644 --- a/demo/index.html +++ b/demo/index.html @@ -108,6 +108,13 @@

Try it

+

+ +

Try it

Useful with TextMate grammars that merge backrefs across begin and end patterns

+
+

-
-