Lines Matching refs:state

413   if (this.state.context.length === 1) {
414 this.state.exprAllowed = true;
418 var out = this.state.context.pop();
420 this.state.context.pop();
421 this.state.exprAllowed = false;
423 this.state.exprAllowed = true;
425 this.state.exprAllowed = !out.isExpr;
430 this.state.exprAllowed = false;
433 if (lineBreak.test(this.input.slice(this.state.end))) {
434 this.state.exprAllowed = true;
440 …this.state.context.push(this.braceIsBlock(prevType) ? types$1.braceStatement : types$1.braceExpres…
441 this.state.exprAllowed = true;
445 this.state.context.push(types$1.templateQuasi);
446 this.state.exprAllowed = true;
451 this.state.context.push(statementParens ? types$1.parenStatement : types$1.parenExpression);
452 this.state.exprAllowed = true;
461 this.state.context.push(types$1.functionExpression);
464 this.state.exprAllowed = false;
469 this.state.context.pop();
471 this.state.context.push(types$1.template);
473 this.state.exprAllowed = false;
631 var state = new State();
639 state[key] = val;
641 return state;
651 var Token = function Token(state) { argument
654 this.type = state.type;
655 this.value = state.value;
656 this.start = state.start;
657 this.end = state.end;
658 this.loc = new SourceLocation(state.startLoc, state.endLoc);
676 this.state = new State();
677 this.state.init(options, input);
684 this.state.tokens.push(new Token(this.state));
687 this.state.lastTokEnd = this.state.end;
688 this.state.lastTokStart = this.state.start;
689 this.state.lastTokEndLoc = this.state.endLoc;
690 this.state.lastTokStartLoc = this.state.startLoc;
708 return this.state.type === type;
720 var old = this.state;
721 this.state = old.clone(true);
727 var curr = this.state.clone(true);
728 this.state = old;
736 this.state.strict = strict;
738 this.state.pos = this.state.start;
739 while (this.state.pos < this.state.lineStart) {
740 this.state.lineStart = this.input.lastIndexOf("\n", this.state.lineStart - 2) + 1;
741 --this.state.curLine;
747 return this.state.context[this.state.context.length - 1];
757 this.state.containsOctal = false;
758 this.state.octalPosition = null;
759 this.state.start = this.state.pos;
760 this.state.startLoc = this.state.curPosition();
761 if (this.state.pos >= this.input.length) return this.finishToken(types.eof);
781 var code = this.input.charCodeAt(this.state.pos);
784 var next = this.input.charCodeAt(this.state.pos + 1);
798 this.state.tokens.push(comment);
799 this.state.comments.push(comment);
805 var startLoc = this.state.curPosition();
806 var start = this.state.pos;
807 var end = this.input.indexOf("*/", this.state.pos += 2);
808 if (end === -1) this.raise(this.state.pos - 2, "Unterminated comment");
810 this.state.pos = end + 2;
813 while ((match = lineBreakG.exec(this.input)) && match.index < this.state.pos) {
814 ++this.state.curLine;
815 this.state.lineStart = match.index + match[0].length;
818 …hComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPo…
822 var start = this.state.pos;
823 var startLoc = this.state.curPosition();
824 var ch = this.input.charCodeAt(this.state.pos += startSkip);
825 …while (this.state.pos < this.input.length && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233)…
826 ++this.state.pos;
827 ch = this.input.charCodeAt(this.state.pos);
830 …(false, this.input.slice(start + startSkip, this.state.pos), start, this.state.pos, startLoc, this…
837 loop: while (this.state.pos < this.input.length) {
838 var ch = this.input.charCodeAt(this.state.pos);
842 ++this.state.pos;
846 if (this.input.charCodeAt(this.state.pos + 1) === 10) {
847 ++this.state.pos;
851 ++this.state.pos;
852 ++this.state.curLine;
853 this.state.lineStart = this.state.pos;
858 switch (this.input.charCodeAt(this.state.pos + 1)) {
875 ++this.state.pos;
889 this.state.end = this.state.pos;
890 this.state.endLoc = this.state.curPosition();
891 var prevType = this.state.type;
892 this.state.type = type;
893 this.state.value = val;
910 var next = this.input.charCodeAt(this.state.pos + 1);
915 var next2 = this.input.charCodeAt(this.state.pos + 2);
918 this.state.pos += 3;
921 ++this.state.pos;
928 if (this.state.exprAllowed) {
929 ++this.state.pos;
933 var next = this.input.charCodeAt(this.state.pos + 1);
945 var next = this.input.charCodeAt(this.state.pos + 1);
950 next = this.input.charCodeAt(this.state.pos + 2);
964 var next = this.input.charCodeAt(this.state.pos + 1);
973 var next = this.input.charCodeAt(this.state.pos + 1);
983 var next = this.input.charCodeAt(this.state.pos + 1);
986 … && this.input.charCodeAt(this.state.pos + 2) === 62 && lineBreak.test(this.input.slice(this.state
1004 var next = this.input.charCodeAt(this.state.pos + 1);
1008 size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2;
1009 …if (this.input.charCodeAt(this.state.pos + size) === 61) return this.finishOp(types.assign, size +…
1013 …33 && code === 60 && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(thi…
1031 var next = this.input.charCodeAt(this.state.pos + 1);
1032 …if (next === 61) return this.finishOp(types.equality, this.input.charCodeAt(this.state.pos + 2) ==…
1035 this.state.pos += 2;
1051 ++this.state.pos;return this.finishToken(types.parenL);
1053 ++this.state.pos;return this.finishToken(types.parenR);
1055 ++this.state.pos;return this.finishToken(types.semi);
1057 ++this.state.pos;return this.finishToken(types.comma);
1059 ++this.state.pos;return this.finishToken(types.bracketL);
1061 ++this.state.pos;return this.finishToken(types.bracketR);
1064 if (this.hasPlugin("flow") && this.input.charCodeAt(this.state.pos + 1) === 124) {
1067 ++this.state.pos;
1072 ++this.state.pos;return this.finishToken(types.braceR);
1075 if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) {
1078 ++this.state.pos;
1083 ++this.state.pos;return this.finishToken(types.question);
1085 ++this.state.pos;return this.finishToken(types.at);
1089 ++this.state.pos;
1094 var next = this.input.charCodeAt(this.state.pos + 1);
1147 this.raise(this.state.pos, "Unexpected character '" + codePointToString(code) + "'");
1151 var str = this.input.slice(this.state.pos, this.state.pos + size);
1152 this.state.pos += size;
1157 var start = this.state.pos;
1161 if (this.state.pos >= this.input.length) this.raise(start, "Unterminated regular expression");
1162 var ch = this.input.charAt(this.state.pos);
1178 ++this.state.pos;
1180 var content = this.input.slice(start, this.state.pos);
1181 ++this.state.pos;
1200 var start = this.state.pos;
1204 var code = this.input.charCodeAt(this.state.pos);
1216 ++this.state.pos;
1219 if (this.state.pos === start || len != null && this.state.pos - start !== len) return null;
1225 this.state.pos += 2; // 0x
1227 if (val == null) this.raise(this.state.start + 2, "Expected number in radix " + radix);
1228 …if (isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.state.pos, "Identifier directly a…
1235 var start = this.state.pos;
1240 if (octal && this.state.pos == start + 1) octal = false; // number === 0
1242 var next = this.input.charCodeAt(this.state.pos);
1245 ++this.state.pos;
1248 next = this.input.charCodeAt(this.state.pos);
1253 next = this.input.charCodeAt(++this.state.pos);
1254 if (next === 43 || next === 45) ++this.state.pos; // '+-'
1259 …if (isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.state.pos, "Identifier directly a…
1261 var str = this.input.slice(start, this.state.pos);
1267 } else if (this.state.strict) {
1280 var ch = this.input.charCodeAt(this.state.pos);
1285 var codePos = ++this.state.pos;
1286 … code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos, throwOnInvalid);
1287 ++this.state.pos;
1289 --this.state.invalidTemplateEscapePosition; // to point to the '\'' instead of the 'u'
1294 this.state.invalidTemplateEscapePosition = codePos - 2;
1306 chunkStart = ++this.state.pos;
1308 …if (this.state.pos >= this.input.length) this.raise(this.state.start, "Unterminated string constan…
1309 var ch = this.input.charCodeAt(this.state.pos);
1313 out += this.input.slice(chunkStart, this.state.pos);
1315 chunkStart = this.state.pos;
1317 if (isNewLine(ch)) this.raise(this.state.start, "Unterminated string constant");
1318 ++this.state.pos;
1321 out += this.input.slice(chunkStart, this.state.pos++);
1329 chunkStart = this.state.pos,
1332 … if (this.state.pos >= this.input.length) this.raise(this.state.start, "Unterminated template");
1333 var ch = this.input.charCodeAt(this.state.pos);
1334 if (ch === 96 || ch === 36 && this.input.charCodeAt(this.state.pos + 1) === 123) {
1336 if (this.state.pos === this.state.start && this.match(types.template)) {
1338 this.state.pos += 2;
1341 ++this.state.pos;
1345 out += this.input.slice(chunkStart, this.state.pos);
1350 out += this.input.slice(chunkStart, this.state.pos);
1357 chunkStart = this.state.pos;
1359 out += this.input.slice(chunkStart, this.state.pos);
1360 ++this.state.pos;
1363 if (this.input.charCodeAt(this.state.pos) === 10) ++this.state.pos;
1371 ++this.state.curLine;
1372 this.state.lineStart = this.state.pos;
1373 chunkStart = this.state.pos;
1375 ++this.state.pos;
1384 var ch = this.input.charCodeAt(++this.state.pos);
1385 ++this.state.pos;
1412 if (this.input.charCodeAt(this.state.pos) === 10) ++this.state.pos; // '\r\n'
1415 this.state.lineStart = this.state.pos;
1416 ++this.state.curLine;
1420 var codePos = this.state.pos - 1;
1421 var octalStr = this.input.substr(this.state.pos - 1, 3).match(/^[0-7]+/)[0];
1429 this.state.invalidTemplateEscapePosition = codePos;
1431 } else if (this.state.strict) {
1433 } else if (!this.state.containsOctal) {
1436 this.state.containsOctal = true;
1437 this.state.octalPosition = codePos;
1440 this.state.pos += octalStr.length - 1;
1450 var codePos = this.state.pos;
1456 this.state.pos = codePos - 1;
1457 this.state.invalidTemplateEscapePosition = codePos - 1;
1470 this.state.containsEsc = false;
1473 chunkStart = this.state.pos;
1474 while (this.state.pos < this.input.length) {
1477 this.state.pos += ch <= 0xffff ? 1 : 2;
1480 this.state.containsEsc = true;
1482 word += this.input.slice(chunkStart, this.state.pos);
1483 var escStart = this.state.pos;
1485 if (this.input.charCodeAt(++this.state.pos) !== 117) {
1487 this.raise(this.state.pos, "Expecting Unicode escape sequence \\uXXXX");
1490 ++this.state.pos;
1497 chunkStart = this.state.pos;
1503 return word + this.input.slice(chunkStart, this.state.pos);
1512 if (!this.state.containsEsc && this.isKeyword(word)) {
1527 return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start));
1538 return !this.state.exprAllowed;
1542 var type = this.state.type;
1546 this.state.exprAllowed = false;
1550 this.state.exprAllowed = type.beforeExpr;
1577 if (_this.state.pos === 0 && _this.input[0] === "#" && _this.input[1] === "!") {
1695 return this.match(types.relational) && this.state.value === op;
1711 return this.match(types.name) && this.state.value === name;
1717 return this.state.value === name && this.eat(types.name);
1729 …s.match(types.braceR) || lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start));
1761 this.raise(pos != null ? pos : this.state.start, messageOrType);
1781 file.comments = this.state.comments;
1782 file.tokens = this.state.tokens;
1821 var starttype = this.state.type;
1877 this.raise(this.state.start, "'import' and 'export' may only appear at the top level");
1881 …this.raise(this.state.start, "'import' and 'export' may appear only with 'sourceType: \"module\"'"…
1887 if (this.state.value === "async") {
1889 var state = this.state.clone();
1895 this.state = state;
1905 var maybeName = this.state.value;
1916 if (this.state.decorators.length) {
1917 node.decorators = this.state.decorators;
1918 this.state.decorators = []; property
1925 this.state.decorators.push(decorator);
1933 this.raise(this.state.start, "Leading decorators must be attached to a class declaration");
1963 for (i = 0; i < this.state.labels.length; ++i) {
1964 var lab = this.state.labels[i];
1970 if (i === this.state.labels.length) this.raise(node.start, "Unsyntactic " + keyword);
1982 this.state.labels.push(loopLabel);
1984 this.state.labels.pop();
2001 this.state.labels.push(loopLabel);
2004 if (this.hasPlugin("asyncGenerators") && this.state.inAsync && this.isContextual("await")) {
2019 var varKind = this.state.type;
2065 if (!this.state.inFunction && !this.options.allowReturnOutsideFunction) {
2066 this.raise(this.state.start, "'return' outside of function");
2090 this.state.labels.push(switchLabel);
2107 if (sawDefault) this.raise(this.state.lastTokStart, "Multiple default clauses");
2122 this.state.labels.pop();
2128 …if (lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start))) this.raise(this.sta…
2177 this.state.labels.push(loopLabel);
2179 this.state.labels.pop();
2184 if (this.state.strict) this.raise(this.state.start, "'with' in strict mode");
2197 …for (var _iterator = this.state.labels, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _…
2216 var kind = this.state.type.isLoop ? "loop" : this.match(types._switch) ? "switch" : null;
2217 for (var i = this.state.labels.length - 1; i >= 0; i--) {
2218 var label = this.state.labels[i];
2220 label.statementStart = this.state.start;
2227 this.state.labels.push({ name: maybeName, kind: kind, statementStart: this.state.start });
2229 this.state.labels.pop();
2264 if (!parsedNonDirective && this.state.containsOctal && !octalPosition) {
2265 octalPosition = this.state.octalPosition;
2275 oldStrict = this.state.strict;
2307 this.state.labels.pop();
2327 this.state.labels.pop();
2344 this.raise(this.state.lastTokEnd, "Complex binding patterns require an initialization value");
2363 var oldInMethod = this.state.inMethod;
2364 this.state.inMethod = false;
2388 this.state.inMethod = oldInMethod;
2426 var oldStrict = this.state.strict;
2427 this.state.strict = true;
2441 this.raise(this.state.lastTokEnd, "Decorators must not be followed by a semicolon");
2460 if (this.match(types.name) && this.state.value === "static") {
2536 …l") && isSimple && _key.name === "call" && this.match(types.name) && this.state.value === "constru…
2560 this.raise(this.state.start, "You have trailing decorators with no method");
2565 this.state.strict = oldStrict;
2569 this.state.inClassProperty = true;
2578 this.state.inClassProperty = false;
2671 return this.state.value !== "async";
2704state.type.keyword === "var" || this.state.type.keyword === "const" || this.state.type.keyword ===…
2756 if (this.state.decorators.length) {
2812 if (this.state.exportedIdentifiers.indexOf(name) > -1) {
2815 this.state.exportedIdentifiers.push(name);
2882 var startPos = this.state.start;
2883 var startLoc = this.state.startLoc;
3063 return this.match(types._yield) && !this.state.strict && !this.state.inGenerator;
3073 switch (this.state.type) {
3075 if (this.state.strict || this.state.inGenerator) this.unexpected();
3134 startLoc = startLoc || this.state.startLoc;
3135 startPos = startPos || this.state.start;
3304 var startPos = this.state.start;
3305 var startLoc = this.state.startLoc;
3323 var startPos = this.state.start;
3324 var startLoc = this.state.startLoc;
3326 if (this.match(types._yield) && this.state.inGenerator) {
3341 this.state.potentialArrowAt = this.state.start;
3346 if (this.state.type.isAssign) {
3348 node.operator = this.state.value;
3379 var startPos = this.state.start;
3380 var startLoc = this.state.startLoc;
3402 var startPos = this.state.start;
3403 var startLoc = this.state.startLoc;
3419 var prec = this.state.type.binop;
3424 node.operator = this.state.value;
3430 var op = this.state.type;
3433 var startPos = this.state.start;
3434 var startLoc = this.state.startLoc;
3447 if (this.state.type.prefix) {
3450 node.operator = this.state.value;
3454 var argType = this.state.type;
3465 …} else if (this.state.strict && node.operator === "delete" && node.argument.type === "Identifier")…
3472 var startPos = this.state.start;
3473 var startLoc = this.state.startLoc;
3476 while (this.state.type.postfix && !this.canInsertSemicolon()) {
3478 _node.operator = this.state.value;
3491 var startPos = this.state.start;
3492 var startLoc = this.state.startLoc;
3493 var potentialArrowAt = this.state.potentialArrowAt;
3528 …var possibleAsync = this.state.potentialArrowAt === base.start && base.type === "Identifier" && ba…
3570 innerParenStart = this.state.start;
3596 var startPos = this.state.start;
3597 var startLoc = this.state.startLoc;
3607 var canBeArrow = this.state.potentialArrowAt === this.state.start;
3610 switch (this.state.type) {
3612 …if (!this.state.inMethod && !this.state.inClassProperty && !this.options.allowSuperOutsideMethod) {
3613 this.raise(this.state.start, "'super' outside of function or class");
3621 …if (this.match(types.parenL) && this.state.inMethod !== "constructor" && !this.options.allowSuperO…
3642 if (this.state.inGenerator) this.unexpected();
3646 var allowAwait = this.state.value === "await" && this.state.inAsync;
3651 if (this.state.inAsync || this.inModule) {
3674 var oldInFunction = this.state.inFunction;
3675 var oldLabels = this.state.labels;
3676 this.state.labels = []; property
3677 this.state.inFunction = false;
3679 this.state.inFunction = oldInFunction;
3680 this.state.labels = oldLabels;
3685 var value = this.state.value;
3692 return this.parseLiteral(this.state.value, "NumericLiteral");
3695 return this.parseLiteral(this.state.value, "StringLiteral");
3757 if (this.state.inGenerator && this.eat(types.dot) && this.hasPlugin("functionSent")) {
3776 startPos = startPos || this.state.start;
3777 startLoc = startLoc || this.state.startLoc;
3781 this.addExtra(node, "raw", this.input.slice(startPos, this.state.end));
3795 startPos = startPos || this.state.start;
3796 startLoc = startLoc || this.state.startLoc;
3801 var innerStartPos = this.state.start;
3802 var innerStartLoc = this.state.startLoc;
3816 optionalCommaStart = this.state.start;
3822 var spreadNodeStartPos = this.state.start;
3823 var spreadNodeStartLoc = this.state.startLoc;
3824 spreadStart = this.state.start;
3832 var innerEndPos = this.state.start;
3833 var innerEndLoc = this.state.startLoc;
3859 this.unexpected(this.state.lastTokStart);
3906 if (!this.state.inFunction) {
3929 if (this.state.value === null) {
3931 this.raise(this.state.invalidTemplateEscapePosition, "Invalid escape sequence in template");
3933 this.state.invalidTemplateEscapePosition = null;
3937 raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"),
3938 cooked: this.state.value
4002 var position = this.state.start;
4024 startPos = this.state.start;
4025 startLoc = this.state.startLoc;
4063 this.raise(this.state.start, "You have trailing decorators with no property");
4074 this.state.type.keyword // get debugger() {}
4115 …prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.pars…
4127 refShorthandDefaultPos.start = this.state.start;
4154 var oldInPropertyName = this.state.inPropertyName;
4155 this.state.inPropertyName = true;
4157 this.state.inPropertyName = oldInPropertyName;
4174 var oldInMethod = this.state.inMethod;
4175 this.state.inMethod = node.kind || true;
4181 this.state.inMethod = oldInMethod;
4223 var oldInAsync = this.state.inAsync;
4224 this.state.inAsync = node.async;
4231 var oldInFunc = this.state.inFunction;
4232 var oldInGen = this.state.inGenerator;
4233 var oldLabels = this.state.labels;
4234 this.state.inFunction = true;this.state.inGenerator = node.generator;this.state.labels = []; property
4237 … this.state.inFunction = oldInFunc;this.state.inGenerator = oldInGen;this.state.labels = oldLabels;
4239 this.state.inAsync = oldInAsync;
4246 var checkLVal = this.state.strict || allowExpression || isStrict;
4254 var oldStrict = this.state.strict;
4255 if (isStrict) this.state.strict = true;
4278 this.state.strict = oldStrict;
4324 this.checkReservedWord(this.state.value, this.state.start, !!this.state.type.keyword, false);
4328 node.name = this.state.value;
4329 } else if (this.state.type.keyword) {
4330 node.name = this.state.type.keyword;
4335 if (!liberal && node.name === "await" && this.state.inAsync) {
4350 …if (this.state.strict && (reservedWords.strict(word) || isBinding && reservedWords.strictBind(word…
4359 if (!this.state.inAsync) {
4374 …if (this.match(types.semi) || this.canInsertSemicolon() || !this.match(types.star) && !this.state.…
4416 return new Node(this.state.start, this.state.startLoc, this.filename);
4434 return finishNodeAt.call(this, node, type, this.state.lastTokEnd, this.state.lastTokEndLoc);
4494 this.state.trailingComments.push(comment);
4495 this.state.leadingComments.push(comment);
4501 var stack = this.state.commentStack;
4509 if (this.state.trailingComments.length > 0) {
4514 if (this.state.trailingComments[0].start >= node.end) {
4515 trailingComments = this.state.trailingComments;
4516 this.state.trailingComments = []; property
4524 this.state.trailingComments.length = 0;
4548 if (firstChild && this.state.leadingComments.length > 0) {
4549 var lastComment = last(this.state.leadingComments);
4553 if (this.state.commentPreviousNode) {
4554 for (j = 0; j < this.state.leadingComments.length; j++) {
4555 if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) {
4556 this.state.leadingComments.splice(j, 1);
4561 if (this.state.leadingComments.length > 0) {
4562 firstChild.trailingComments = this.state.leadingComments;
4563 this.state.leadingComments = []; property
4571 if (this.state.commentPreviousNode) {
4572 if (this.state.leadingComments.length > 0) {
4573 lastArg.trailingComments = this.state.leadingComments;
4574 this.state.leadingComments = []; property
4598 } else if (this.state.leadingComments.length > 0) {
4599 if (last(this.state.leadingComments).end <= node.start) {
4600 if (this.state.commentPreviousNode) {
4601 for (j = 0; j < this.state.leadingComments.length; j++) {
4602 if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) {
4603 this.state.leadingComments.splice(j, 1);
4608 if (this.state.leadingComments.length > 0) {
4609 node.leadingComments = this.state.leadingComments;
4610 this.state.leadingComments = []; property
4624 for (i = 0; i < this.state.leadingComments.length; i++) {
4625 if (this.state.leadingComments[i].end > node.start) {
4634 node.leadingComments = this.state.leadingComments.slice(0, i);
4641 trailingComments = this.state.leadingComments.slice(i);
4648 this.state.commentPreviousNode = node;
4842 switch (this.state.type) {
4844 return this.estreeParseRegExpLiteral(this.state.value);
4848 return this.estreeParseLiteral(this.state.value);
4984 var oldInType = this.state.inType;
4985 this.state.inType = true;
4989 this.state.inType = oldInType;
4995 var moduloLoc = this.state.startLoc;
4996 var moduloPos = this.state.start;
4998 var checksLoc = this.state.startLoc;
5014 var oldInType = this.state.inType;
5015 this.state.inType = true;
5020 this.state.inType = oldInType;
5024 this.state.inType = oldInType;
5234 if (primitiveTypes.indexOf(this.state.value) > -1) {
5235 this.raise(this.state.start, "Cannot overwrite primitive type " + this.state.value);
5306 var oldInType = this.state.inType;
5310 this.state.inType = true;
5327 this.state.inType = oldInType;
5334 var oldInType = this.state.inType;
5337 this.state.inType = true;
5348 this.state.inType = oldInType;
5421 var oldInType = this.state.inType;
5422 this.state.inType = true;
5449 var startPos = this.state.start;
5450 var startLoc = this.state.startLoc;
5457 var variancePos = this.state.start;
5509 this.state.inType = oldInType;
5521 startPos = startPos || this.state.start;
5522 startLoc = startLoc || this.state.startLoc;
5560 while (this.state.pos < this.input.length && !this.match(types.bracketR)) {
5647 var startPos = this.state.start;
5648 var startLoc = this.state.startLoc;
5653 var oldNoAnonFunctionType = this.state.noAnonFunctionType;
5655 switch (this.state.type) {
5669 if (this.state.value === "<") {
5699 this.state.noAnonFunctionType = false;
5701 this.state.noAnonFunctionType = oldNoAnonFunctionType;
5704 …if (this.state.noAnonFunctionType || !(this.match(types.comma) || this.match(types.parenR) && this…
5733 return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation");
5741 if (this.state.value === "-") {
5745 …return this.parseLiteral(-this.state.value, "NumericLiteralTypeAnnotation", node.start, node.loc.s…
5750 return this.parseLiteral(this.state.value, "NumericLiteralTypeAnnotation");
5767 if (this.state.type.keyword === "typeof") {
5776 var startPos = this.state.start,
5777 startLoc = this.state.startLoc;
5801 if (!this.state.noAnonFunctionType && this.eat(types.arrow)) {
5835 var oldInType = this.state.inType;
5836 this.state.inType = true;
5838 this.state.inType = oldInType;
5877 if (this.state.value === "+") {
5879 } else if (this.state.value === "-") {
5905 if (this.state.strict && this.match(types.name) && this.state.value === "interface") {
5947 …if (this.match(types.name) && (this.state.value === "type" || this.state.value === "interface" || …
5960 var state = this.state.clone();
5965 this.state = state;
5966 refNeedsArrowPos.start = err.pos || this.state.start;
6056 if (this.state.inType && name === "void") {
6067 if (this.state.inType && (code === 62 || code === 60)) {
6078 if (!this.state.inType) return inner.call(this);
6227 var variancePos = this.state.start;
6318 var firstIdentLoc = this.state.start;
6331 if (specifierTypeKind !== null && !this.match(types.name) && !this.state.type.keyword) {
6342 … } else if (specifierTypeKind !== null && (this.match(types.name) || this.state.type.keyword)) {
6395 var oldNoAnonFunctionType = this.state.noAnonFunctionType;
6396 this.state.noAnonFunctionType = true;
6398 this.state.noAnonFunctionType = oldNoAnonFunctionType;
6431 var state = this.state.clone();
6436 this.state = state;
6441 this.state.context.length -= 2;
6482 var state = this.state.clone();
6484 var oldNoAnonFunctionType = this.state.noAnonFunctionType;
6485 this.state.noAnonFunctionType = true;
6487 this.state.noAnonFunctionType = oldNoAnonFunctionType;
6495 this.state = state;
6851 this.state.context.push(types$1.j_expr); // treat as beginning of JSX expression
6852 this.state.context.push(types$1.j_oTag); // start opening tag context
6853 this.state.exprAllowed = false;
6857 var out = this.state.context.pop();
6859 this.state.context.pop();
6860 this.state.exprAllowed = this.curContext() === types$1.j_expr;
6862 this.state.exprAllowed = true;
6872 var chunkStart = this.state.pos;
6874 if (this.state.pos >= this.input.length) {
6875 this.raise(this.state.start, "Unterminated JSX contents");
6878 var ch = this.input.charCodeAt(this.state.pos);
6884 if (this.state.pos === this.state.start) {
6885 if (ch === 60 && this.state.exprAllowed) {
6886 ++this.state.pos;
6891 out += this.input.slice(chunkStart, this.state.pos);
6896 out += this.input.slice(chunkStart, this.state.pos);
6898 chunkStart = this.state.pos;
6903 out += this.input.slice(chunkStart, this.state.pos);
6905 chunkStart = this.state.pos;
6907 ++this.state.pos;
6914 var ch = this.input.charCodeAt(this.state.pos);
6916 ++this.state.pos;
6917 if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) {
6918 ++this.state.pos;
6923 ++this.state.curLine;
6924 this.state.lineStart = this.state.pos;
6931 var chunkStart = ++this.state.pos;
6933 if (this.state.pos >= this.input.length) {
6934 this.raise(this.state.start, "Unterminated string constant");
6937 var ch = this.input.charCodeAt(this.state.pos);
6941 out += this.input.slice(chunkStart, this.state.pos);
6943 chunkStart = this.state.pos;
6945 out += this.input.slice(chunkStart, this.state.pos);
6947 chunkStart = this.state.pos;
6949 ++this.state.pos;
6952 out += this.input.slice(chunkStart, this.state.pos++);
6960 var ch = this.input[this.state.pos];
6962 var startPos = ++this.state.pos;
6963 while (this.state.pos < this.input.length && count++ < 10) {
6964 ch = this.input[this.state.pos++];
6982 this.state.pos = startPos;
6997 var start = this.state.pos;
6999 ch = this.input.charCodeAt(++this.state.pos);
7001 return this.finishToken(types.jsxName, this.input.slice(start, this.state.pos));
7025 node.name = this.state.value;
7026 } else if (this.state.type.keyword) {
7027 node.name = this.state.type.keyword;
7038 var startPos = this.state.start;
7039 var startLoc = this.state.startLoc;
7053 var startPos = this.state.start;
7054 var startLoc = this.state.startLoc;
7069 switch (this.state.type) {
7085 this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text");
7094 var node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc);
7095 return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc);
7174 switch (this.state.type) {
7176 startPos = this.state.start;startLoc = this.state.startLoc;
7212 if (this.match(types.relational) && this.state.value === "<") {
7213 this.raise(this.state.start, "Adjacent JSX elements must be wrapped in an enclosing tag");
7221 var startPos = this.state.start;
7222 var startLoc = this.state.startLoc;
7231 var node = this.parseLiteral(this.state.value, "JSXText");
7245 if (this.state.inPropertyName) return inner.call(this, code);
7259 ++this.state.pos;
7268 if (code === 60 && this.state.exprAllowed) {
7269 ++this.state.pos;
7282 this.state.context.push(types$1.braceExpression);
7284 this.state.context.push(types$1.templateQuasi);
7288 this.state.exprAllowed = true;
7290 this.state.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore
7291 this.state.context.push(types$1.j_cTag); // reconsider as closing tag context
7292 this.state.exprAllowed = false;
7311 parser.state.strict = true;