Remove pry and add a comment for check_grammar
This commit is contained in:
parent
b2d80874e6
commit
033d94dfe1
2 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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/)
|
||||
|
|
Loading…
Reference in a new issue