Skip to content

Latest commit

 

History

History
89 lines (56 loc) · 2.63 KB

CHANGELOG.md

File metadata and controls

89 lines (56 loc) · 2.63 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[0.2.3] - 2023-08-28

  • Remove ruby-next-core as a dependency. (@palkan)

[0.2.2] - 2023-08-23

Fixed

  • Ship gem with pre-transpiled files (lib/.rbnext). (@palkan)

0.2.1 - 2022-05-17

Added

0.2.0 - 2021-12-28

Added

  • Callstack collection for debugging. (@skryukov)

Pass with_callstack: true to the Paco::Parser#parse method to collect a callstack while parsing. To examine the callstack catch the ParseError exception:

begin
  string("Paco").parse("Paco!", with_callstack: true)
rescue Paco::ParseError => e
  pp e.callstack.stack # You will probably want to use `binding.irb` or `binding.pry`
end
  • Paco::Combinators.index method. (@skryukov)

Call Paco::Combinators.index to get Paco::Index representing the current offset into the parse without consuming the input. Paco::Index has a 0-based character offset attribute :pos and 1-based :line and :column attributes.

index.parse("Paco") #=> #<struct Paco::Index pos=0, line=1, column=1> 

Add require "paco/rspec" to spec_helper.rb to enable a special RSpec matcher #parse:

subject { string("Paco") }

it { is_expected.to parse("Paco") } # just checks if parser succeeds
it { is_expected.to parse("Paco").as("Paco") } # checks if parser result is eq to value passed to `#as`
it { is_expected.to parse("Paco").fully } # checks if parser result is the same as value passed to `#parse`

Changed

  • Paco::Combinators.seq_map merged into Paco::Combinators.seq. (@skryukov)
  • Paco::Combinators.sep_by_1 renamed to Paco::Combinators.sep_by!. (@skryukov)

Fixed

  • Paco::Combinators::Char#regexp now uses \A instead of ^. (@skryukov)
  • include Paco now works inside irb. (@skryukov)
  • Paco::Combinators#not_followed_by and Paco::Combinators#seq now don't consume input on error. (@skryukov)

0.1.0 - 2021-12-12

Added