Skip to content
This repository was archived by the owner on Aug 28, 2023. It is now read-only.

Releases: romshark/llparser

v0.8.0

Choose a tag to compare

@romshark romshark released this 03 Nov 12:12
23b0ffa

This release introduces improved performance for the Lexed pattern, improved parse-tree formatting options and the new recursion control feature which allows limiting the maximum level of recursion when parsing, hence avoiding runtime panics.

Added

  • Parser.MaxRecursionLevel specifying the maximum tolerated recursion level.
  • Lexed.MinLen specifying the minimum expected length of the lexed token.
  • FragPrintOptions.Format specifying the formatting of a parse-tree node (optionally both header and body).

Changed

  • Lexed.Fn changed its type to func(index uint, cursor llparser.Cursor) bool.

Removed

  • FragPrintOptions.HeadFmt was replaced by the new FragPrintOptions.Format option.

Fixed

  • Fixed a few small documentation issues.

v0.7.0

Choose a tag to compare

@romshark romshark released this 27 Oct 10:22

This release improves reliability by automatically validating the grammar during the parser's initialization.

Added

  • ValidatePattern(ptr Pattern) error was added to allow for manual recursive pattern validation.

Changed

  • Pattern Lexed must now be passed as a pointer.
  • Pattern Exact must now be passed as a pointer.
  • Pattern Repeated must now be passed as a pointer.
  • NewParser now takes grammar *Rule and errGrammar *Rule parameters and returns (*Parser, error) returning an error in case of invalid grammars.
  • (pr *Parser) Parse now takes only one parameter: source *SourceFile.

v0.6.0

Choose a tag to compare

@romshark romshark released this 15 Oct 20:40
056c3ea

This release introduces a new pattern Not which allows deliberately failing parsing in case of unexpected tokens.

Added

  • Pattern Not

Fixed

  • example boolexp now properly handles unexpected inputs.

v0.5.0

Choose a tag to compare

@romshark romshark released this 30 Sep 00:10

This release ships a new example (boolean expression parser), bug-fixes, performance improvements and an improved fragment printer implementation allowing the user to specify printing prefixes, custom line-breaks and custom token-header formatting functions.

Added

  • A new boolean expression parser example was added.

Changed

  • PrintFragment now takes FragPrintOptions as the second parameter.

Fixed

  • Endless recursion on right-recursive grammars was fixed by making the parser check for EOF before parsing terminals.
  • PrintFragment now uses spaces instead of line-breaks when indentation is disabled.

v0.4.0

Choose a tag to compare

@romshark romshark released this 16 Sep 13:42

This release improves and simplifies the API introducing the Repeated pattern (#10) replacing the removed ZeroOrMore, OneOrMore and Optional patterns.

Added

  • A new pattern Repeated was added to replace the removed patterns.

Changed

Removed

  • The pattern ZeroOrMore was removed.
  • The pattern OneOrMore was removed.
  • The pattern Optional was removed.

Fixed

  • A parser-bug in example/dicklang was fixed.

v0.3.0

Choose a tag to compare

@romshark romshark released this 13 Sep 16:34

This release improves and simplifies the API and introduces error-rules to allow users to associate specific patterns with specific errors returned by the parser to improve the error reporting quality (#8). The lexer is now a built-in part of the parser, implementing a custom Lexer is no longer possible, Lexed should be used instead.

Changed

  • Parser.Parse now takes an additional parameter errRule *Rule which defines the error-rule
    which the parser tries to match before returning a generic ErrUnexpectedToken error.
  • Parser.Parse now takes *SourceFile as the first parameter instead of Lexer.
  • The pattern TermExact was renamed to Exact.

Removed

  • The Lexer interface was removed.
  • The pattern Term was removed.
  • The pattern Checked was removed.
  • Scanner is no longer an exported type.
  • The field ErrUnexpectedToken.Actual was removed.
  • The package misc was removed.

v0.2.0

Choose a tag to compare

@romshark romshark released this 01 Sep 14:49
2ae3898

Added

  • Added a new pattern Lexed to allow instructing the lexer to lex a particular sequence of characters specified by the grammar.

Changed

  • llparser.SourceFile.Src is now of type []rune instead of string.
  • llparser.Fragment.Src now returns []rune instead of string.
  • llparser.TermExact.Expectation is now of type []rune instead of string.
  • llparser.Checked.Fn is now of type func([]rune) bool instead of func(string) bool.
  • llparser.Lexer.ReadExact now accepts expectation []rune instead of expectation string as its first parameter.
  • llparser.Lexer now requires a new method to be supported by the lexer implementation:
ReadUntil(
	fn func(Cursor) uint,
	kind FragmentKind,
) (
	token *Token,
	err error,
)

v0.1.0

Choose a tag to compare

@romshark romshark released this 12 Aug 14:48
90d1a0f

This is the first official release of the library. The API is not yet guaranteed to remain stable and even though most critical bugs have already been fixed - minor bugs could still be encountered.