diff --git a/exe/mm2ep-depend b/exe/mm2ep-depend index 40114fe..8c3f533 100755 --- a/exe/mm2ep-depend +++ b/exe/mm2ep-depend @@ -28,9 +28,10 @@ module Mm2ep pp token puts "RAW : #{line}" puts "EVAL: #{token.to_s}" + parser.check_grammar line, token - binding.pry exit 1 unless token.errors.empty? || token.nil? + puts "RESULT: #{token.compute}" end diff --git a/lib/mm2ep_depend/parser.rb b/lib/mm2ep_depend/parser.rb index 2329b1d..bd9c4d8 100755 --- a/lib/mm2ep_depend/parser.rb +++ b/lib/mm2ep_depend/parser.rb @@ -176,6 +176,7 @@ module Mm2ep class Parser < Rly::Yacc attr_writer :names + # Check if grammar is valid def check_grammar(line, tokens) grammar = tokens.to_s.split(/=|AND|OR/) expr = line.split(/=|AND|OR/)