Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In my parser, what is wrong with this precedence list? precedence = (
- ('nonassoc', IF, THEN),
- ('left', COLON),
- ('nonassoc', ELSE),
- # ('right', EQUALS), # right to allow x = a = b
- ('nonassoc', EQUALS, LT, GT, LE, GE, NE),
- # ^ needs to be nonassoc so = isn't associated with itself...
- # since it has a different meaning based on context.
- # separate from EQUALS to allow x=a>b?
- ('nonassoc', FLUSH),
- ('left', CREATE_EXPRS, APPEND_EXPRS),
- ('left', PLUS, MINUS),
- ('left', MULTIPLY, DIVIDE),
- ('left', POWER), # exponent (*not* same as EXP function)
- ('nonassoc', UNARY_MINUS),
- )
Advertisement
Add Comment
Please, Sign In to add comment