Skip to content

Releases: fosskers/parcom

1.6.3

16 Nov 23:01
739b5ab

Choose a tag to compare

Added

  • The string-lenient function as a companion to string but that accepts any
    cl:string as an argument.

Fixed

  • The type of the string parser has been restored to reflect that it has only
    ever accepted (simple-array character (*)) as an argument.

1.6.2

12 Nov 21:50
25ac948

Choose a tag to compare

The crash involving sliding-take appears to be gone, at least with SBCL 2.5.10. Other compilers have no issue.

1.6.0

20 Oct 22:55
1b3df85

Choose a tag to compare

The theme of this release is "type information". Overall, function signatures
have been greatly elaborated across the various systems.

Added

  • ->, fn, always, and maybe for concise definition of function
    signatures that involve parsers.
  • Parser: sliding-take and sliding-take1 for parsing escaped characters
    efficiently.

Changed

  • <$ is now a macro.
  • between is now a macro.
  • :fail can be returned from the lambda given to ap to fail the whole parse.
    This is useful for manually validating the results of parse.
  • toml: Improved performance.
  • xml: Improved performance.

Removed

  • Certain parsers no longer have an internal, automatically managed "lambda
    cache". In any case, it is considered best practice to instead define your own
    top-level, preallocated parsers for known cost-centers. These often involve
    char, string, between, and consume. For instance, you should
    essentially always define:
(defparameter +colon+ (p:char #\:))

And call +colon+ at usage sites, instead of using p:char directly within
your composite parsers. This avoids a significant amount of lambda allocation at
runtime. By doing this consistently you can expect a 3x-10x reduction in memory
allocation and a 2x-3x speed up.

For parsers/combinators that have a &key id in their arguments lists, the
argument have been left alone to avoid API breakage, although it now has no
effect. Even so, you should define your own defparameters for these as well.

1.5.1

29 Sep 23:06
e29a293

Choose a tag to compare

Fixed

  • Depending on the parser they were given, many and many1 were consuming too
    much offset. I only discovered this now as I mostly avoid many in favour of
    take-while or sep, but in some recent code I needed many for its
    original purpose (collecting a list), and the bug surfaced.

1.5.0

14 Sep 00:56
8cb4a11

Choose a tag to compare

Added

  • Combinator: not for succeeding when a parser fails. Useful when trying to
    test a complicated parse boundary, say in combination with sep-end.
  • Combinator: consume-sep and consume-sep1 for advancing the parser like
    sep but without allocating.
  • datetime: The simple-local-time parser for lenient parsing of local times.
  • email: The new parcom/email system.

Changed

  • A number of parsers/combinators are now more memory efficient by avoiding
    internal lambda allocations.

1.4.0

17 Aug 08:18
cb094a5

Choose a tag to compare

Added

  • Combinator: maybe for conditionally applying a function to the result of a parser.

Changed

  • toml: parse checks if you've reached the end of the file.
  • xml: parse checks if you've reached the end of the file.
  • json: Numbers now parse as fixnum if they can be.
  • json: Number parsing is now 2x as fast and uses half as much memory.

Fixed

  • xml: Allow a <!DOCTYPE ...> tag near the top of the file.

1.3.0

31 May 12:54
54c14e2

Choose a tag to compare

Added

  • The parcom/xml system.

Changed

  • Improved performance of parcom/json.
  • Improved contextual output in parse failure condition.
  • consume: Yields the offset as a value instead of t.
  • A few more functions have been given lambda caches.

1.2.0

16 May 22:21
73eaae7

Choose a tag to compare

Added

  • The parcom/toml system.
  • Parser: pure for injecting values as parsers.
  • Utility: pmap for transforming parser successes more directly than fmap.

1.1.0

08 May 21:22
d448d14

Choose a tag to compare

Added

  • The parcom/datetime system.
  • Parser: any-if.
  • Parser: sneak.
  • Combinator: take-until.

Changed

  • Vastly improved performance. Runtime is ~3x faster and uses 25x less memory.
  • The signalling of parsing success and failure is done through multiple return
    values, not structs. The fundamental signature of parser functions is thus now
    offset -> (value, offset).
  • Contextual information when parsing fails is more accurate.
  • anybut -> any-but

Removed

  • The explicit parser, failure, and input types. This is now managed by
    multiple return values, as described above.

1.0.0

22 Apr 22:10
35a9dc5

Choose a tag to compare

Initial release, including parcom and parcom/json.