Sha256: c83af71075072a4f9990a397b4a1d27c88cee2ae7140e9f5f147206f4dae831c
Contents?: true
Size: 734 Bytes
Versions: 1
Compression:
Stored size: 734 Bytes
Contents
require "rly" require "rly/parse/rule_parser" describe Rly::RuleParser do it "parses a simple rule string" do s = 'expression : expression "+" expression | expression "-" expression | expression "*" expression | expression "/" expression' p = Rly::RuleParser.new productions = p.parse(s) productions.length.should == 4 productions[0].should == [:expression, [:expression, '+', :expression], nil] productions[1].should == [:expression, [:expression, '-', :expression], nil] productions[2].should == [:expression, [:expression, '*', :expression], nil] productions[3].should == [:expression, [:expression, '/', :expression], nil] end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rly-0.2.1 | spec/parse/rule_parser_spec.rb |