Skip to content

Commit e080a7f

Browse files
jmdyckljharb
authored andcommitted
Editorial: Be consistent about the sense of "match" (#2572)
Given 'prod' (a nonterminal, production, or Parse Node) and 'text' (some source text, source code, or code points), the spec has occurrences of both: - prod matches text / text is matched by prod and - text matches prod / prod is matched by text This PR changes the latter into the former.
1 parent eb42654 commit e080a7f

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

spec.html

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11870,7 +11870,7 @@ <h1>
1187011870
1. If _env_ is not present or if _env_ is *undefined*, then
1187111871
1. Set _env_ to the running execution context's LexicalEnvironment.
1187211872
1. Assert: _env_ is an Environment Record.
11873-
1. If the code matching the syntactic production that is being evaluated is contained in strict mode code, let _strict_ be *true*; else let _strict_ be *false*.
11873+
1. If the code matched by the syntactic production that is being evaluated is contained in strict mode code, let _strict_ be *true*; else let _strict_ be *false*.
1187411874
1. Return ? GetIdentifierReference(_env_, _name_, _strict_).
1187511875
</emu-alg>
1187611876
<emu-note>
@@ -16685,7 +16685,7 @@ <h1>Static Semantics: Early Errors</h1>
1668516685
DecimalIntegerLiteral :: NonOctalDecimalIntegerLiteral
1668616686
</emu-grammar>
1668716687
<ul>
16688-
<li>It is a Syntax Error if the source code matching this production is strict mode code.</li>
16688+
<li>It is a Syntax Error if the source code matched by this production is strict mode code.</li>
1668916689
</ul>
1669016690
<emu-note>In non-strict code, this syntax is Legacy.</emu-note>
1669116691
</emu-clause>
@@ -16952,7 +16952,7 @@ <h1>Static Semantics: Early Errors</h1>
1695216952
NonOctalDecimalEscapeSequence
1695316953
</emu-grammar>
1695416954
<ul>
16955-
<li>It is a Syntax Error if the source code matching this production is strict mode code.</li>
16955+
<li>It is a Syntax Error if the source code matched by this production is strict mode code.</li>
1695616956
</ul>
1695716957
<emu-note>In non-strict code, this syntax is Legacy.</emu-note>
1695816958
<emu-note>
@@ -18243,7 +18243,7 @@ <h1>Static Semantics: Early Errors</h1>
1824318243
<emu-grammar>PropertyDefinition : CoverInitializedName</emu-grammar>
1824418244
<ul>
1824518245
<li>
18246-
Always throw a Syntax Error if code matches this production.
18246+
Always throw a Syntax Error if code is matched by this production.
1824718247
</li>
1824818248
</ul>
1824918249
<emu-note>
@@ -18846,7 +18846,7 @@ <h1>Static Semantics: Early Errors</h1>
1884618846
</emu-grammar>
1884718847
<ul>
1884818848
<li>
18849-
It is a Syntax Error if any code matches this production.
18849+
It is a Syntax Error if any code is matched by this production.
1885018850
</li>
1885118851
</ul>
1885218852
<emu-note>
@@ -19041,7 +19041,7 @@ <h1>Runtime Semantics: Evaluation</h1>
1904119041
1. Let _argList_ be ? ArgumentListEvaluation of _arguments_.
1904219042
1. If _argList_ has no elements, return *undefined*.
1904319043
1. Let _evalArg_ be the first element of _argList_.
19044-
1. If the source code matching this |CallExpression| is strict mode code, let _strictCaller_ be *true*. Otherwise let _strictCaller_ be *false*.
19044+
1. If the source code matched by this |CallExpression| is strict mode code, let _strictCaller_ be *true*. Otherwise let _strictCaller_ be *false*.
1904519045
1. Let _evalRealm_ be the current Realm Record.
1904619046
1. [id="step-callexpression-evaluation-direct-eval"] Return ? PerformEval(_evalArg_, _evalRealm_, _strictCaller_, *true*).
1904719047
1. Let _thisCall_ be this |CallExpression|.
@@ -22432,7 +22432,7 @@ <h1>Static Semantics: Early Errors</h1>
2243222432
<emu-grammar>WithStatement : `with` `(` Expression `)` Statement</emu-grammar>
2243322433
<ul>
2243422434
<li>
22435-
It is a Syntax Error if the code that matches this production is contained in strict mode code.
22435+
It is a Syntax Error if the code matched by this production is contained in strict mode code.
2243622436
</li>
2243722437
<li>
2243822438
It is a Syntax Error if IsLabelledFunction(|Statement|) is *true*.
@@ -22642,7 +22642,7 @@ <h1>Static Semantics: Early Errors</h1>
2264222642
<emu-grammar>LabelledItem : FunctionDeclaration</emu-grammar>
2264322643
<ul>
2264422644
<li>
22645-
It is a Syntax Error if any source text matches this rule.
22645+
It is a Syntax Error if any source text is matched by this rule.
2264622646
</li>
2264722647
</ul>
2264822648
<emu-note>
@@ -23222,10 +23222,10 @@ <h1>Static Semantics: Early Errors</h1>
2322223222
</emu-grammar>
2322323223
<ul>
2322423224
<li>
23225-
If the source code matching |FormalParameters| is strict mode code, the Early Error rules for <emu-grammar>UniqueFormalParameters : FormalParameters</emu-grammar> are applied.
23225+
If the source code matched by |FormalParameters| is strict mode code, the Early Error rules for <emu-grammar>UniqueFormalParameters : FormalParameters</emu-grammar> are applied.
2322623226
</li>
2322723227
<li>
23228-
If |BindingIdentifier| is present and the source code matching |BindingIdentifier| is strict mode code, it is a Syntax Error if the StringValue of |BindingIdentifier| is *"eval"* or *"arguments"*.
23228+
If |BindingIdentifier| is present and the source code matched by |BindingIdentifier| is strict mode code, it is a Syntax Error if the StringValue of |BindingIdentifier| is *"eval"* or *"arguments"*.
2322923229
</li>
2323023230
<li>
2323123231
It is a Syntax Error if FunctionBodyContainsUseStrict of |FunctionBody| is *true* and IsSimpleParameterList of |FormalParameters| is *false*.
@@ -23800,10 +23800,10 @@ <h1>Static Semantics: Early Errors</h1>
2380023800
</emu-grammar>
2380123801
<ul>
2380223802
<li>
23803-
If the source code matching |FormalParameters| is strict mode code, the Early Error rules for <emu-grammar>UniqueFormalParameters : FormalParameters</emu-grammar> are applied.
23803+
If the source code matched by |FormalParameters| is strict mode code, the Early Error rules for <emu-grammar>UniqueFormalParameters : FormalParameters</emu-grammar> are applied.
2380423804
</li>
2380523805
<li>
23806-
If |BindingIdentifier| is present and the source code matching |BindingIdentifier| is strict mode code, it is a Syntax Error if the StringValue of |BindingIdentifier| is *"eval"* or *"arguments"*.
23806+
If |BindingIdentifier| is present and the source code matched by |BindingIdentifier| is strict mode code, it is a Syntax Error if the StringValue of |BindingIdentifier| is *"eval"* or *"arguments"*.
2380723807
</li>
2380823808
<li>
2380923809
It is a Syntax Error if FunctionBodyContainsUseStrict of |GeneratorBody| is *true* and IsSimpleParameterList of |FormalParameters| is *false*.
@@ -24039,8 +24039,8 @@ <h1>Static Semantics: Early Errors</h1>
2403924039
`async` `function` `*` BindingIdentifier? `(` FormalParameters `)` `{` AsyncGeneratorBody `}`
2404024040
</emu-grammar>
2404124041
<ul>
24042-
<li>If the source code matching |FormalParameters| is strict mode code, the Early Error rules for <emu-grammar>UniqueFormalParameters : FormalParameters</emu-grammar> are applied.</li>
24043-
<li>If |BindingIdentifier| is present and the source code matching |BindingIdentifier| is strict mode code, it is a Syntax Error if the StringValue of |BindingIdentifier| is *"eval"* or *"arguments"*.</li>
24042+
<li>If the source code matched by |FormalParameters| is strict mode code, the Early Error rules for <emu-grammar>UniqueFormalParameters : FormalParameters</emu-grammar> are applied.</li>
24043+
<li>If |BindingIdentifier| is present and the source code matched by |BindingIdentifier| is strict mode code, it is a Syntax Error if the StringValue of |BindingIdentifier| is *"eval"* or *"arguments"*.</li>
2404424044
<li>It is a Syntax Error if FunctionBodyContainsUseStrict of |AsyncGeneratorBody| is *true* and IsSimpleParameterList of |FormalParameters| is *false*.</li>
2404524045
<li>It is a Syntax Error if any element of the BoundNames of |FormalParameters| also occurs in the LexicallyDeclaredNames of |AsyncGeneratorBody|.</li>
2404624046
<li>It is a Syntax Error if |FormalParameters| Contains |YieldExpression| is *true*.</li>
@@ -24985,8 +24985,8 @@ <h1>Static Semantics: Early Errors</h1>
2498524985
<ul>
2498624986
<li>It is a Syntax Error if FunctionBodyContainsUseStrict of |AsyncFunctionBody| is *true* and IsSimpleParameterList of |FormalParameters| is *false*.</li>
2498724987
<li>It is a Syntax Error if |FormalParameters| Contains |AwaitExpression| is *true*.</li>
24988-
<li>If the source code matching |FormalParameters| is strict mode code, the Early Error rules for <emu-grammar>UniqueFormalParameters : FormalParameters</emu-grammar> are applied.</li>
24989-
<li>If |BindingIdentifier| is present and the source code matching |BindingIdentifier| is strict mode code, it is a Syntax Error if the StringValue of |BindingIdentifier| is *"eval"* or *"arguments"*.</li>
24988+
<li>If the source code matched by |FormalParameters| is strict mode code, the Early Error rules for <emu-grammar>UniqueFormalParameters : FormalParameters</emu-grammar> are applied.</li>
24989+
<li>If |BindingIdentifier| is present and the source code matched by |BindingIdentifier| is strict mode code, it is a Syntax Error if the StringValue of |BindingIdentifier| is *"eval"* or *"arguments"*.</li>
2499024990
<li>It is a Syntax Error if any element of the BoundNames of |FormalParameters| also occurs in the LexicallyDeclaredNames of |AsyncFunctionBody|.</li>
2499124991
<li>It is a Syntax Error if |FormalParameters| Contains |SuperProperty| is *true*.</li>
2499224992
<li>It is a Syntax Error if |AsyncFunctionBody| Contains |SuperProperty| is *true*.</li>
@@ -25259,7 +25259,7 @@ <h1>
2525925259
<dl class="header">
2526025260
</dl>
2526125261
<emu-alg>
25262-
1. If the source code matching _call_ is non-strict code, return *false*.
25262+
1. If the source code matched by _call_ is non-strict code, return *false*.
2526325263
1. If _call_ is not contained within a |FunctionBody|, |ConciseBody|, or |AsyncConciseBody|, return *false*.
2526425264
1. Let _body_ be the |FunctionBody|, |ConciseBody|, or |AsyncConciseBody| that most closely contains _call_.
2526525265
1. If _body_ is the |FunctionBody| of a |GeneratorBody|, return *false*.
@@ -28503,7 +28503,7 @@ <h1>Forbidden Extensions</h1>
2850328503
The RegExp pattern grammars in <emu-xref href="#sec-patterns"></emu-xref> and <emu-xref href="#sec-regular-expressions-patterns"></emu-xref> must not be extended to recognize any of the source characters A-Z or a-z as |IdentityEscape[+UnicodeMode]| when the <sub>[UnicodeMode]</sub> grammar parameter is present.
2850428504
</li>
2850528505
<li>
28506-
The Syntactic Grammar must not be extended in any manner that allows the token `:` to immediately follow source text that matches the |BindingIdentifier| nonterminal symbol.
28506+
The Syntactic Grammar must not be extended in any manner that allows the token `:` to immediately follow source text that is matched by the |BindingIdentifier| nonterminal symbol.
2850728507
</li>
2850828508
<li>
2850928509
When processing strict mode code, an implementation must not relax the early error rules of <emu-xref href="#sec-numeric-literals-early-errors"></emu-xref>.
@@ -29949,7 +29949,7 @@ <h1>
2994929949
1. Let _body_ be ParseText(! StringToCodePoints(_bodyString_), _bodySym_).
2995029950
1. If _body_ is a List of errors, throw a *SyntaxError* exception.
2995129951
1. NOTE: The parameters and body are parsed separately to ensure that each is valid alone. For example, `new Function("/*", "*/ ) {")` is not legal.
29952-
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.
29952+
1. NOTE: If this step is reached, _sourceText_ must have the syntax of _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.
2995329953
1. Let _expr_ be ParseText(_sourceText_, _exprSym_).
2995429954
1. If _expr_ is a List of errors, throw a *SyntaxError* exception.
2995529955
1. Let _proto_ be ? GetPrototypeFromConstructor(_newTarget_, _fallbackProto_).
@@ -46797,7 +46797,7 @@ <h1>Static Semantics: Early Errors</h1>
4679746797
<emu-grammar>ExtendedAtom :: InvalidBracedQuantifier</emu-grammar>
4679846798
<ul>
4679946799
<li>
46800-
It is a Syntax Error if any source text matches this rule.
46800+
It is a Syntax Error if any source text is matched by this rule.
4680146801
</li>
4680246802
</ul>
4680346803
<p>Additionally, the rules for the following productions are modified with the addition of the <ins>highlighted</ins> text:</p>
@@ -47325,7 +47325,7 @@ <h1>Labelled Function Declarations</h1>
4732547325
<emu-grammar>LabelledItem : FunctionDeclaration</emu-grammar>
4732647326
<ul>
4732747327
<li>
47328-
It is a Syntax Error if any <ins>strict mode</ins> source code matches this rule.
47328+
It is a Syntax Error if any <ins>strict mode</ins> source code is matched by this rule.
4732947329
</li>
4733047330
</ul>
4733147331
<emu-note>
@@ -47490,7 +47490,7 @@ <h1>Changes to Block Static Semantics: Early Errors</h1>
4749047490
<emu-grammar>Block : `{` StatementList `}`</emu-grammar>
4749147491
<ul>
4749247492
<li>
47493-
It is a Syntax Error if the LexicallyDeclaredNames of |StatementList| contains any duplicate entries<ins>, unless the source code matching this production is not strict mode code and the duplicate entries are only bound by FunctionDeclarations</ins>.
47493+
It is a Syntax Error if the LexicallyDeclaredNames of |StatementList| contains any duplicate entries<ins>, unless the source code matched by this production is not strict mode code and the duplicate entries are only bound by FunctionDeclarations</ins>.
4749447494
</li>
4749547495
<li>
4749647496
It is a Syntax Error if any element of the LexicallyDeclaredNames of |StatementList| also occurs in the VarDeclaredNames of |StatementList|.
@@ -47504,7 +47504,7 @@ <h1>Changes to `switch` Statement Static Semantics: Early Errors</h1>
4750447504
<emu-grammar>SwitchStatement : `switch` `(` Expression `)` CaseBlock</emu-grammar>
4750547505
<ul>
4750647506
<li>
47507-
It is a Syntax Error if the LexicallyDeclaredNames of |CaseBlock| contains any duplicate entries<ins>, unless the source code matching this production is not strict mode code and the duplicate entries are only bound by FunctionDeclarations</ins>.
47507+
It is a Syntax Error if the LexicallyDeclaredNames of |CaseBlock| contains any duplicate entries<ins>, unless the source code matched by this production is not strict mode code and the duplicate entries are only bound by FunctionDeclarations</ins>.
4750847508
</li>
4750947509
<li>
4751047510
It is a Syntax Error if any element of the LexicallyDeclaredNames of |CaseBlock| also occurs in the VarDeclaredNames of |CaseBlock|.
@@ -47540,7 +47540,7 @@ <h1>FunctionDeclarations in IfStatement Statement Clauses</h1>
4754047540
`if` `(` Expression[+In, ?Yield, ?Await] `)` FunctionDeclaration[?Yield, ?Await, ~Default] `else` FunctionDeclaration[?Yield, ?Await, ~Default]
4754147541
`if` `(` Expression[+In, ?Yield, ?Await] `)` FunctionDeclaration[?Yield, ?Await, ~Default] [lookahead != `else`]
4754247542
</emu-grammar>
47543-
<p>This production only applies when parsing non-strict code. Code matching this production is processed as if each matching occurrence of |FunctionDeclaration[?Yield, ?Await, ~Default]| was the sole |StatementListItem| of a |BlockStatement| occupying that position in the source code. The semantics of such a synthetic |BlockStatement| includes the web legacy compatibility semantics specified in <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics"></emu-xref>.</p>
47543+
<p>This production only applies when parsing non-strict code. Code matched by this production is processed as if each matching occurrence of |FunctionDeclaration[?Yield, ?Await, ~Default]| was the sole |StatementListItem| of a |BlockStatement| occupying that position in the source code. The semantics of such a synthetic |BlockStatement| includes the web legacy compatibility semantics specified in <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics"></emu-xref>.</p>
4754447544
</emu-annex>
4754547545

4754647546
<emu-annex id="sec-variablestatements-in-catch-blocks">

0 commit comments

Comments
 (0)