Skip to content

Commit

Permalink
[spec] make \ escapes legal in u/v mode
Browse files Browse the repository at this point in the history
Fixes #52. Fixes #55.
  • Loading branch information
ljharb committed Oct 12, 2023
1 parent baa3621 commit 9c55324
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec.emu
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,25 @@ contributors: Jordan Harband
<emu-clause id="sec-regexp-regular-expression-objects" number="2">
<h1>RegExp (Regular Expression) Objects</h1>

<emu-clause id="sec-patterns" number="1">
<h1>Patterns</h1>

<h2>Syntax</h2>
<p>Each `\\u` |HexTrailSurrogate| for which the choice of associated `u` |HexLeadSurrogate| is ambiguous shall be associated with the nearest possible `u` |HexLeadSurrogate| that would otherwise have no corresponding `\\u` |HexTrailSurrogate|.</p>
<emu-grammar type="definition">
HexNonSurrogate ::
Hex4Digits [> but only if the MV of |Hex4Digits| is not in the inclusive interval from 0xD800 to 0xDFFF]

IdentityEscape[UnicodeMode] ::
[+UnicodeMode] SyntaxCharacter
[+UnicodeMode] `/` <ins>`,` `-` `=` `<` `>` `/` `#` `&` `!` `%` `:` `;` `@` `~` `'` `"`</ins>
[~UnicodeMode] SourceCharacter but not UnicodeIDContinue

DecimalEscape ::
NonZeroDigit DecimalDigits[~Sep]? [lookahead &notin; DecimalDigit]
</emu-grammar>
</emu-clause>

<emu-clause id="sec-properties-of-the-regexp-constructor" number="5">
<h1>Properties of the RegExp Constructor</h1>

Expand Down

0 comments on commit 9c55324

Please sign in to comment.