Now
MAIN commitmail json YAML
lint: resolve shift/reduce conflicts for unary expressions
The grammar rule 'term' was ambiguous since both the prefix and postfix
increment operators were listed with the same precedence. The
expression '++x++' was parsed as '++ (x++)', as expected, since
conflicts resolve towards shift.
Resolve these conflicts by structuring the grammar as in C99, with the
GCC extension of statement-expressions. The resolved conflicts are:
134: shift/reduce conflict (shift 161, reduce 347) on T_LBRACK
134: shift/reduce conflict (shift 162, reduce 347) on T_LPAREN
134: shift/reduce conflict (shift 163, reduce 347) on T_POINT
134: shift/reduce conflict (shift 164, reduce 347) on T_ARROW
134: shift/reduce conflict (shift 165, reduce 347) on T_INCDEC
state 134
term : term . T_INCDEC (335)
term : term . T_LBRACK expr T_RBRACK (341)
term : term . T_LPAREN T_RPAREN (342)
term : term . T_LPAREN argument_expression_list T_RPAREN (343)
term : term . point_or_arrow T_NAME (344)
term : T_EXTENSION term . (347)
No functional change.
The grammar rule 'term' was ambiguous since both the prefix and postfix
increment operators were listed with the same precedence. The
expression '++x++' was parsed as '++ (x++)', as expected, since
conflicts resolve towards shift.
Resolve these conflicts by structuring the grammar as in C99, with the
GCC extension of statement-expressions. The resolved conflicts are:
134: shift/reduce conflict (shift 161, reduce 347) on T_LBRACK
134: shift/reduce conflict (shift 162, reduce 347) on T_LPAREN
134: shift/reduce conflict (shift 163, reduce 347) on T_POINT
134: shift/reduce conflict (shift 164, reduce 347) on T_ARROW
134: shift/reduce conflict (shift 165, reduce 347) on T_INCDEC
state 134
term : term . T_INCDEC (335)
term : term . T_LBRACK expr T_RBRACK (341)
term : term . T_LPAREN T_RPAREN (342)
term : term . T_LPAREN argument_expression_list T_RPAREN (343)
term : term . point_or_arrow T_NAME (344)
term : T_EXTENSION term . (347)
No functional change.