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-core
as 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`
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>
- 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_map
merged intoPaco::Combinators.seq
. (@skryukov)Paco::Combinators.sep_by_1
renamed toPaco::Combinators.sep_by!
. (@skryukov)
Paco::Combinators::Char#regexp
now uses\A
instead of^
. (@skryukov)include Paco
now works insideirb
. (@skryukov)Paco::Combinators#not_followed_by
andPaco::Combinators#seq
now don't consume input on error. (@skryukov)
0.1.0 - 2021-12-12
- Initial implementation. (@skryukov)