Releases: j-mie6/parsley
Releases · j-mie6/parsley
Parsley 4.0.3
What's Changed
Full Changelog: v4.0.2...v4.0.3
Parsley 4.1.0-M1
This is the first milestone release ahead of 4.1.0
. See #136 for details.
What's Changed
Minor Changes
- Added
parsley.token.errors.ErrorConfig
as a new constructor toLexer
to make use of it:- The existing error messages generated by the lexer are now configurable via this object
Full Changelog: v4.0.2...v4.1.0-M1
Parsley 4.0.2
This is a patch release with the following changes:
filter
/filterOut
/filterMap
generate a wide-caret, as per4.0.1
, but no longer generate an unexpected token, to be more consistent with their original behaviour from4.0.0
What's Changed
- Remove unexpected token from
filter
/filterOut
/filterMap
, but keep caret by @j-mie6 in #134 - New SBT by @j-mie6 in #135
Full Changelog: v4.0.1...v4.0.2
Parsley 4.0.1
This is a patch release with the following changes:
- Added a grouping for
unexpectedToken
in the documentation - Added a proper label to the keyword and operator combinators in
token.symbol
, this was only done forBasic
defined parsers before - Corrected wrong documentation for
token.descriptions.numeric.NumericDesc.plain
- Corrected the caret width logic on
filter
/filterOut
/mapFilter
.
Full Changelog: v4.0.0...v4.0.1
Parsley 4.0.0
What's Changed
In short: a lot 😄
Major Changes
- Improve the expression parsing combinators in line with the presentation in Design Patterns for Parser Combinators
- Enforced the deprecation of many combinators:
- all the original function based register combinators - they are now methods on register itself, allowing better type inference
- the problematic
<\>
combinator, which both had an inappropriate associativity, and encouraged an overuse ofattempt
unsafeLabel
, which leveraged the previously unsound error message system of pre-2.6.0: this just simply isn't needed, and optimisations oflabel
in the backend more than make up for its loss.- the remaining
unsafe
API in general: none of this functionality is required, and causes a variety of legacy code maintenance problems
- Moved to a strict API: this means that the receivers of combinators are strict, and left-recursion will now diverge sooner. Left-recursion handling is out of scope for Parsley, so this is a good change. It may also result in improved warnings from Scala itself that point out left-recursion in parsers. The
LazyParsley
extension class still exists, and it supports theunary_~
combinator to make a parser lazy for use in the fully strictzipped
combinators. As a result, the structure of the library is simplified, with all the combinators defined as methods onParsley
itself. - Improved factoring of the expression API to distinguish between the heterogeneous chains in
infix
with the homogeneous ones inchain
. - Removed the
cast
combinator, as the register restriction is lifted, and it can be a misleading combinator. - Moved a selection of combinators into new homes:
Parsley.sequence
->combinator.sequence
Parsley.traverse
->combinator.traverse
Parsley.skip
->combinator.skip
Parsley.void
made into a method onParsley
itselfcharacter.anyChar
->character.item
combinator.repeat
->combinator.exactly
combinator.optionally
->combinator.optionalAs
Parsley.LazyMapParsley
->extension.HaskellStyleMap
Parsley.LazyChooseParsley
->extension.LazyChooseParsley
- Removed the revision system for error builders, as it is no longer compatible with the new versioning policy
- Added wide-carets to the error builder
- Some combinators have been adjusted to remove inconsistent states or be more consistent with other combinators:
fail
must receive at least one argumentstring
no longer accepts the empty string (there is no reason to do this!)collectMsg
now accepts 1 or more message argumentscollectMsg
andguardAgainst
now produceSeq[String]
as the messages (this should be non-empty!)precedence
requires at least one atom and one level, this also allows for vararg versions in the other direction
zipped
combinators are now fully strict, andLazyZipped
has been removed entirely- Allow the user to decide how to extract an unexpected token from the input (provided as
Iterator[Char]
) at fail position additionally given the amount of input the parser tried to parse unsuccessfully.
Major parsley.token
Changes
- Remove
BitSet
andImpl
- Remove
LanguageDef
and replace withLexicalDesc
and friends - Subdivide
Lexer
into categories, which can share functionality with each other:numeric
text
symbol
names
space
separators
enclosing
Minor Changes
- Support for mixed-fixity precedence levels
- Added
fresh
combinator, for generation of unique results frompure
- Added the
strings
combinator, which efficiently parses one of a set of strings - Added the
strings
combinator, which efficiently parses one a mapping of strings to other parsers - Added the
stringOfMany
andstringOfSome
combinators, which allow for efficient string construction, instead of the old.map(_.mkString)
idiom onmany
orsome
- Added the
|
combinator alias - Added
filterWith
back onto the API - Added
combinator.ifP
- Added
extensions.OperatorSugar
which comes with a few operators inspired by the SPC library - Added the
newReg
andfillReg
combinators - Added the
forP
andforP_
combinators - Added the
forYieldP
, andforYieldP_
combinators - Added the
mapFilter
combinator - An error message debugging combinator
- Added the generic bridge traits of
ParserBridge0
throughParserBridge22
as well asParserSingletonBridge
for basic use of the Parser Bridge and Singleton Bridge patterns. - Added
ap1
throughap22
, which are logical precursors tolift1
tolift22
. - Added
markAsToken
andunexpectedWhen
combinators toparsley.errors.combinator
fail
andunexpected
should be able to specify the caret width of their error, for unexpected errors, widest now wins against ambiguity
Patch Changes
- Improved the implementation of
persist
- Made the
<|>
combinator more consistent when the (internal)JumpTable
optimisation applied - General improvements to semantic preservation of optimisations on parsers
- Error semantics adjusted to be consistent with mrkkrp/megaparsec#482
- Better unicode support for error messages
- The
.unexpected
,.!
,.collectMsg
,.guardAgainst
,.filter
,.collect
,.filterMap
,.filterOut
, and.filterNot
combinators now have amended semantics by default, and sets the caret width to be the thing that was parsed. (behaviour needs documentation)
Other Changes
- Major documentation overhaul, with the entire documentation rewritten and standardised, with examples throughout. This should be much friendlier for newcomers to the library.
- Changed the versioning policy to be consistent with Scala's SemVer policy:
M.m.p
represents binary back-compat, source back-compat and then patch. This should make the library far more stable in the wild, and the policy is enforced by CI. - More than 4 registers may be now used simultaneously
Merged PRs
- Parsley 4 Major Changes by @j-mie6 in #98
- Strict API by @j-mie6 in #100
- Reshuffled Chains by @j-mie6 in #111
- Frontend backend separation by @j-mie6 in #112
- Improved Parsley Documentation by @j-mie6 in #113
- Parsley 4 string enhancements by @j-mie6 in #116
- Make
collectMsg
andguardAgainst
produce multiple errors for consistency withfail
by @j-mie6 in #117 - Instruction rework by @j-mie6 in #120
- AST Normalisation by @j-mie6 in #124
- Lifting register restriction by @j-mie6 in #125
- Improved
token
by @j-mie6 in #128
Full Changelog: v3.3.10...v4.0.0
Parsley 3.3.10
What's Changed
Full Changelog: v3.3.9...v3.3.10
Parsley 3.3.9
What's Changed
Full Changelog: v3.3.8...v3.3.9
Parsley 3.3.8
Support added for Scala 3 on Scala Native builds.
Parsley 3.3.7
What's Changed
Full Changelog: v3.3.6...v3.3.7
Parsley 3.3.6
Slight cosmetic change for DefaultErrorBuilder
on this release.
What's Changed
Full Changelog: v3.3.5...v3.3.6