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.
- Remove
ruby-next-coreas a dependency. (@palkan)
- Ship gem with pre-transpiled files (
lib/.rbnext). (@palkan)
0.2.1 - 2022-05-17
- Support Ruby 2.2+. (@palkan)
0.2.0 - 2021-12-28
- 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`
endPaco::Combinators.indexmethod. (@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> - RSpec matcher
#parse. (@skryukov)
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`Paco::Combinators.seq_mapmerged intoPaco::Combinators.seq. (@skryukov)Paco::Combinators.sep_by_1renamed toPaco::Combinators.sep_by!. (@skryukov)
Paco::Combinators::Char#regexpnow uses\Ainstead of^. (@skryukov)include Paconow works insideirb. (@skryukov)Paco::Combinators#not_followed_byandPaco::Combinators#seqnow don't consume input on error. (@skryukov)
0.1.0 - 2021-12-12
- Initial implementation. (@skryukov)