Open
Description
When a rule has multiple arguments and passes those arguments to another rule, all but the last argument are wrapped in single-valued tuples. This is a concern because the tuples are unexpected and the multiple arguments are not handled consistently.
Code example:
from parsley import makeGrammar
GRAMMAR = """
a :x :y :z = b(x, y, z) -> print("a: x={} y={} z={}".format(x, y, z))
b :x :y :z = c(x, y, z) -> print("b: x={} y={} z={}".format(x, y, z))
c :x :y :z = -> print("c: x={} y={} z={}".format(x, y, z))
"""
ParserClass = makeGrammar(GRAMMAR, {})
parser = ParserClass('')
parser.a(1, 2, 3)
Output from Python 3.5.3:
c: x=((1,),) y=((2,),) z=3
b: x=(1,) y=(2,) z=3
a: x=1 y=2 z=3
Metadata
Metadata
Assignees
Labels
No labels
Activity