Skip to content

Releases: slevithan/oniguruma-to-es

v0.9.0

27 Dec 02:39
Compare
Choose a tag to compare
  • Rename option allowUnhandledGAnchors as ignoreUnsupportedGAnchors.
  • Externalize dependencies for the ESM bundle. (#12, @bluwy)
  • Keep duplicate group names on the first instance (rather than last) to match Oniguruma's match results in cases affected by subroutines or duplicate group names.
  • When not using option avoidSubclass:
    • Hide subpattern details for captures created by emulated subroutines from match results.
    • Transfer subroutine (and descendent) capture details on match results to the indexes of groups they reference (if preceding) to match Oniguruma's subpattern match results/ordering.
  • Don't restrict Unicode properties based on target. (#10)

v0.8.1

21 Dec 01:12
Compare
Choose a tag to compare
  • Fix: When the following conditions were all met, the indices values of result arrays could be incorrect: (1) options hasIndices and global both enabled, (2) the pattern included (^|\G) or similar, and (3) the generated regex was used while its lastIndex was greater than 0.

v0.8.0

19 Dec 07:52
Compare
Choose a tag to compare
  • Added option rules.captureGroup (equivalent to Oniguruma compile-time option ONIG_OPTION_CAPTURE_GROUP) to toDetails, toRegExp, and toOnigurumaAst. Allows unnamed captures and numbered backreferences/subroutines when using named capture (with complex resulting rules in edge cases).
  • When using option allowUnhandledGAnchors, don't add flag y for unsupported \G (provides better tradeoffs).
  • When not using option avoidSubclass, use emulation groups (which prevent captured values from appearing on the result array) for copies of capturing groups created by recursion.
  • Fix: Prevent ^ from matching after a string-terminating line feed. (#9)

v0.7.0

27 Nov 15:53
Compare
Choose a tag to compare
  • Support recursion with backreferences (when the recursed subpattern doesn't contain captures).
  • Fix: Allow unescaped, leading ] in character classes.

v0.6.1

23 Nov 22:36
Compare
Choose a tag to compare
  • Fix: With target ES2018, some advanced but supported patterns that contained \[ within a character class were resulting in invalid syntax. (#5)

v0.6.0

22 Nov 15:44
Compare
Choose a tag to compare
  • Added support for flags D (Digit is ASCII) and S (Space is ASCII) at top-level.
  • Added option rules.asciiWordBoundaries.
  • Replaced option accuracy: 'loose' with rules.allowUnhandledGAnchors.
  • Replaced option tmGrammar with rules.allowOrphanBackrefs.
  • Fix: \w, \d, \s, and their inversions are Unicode-based by default. (#4)
  • Fix: Unicode combining marks qualify as \b word boundaries by default.
  • Fix: In edge cases, using nested character classes that combined union and intersection led to invalid patterns.
  • Fix: In edge cases, some characters were not escaped appropriately in nested character classes.

v0.5.0

19 Nov 11:32
Compare
Choose a tag to compare
  • Added support for flag W (Word is ASCII) at top-level.
  • Minor type changes.

v0.4.1

17 Nov 08:24
Compare
Choose a tag to compare
  • Worked around a parser bug in versions of Bun prior to v1.1.35. (#2)

v0.4.0

16 Nov 19:00
Compare
Choose a tag to compare
  • Uses EmulatedRegExp (unless avoidSubclass is enabled) for patterns with atomic groups or possessive quantifiers.
  • EmulatedRegExp automatically adjusts subpattern matches and indices to account for injected emulation groups.
  • Added target option 'auto' (hat-tip @antfu for idea).
  • Improved \G support so it works with additional patterns.
  • Changed the shape of toDetails results when subclass details are included.
  • Renamed the types used for options objects.
  • Added missing Unicode case folding for Latin small long s ſ U+017F.

v0.3.0

13 Nov 17:37
Compare
Choose a tag to compare
  • Added support for multiple, non-overlapping recursions.
  • Added support for indirect recursion.
  • Changed the default maxRecursionDepth from 6 to 5.
  • Fixed a bug with some group types when using recursion by number.
  • Improved some cases of \G emulation.