From 6ee290e0bbb0110b1dbd28846ea4d7d2a2950e40 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Thu, 8 May 2014 21:09:07 +0300 Subject: [PATCH] fixes all existing parser tests --- lib/parser/composed.rb | 2 +- test/parser/test_basic.rb | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/parser/composed.rb b/lib/parser/composed.rb index 6eba0000..73aa5da9 100644 --- a/lib/parser/composed.rb +++ b/lib/parser/composed.rb @@ -46,7 +46,7 @@ module Parser rule(:expressions_end) { delimited_expressions(keyword_end) } rule(:function_definition) { - keyword_def >> name.as(:function_definition) >> parmeter_list >> expressions_end + keyword_def >> name.as(:function_definition) >> parmeter_list >> newline >> expressions_end } rule(:parmeter_list) { diff --git a/test/parser/test_basic.rb b/test/parser/test_basic.rb index aae32e71..783c6c40 100644 --- a/test/parser/test_basic.rb +++ b/test/parser/test_basic.rb @@ -19,8 +19,10 @@ class TestBasic < MiniTest::Test end def test_comment - @string_input = '# i am a comment\n' #NEEDS the return, which is what delimits the comment - @parse_output = {:comment => ' i am a comment'} + out = "# i am a comment \n" + @string_input = out.dup #NEEDS the return, which is what delimits the comment + out = out[1..-2] + @parse_output = {:comment => out} @transform_output = @parse_output #dont transform @parser = @parser.comment end