Skip to content

Commit

Permalink
Editorial: refactor control flow for RegExp assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkot committed Nov 29, 2019
1 parent c95ab23 commit d5197a1
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions spec.html
Expand Up @@ -31095,9 +31095,8 @@ <h1>Assertion</h1>
<emu-alg>
1. Return an internal Matcher closure that takes two arguments, a State _x_ and a Continuation _c_, and performs the following steps:
1. Let _e_ be _x_'s _endIndex_.
1. If _e_ is zero, call _c_(_x_) and return its result.
1. If _Multiline_ is *false*, return ~failure~.
1. If the character _Input_[_e_ - 1] is one of |LineTerminator|, call _c_(_x_) and return its result.
1. If _e_ is zero, or if _Multiline_ is *true* and the character _Input_[_e_ - 1] is one of |LineTerminator|, then
1. Call _c_(_x_) and return its result.
1. Return ~failure~.
</emu-alg>
<emu-note>
Expand All @@ -31107,9 +31106,8 @@ <h1>Assertion</h1>
<emu-alg>
1. Return an internal Matcher closure that takes two arguments, a State _x_ and a Continuation _c_, and performs the following steps:
1. Let _e_ be _x_'s _endIndex_.
1. If _e_ is equal to _InputLength_, call _c_(_x_) and return its result.
1. If _Multiline_ is *false*, return ~failure~.
1. If the character _Input_[_e_] is one of |LineTerminator|, call _c_(_x_) and return its result.
1. If _e_ is equal to _InputLength_, or if _Multiline_ is *true* and the character _Input_[_e_] is one of |LineTerminator|, then
1. Call _c_(_x_) and return its result.
1. Return ~failure~.
</emu-alg>
<p>The production <emu-grammar>Assertion :: `\` `b`</emu-grammar> evaluates as follows:</p>
Expand All @@ -31118,8 +31116,8 @@ <h1>Assertion</h1>
1. Let _e_ be _x_'s _endIndex_.
1. Call IsWordChar(_e_ - 1) and let _a_ be the Boolean result.
1. Call IsWordChar(_e_) and let _b_ be the Boolean result.
1. If _a_ is *true* and _b_ is *false*, call _c_(_x_) and return its result.
1. If _a_ is *false* and _b_ is *true*, call _c_(_x_) and return its result.
1. If _a_ is *true* and _b_ is *false*, or if _a_ is *false* and _b_ is *true*, then
1. Call _c_(_x_) and return its result.
1. Return ~failure~.
</emu-alg>
<p>The production <emu-grammar>Assertion :: `\` `B`</emu-grammar> evaluates as follows:</p>
Expand All @@ -31128,9 +31126,9 @@ <h1>Assertion</h1>
1. Let _e_ be _x_'s _endIndex_.
1. Call IsWordChar(_e_ - 1) and let _a_ be the Boolean result.
1. Call IsWordChar(_e_) and let _b_ be the Boolean result.
1. If _a_ is *true* and _b_ is *false*, return ~failure~.
1. If _a_ is *false* and _b_ is *true*, return ~failure~.
1. Call _c_(_x_) and return its result.
1. If _a_ is *true* and _b_ is *true*, or if _a_ is *false* and _b_ is *false*, then
1. Call _c_(_x_) and return its result.
1. Return ~failure~.
</emu-alg>
<p>The production <emu-grammar>Assertion :: `(` `?` `=` Disjunction `)`</emu-grammar> evaluates as follows:</p>
<emu-alg>
Expand Down

0 comments on commit d5197a1

Please sign in to comment.