archives

« Bugzilla Issues Index

#2338 — 12.2: Optional Arguments in "MemberExpression : new super Arguments" leads to Shift/Reduce conflicts


The optional "Arguments" in "MemberExpression : new super Arguments{opt}" leads to three shift/reduce conflicts.

> bison --report=all super.y
super.y: Conflicts: 3 Shift/Reduce


super.y:
---
%start leftHandSideExpression

%error-verbose

%token SUPER "super"
%token NEW "new"
%token NUMBER
%token ID

%%

leftHandSideExpression : newExpression
| callExpression
;

arguments : '(' ')' ;

callExpression : memberExpression arguments
| SUPER arguments
| callExpression arguments
| callExpression '[' expression ']'
| callExpression '.' identifierName
| callExpression templateLiteral
;

newExpression : memberExpression
| NEW newExpression
;

memberExpression : primaryExpression
| memberExpression '[' expression ']'
| memberExpression '.' identifierName
| memberExpression templateLiteral
| SUPER '[' expression ']'
| SUPER '.' identifierName
| NEW SUPER arguments
| NEW SUPER
| NEW memberExpression arguments
;

templateLiteral : '`' '`' ;

expression : leftHandSideExpression ;
primaryExpression : NUMBER ;
identifierName : ID ;

%%
---


fixed in rev23 editor's draft

added a 'super' lookahead restriction for

MemberExpression :
'new' MemberExpression Arguments


fixed in rev23 draft