Skip to content

Commit

Permalink
fix: cases are the same
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkot committed Jan 24, 2021
1 parent c98f28a commit 994a5cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1848,7 +1848,7 @@
display: none;
}
}
</style></head><body><div id="menu-toggle">☰</div><div id="menu-spacer"></div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-pins"><div class="menu-pane-header">Pins</div><ul id="menu-pins-list"></ul></div><div class="menu-pane-header">Table of Contents</div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-intro" title="Introduction">Introduction</a></li><li><span class="item-toggle">◢</span><a href="#sec-do" title="Do Expressions"><span class="secnum">1</span> Do Expressions</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-doexpression-runtime-semantics-evaluation" title="Runtime Semantics: Evaluation"><span class="secnum">1.1</span> RS: Evaluation</a></li><li><span class="item-toggle-none"></span><a href="#sec-doexpression-static-semantics-early-errors" title="Static Semantics: Early Errors"><span class="secnum">1.2</span> SS: Early Errors</a></li><li><span class="item-toggle-none"></span><a href="#sec-endsiniterationordeclaration" title="Static Semantics: EndsInIterationOrDeclaration"><span class="secnum">1.3</span> SS: EndsInIterationOrDeclaration</a></li><li><span class="item-toggle-none"></span><a href="#sec-isempty" title="Static Semantics: IsEmpty"><span class="secnum">1.4</span> SS: IsEmpty</a></li><li><span class="item-toggle-none"></span><a href="#sec-isbreak" title="Static Semantics: IsBreak"><span class="secnum">1.5</span> SS: IsBreak</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-integration" title="Integration"><span class="secnum">2</span> Integration</a></li><li><span class="item-toggle-none"></span><a href="#sec-copyright-and-software-license" title="Copyright &amp; Software License"><span class="secnum">A</span> Copyright &amp; Software License</a></li></ol></div></div><div id="spec-container"><h1 class="version first">Stage 1 Draft / January 23, 2021</h1><h1 class="title">do expressions</h1>
</style></head><body><div id="menu-toggle">☰</div><div id="menu-spacer"></div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-pins"><div class="menu-pane-header">Pins</div><ul id="menu-pins-list"></ul></div><div class="menu-pane-header">Table of Contents</div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-intro" title="Introduction">Introduction</a></li><li><span class="item-toggle">◢</span><a href="#sec-do" title="Do Expressions"><span class="secnum">1</span> Do Expressions</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-doexpression-runtime-semantics-evaluation" title="Runtime Semantics: Evaluation"><span class="secnum">1.1</span> RS: Evaluation</a></li><li><span class="item-toggle-none"></span><a href="#sec-doexpression-static-semantics-early-errors" title="Static Semantics: Early Errors"><span class="secnum">1.2</span> SS: Early Errors</a></li><li><span class="item-toggle-none"></span><a href="#sec-endsiniterationordeclaration" title="Static Semantics: EndsInIterationOrDeclaration"><span class="secnum">1.3</span> SS: EndsInIterationOrDeclaration</a></li><li><span class="item-toggle-none"></span><a href="#sec-isempty" title="Static Semantics: IsEmpty"><span class="secnum">1.4</span> SS: IsEmpty</a></li><li><span class="item-toggle-none"></span><a href="#sec-isbreak" title="Static Semantics: IsBreak"><span class="secnum">1.5</span> SS: IsBreak</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-integration" title="Integration"><span class="secnum">2</span> Integration</a></li><li><span class="item-toggle-none"></span><a href="#sec-copyright-and-software-license" title="Copyright &amp; Software License"><span class="secnum">A</span> Copyright &amp; Software License</a></li></ol></div></div><div id="spec-container"><h1 class="version first">Stage 1 Draft / January 24, 2021</h1><h1 class="title">do expressions</h1>
<emu-intro id="sec-intro">
<h1>Introduction</h1>
Expand Down Expand Up @@ -2017,7 +2017,7 @@ <h1><span class="secnum">1.3</span> Static Semantics: EndsInIterationOrDeclarati
</emu-rhs>
</emu-production>
</emu-grammar>
<emu-alg><ol><li>If <var>isLast</var> is <emu-val>true</emu-val>, then<ol><li>Let <var>newLabelSet</var> be a copy of <var>labelSet</var> with <emu-const>empty</emu-const> appended.</li></ol></li><li>Else,<ol><li>Let <var>newLabelSet</var> be a copy of <var>labelSet</var> with any occurences of <emu-const>empty</emu-const> removed.</li></ol></li><li>If the first <emu-nt><a href="https://tc39.es/ecma262/#prod-CaseClauses">CaseClauses</a></emu-nt> is present, then<ol><li>Let <var>A</var> be the <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> of <emu-nt id="_ref_33"><a href="#prod-CaseClause">CaseClause</a></emu-nt> items in the first <emu-nt><a href="https://tc39.es/ecma262/#prod-CaseClauses">CaseClauses</a></emu-nt>, in source text order.</li></ol></li><li>Else,<ol><li>Let <var>A</var> be « ».</li></ol></li><li>If the second <emu-nt><a href="https://tc39.es/ecma262/#prod-CaseClauses">CaseClauses</a></emu-nt> is present, then<ol><li>Let <var>B</var> be the <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> of <emu-nt id="_ref_34"><a href="#prod-CaseClause">CaseClause</a></emu-nt> items in the second <emu-nt><a href="https://tc39.es/ecma262/#prod-CaseClauses">CaseClauses</a></emu-nt>, in source text order.</li></ol></li><li>Else,<ol><li>Let <var>B</var> be « ».</li></ol></li><li>Let <var>clauses</var> be a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> whose elements are the elements of <var>A</var>, followed by <emu-nt id="_ref_35"><a href="#prod-DefaultClause">DefaultClause</a></emu-nt>, followed by the elements of <var>B</var>.</li><li>For each element <var>clause</var> of <var>clauses</var>, in reverse <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> order, do<ol><li>If IsEmpty of <var>clause</var> with argument « » is <emu-val>false</emu-val>, then<ol><li>If EndsInIterationOrDeclaration of <var>clause</var> with arguments <var>newLabelSet</var> and <var>isLast</var> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>Set <var>isLast</var> to <emu-val>false</emu-val>.</li></ol></li></ol></li><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-alg><ol><li>If <var>isLast</var> is <emu-val>true</emu-val>, then<ol><li>Let <var>newLabelSet</var> be a copy of <var>labelSet</var> with <emu-const>empty</emu-const> appended.</li></ol></li><li>Else,<ol><li>Let <var>newLabelSet</var> be a copy of <var>labelSet</var> with any occurences of <emu-const>empty</emu-const> removed.</li></ol></li><li>If the first <emu-nt><a href="https://tc39.es/ecma262/#prod-CaseClauses">CaseClauses</a></emu-nt> is present, then<ol><li>Let <var>A</var> be the <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> of <emu-nt id="_ref_33"><a href="#prod-CaseClause">CaseClause</a></emu-nt> items in the first <emu-nt><a href="https://tc39.es/ecma262/#prod-CaseClauses">CaseClauses</a></emu-nt>, in source text order.</li></ol></li><li>Else,<ol><li>Let <var>A</var> be « ».</li></ol></li><li>If the second <emu-nt><a href="https://tc39.es/ecma262/#prod-CaseClauses">CaseClauses</a></emu-nt> is present, then<ol><li>Let <var>B</var> be the <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> of <emu-nt id="_ref_34"><a href="#prod-CaseClause">CaseClause</a></emu-nt> items in the second <emu-nt><a href="https://tc39.es/ecma262/#prod-CaseClauses">CaseClauses</a></emu-nt>, in source text order.</li></ol></li><li>Else,<ol><li>Let <var>B</var> be « ».</li></ol></li><li>Let <var>clauses</var> be a <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> whose elements are the elements of <var>A</var>, followed by <emu-nt id="_ref_35"><a href="#prod-DefaultClause">DefaultClause</a></emu-nt>, followed by the elements of <var>B</var>.</li><li>For each element <var>clause</var> of <var>clauses</var>, in reverse <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref> order, do<ol><li>If IsEmpty of <var>clause</var> with argument « » is <emu-val>false</emu-val>, then<ol><li>If EndsInIterationOrDeclaration of <var>clause</var> with arguments <var>newLabelSet</var> and <var>isLast</var> is <emu-val>true</emu-val>, return <emu-val>true</emu-val>.</li><li>If IsBreak of <var>clause</var> with argument <var>newLabelSet</var> is <emu-val>true</emu-val>, then<ol><li>Set <var>isLast</var> to <emu-val>true</emu-val>.</li></ol></li><li>Else,<ol><li>Set <var>isLast</var> to <emu-val>false</emu-val>.</li></ol></li></ol></li></ol></li><li>Return <emu-val>false</emu-val>.</li></ol></emu-alg>
<emu-grammar><emu-production name="CaseClause" id="prod-CaseClause">
<emu-nt><a href="#prod-CaseClause">CaseClause</a></emu-nt> <emu-geq>:</emu-geq> <emu-rhs a="c76d0d30">
<emu-t>case</emu-t>
Expand Down
5 changes: 4 additions & 1 deletion spec.emu
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@ contributors: Dave Herman, Chris Krychom, Kevin Gibbons
1. For each element _clause_ of _clauses_, in reverse List order, do
1. If IsEmpty of _clause_ with argument &laquo; &raquo; is *false*, then
1. If EndsInIterationOrDeclaration of _clause_ with arguments _newLabelSet_ and _isLast_ is *true*, return *true*.
1. Set _isLast_ to *false*.
1. If IsBreak of _clause_ with argument _newLabelSet_ is *true*, then
1. Set _isLast_ to *true*.
1. Else,
1. Set _isLast_ to *false*.
1. Return *false*.
</emu-alg>
<emu-grammar>
Expand Down

0 comments on commit 994a5cc

Please sign in to comment.