Sha256: 15308f7af7b77990db09454a5dbf2cef5c01f494ffa770d4f54600830afb1f45

Contents?: true

Size: 742 Bytes

Versions: 6

Compression:

Stored size: 742 Bytes

Contents

require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")

module GrammarCompositionSpec
  describe "several composed grammars" do
    before do
      dir = File.dirname(__FILE__)
      Treetop.load File.join(dir, 'a')
      Treetop.load File.join(dir, 'b')
      Treetop.load File.join(dir, 'c')
      # Check that polyglot finds d.treetop and loads it:
      $: << dir
      require 'd'
  
      @c = ::Test::CParser.new
      @d = ::Test::DParser.new
    end

    specify "rules in C have access to rules defined in A and B" do
      @c.parse('abc').should_not be_nil
    end

    specify "rules in C can override rules in A and B with super semantics" do
      @d.parse('superkeywordworks').should_not be_nil
    end
  end
end

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
skylinecms-3.1.0 vendor/digitpaint/personify/vendor/treetop/spec/composition/grammar_composition_spec.rb
personify-1.0.0 vendor/treetop/spec/composition/grammar_composition_spec.rb
westarete-skylinecms-3.0.8.20100329 vendor/digitpaint/personify/vendor/treetop/spec/composition/grammar_composition_spec.rb
westarete-skylinecms-3.0.8.20100330 vendor/digitpaint/personify/vendor/treetop/spec/composition/grammar_composition_spec.rb
skylinecms-3.0.8 vendor/digitpaint/personify/vendor/treetop/spec/composition/grammar_composition_spec.rb
skylinecms-3.0.7 vendor/digitpaint/personify/vendor/treetop/spec/composition/grammar_composition_spec.rb