Skip to content

Commit 0c26790

Browse files
committed
Syntax tree format: document async function and await expression
Refs #1079 Refs #1477 Closes gh-1741
1 parent 1b04a62 commit 0c26790

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

docs/syntax-tree-format.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ An expression can be one of the following:
5353
type Expression = ThisExpression | Identifier | Literal |
5454
ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | ClassExpression |
5555
TaggedTemplateExpression | MemberExpression | Super | MetaProperty |
56-
NewExpression | CallExpression | UpdateExpression | UnaryExpression |
56+
NewExpression | CallExpression | UpdateExpression | AwaitExpression | UnaryExpression |
5757
BinaryExpression | LogicalExpression | ConditionalExpression |
5858
YieldExpression | AssignmentExpression | SequenceExpression;
5959
```
@@ -174,6 +174,7 @@ interface FunctionExpression {
174174
params: FunctionParameter[];
175175
body: BlockStatement;
176176
generator: boolean;
177+
async: boolean;
177178
expression: boolean;
178179
}
179180
```
@@ -195,6 +196,7 @@ interface FunctionExpression {
195196
params: FunctionParameter[];
196197
body: BlockStatement | Expression;
197198
generator: boolean;
199+
async: boolean;
198200
expression: false;
199201
}
200202
```
@@ -320,6 +322,15 @@ interface UpdateExpression {
320322
}
321323
```
322324
325+
### Await Expression
326+
327+
```js
328+
interface AwaitExpression {
329+
type: 'AwaitExpression';
330+
argument: Expression;
331+
}
332+
```
333+
323334
### Unary Expression
324335
325336
```js
@@ -414,7 +425,7 @@ type Statement = BlockStatement | BreakStatement | ContinueStatement |
414425
A declaration can be one of the following:
415426
416427
```js
417-
type Declaration = ClassDeclaration | FunctionDeclaration VariableDeclaration;
428+
type Declaration = ClassDeclaration | FunctionDeclaration | VariableDeclaration;
418429
```
419430
420431
A statement list item is either a statement or a declaration:
@@ -545,6 +556,7 @@ interface FunctionDeclaration {
545556
params: FunctionParameter[];
546557
body: BlockStatement;
547558
generator: boolean;
559+
async: boolean;
548560
expression: false;
549561
}
550562
```

0 commit comments

Comments
 (0)