fixes all existing parser tests
This commit is contained in:
parent
53a8efaa59
commit
6ee290e0bb
@ -46,7 +46,7 @@ module Parser
|
|||||||
rule(:expressions_end) { delimited_expressions(keyword_end) }
|
rule(:expressions_end) { delimited_expressions(keyword_end) }
|
||||||
|
|
||||||
rule(:function_definition) {
|
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) {
|
rule(:parmeter_list) {
|
||||||
|
@ -19,8 +19,10 @@ class TestBasic < MiniTest::Test
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_comment
|
def test_comment
|
||||||
@string_input = '# i am a comment\n' #NEEDS the return, which is what delimits the comment
|
out = "# i am a comment \n"
|
||||||
@parse_output = {:comment => ' i am a comment'}
|
@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
|
@transform_output = @parse_output #dont transform
|
||||||
@parser = @parser.comment
|
@parser = @parser.comment
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user