Sha256: 512cff1bc34a51e22ef869d2056e2e45b088ef080f86099aa7aee66272073bd7

Contents?: true

Size: 887 Bytes

Versions: 262

Compression:

Stored size: 887 Bytes

Contents

require 'spec_helper'

BENCHMARK = false
METAGRAMMAR_PATH = File.expand_path('../../../lib/treetop/compiler/metagrammar.treetop', __FILE__)

module CircularCompilationSpec
  describe "a parser for the metagrammar" do
    attr_reader :parser
    
    before do
      @parser = Treetop::Compiler::MetagrammarParser.new
    end
    
    it "can parse the metagrammar.treetop whence it was generated" do
      File.open(METAGRAMMAR_PATH, 'r') do |f|
        metagrammar_source = f.read
        result = parser.parse(metagrammar_source)
        result.should_not be_nil

        # generated_parser = result.compile
        # Object.class_eval(generated_parser)
        # parser_2 = Treetop::Compiler::MetagrammarParser.new
        # optionally_benchmark do
        #   result = parser_2.parse(metagrammar_source)
        #   result.should_not be_nil
        # end
      end
    end
  end
end

Version data entries

262 entries across 217 versions & 32 rubygems

Version Path
depengine-0.0.31 etc/isolate/jruby-1.8/gems/treetop-1.4.8/spec/compiler/circular_compilation_spec.rb
depengine-0.0.31 etc/isolate/ruby-1.8/gems/treetop-1.4.8/spec/compiler/circular_compilation_spec.rb
depengine-0.0.30 etc/isolate/jruby-1.8/gems/treetop-1.4.8/spec/compiler/circular_compilation_spec.rb
depengine-0.0.30 etc/isolate/ruby-1.8/gems/treetop-1.4.8/spec/compiler/circular_compilation_spec.rb
depengine-0.0.29 etc/isolate/jruby-1.8/gems/treetop-1.4.8/spec/compiler/circular_compilation_spec.rb
depengine-0.0.29 etc/isolate/ruby-1.8/gems/treetop-1.4.8/spec/compiler/circular_compilation_spec.rb
depengine-0.0.28 etc/isolate/ruby-1.8/gems/treetop-1.4.8/spec/compiler/circular_compilation_spec.rb
depengine-0.0.28 etc/isolate/jruby-1.8/gems/treetop-1.4.8/spec/compiler/circular_compilation_spec.rb
depengine-0.0.27 etc/isolate/jruby-1.8/gems/treetop-1.4.8/spec/compiler/circular_compilation_spec.rb
depengine-0.0.27 etc/isolate/ruby-1.8/gems/treetop-1.4.8/spec/compiler/circular_compilation_spec.rb
depengine-0.0.26 etc/isolate/ruby-1.8/gems/treetop-1.4.8/spec/compiler/circular_compilation_spec.rb
depengine-0.0.26 etc/isolate/jruby-1.8/gems/treetop-1.4.8/spec/compiler/circular_compilation_spec.rb
depengine-0.0.25 etc/isolate/ruby-1.8/gems/treetop-1.4.8/spec/compiler/circular_compilation_spec.rb
depengine-0.0.25 etc/isolate/jruby-1.8/gems/treetop-1.4.8/spec/compiler/circular_compilation_spec.rb
depengine-0.0.24 etc/isolate/jruby-1.8/gems/treetop-1.4.8/spec/compiler/circular_compilation_spec.rb
depengine-0.0.24 etc/isolate/ruby-1.8/gems/treetop-1.4.8/spec/compiler/circular_compilation_spec.rb
depengine-0.0.23 etc/isolate/ruby-1.8/gems/treetop-1.4.8/spec/compiler/circular_compilation_spec.rb
depengine-0.0.23 etc/isolate/jruby-1.8/gems/treetop-1.4.8/spec/compiler/circular_compilation_spec.rb
depengine-0.0.22 etc/isolate/ruby-1.8/gems/treetop-1.4.8/spec/compiler/circular_compilation_spec.rb
depengine-0.0.22 etc/isolate/jruby-1.8/gems/treetop-1.4.8/spec/compiler/circular_compilation_spec.rb