I've got a grammar with precedence:
precedence = (
("nonassoc", "COMPARISON"),
("left", "AMPER", "VBAR", "CIRCUMFLEX"),
("left", "PLUS", "MINUS"),
("left", "STAR", "SLASH", "PERCENT"),
("right", "UNARY"),
("right", "POWER"),
)
Which I believe is correct. However given: a ** b ** c; it parses it
as:
[('BinOpNode', ('BinOpNode', ('NameNode', 'a'), ('NameNode', 'b'),
'**'), ('NameNode', 'c'), '**')]
Whereas I would expect:
[('BinOpNode', ('NameNode', 'a'), ('BinOpNode', ('NameNode', 'b'),
('NameNode', 'c'), '**'), '**')]
Hopefully that syntax is clear. Any suggestions as to why I'm getting
an incorrect parse.
Alex
--
You received this message because you are subscribed to the Google Groups
"ply-hack" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/ply-hack?hl=en.