From 6504e6648ee1108ae3d19d48c3fcb7e42d23edbd Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Wed, 10 Feb 2016 16:59:23 -0500 Subject: [PATCH] Editorial: Tweak the syntax of grammatical parameters. (Make things more explicit, and establish a clearer parallel between rhs-guard syntax and rhs-nonterminal use syntax.) See https://bugs.ecmascript.org/show_bug.cgi?id=2794 and https://github.com/tc39/ecma262/issues/374 --- spec.html | 246 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 129 insertions(+), 117 deletions(-) diff --git a/spec.html b/spec.html index 8cb09c73538..8253a38ba4e 100644 --- a/spec.html +++ b/spec.html @@ -536,7 +536,7 @@

Grammar Notation

StatementList : ReturnStatement - ExpressionStatement[In] + ExpressionStatement[+In]

is equivalent to saying:

@@ -544,10 +544,22 @@

Grammar Notation

ReturnStatement ExpressionStatement_In
+

and

+ + StatementList : + ReturnStatement + ExpressionStatement[~In] + +

is equivalent to:

+ + StatementList : + ReturnStatement + ExpressionStatement +

A nonterminal reference may have both a parameter list and an “opt” suffix. For example:

VariableDeclaration : - BindingIdentifier Initializer[In]? + BindingIdentifier Initializer[+In]?

is an abbreviation for:

@@ -10353,17 +10365,17 @@

Rules of Automatic Semicolon Insertion

ReturnStatement[Yield] : `return` `;` - `return` [no LineTerminator here] Expression[In, ?Yield] `;` + `return` [no LineTerminator here] Expression[+In, ?Yield] `;` ThrowStatement[Yield] : - `throw` [no LineTerminator here] Expression[In, ?Yield] `;` + `throw` [no LineTerminator here] Expression[+In, ?Yield] `;` ArrowFunction[In, Yield] : ArrowParameters[?Yield] [no LineTerminator here] `=>` ConciseBody[?In] YieldExpression[In] : - `yield` [no LineTerminator here] `*` AssignmentExpression[?In, Yield] - `yield` [no LineTerminator here] AssignmentExpression[?In, Yield] + `yield` [no LineTerminator here] `*` AssignmentExpression[?In, +Yield] + `yield` [no LineTerminator here] AssignmentExpression[?In, +Yield]

The practical effect of these restricted productions is as follows: