Sha256: 947af0c0b260d42994e9c3c0f7928b55431eec728d2dbd43b13bacfff2231b6a

Contents?: true

Size: 552 Bytes

Versions: 2

Compression:

Stored size: 552 Bytes

Contents

#
# specifying raabro
#
# Sun Oct 11 04:24:32 SGT 2015
#

require 'spec_helper'


module Sample::OwnRewrite include Raabro

  # parse

  def hello(i); str(:hello, i, 'hello'); end

  #alias root exp
    # not necessary since Raabro takes the last defined parser as the root

  # rewrite

  def rewrite(t)

    [ :ok, t.string ]
  end
end


describe Raabro do

  describe Sample::OwnRewrite do

    it 'uses its own rewrite' do

      expect(
        Sample::OwnRewrite.parse('hello')
      ).to eq(
        [ :ok, 'hello' ]
      )
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
raabro-1.1.1 spec/sample_spec.rb
raabro-1.1.0 spec/sample_spec.rb