Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

Add grammar flags to disallow mixing ?? with || and &&. #39

Merged
merged 4 commits into from
Jul 13, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,27 @@ <h1>Introduction</h1>
<h1>Syntax</h1>

<emu-grammar>
LogicalORExpression[In, Yield, Await] :
LogicalANDExpression[?In, ?Yield, ?Await]
LogicalORExpression[?In, ?Yield, ?Await] `||` LogicalANDExpression[?In, ?Yield, ?Await]
<ins>LogicalORExpression[?In, ?Yield, ?Await] `??` LogicalANDExpression[?In, ?Yield, ?Await]</ins>
ConditionalExpression[In, Yield, Await] :
<del>LogicalORExpression[?In, ?Yield, ?Await]</del>
<del>LogicalORExpression[?In, ?Yield, ?Await] `?` AssignmentExpression[+In, ?Yield, ?Await] `:` AssignmentExpression[?In, ?Yield, ?Await]</del>
jridgewell marked this conversation as resolved.
Show resolved Hide resolved
<ins>NullishExpression[?In, ?Yield, ?Await, ~Nullish]</ins>
<ins>NullishExpression[?In, ?Yield, ?Await, ~Nullish] `?` AssignmentExpression[+In, ?Yield, ?Await] `:` AssignmentExpression[+In, ?Yield, ?Await]</ins>

<ins>
NullishExpression[In, Yield, Await, Nullish] :
LogicalORExpression[?In, ?Yield, ?Await, ?Nullish]
NullishExpression[?In, ?Yield, ?Await, +Nullish] `??` LogicalORExpression[?In, ?Yield, ?Await, +Nullish]
</ins>

LogicalORExpression[In, Yield, Await, <ins>Nullish</ins>] :
LogicalANDExpression[?In, ?Yield, ?Await, <ins>?Nullish</ins>]
<del>LogicalORExpression[?In, ?Yield, ?Await] `||` LogicalANDExpression[?In, ?Yield, ?Await]</del>
<ins>[~Nullish] LogicalORExpression[?In, ?Yield, ?Await, ~Nullish] `||` LogicalANDExpression[?In, ?Yield, ?Await, ~Nullish]</ins>

LogicalANDExpression[In, Yield, Await, <ins>Nullish</ins>] :
BitwiseORExpression[?In, ?Yield, ?Await]
<del>LogicalANDExpression[?In, ?Yield, ?Await] `&&` BitwiseORExpression[?In, ?Yield, ?Await]</del>
<ins>[~Nullish] LogicalANDExpression[?In, ?Yield, ?Await] `&&` BitwiseORExpression[?In, ?Yield, ?Await]</ins>
</emu-grammar>
</emu-clause>

Expand Down