Skip to content
Open
Changes from all 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
42 changes: 20 additions & 22 deletions proposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,22 @@ See above. The proposal is strictly limited to the above syntactic transforms.
#### 16.19.1 Compound Assignment

A compound assignment of the form *v op= e* is equivalent to *v=v op e*. A compound assignment of the form *C.v op= e* is equivalent to *C.v = C.v op e*. A compound assignment of the form *e1.v op = e2* is equivalent to `((x) => x.v = x.v op e2)(e1)` where *x* is a variable that is not used in *e2*. A compound assignment of the form *e1[e2] op= e3* is equivalent to `((a, i) => a[i] = a[i] op e3)(e1, e2)` where *a* and *i* are variables that are not used in *e3*.
;


```
compoundAssignmentOperator:

‘*=’ |
‘/=’ |
‘ ̃/=’ |
‘%=’ |
‘+=’ |
‘-=’ |
‘<<=’ |
‘>>=’ |
‘&=’ |
‘ˆ=’ |
‘|=’
‘??=’
‘*=’ |
‘/=’ |
‘ ̃/=’ |
‘%=’ |
‘+=’ |
‘-=’ |
‘<<=’ |
‘>>=’ |
‘&=’ |
‘ˆ=’ |
‘|=’
‘??=’
;
```

Expand All @@ -100,10 +98,10 @@ compoundAssignmentOperator:
#### 16.20 Conditional

A conditional expression evaluates one of two expressions based on a boolean condition.
conditionalExpression:

```
ifNullExpression (‘ ?’ expressionWithoutCascade ‘:’ expressionWithoutCascade)?
conditionalExpression:
ifNullExpression (‘ ?’ expressionWithoutCascade ‘:’ expressionWithoutCascade)?
;
```
**Rest of section 16.20 is unchanged**
Expand All @@ -128,15 +126,15 @@ Assignable expressions are expressions that can appear on the left hand side of

```
assignableExpression:
primary (arguments* assignableSelector)+ |
super assignableSelector |
identifier
primary (arguments* assignableSelector)+ |
super assignableSelector |
identifier
;

assignableSelector:
‘[’ expression ‘]’ |
‘.’ identifier |
‘?.’ identifier
‘[’ expression ‘]’ |
‘.’ identifier |
‘?.’ identifier
;
```
An assignable expression can be conditional or unconditional.
Expand Down