From ac6a82c44686285714e854bebf374b11472c679e Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Tue, 12 Sep 2017 16:35:11 +0200 Subject: [PATCH] Simplify read --- exe/mm2ep-depend | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/exe/mm2ep-depend b/exe/mm2ep-depend index be312d1..7f9d9cf 100755 --- a/exe/mm2ep-depend +++ b/exe/mm2ep-depend @@ -14,19 +14,18 @@ module Mm2ep class ParseCli < Thor desc 'parse INFILE', 'Parse INFILE into tokens' def parse(infile) - File.open(infile).each_line do |line| - parser = Parser.new(Lexer.new) - puts line.inspect - token = parser.parse(line.chomp, true) - pp token - puts token.to_s - # puts false && true - # puts false || false - # binding.pry - # parser = Parser2.new - # lexer = TestLexer.new(parser.parse(line)) - # puts lexer.testlexe - end + line = File.read(infile).gsub(/\n/,'') + parser = Parser.new(Lexer.new) + puts line.inspect + token = parser.parse(line.chomp, true) + pp token + puts token.to_s + # puts false && true + # puts false || false + # binding.pry + # parser = Parser2.new + # lexer = TestLexer.new(parser.parse(line)) + # puts lexer.testlexe end end end