Releases: fosskers/parcom
Releases · fosskers/parcom
1.6.3
1.6.2
1.6.0
The theme of this release is "type information". Overall, function signatures
have been greatly elaborated across the various systems.
Added
->,fn,always, andmaybefor concise definition of function
signatures that involve parsers.- Parser:
sliding-takeandsliding-take1for parsing escaped characters
efficiently.
Changed
<$is now a macro.betweenis now a macro.:failcan be returned from the lambda given toapto 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, andconsume. 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
Fixed
- Depending on the parser they were given,
manyandmany1were consuming too
much offset. I only discovered this now as I mostly avoidmanyin favour of
take-whileorsep, but in some recent code I neededmanyfor its
original purpose (collecting a list), and the bug surfaced.
1.5.0
Added
- Combinator:
notfor succeeding when a parser fails. Useful when trying to
test a complicated parse boundary, say in combination withsep-end. - Combinator:
consume-sepandconsume-sep1for advancing the parser like
sepbut without allocating. - datetime: The
simple-local-timeparser for lenient parsing of local times. - email: The new
parcom/emailsystem.
Changed
- A number of parsers/combinators are now more memory efficient by avoiding
internal lambda allocations.
1.4.0
Added
- Combinator:
maybefor conditionally applying a function to the result of a parser.
Changed
- toml:
parsechecks if you've reached the end of the file. - xml:
parsechecks if you've reached the end of the file. - json: Numbers now parse as
fixnumif 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
1.2.0
1.1.0
Added
- The
parcom/datetimesystem. - 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, andinputtypes. This is now managed by
multiple return values, as described above.