Skip to content

Releases: j-mie6/parsley

Parsley 4.0.3

31 Dec 17:48
73f1e20
Compare
Choose a tag to compare

What's Changed

  • Fixed missing wider caret for unexpectedless trivial errors by @j-mie6 in #137

Full Changelog: v4.0.2...v4.0.3

Parsley 4.1.0-M1

30 Dec 16:16
5725e60
Compare
Choose a tag to compare
Parsley 4.1.0-M1 Pre-release
Pre-release

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 to Lexer 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

30 Dec 16:10
6021d4e
Compare
Choose a tag to compare

This is a patch release with the following changes:

  • filter/filterOut/filterMap generate a wide-caret, as per 4.0.1, but no longer generate an unexpected token, to be more consistent with their original behaviour from 4.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

05 Dec 15:24
fd81d65
Compare
Choose a tag to compare

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 for Basic 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

30 Nov 22:46
51ccb79
Compare
Choose a tag to compare

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 of attempt
    • unsafeLabel, which leveraged the previously unsound error message system of pre-2.6.0: this just simply isn't needed, and optimisations of label 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 the unary_~ combinator to make a parser lazy for use in the fully strict zipped combinators. As a result, the structure of the library is simplified, with all the combinators defined as methods on Parsley itself.
  • Improved factoring of the expression API to distinguish between the heterogeneous chains in infix with the homogeneous ones in chain.
  • 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 on Parsley itself
    • character.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 argument
    • string no longer accepts the empty string (there is no reason to do this!)
    • collectMsg now accepts 1 or more message arguments
    • collectMsg and guardAgainst now produce Seq[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, and LazyZipped 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 and Impl
  • Remove LanguageDef and replace with LexicalDesc 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 from pure
  • 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 and stringOfSome combinators, which allow for efficient string construction, instead of the old .map(_.mkString) idiom on many or some
  • 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 and fillReg combinators
  • Added the forP and forP_ combinators
  • Added the forYieldP, and forYieldP_ combinators
  • Added the mapFilter combinator
  • An error message debugging combinator
  • Added the generic bridge traits of ParserBridge0 through ParserBridge22 as well as ParserSingletonBridge for basic use of the Parser Bridge and Singleton Bridge patterns.
  • Added ap1 through ap22, which are logical precursors to lift1 to lift22.
  • Added markAsToken and unexpectedWhen combinators to parsley.errors.combinator
  • fail and unexpected 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

Full Changelog: v3.3.10...v4.0.0

Parsley 3.3.10

29 Jul 12:13
57a561f
Compare
Choose a tag to compare

What's Changed

  • Bugfix: Ensure that comments without shared prefix do not loop indefinitely by @j-mie6 in #127

Full Changelog: v3.3.9...v3.3.10

Parsley 3.3.9

08 Jun 16:27
322b0b9
Compare
Choose a tag to compare

What's Changed

  • Bugfix: Added missing depth decrement to multiRet by @j-mie6 in #123

Full Changelog: v3.3.8...v3.3.9

Parsley 3.3.8

07 Jun 11:39
93610f4
Compare
Choose a tag to compare

Support added for Scala 3 on Scala Native builds.

Parsley 3.3.7

25 Apr 20:04
7f2fb16
Compare
Choose a tag to compare

What's Changed

  • Fixed infinite loop in whitespace with no comments in LanguageDef by @j-mie6 in #119

Full Changelog: v3.3.6...v3.3.7

Parsley 3.3.6

10 Feb 14:33
13f2d25
Compare
Choose a tag to compare

Slight cosmetic change for DefaultErrorBuilder on this release.

What's Changed

  • Improved rendering of whitespace leading unexpected tokens by @j-mie6 in #109

Full Changelog: v3.3.5...v3.3.6