1 | "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _index = require('../tokenizer/index');
|
2 | var _types = require('../tokenizer/types');
|
3 | var _base = require('../traverser/base');
|
4 | var _expression = require('../traverser/expression');
|
5 | var _flow = require('./flow');
|
6 | var _typescript = require('./typescript');
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | function typedParseConditional(noIn) {
|
14 |
|
15 |
|
16 |
|
17 | if (_index.match.call(void 0, _types.TokenType.question)) {
|
18 | const nextType = _index.lookaheadType.call(void 0, );
|
19 | if (nextType === _types.TokenType.colon || nextType === _types.TokenType.comma || nextType === _types.TokenType.parenR) {
|
20 | return;
|
21 | }
|
22 | }
|
23 | _expression.baseParseConditional.call(void 0, noIn);
|
24 | } exports.typedParseConditional = typedParseConditional;
|
25 |
|
26 |
|
27 |
|
28 | function typedParseParenItem() {
|
29 | if (_index.eat.call(void 0, _types.TokenType.question)) {
|
30 | _base.state.tokens[_base.state.tokens.length - 1].isType = true;
|
31 | }
|
32 | if (_index.match.call(void 0, _types.TokenType.colon)) {
|
33 | if (_base.isTypeScriptEnabled) {
|
34 | _typescript.tsParseTypeAnnotation.call(void 0, );
|
35 | } else if (_base.isFlowEnabled) {
|
36 | _flow.flowParseTypeAnnotation.call(void 0, );
|
37 | }
|
38 | }
|
39 | } exports.typedParseParenItem = typedParseParenItem;
|