From 033d94dfe1feca7629ed551e295efc55b955d12b Mon Sep 17 00:00:00 2001 From: Roguelearg Date: Mon, 18 Sep 2017 11:44:31 +0200 Subject: [PATCH] Remove pry and add a comment for check_grammar --- exe/mm2ep-depend | 3 ++- lib/mm2ep_depend/parser.rb | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) 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/)