Conflowio Parsley Versions Save

Parser combinator library written in Go

v0.12.0

5 years ago

IMPROVEMENTS:

  • Add parsley.NonTerminalNode interface for nonterminal nodes
  • Add parsley.StaticChecker and parsley.StaticCheckable interface for doing static analysis
  • Add type to the AST nodes

BACKWARDS INCOMPATIBILITIES:

  • The parsley.Interpreter's Eval now expects a parsley.NonTerminalNode instead of a list of nodes
  • The ast.NodeList's node methods will run always on the first node only
  • The ast.NilNode was renamed to ast.EmptyNode to avoid confusion
  • The ast.NewTerminalNode now expects a new valueType parameter
  • Most of the text/terminal parsers now will return a custom node type (string node, int node, etc.)

v0.9.0

5 years ago

BACKWARDS INCOMPATIBILITIES:

  • The parser interface was changed to return an error. The error return value was previously removed but since I realised it was a bad design decision to save ~10% in benchmarks.
  • The parser interface doesn't contain the Name() method anymore, it wasn't that useful.
  • The error field was removed from the parsing context
  • The parsing context now carries the file set
  • The top level parsley.Parse and parsley.Evaluate now will return with a simple error type which already contains the error position (these are only convenience methods).
  • I removed the *OrValue combinators as you can force a single child result with the Single combinator
  • Clean up all combinators to only have parser parameters
  • Add parser.ReturnError combinator to be able to override a parser's error (if the error's position is the same as the reader's) -Add ReturnError() helper method to parser.Func

BUGFIXES:

  • The string parser won't accept new-line characters (\r, \n) in double-quoted strings anymore

v0.8.4

5 years ago

BUGFIXES:

  • The Single combinator will now return with the original parser's name

v0.8.3

5 years ago

IMPROVEMENTS:

  • Add Go module definition
  • Update CircleCI config to use Go 1.11

v0.8.2

5 years ago

IMPROVEMENTS:

  • Add Single combinator: Single will change the result of p if it returns with a non terminal node with only one child. In this case directly the child will be returned.

v0.8.1

5 years ago

IMPROVEMENTS:

  • Add back the SeqTryOrValue, SepByOrValue and SepByOrValue1 combinators as these are required

BUGFIXES:

  • Many1 won't match for zero p matches

v0.8.0

5 years ago

IMPROVEMENTS:

  • the library got a huge performance increase by refactoring the String terminal parser. The issue was caused by string concatenation and the excessive use of strconv.UnquoteChar.

BACKWARDS INCOMPATIBILITIES:

  • a new parsing context struct was introduced which carries the reader, the result cache, the call count and the best error
  • the parser interface was changed to use the parsing context
  • the parsley.History interface and the parser.History struct was replaced by parsley.ResultCache (which lives in the context now)
  • the terminal.Integer parser will return an int64

v0.7.0

5 years ago

BACKWARDS INCOMPATIBILITIES:

  • extend parsley.Error to have a Cause() error method
  • rename parsley.NewError() to parsley.NewErrorf()
  • add parsley.NewError with error type as input
  • parsley.WrapError will store the original cause but update the error message
  • use v[version] tags for versioning

0.6.0

6 years ago

BACKWARDS INCOMPATIBILITIES:

  • major refactor of most of the API
  • most of the interfaces were moved to the parsley package
  • the position handling was rewritten similar to go's token.Pos
  • the builders were completely removed
  • the reader doesn't handle whitespaces anymore
  • the parsers' return value were simplified
  • nil node values are not allowed anymore
  • most of the combinators API's were simplified to avoid repetition (like name + token)

IMPROVEMENTS:

  • the reader became stateless
  • most of the tests were rewritten using Ginkgo/Gomega
  • common interpreters were added (array, object)
  • whitespaces can be handled precisely with new parsers (text.LeftTrim/RightTrim/Trim)
  • new error type with position (parsley.Pos)
  • new empty node type
  • new file and fileset types were introduced to support parsing multiple files better

BUGFIXES:

  • the History was using the wrong key when checking left-recursion and wasn't curtailing properly

TODO:

  • some of the old tests in the combinator package needs to be rewritten using Gingko (this means we miss a lot of test coverage)

0.5.0

6 years ago

BACKWARDS INCOMPATIBILITIES:

  • text.NewReader now expects a filename parameter

IMPROVEMENTS:

  • Windows-style line endings (\r\n) are automatically replaced to Unix-style line endings (\n) in the text reader.