Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upToo sparse production-rules for AssignmentExpression? #344
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
zenparsing
Feb 1, 2016
Contributor
Looks like the rule PostfixExpression : LeftHandSideExpression is missing from the grammar summary section. Is this a problem with emu-prodref?
|
Looks like the rule |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
zenparsing
Feb 1, 2016
Contributor
Same issue for YieldExpression in the grammar summary. It's linking to the first occurrence of YieldExpression which happens to be in the "restricted grammar rules" section (and where it's only showing the NLTH rules).
|
Same issue for YieldExpression in the grammar summary. It's linking to the first occurrence of YieldExpression which happens to be in the "restricted grammar rules" section (and where it's only showing the NLTH rules). |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
RaoulSchaffranek
Feb 1, 2016
Indeed, with PostfixExpression : LeftHandSideExpression it becomes possible to derive (x => x) with the following sequence:
PrimaryExpression →
CoverParenthesizedExpressionAndArrowParameterList →
(Expression) →
(AssignmentExpression) →
(ArrowFunction) →
(ArrowParameters => ConciseBody) →
(ArrowParameters => AssignmentExpression) →
(ArrowParameters => ConditionalExpression) →
(ArrowParameters => LogicalORExpression) →
(ArrowParameters => LogicalANDExpression) →
(ArrowParameters => BitwiseORExpression) →
(ArrowParameters => BitwiseXORExpression) →
(ArrowParameters => BitwiseANDExpression) →
(ArrowParameters => EqualityExpression) →
(ArrowParameters => RelationalExpression) →
(ArrowParameters => ShiftExpression) →
(ArrowParameters => AdditiveExpression) →
(ArrowParameters => MultiplicativeExpression) →
(ArrowParameters => UnaryExpression) →
(ArrowParameters => PostfixExpression) →
(ArrowParameters => LeftHandSideExpression) →
(ArrowParameters => NewExpression) →
(ArrowParameters => MemberExpression) →
(ArrowParameters => PrimaryExpression) →
(ArrowParameters => IdentifierReference) →
(ArrowParameters => Identifier) →
(ArrowParameters => IdentifierName) →
(ArrowParameters => IdentifierStart) →
(ArrowParameters => UnicodeIDStart) →
(ArrowParameters => x) →
(BindingIdentifier => x) →
(Identifier => x) →
(IdentifierName => x) →
(IdentifierStart => x) →
(UnicodeIDStart => x) →
(x => x)
Awkwardly verbose, but it works.
Thanks @zenparsing
RaoulSchaffranek
commented
Feb 1, 2016
|
Indeed, with
Awkwardly verbose, but it works. |
RaoulSchaffranek commentedFeb 1, 2016
Hi everybody,
i just tried to derive the simple expression
(x => x)from EcmaScript2015/16 syntax rules, what i thought should be an easy excercise. There is also a test case that covers a similar construct. However, if i'm not overseeing something crucial, then i must conclude that these expressions cannot be derieved from the official production rules. So, here is my naive approach:The problem here is that i cannot derive an IdentifierReference from an AssignmentExpression. The only production rules i could take from here, are:
I'm filing this here, becuase i think that this dilemma has even more implications. For example, even
x = 42is not a valid AssignmentExpression, which does'nt seem to capture the correct idea.