Skip to content

wrong AST for Call with argument and do block  #33

@uujava

Description

@uujava

Following code snipped parsed incorrectly:

A.call an_arg do
  do_block_call
end

This test case failed:

     assert_parse("[Script, [[Call, [Constant, [SimpleString, A]], [SimpleString, call], [[VCall, [SimpleString, an_arg]]], [Block, null, [[VCall, [SimpleString, do_block]]]]]], null]]]",
                  "A.call an_arg do; do_block; end")

Those are ok:

     assert_parse("[Script, [[FunctionalCall, [SimpleString, do_call], [[FunctionalCall, [SimpleString, curly_call], [], [Block, null, [[VCall, [SimpleString, curlyblock]]]]]], [Block, null, [[VCall, [SimpleString, doblock]]]]]]]",
                  "do_call curly_call {curlyblock} do;doblock;end")
     assert_parse("[Script, [[FunctionalCall, [SimpleString, a_call], [[FunctionalCall, [SimpleString, an_arg], [], [Block, null, [[VCall, [SimpleString, curlyblock]]]]]], null]]]",
                  "a_call an_arg { curlyblock }")
     assert_parse("[Script, [[FunctionalCall, [SimpleString, a_call], [[VCall, [SimpleString, an_arg]]], [Block, null, [[VCall, [SimpleString, do_block]]]]]]]",
                  "a_call an_arg do; do_block; end")
     assert_parse("[Script, [[Call, [Constant, [SimpleString, A]], [SimpleString, call], [[FunctionalCall, [SimpleString, an_arg], [], [Block, null, [[VCall, [SimpleString, curlyblock]]]]]], null]]]",
                  "A.call an_arg {curlyblock}")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions