Skip to content

0.3.0

Compare
Choose a tag to compare
@mincrmatt12 mincrmatt12 released this 06 May 01:42
· 170 commits to master since this release

This is a feature release which adds a bunch of miscellaneous features, in addition to changing the public-facing API.

New Features

  • New API: (cbd45c4)
    • Instead of taking in single characters, the _feed function now takes in blocks of characters at once. The function can also
      optionally report how many characters it read in case of early finishes, to aid in chaining parsers.
    • Instead of having a parameter for is_end, there is now an optional separate _end function for handling EOF detection, enabled
      by the -feof-support flag.
    • These changes are designed to improve generated parser efficiency.
  • Fallthrough semantics: (cce57c4, af6728f)
    • Instead of else matches in case nodes and catch blocks consuming characters, they now forward the error/else to the first match
      in their block.
    • This makes error handling more robust, as well as removing a lot of the uses for some_var += [$last], simplifying parsers.
  • Revamped regexes: (50f219c, 5603d44)
    • Operator precedence is now more consistent with typical regexes, so (option1|option2) now works correctly.
    • Repetition syntax (\d{4-6}) is now supported.
  • Foreach statement: (9cda4ac)
    • Parsers can now execute statements on each character matched by some region.
    • This greatly simplifies things like reading numbers:
      foreach {
        \d+\;
      } do {
        num = [num * 10 + ($last - '0')];
      }
      
  • Macros can now take arguments. (07e4a04)
  • Character constants can now be used in math expressions. (fc93c91)

Bugs Fixed

  • Fixed problem where having a wait match after a try except could break due to incomplete error-handling redirection. (87de753)
  • Fixed internal error with allow_replace in DFState.transition which could hide ambiguous transitions. (0e1ad3b)
  • Fixed problems with incomplete else handling on case nodes with regex-matches with inverted character sets/wildcards. (417fb41, 3fa4d93)

Infrastructure Changes

  • NMFU now also builds AppImages (57ff2e7, 193910a)
  • The test suite has been thoroughly expanded, and now covers a lot more. (lots)
  • There is now an automated version update script. (2556d66)