From 60918190f2d718243764e5c5f4549ba0e0324090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=C2=A0S=2E=20Choi?= Date: Tue, 31 Aug 2021 10:48:20 -0400 Subject: [PATCH] spec: Remove modifications to EqualityExpression In anticipation of changing `%=` to `%` [contiguous] `=`. See #13. --- spec.html | 158 +----------------------------------------------------- 1 file changed, 1 insertion(+), 157 deletions(-) diff --git a/spec.html b/spec.html index 6fd4891..bfe0673 100644 --- a/spec.html +++ b/spec.html @@ -54,16 +54,6 @@

Static Semantics: IsFunctionDefinition

RegularExpressionLiteral TemplateLiteral - EqualityExpression : - EqualityExpression `==` RelationalExpression - EqualityExpression `!=` RelationalExpression - EqualityExpression `===` RelationalExpression - EqualityExpression `!==` RelationalExpression - - `%==` RelationalExpression - `%===` RelationalExpression - - PipeExpression : ShortCircuitExpression `|>` PipeBody @@ -130,33 +120,6 @@

Static Semantics: Contains

With parameter _symbol_.

- - EqualityExpression : - `%==` RelationalExpression - `%===` RelationalExpression - - - - 1. If _symbol_ is `%`, return *true*. - 1. For each child node _child_ of this Parse Node, do - 1. If _child_ is an instance of _symbol_, return *true*. - 1. If _child_ is an instance of a nonterminal, then - 1. Let _contained_ be the result of _child_ Contains _symbol_. - 1. If _contained_ is *true*, return *true*. - 1. Return *false*. - - - -

Several early error rules for |ScriptBody| and for - |ModuleItemList|, as well as a step in CreateDynamicFunction, - use the Contains operation to check for any unbound topic reference `%`. - With this definition, - any |EqualityExpression| that uses `%==` or `%===` - is considered to contain `%`. - This guarantees that `%==` and `%===` may only be - used within a topic-binding environment created by a |PipeBody|.

-
- PipeBody : PipeExpression @@ -217,12 +180,6 @@

Static Semantics: AssignmentTargetType

RegularExpressionLiteral TemplateLiteral - EqualityExpression : - - `%==` RelationalExpression - `%===` RelationalExpression - - PipeExpression : ShortCircuitExpression `|>` PipeBody @@ -579,7 +536,6 @@

Punctuators

`.` `...` `;` `,` `<` `>` `<=` `>=` `==` `!=` `===` `!==` - `%==` `%===` `+` `-` `*` `%` `**` `++` `--` `<<` `>>` `>>>` @@ -662,18 +618,6 @@

Topic Reference

Records.

- -

The `%==` and `%===` punctuators - respectively "combine" the topic reference `%` - with the equality operators `==` and `===`. - These punctuators are declared in addition to `%`, `==`, and `===` - so that the lexical grammar may distinguish them - from the modulo assignment operator `%=`. - See also the - Equality Operators - clause.

-
-

An unbound topic reference is a topic reference that is not present within any topic-binding environment created by a |PipeBody|. @@ -683,10 +627,6 @@

Topic Reference

use the Contains operation to check for any unbound topic reference `%`. - (Any |EqualityExpression| that uses `%==` and `%===` - is also considered to - contain - `%` for this purpose.) Any inner topic reference within a |PipeBody| is hidden from these rules, preventing them from triggering the rules during program compilation.

@@ -717,98 +657,6 @@

Runtime Semantics: Evaluation

- -

Equality Operators

- - -

This section augments the original - Equality Operators clause.

- -

It presumptively uses `%` as the placeholder token for the - topic reference. This choice of token is not a final decision; `%` - could instead be `#`, `@`, `?`, or many other tokens.

-
- -

Syntax

- - EqualityExpression[In, Yield, Await] : - RelationalExpression[?In, ?Yield, ?Await] - EqualityExpression[?In, ?Yield, ?Await] `==` RelationalExpression[?In, ?Yield, ?Await] - EqualityExpression[?In, ?Yield, ?Await] `!=` RelationalExpression[?In, ?Yield, ?Await] - EqualityExpression[?In, ?Yield, ?Await] `===` RelationalExpression[?In, ?Yield, ?Await] - EqualityExpression[?In, ?Yield, ?Await] `!==` RelationalExpression[?In, ?Yield, ?Await] - - `%==` RelationalExpression[?In, ?Yield, ?Await] - `%===` RelationalExpression[?In, ?Yield, ?Await] - - - - - -

The `%==` and `%===` punctuators - respectively "combine" the topic reference `%` - with the equality operators `==` and `===`. - These punctuators are declared—in addition to `%`, `==`, and `===`— - so that the lexical grammar may distinguish them - from the modulo assignment operator `%=`.

- -

For example:
- `x |> z%=y` is equivalent to `x |> z %= y`,
- `x |> %==y` is equivalent to `x |> % == y`, and
- `x |> %===y` is equivalent to `x |> % === y`.

- -

Several early error rules for |ScriptBody| and for - |ModuleItemList|, as well as a step in CreateDynamicFunction, - use the Contains operation to check for any unbound topic reference. - (Any |EqualityExpression| that uses `%==` or `%===` - is considered to - contain - `%` for this purpose.) - This guarantees that `%==` and `%===` may only be - used within a topic-binding environment created by a |PipeBody|.

-
-
- - -

Runtime Semantics: Evaluation

- - EqualityExpression : `%==` RelationalExpression - - 1. Let _lval_ be GetPrimaryTopicValue(_lref_). - 1. Let _rref_ be the result of evaluating |RelationalExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Return IsLooselyEqual(_rval_, _lval_). - - EqualityExpression : EqualityExpression `%===` RelationalExpression - - 1. Let _lval_ be GetPrimaryTopicValue(_lref_). - 1. Let _rref_ be the result of evaluating |RelationalExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Return IsStrictlyEqual(_rval_, _lval_). - - -

An |EqualityExpression| that uses `%==` or `%===` - must not - contain - an unbound topic reference, - and an |EqualityExpression| may be evaluated only when - the running execution context's topic environment is not *null*. - This is syntactically enforced by early error rules - for |ScriptBody| and for |ModuleItemList|, - as well as a step in CreateDynamicFunction. - These rules use the - Contains - operation to check for any unbound topic reference, - and any |EqualityExpression| that uses `%==` or `%===` - is considered to - contain - `%` for this purpose.

-
-
-
-
-

Pipe Operator

@@ -850,10 +698,6 @@

Static Semantics: Early Errors

because its |PipeBody| does not contain a topic reference `%`. - (Any |EqualityExpression| that uses `%==` or `%===` - is considered to - contain - `%` for this purpose.) This design is such because omission of any topic reference from a |PipeBody| is almost certainly an accidental programmer error.

@@ -1091,7 +935,7 @@

CreateDynamicFunction ( _constructor_, _newTarget_, _kind_, _args_ )

1. NOTE: If this step is reached, _sourceText_ must match _exprSym_ (although the reverse implication does not hold). The purpose of the next two steps is to enforce any Early Error rules which apply to _exprSym_ directly. 1. Let _expr_ be ParseText(_sourceText_, _exprSym_). 1. If _expr_ is a List of errors, throw a *SyntaxError* exception. - 1. NOTE: The dynamic function must not contain an unbound topic reference `%`. (Any |EqualityExpression| that uses `%==` or `%===` is considered to contain `%` for this purpose.) + 1. NOTE: The dynamic function must not contain an unbound topic reference `%`.) 1. If _expr_ Contains `%` is *true*, throw a *SyntaxError* exception. 1. Let _proto_ be ? GetPrototypeFromConstructor(_newTarget_, _fallbackProto_). 1. Let _realmF_ be the current Realm Record.