Skip to content

Commit

Permalink
Readme tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
slevithan committed Dec 19, 2024
1 parent 2fee338 commit 3afb0cc
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ Notice that nearly every feature below has at least subtle differences from Java
<td align="middle">✅</td>
<td align="middle">✅</td>
<td>
✔ Different allowed set than JS<br>
✔ Different set than JS<br>
✔ Allows multibyte chars<br>
</td>
</tr>
Expand Down Expand Up @@ -431,7 +431,7 @@ Notice that nearly every feature below has at least subtle differences from Java
</td>
</tr>
<tr valign="top">
<td>Control</td>
<td>Caret notation</td>
<td><code>\cA</code>, <code>\C-A</code></td>
<td align="middle">✅</td>
<td align="middle">✅</td>
Expand Down Expand Up @@ -937,11 +937,11 @@ The table above doesn't include all aspects that Oniguruma-To-ES emulates (inclu
3. With target `ES2018`, the specific POSIX classes `[:graph:]` and `[:print:]` use ASCII-based versions rather than the Unicode versions available for target `ES2024` and later, and they result in an error if using strict `accuracy`.
4. Target `ES2018` doesn't support nested *negated* character classes.
5. It's not an error for *numbered* backreferences to come before their referenced group in Oniguruma, but an error is the best path for Oniguruma-To-ES because (1) most placements are mistakes and can never match (based on the Oniguruma behavior for backreferences to nonparticipating groups), (2) erroring matches the behavior of named backreferences, and (3) the edge cases where they're matchable rely on rules for backreference resetting within quantified groups that are different in JavaScript and aren't emulatable. Note that it's not a backreference in the first place if using `\10` or higher and not as many capturing groups are defined to the left (it's an octal or identity escape).
6. The recursion depth limit is specified by option `maxRecursionDepth`. Use of backreferences when the recursed subpattern contains captures isn't yet supported. Patterns that would error in Oniguruma due to triggering infinite recursion might find a match in Oniguruma-To-ES since recursion is bounded (future versions will detect this and error at transpilation time).
6. The recursion depth limit is specified by option `maxRecursionDepth`. Overlapping recursions and the use of backreferences when the recursed subpattern contains captures aren't yet supported. Patterns that would error in Oniguruma due to triggering infinite recursion might find a match in Oniguruma-To-ES since recursion is bounded (future versions will detect this and error at transpilation time).

## ❌ Unsupported features

The following don't yet have any support, and throw errors. They're all infrequently-used features, with most being *extremely* rare.
The following don't yet have any support, and throw errors. They're all infrequently-used features, with most being *extremely* rare. Note that Oniguruma-To-ES can handle 99.9% of real-world Oniguruma regexes, based on patterns used in a large [collection](https://github.com/shikijs/textmate-grammars-themes/tree/main/packages/tm-grammars/grammars) of TextMate grammars.

- Supportable:
- Grapheme boundaries: `\y`, `\Y`.
Expand All @@ -952,12 +952,10 @@ The following don't yet have any support, and throw errors. They're all infreque
- Supportable for some uses:
- Absence functions: `(?~…)`, etc.
- Conditionals: `(?(…)…)`, etc.
- Whole-pattern modifiers: Find longest `(?L)`.
- Whole-pattern modifier: Find longest `(?L)`.
- Not supportable:
- Callout functions: `(?{…})`, etc.

Despite the current omissions, Oniguruma-To-ES handles more than 99.9% of real-world Oniguruma regexes, based on patterns used in a large [collection](https://github.com/shikijs/textmate-grammars-themes/tree/main/packages/tm-grammars/grammars) of TextMate grammars.

## ㊗️ Unicode / mixed case-sensitivity

Oniguruma-To-ES fully supports mixed case-sensitivity (and handles the Unicode edge cases) regardless of JavaScript [target](#target). It also restricts Unicode properties to those supported by Oniguruma and the target JavaScript version.
Expand Down

0 comments on commit 3afb0cc

Please sign in to comment.