* Parse ES7 simple-unary expression or higher: * * ES7 UnaryExpression: * 1) UpdateExpression[?yield] * 2) delete UnaryExpression[?yield] * 3) void UnaryExpression[?yield] * 4) typeof UnaryExpression[?yield] * 5)
()
| 34977 | * 9) [+Await] await UnaryExpression[?yield] |
| 34978 | */ |
| 34979 | function parseSimpleUnaryExpression() { |
| 34980 | switch (token()) { |
| 34981 | case 39 /* SyntaxKind.PlusToken */: |
| 34982 | case 40 /* SyntaxKind.MinusToken */: |
| 34983 | case 54 /* SyntaxKind.TildeToken */: |
| 34984 | case 53 /* SyntaxKind.ExclamationToken */: |
| 34985 | return parsePrefixUnaryExpression(); |
| 34986 | case 89 /* SyntaxKind.DeleteKeyword */: |
| 34987 | return parseDeleteExpression(); |
| 34988 | case 112 /* SyntaxKind.TypeOfKeyword */: |
| 34989 | return parseTypeOfExpression(); |
| 34990 | case 114 /* SyntaxKind.VoidKeyword */: |
| 34991 | return parseVoidExpression(); |
| 34992 | case 29 /* SyntaxKind.LessThanToken */: |
| 34993 | // This is modified UnaryExpression grammar in TypeScript |
| 34994 | // UnaryExpression (modified): |
| 34995 | // < type > UnaryExpression |
| 34996 | return parseTypeAssertion(); |
| 34997 | case 132 /* SyntaxKind.AwaitKeyword */: |
| 34998 | if (isAwaitExpression()) { |
| 34999 | return parseAwaitExpression(); |
| 35000 | } |
| 35001 | // falls through |
| 35002 | default: |
| 35003 | return parseUpdateExpression(); |
| 35004 | } |
| 35005 | } |
| 35006 | /** |
| 35007 | * Check if the current token can possibly be an ES7 increment expression. |
| 35008 | * |
no test coverage detected