{"ast":null,"code":"import { eat, finishToken, IdentifierRole, lookaheadType, lookaheadTypeAndKeyword, match, next, nextTemplateToken, popTypeContext, pushTypeContext, rescan_gt } from \"../tokenizer/index\";\nimport { ContextualKeyword } from \"../tokenizer/keywords\";\nimport { TokenType, TokenType as tt } from \"../tokenizer/types\";\nimport { isJSXEnabled, state } from \"../traverser/base\";\nimport { atPossibleAsync, baseParseMaybeAssign, baseParseSubscript, parseCallExpressionArguments, parseExprAtom, parseExpression, parseFunctionBody, parseIdentifier, parseLiteral, parseMaybeAssign, parseMaybeUnary, parsePropertyName, parseTemplate } from \"../traverser/expression\";\nimport { parseBindingIdentifier, parseBindingList, parseImportedIdentifier } from \"../traverser/lval\";\nimport { baseParseMaybeDecoratorArguments, parseBlockBody, parseClass, parseFunction, parseFunctionParams, parseStatement, parseVarStatement } from \"../traverser/statement\";\nimport { canInsertSemicolon, eatContextual, expect, expectContextual, hasPrecedingLineBreak, isContextual, isLineTerminator, isLookaheadContextual, semicolon, unexpected } from \"../traverser/util\";\nimport { nextJSXTagToken } from \"./jsx\";\nfunction tsIsIdentifier() {\n  // TODO: actually a bit more complex in TypeScript, but shouldn't matter.\n  // See https://github.com/Microsoft/TypeScript/issues/15008\n  return match(tt.name);\n}\nfunction isLiteralPropertyName() {\n  return match(tt.name) || Boolean(state.type & TokenType.IS_KEYWORD) || match(tt.string) || match(tt.num) || match(tt.bigint) || match(tt.decimal);\n}\nfunction tsNextTokenCanFollowModifier() {\n  // Note: TypeScript's implementation is much more complicated because\n  // more things are considered modifiers there.\n  // This implementation only handles modifiers not handled by babylon itself. And \"static\".\n  // TODO: Would be nice to avoid lookahead. Want a hasLineBreakUpNext() method...\n  const snapshot = state.snapshot();\n  next();\n  const canFollowModifier = (match(tt.bracketL) || match(tt.braceL) || match(tt.star) || match(tt.ellipsis) || match(tt.hash) || isLiteralPropertyName()) && !hasPrecedingLineBreak();\n  if (canFollowModifier) {\n    return true;\n  } else {\n    state.restoreFromSnapshot(snapshot);\n    return false;\n  }\n}\nexport function tsParseModifiers(allowedModifiers) {\n  while (true) {\n    const modifier = tsParseModifier(allowedModifiers);\n    if (modifier === null) {\n      break;\n    }\n  }\n}\n\n/** Parses a modifier matching one the given modifier names. */\nexport function tsParseModifier(allowedModifiers) {\n  if (!match(tt.name)) {\n    return null;\n  }\n  const modifier = state.contextualKeyword;\n  if (allowedModifiers.indexOf(modifier) !== -1 && tsNextTokenCanFollowModifier()) {\n    switch (modifier) {\n      case ContextualKeyword._readonly:\n        state.tokens[state.tokens.length - 1].type = tt._readonly;\n        break;\n      case ContextualKeyword._abstract:\n        state.tokens[state.tokens.length - 1].type = tt._abstract;\n        break;\n      case ContextualKeyword._static:\n        state.tokens[state.tokens.length - 1].type = tt._static;\n        break;\n      case ContextualKeyword._public:\n        state.tokens[state.tokens.length - 1].type = tt._public;\n        break;\n      case ContextualKeyword._private:\n        state.tokens[state.tokens.length - 1].type = tt._private;\n        break;\n      case ContextualKeyword._protected:\n        state.tokens[state.tokens.length - 1].type = tt._protected;\n        break;\n      case ContextualKeyword._override:\n        state.tokens[state.tokens.length - 1].type = tt._override;\n        break;\n      case ContextualKeyword._declare:\n        state.tokens[state.tokens.length - 1].type = tt._declare;\n        break;\n      default:\n        break;\n    }\n    return modifier;\n  }\n  return null;\n}\nfunction tsParseEntityName() {\n  parseIdentifier();\n  while (eat(tt.dot)) {\n    parseIdentifier();\n  }\n}\nfunction tsParseTypeReference() {\n  tsParseEntityName();\n  if (!hasPrecedingLineBreak() && match(tt.lessThan)) {\n    tsParseTypeArguments();\n  }\n}\nfunction tsParseThisTypePredicate() {\n  next();\n  tsParseTypeAnnotation();\n}\nfunction tsParseThisTypeNode() {\n  next();\n}\nfunction tsParseTypeQuery() {\n  expect(tt._typeof);\n  if (match(tt._import)) {\n    tsParseImportType();\n  } else {\n    tsParseEntityName();\n  }\n  if (!hasPrecedingLineBreak() && match(tt.lessThan)) {\n    tsParseTypeArguments();\n  }\n}\nfunction tsParseImportType() {\n  expect(tt._import);\n  expect(tt.parenL);\n  expect(tt.string);\n  expect(tt.parenR);\n  if (eat(tt.dot)) {\n    tsParseEntityName();\n  }\n  if (match(tt.lessThan)) {\n    tsParseTypeArguments();\n  }\n}\nfunction tsParseTypeParameter() {\n  eat(tt._const);\n  const hadIn = eat(tt._in);\n  const hadOut = eatContextual(ContextualKeyword._out);\n  eat(tt._const);\n  if ((hadIn || hadOut) && !match(tt.name)) {\n    // The \"in\" or \"out\" keyword must have actually been the type parameter\n    // name, so set it as the name.\n    state.tokens[state.tokens.length - 1].type = tt.name;\n  } else {\n    parseIdentifier();\n  }\n  if (eat(tt._extends)) {\n    tsParseType();\n  }\n  if (eat(tt.eq)) {\n    tsParseType();\n  }\n}\nexport function tsTryParseTypeParameters() {\n  if (match(tt.lessThan)) {\n    tsParseTypeParameters();\n  }\n}\nfunction tsParseTypeParameters() {\n  const oldIsType = pushTypeContext(0);\n  if (match(tt.lessThan) || match(tt.typeParameterStart)) {\n    next();\n  } else {\n    unexpected();\n  }\n  while (!eat(tt.greaterThan) && !state.error) {\n    tsParseTypeParameter();\n    eat(tt.comma);\n  }\n  popTypeContext(oldIsType);\n}\n\n// Note: In TypeScript implementation we must provide `yieldContext` and `awaitContext`,\n// but here it's always false, because this is only used for types.\nfunction tsFillSignature(returnToken) {\n  // Arrow fns *must* have return token (`=>`). Normal functions can omit it.\n  const returnTokenRequired = returnToken === tt.arrow;\n  tsTryParseTypeParameters();\n  expect(tt.parenL);\n  // Create a scope even though we're doing type parsing so we don't accidentally\n  // treat params as top-level bindings.\n  state.scopeDepth++;\n  tsParseBindingListForSignature(false /* isBlockScope */);\n  state.scopeDepth--;\n  if (returnTokenRequired) {\n    tsParseTypeOrTypePredicateAnnotation(returnToken);\n  } else if (match(returnToken)) {\n    tsParseTypeOrTypePredicateAnnotation(returnToken);\n  }\n}\nfunction tsParseBindingListForSignature(isBlockScope) {\n  parseBindingList(tt.parenR, isBlockScope);\n}\nfunction tsParseTypeMemberSemicolon() {\n  if (!eat(tt.comma)) {\n    semicolon();\n  }\n}\nfunction tsParseSignatureMember() {\n  tsFillSignature(tt.colon);\n  tsParseTypeMemberSemicolon();\n}\nfunction tsIsUnambiguouslyIndexSignature() {\n  const snapshot = state.snapshot();\n  next(); // Skip '{'\n  const isIndexSignature = eat(tt.name) && match(tt.colon);\n  state.restoreFromSnapshot(snapshot);\n  return isIndexSignature;\n}\nfunction tsTryParseIndexSignature() {\n  if (!(match(tt.bracketL) && tsIsUnambiguouslyIndexSignature())) {\n    return false;\n  }\n  const oldIsType = pushTypeContext(0);\n  expect(tt.bracketL);\n  parseIdentifier();\n  tsParseTypeAnnotation();\n  expect(tt.bracketR);\n  tsTryParseTypeAnnotation();\n  tsParseTypeMemberSemicolon();\n  popTypeContext(oldIsType);\n  return true;\n}\nfunction tsParsePropertyOrMethodSignature(isReadonly) {\n  eat(tt.question);\n  if (!isReadonly && (match(tt.parenL) || match(tt.lessThan))) {\n    tsFillSignature(tt.colon);\n    tsParseTypeMemberSemicolon();\n  } else {\n    tsTryParseTypeAnnotation();\n    tsParseTypeMemberSemicolon();\n  }\n}\nfunction tsParseTypeMember() {\n  if (match(tt.parenL) || match(tt.lessThan)) {\n    // call signature\n    tsParseSignatureMember();\n    return;\n  }\n  if (match(tt._new)) {\n    next();\n    if (match(tt.parenL) || match(tt.lessThan)) {\n      // constructor signature\n      tsParseSignatureMember();\n    } else {\n      tsParsePropertyOrMethodSignature(false);\n    }\n    return;\n  }\n  const readonly = !!tsParseModifier([ContextualKeyword._readonly]);\n  const found = tsTryParseIndexSignature();\n  if (found) {\n    return;\n  }\n  if ((isContextual(ContextualKeyword._get) || isContextual(ContextualKeyword._set)) && tsNextTokenCanFollowModifier()) {\n    // This is a getter/setter on a type. The tsNextTokenCanFollowModifier\n    // function already called next() for us, so continue parsing the name.\n  }\n  parsePropertyName(-1 /* Types don't need context IDs. */);\n  tsParsePropertyOrMethodSignature(readonly);\n}\nfunction tsParseTypeLiteral() {\n  tsParseObjectTypeMembers();\n}\nfunction tsParseObjectTypeMembers() {\n  expect(tt.braceL);\n  while (!eat(tt.braceR) && !state.error) {\n    tsParseTypeMember();\n  }\n}\nfunction tsLookaheadIsStartOfMappedType() {\n  const snapshot = state.snapshot();\n  const isStartOfMappedType = tsIsStartOfMappedType();\n  state.restoreFromSnapshot(snapshot);\n  return isStartOfMappedType;\n}\nfunction tsIsStartOfMappedType() {\n  next();\n  if (eat(tt.plus) || eat(tt.minus)) {\n    return isContextual(ContextualKeyword._readonly);\n  }\n  if (isContextual(ContextualKeyword._readonly)) {\n    next();\n  }\n  if (!match(tt.bracketL)) {\n    return false;\n  }\n  next();\n  if (!tsIsIdentifier()) {\n    return false;\n  }\n  next();\n  return match(tt._in);\n}\nfunction tsParseMappedTypeParameter() {\n  parseIdentifier();\n  expect(tt._in);\n  tsParseType();\n}\nfunction tsParseMappedType() {\n  expect(tt.braceL);\n  if (match(tt.plus) || match(tt.minus)) {\n    next();\n    expectContextual(ContextualKeyword._readonly);\n  } else {\n    eatContextual(ContextualKeyword._readonly);\n  }\n  expect(tt.bracketL);\n  tsParseMappedTypeParameter();\n  if (eatContextual(ContextualKeyword._as)) {\n    tsParseType();\n  }\n  expect(tt.bracketR);\n  if (match(tt.plus) || match(tt.minus)) {\n    next();\n    expect(tt.question);\n  } else {\n    eat(tt.question);\n  }\n  tsTryParseType();\n  semicolon();\n  expect(tt.braceR);\n}\nfunction tsParseTupleType() {\n  expect(tt.bracketL);\n  while (!eat(tt.bracketR) && !state.error) {\n    // Do not validate presence of either none or only labeled elements\n    tsParseTupleElementType();\n    eat(tt.comma);\n  }\n}\nfunction tsParseTupleElementType() {\n  // parses `...TsType[]`\n  if (eat(tt.ellipsis)) {\n    tsParseType();\n  } else {\n    // parses `TsType?`\n    tsParseType();\n    eat(tt.question);\n  }\n\n  // The type we parsed above was actually a label\n  if (eat(tt.colon)) {\n    // Labeled tuple types must affix the label with `...` or `?`, so no need to handle those here\n    tsParseType();\n  }\n}\nfunction tsParseParenthesizedType() {\n  expect(tt.parenL);\n  tsParseType();\n  expect(tt.parenR);\n}\nfunction tsParseTemplateLiteralType() {\n  // Finish `, read quasi\n  nextTemplateToken();\n  // Finish quasi, read ${\n  nextTemplateToken();\n  while (!match(tt.backQuote) && !state.error) {\n    expect(tt.dollarBraceL);\n    tsParseType();\n    // Finish }, read quasi\n    nextTemplateToken();\n    // Finish quasi, read either ${ or `\n    nextTemplateToken();\n  }\n  next();\n}\nvar FunctionType;\n(function (FunctionType) {\n  const TSFunctionType = 0;\n  FunctionType[FunctionType[\"TSFunctionType\"] = TSFunctionType] = \"TSFunctionType\";\n  const TSConstructorType = TSFunctionType + 1;\n  FunctionType[FunctionType[\"TSConstructorType\"] = TSConstructorType] = \"TSConstructorType\";\n  const TSAbstractConstructorType = TSConstructorType + 1;\n  FunctionType[FunctionType[\"TSAbstractConstructorType\"] = TSAbstractConstructorType] = \"TSAbstractConstructorType\";\n})(FunctionType || (FunctionType = {}));\nfunction tsParseFunctionOrConstructorType(type) {\n  if (type === FunctionType.TSAbstractConstructorType) {\n    expectContextual(ContextualKeyword._abstract);\n  }\n  if (type === FunctionType.TSConstructorType || type === FunctionType.TSAbstractConstructorType) {\n    expect(tt._new);\n  }\n  const oldInDisallowConditionalTypesContext = state.inDisallowConditionalTypesContext;\n  state.inDisallowConditionalTypesContext = false;\n  tsFillSignature(tt.arrow);\n  state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext;\n}\nfunction tsParseNonArrayType() {\n  switch (state.type) {\n    case tt.name:\n      tsParseTypeReference();\n      return;\n    case tt._void:\n    case tt._null:\n      next();\n      return;\n    case tt.string:\n    case tt.num:\n    case tt.bigint:\n    case tt.decimal:\n    case tt._true:\n    case tt._false:\n      parseLiteral();\n      return;\n    case tt.minus:\n      next();\n      parseLiteral();\n      return;\n    case tt._this:\n      {\n        tsParseThisTypeNode();\n        if (isContextual(ContextualKeyword._is) && !hasPrecedingLineBreak()) {\n          tsParseThisTypePredicate();\n        }\n        return;\n      }\n    case tt._typeof:\n      tsParseTypeQuery();\n      return;\n    case tt._import:\n      tsParseImportType();\n      return;\n    case tt.braceL:\n      if (tsLookaheadIsStartOfMappedType()) {\n        tsParseMappedType();\n      } else {\n        tsParseTypeLiteral();\n      }\n      return;\n    case tt.bracketL:\n      tsParseTupleType();\n      return;\n    case tt.parenL:\n      tsParseParenthesizedType();\n      return;\n    case tt.backQuote:\n      tsParseTemplateLiteralType();\n      return;\n    default:\n      if (state.type & TokenType.IS_KEYWORD) {\n        next();\n        state.tokens[state.tokens.length - 1].type = tt.name;\n        return;\n      }\n      break;\n  }\n  unexpected();\n}\nfunction tsParseArrayTypeOrHigher() {\n  tsParseNonArrayType();\n  while (!hasPrecedingLineBreak() && eat(tt.bracketL)) {\n    if (!eat(tt.bracketR)) {\n      // If we hit ] immediately, this is an array type, otherwise it's an indexed access type.\n      tsParseType();\n      expect(tt.bracketR);\n    }\n  }\n}\nfunction tsParseInferType() {\n  expectContextual(ContextualKeyword._infer);\n  parseIdentifier();\n  if (match(tt._extends)) {\n    // Infer type constraints introduce an ambiguity about whether the \"extends\"\n    // is a constraint for this infer type or is another conditional type.\n    const snapshot = state.snapshot();\n    expect(tt._extends);\n    const oldInDisallowConditionalTypesContext = state.inDisallowConditionalTypesContext;\n    state.inDisallowConditionalTypesContext = true;\n    tsParseType();\n    state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext;\n    if (state.error || !state.inDisallowConditionalTypesContext && match(tt.question)) {\n      state.restoreFromSnapshot(snapshot);\n    }\n  }\n}\nfunction tsParseTypeOperatorOrHigher() {\n  if (isContextual(ContextualKeyword._keyof) || isContextual(ContextualKeyword._unique) || isContextual(ContextualKeyword._readonly)) {\n    next();\n    tsParseTypeOperatorOrHigher();\n  } else if (isContextual(ContextualKeyword._infer)) {\n    tsParseInferType();\n  } else {\n    const oldInDisallowConditionalTypesContext = state.inDisallowConditionalTypesContext;\n    state.inDisallowConditionalTypesContext = false;\n    tsParseArrayTypeOrHigher();\n    state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext;\n  }\n}\nfunction tsParseIntersectionTypeOrHigher() {\n  eat(tt.bitwiseAND);\n  tsParseTypeOperatorOrHigher();\n  if (match(tt.bitwiseAND)) {\n    while (eat(tt.bitwiseAND)) {\n      tsParseTypeOperatorOrHigher();\n    }\n  }\n}\nfunction tsParseUnionTypeOrHigher() {\n  eat(tt.bitwiseOR);\n  tsParseIntersectionTypeOrHigher();\n  if (match(tt.bitwiseOR)) {\n    while (eat(tt.bitwiseOR)) {\n      tsParseIntersectionTypeOrHigher();\n    }\n  }\n}\nfunction tsIsStartOfFunctionType() {\n  if (match(tt.lessThan)) {\n    return true;\n  }\n  return match(tt.parenL) && tsLookaheadIsUnambiguouslyStartOfFunctionType();\n}\nfunction tsSkipParameterStart() {\n  if (match(tt.name) || match(tt._this)) {\n    next();\n    return true;\n  }\n  // If this is a possible array/object destructure, walk to the matching bracket/brace.\n  // The next token after will tell us definitively whether this is a function param.\n  if (match(tt.braceL) || match(tt.bracketL)) {\n    let depth = 1;\n    next();\n    while (depth > 0 && !state.error) {\n      if (match(tt.braceL) || match(tt.bracketL)) {\n        depth++;\n      } else if (match(tt.braceR) || match(tt.bracketR)) {\n        depth--;\n      }\n      next();\n    }\n    return true;\n  }\n  return false;\n}\nfunction tsLookaheadIsUnambiguouslyStartOfFunctionType() {\n  const snapshot = state.snapshot();\n  const isUnambiguouslyStartOfFunctionType = tsIsUnambiguouslyStartOfFunctionType();\n  state.restoreFromSnapshot(snapshot);\n  return isUnambiguouslyStartOfFunctionType;\n}\nfunction tsIsUnambiguouslyStartOfFunctionType() {\n  next();\n  if (match(tt.parenR) || match(tt.ellipsis)) {\n    // ( )\n    // ( ...\n    return true;\n  }\n  if (tsSkipParameterStart()) {\n    if (match(tt.colon) || match(tt.comma) || match(tt.question) || match(tt.eq)) {\n      // ( xxx :\n      // ( xxx ,\n      // ( xxx ?\n      // ( xxx =\n      return true;\n    }\n    if (match(tt.parenR)) {\n      next();\n      if (match(tt.arrow)) {\n        // ( xxx ) =>\n        return true;\n      }\n    }\n  }\n  return false;\n}\nfunction tsParseTypeOrTypePredicateAnnotation(returnToken) {\n  const oldIsType = pushTypeContext(0);\n  expect(returnToken);\n  const finishedReturn = tsParseTypePredicateOrAssertsPrefix();\n  if (!finishedReturn) {\n    tsParseType();\n  }\n  popTypeContext(oldIsType);\n}\nfunction tsTryParseTypeOrTypePredicateAnnotation() {\n  if (match(tt.colon)) {\n    tsParseTypeOrTypePredicateAnnotation(tt.colon);\n  }\n}\nexport function tsTryParseTypeAnnotation() {\n  if (match(tt.colon)) {\n    tsParseTypeAnnotation();\n  }\n}\nfunction tsTryParseType() {\n  if (eat(tt.colon)) {\n    tsParseType();\n  }\n}\n\n/**\n * Detect a few special return syntax cases: `x is T`, `asserts x`, `asserts x is T`,\n * `asserts this is T`.\n *\n * Returns true if we parsed the return type, false if there's still a type to be parsed.\n */\nfunction tsParseTypePredicateOrAssertsPrefix() {\n  const snapshot = state.snapshot();\n  if (isContextual(ContextualKeyword._asserts)) {\n    // Normally this is `asserts x is T`, but at this point, it might be `asserts is T` (a user-\n    // defined type guard on the `asserts` variable) or just a type called `asserts`.\n    next();\n    if (eatContextual(ContextualKeyword._is)) {\n      // If we see `asserts is`, then this must be of the form `asserts is T`, since\n      // `asserts is is T` isn't valid.\n      tsParseType();\n      return true;\n    } else if (tsIsIdentifier() || match(tt._this)) {\n      next();\n      if (eatContextual(ContextualKeyword._is)) {\n        // If we see `is`, then this is `asserts x is T`. Otherwise, it's `asserts x`.\n        tsParseType();\n      }\n      return true;\n    } else {\n      // Regular type, so bail out and start type parsing from scratch.\n      state.restoreFromSnapshot(snapshot);\n      return false;\n    }\n  } else if (tsIsIdentifier() || match(tt._this)) {\n    // This is a regular identifier, which may or may not have \"is\" after it.\n    next();\n    if (isContextual(ContextualKeyword._is) && !hasPrecedingLineBreak()) {\n      next();\n      tsParseType();\n      return true;\n    } else {\n      // Regular type, so bail out and start type parsing from scratch.\n      state.restoreFromSnapshot(snapshot);\n      return false;\n    }\n  }\n  return false;\n}\nexport function tsParseTypeAnnotation() {\n  const oldIsType = pushTypeContext(0);\n  expect(tt.colon);\n  tsParseType();\n  popTypeContext(oldIsType);\n}\nexport function tsParseType() {\n  tsParseNonConditionalType();\n  if (state.inDisallowConditionalTypesContext || hasPrecedingLineBreak() || !eat(tt._extends)) {\n    return;\n  }\n  // extends type\n  const oldInDisallowConditionalTypesContext = state.inDisallowConditionalTypesContext;\n  state.inDisallowConditionalTypesContext = true;\n  tsParseNonConditionalType();\n  state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext;\n  expect(tt.question);\n  // true type\n  tsParseType();\n  expect(tt.colon);\n  // false type\n  tsParseType();\n}\nfunction isAbstractConstructorSignature() {\n  return isContextual(ContextualKeyword._abstract) && lookaheadType() === tt._new;\n}\nexport function tsParseNonConditionalType() {\n  if (tsIsStartOfFunctionType()) {\n    tsParseFunctionOrConstructorType(FunctionType.TSFunctionType);\n    return;\n  }\n  if (match(tt._new)) {\n    // As in `new () => Date`\n    tsParseFunctionOrConstructorType(FunctionType.TSConstructorType);\n    return;\n  } else if (isAbstractConstructorSignature()) {\n    // As in `abstract new () => Date`\n    tsParseFunctionOrConstructorType(FunctionType.TSAbstractConstructorType);\n    return;\n  }\n  tsParseUnionTypeOrHigher();\n}\nexport function tsParseTypeAssertion() {\n  const oldIsType = pushTypeContext(1);\n  tsParseType();\n  expect(tt.greaterThan);\n  popTypeContext(oldIsType);\n  parseMaybeUnary();\n}\nexport function tsTryParseJSXTypeArgument() {\n  if (eat(tt.jsxTagStart)) {\n    state.tokens[state.tokens.length - 1].type = tt.typeParameterStart;\n    const oldIsType = pushTypeContext(1);\n    while (!match(tt.greaterThan) && !state.error) {\n      tsParseType();\n      eat(tt.comma);\n    }\n    // Process >, but the one after needs to be parsed JSX-style.\n    nextJSXTagToken();\n    popTypeContext(oldIsType);\n  }\n}\nfunction tsParseHeritageClause() {\n  while (!match(tt.braceL) && !state.error) {\n    tsParseExpressionWithTypeArguments();\n    eat(tt.comma);\n  }\n}\nfunction tsParseExpressionWithTypeArguments() {\n  // Note: TS uses parseLeftHandSideExpressionOrHigher,\n  // then has grammar errors later if it's not an EntityName.\n  tsParseEntityName();\n  if (match(tt.lessThan)) {\n    tsParseTypeArguments();\n  }\n}\nfunction tsParseInterfaceDeclaration() {\n  parseBindingIdentifier(false);\n  tsTryParseTypeParameters();\n  if (eat(tt._extends)) {\n    tsParseHeritageClause();\n  }\n  tsParseObjectTypeMembers();\n}\nfunction tsParseTypeAliasDeclaration() {\n  parseBindingIdentifier(false);\n  tsTryParseTypeParameters();\n  expect(tt.eq);\n  tsParseType();\n  semicolon();\n}\nfunction tsParseEnumMember() {\n  // Computed property names are grammar errors in an enum, so accept just string literal or identifier.\n  if (match(tt.string)) {\n    parseLiteral();\n  } else {\n    parseIdentifier();\n  }\n  if (eat(tt.eq)) {\n    const eqIndex = state.tokens.length - 1;\n    parseMaybeAssign();\n    state.tokens[eqIndex].rhsEndIndex = state.tokens.length;\n  }\n}\nfunction tsParseEnumDeclaration() {\n  parseBindingIdentifier(false);\n  expect(tt.braceL);\n  while (!eat(tt.braceR) && !state.error) {\n    tsParseEnumMember();\n    eat(tt.comma);\n  }\n}\nfunction tsParseModuleBlock() {\n  expect(tt.braceL);\n  parseBlockBody( /* end */tt.braceR);\n}\nfunction tsParseModuleOrNamespaceDeclaration() {\n  parseBindingIdentifier(false);\n  if (eat(tt.dot)) {\n    tsParseModuleOrNamespaceDeclaration();\n  } else {\n    tsParseModuleBlock();\n  }\n}\nfunction tsParseAmbientExternalModuleDeclaration() {\n  if (isContextual(ContextualKeyword._global)) {\n    parseIdentifier();\n  } else if (match(tt.string)) {\n    parseExprAtom();\n  } else {\n    unexpected();\n  }\n  if (match(tt.braceL)) {\n    tsParseModuleBlock();\n  } else {\n    semicolon();\n  }\n}\nexport function tsParseImportEqualsDeclaration() {\n  parseImportedIdentifier();\n  expect(tt.eq);\n  tsParseModuleReference();\n  semicolon();\n}\nfunction tsIsExternalModuleReference() {\n  return isContextual(ContextualKeyword._require) && lookaheadType() === tt.parenL;\n}\nfunction tsParseModuleReference() {\n  if (tsIsExternalModuleReference()) {\n    tsParseExternalModuleReference();\n  } else {\n    tsParseEntityName();\n  }\n}\nfunction tsParseExternalModuleReference() {\n  expectContextual(ContextualKeyword._require);\n  expect(tt.parenL);\n  if (!match(tt.string)) {\n    unexpected();\n  }\n  parseLiteral();\n  expect(tt.parenR);\n}\n\n// Utilities\n\n// Returns true if a statement matched.\nfunction tsTryParseDeclare() {\n  if (isLineTerminator()) {\n    return false;\n  }\n  switch (state.type) {\n    case tt._function:\n      {\n        const oldIsType = pushTypeContext(1);\n        next();\n        // We don't need to precisely get the function start here, since it's only used to mark\n        // the function as a type if it's bodiless, and it's already a type here.\n        const functionStart = state.start;\n        parseFunction(functionStart, /* isStatement */true);\n        popTypeContext(oldIsType);\n        return true;\n      }\n    case tt._class:\n      {\n        const oldIsType = pushTypeContext(1);\n        parseClass( /* isStatement */true, /* optionalId */false);\n        popTypeContext(oldIsType);\n        return true;\n      }\n    case tt._const:\n      {\n        if (match(tt._const) && isLookaheadContextual(ContextualKeyword._enum)) {\n          const oldIsType = pushTypeContext(1);\n          // `const enum = 0;` not allowed because \"enum\" is a strict mode reserved word.\n          expect(tt._const);\n          expectContextual(ContextualKeyword._enum);\n          state.tokens[state.tokens.length - 1].type = tt._enum;\n          tsParseEnumDeclaration();\n          popTypeContext(oldIsType);\n          return true;\n        }\n      }\n    // falls through\n    case tt._var:\n    case tt._let:\n      {\n        const oldIsType = pushTypeContext(1);\n        parseVarStatement(state.type !== tt._var);\n        popTypeContext(oldIsType);\n        return true;\n      }\n    case tt.name:\n      {\n        const oldIsType = pushTypeContext(1);\n        const contextualKeyword = state.contextualKeyword;\n        let matched = false;\n        if (contextualKeyword === ContextualKeyword._global) {\n          tsParseAmbientExternalModuleDeclaration();\n          matched = true;\n        } else {\n          matched = tsParseDeclaration(contextualKeyword, /* isBeforeToken */true);\n        }\n        popTypeContext(oldIsType);\n        return matched;\n      }\n    default:\n      return false;\n  }\n}\n\n// Note: this won't be called unless the keyword is allowed in `shouldParseExportDeclaration`.\n// Returns true if it matched a declaration.\nfunction tsTryParseExportDeclaration() {\n  return tsParseDeclaration(state.contextualKeyword, /* isBeforeToken */true);\n}\n\n// Returns true if it matched a statement.\nfunction tsParseExpressionStatement(contextualKeyword) {\n  switch (contextualKeyword) {\n    case ContextualKeyword._declare:\n      {\n        const declareTokenIndex = state.tokens.length - 1;\n        const matched = tsTryParseDeclare();\n        if (matched) {\n          state.tokens[declareTokenIndex].type = tt._declare;\n          return true;\n        }\n        break;\n      }\n    case ContextualKeyword._global:\n      // `global { }` (with no `declare`) may appear inside an ambient module declaration.\n      // Would like to use tsParseAmbientExternalModuleDeclaration here, but already ran past \"global\".\n      if (match(tt.braceL)) {\n        tsParseModuleBlock();\n        return true;\n      }\n      break;\n    default:\n      return tsParseDeclaration(contextualKeyword, /* isBeforeToken */false);\n  }\n  return false;\n}\n\n/**\n * Common code for parsing a declaration.\n *\n * isBeforeToken indicates that the current parser state is at the contextual\n * keyword (and that it is not yet emitted) rather than reading the token after\n * it. When isBeforeToken is true, we may be preceded by an `export` token and\n * should include that token in a type context we create, e.g. to handle\n * `export interface` or `export type`. (This is a bit of a hack and should be\n * cleaned up at some point.)\n *\n * Returns true if it matched a declaration.\n */\nfunction tsParseDeclaration(contextualKeyword, isBeforeToken) {\n  switch (contextualKeyword) {\n    case ContextualKeyword._abstract:\n      if (tsCheckLineTerminator(isBeforeToken) && match(tt._class)) {\n        state.tokens[state.tokens.length - 1].type = tt._abstract;\n        parseClass( /* isStatement */true, /* optionalId */false);\n        return true;\n      }\n      break;\n    case ContextualKeyword._enum:\n      if (tsCheckLineTerminator(isBeforeToken) && match(tt.name)) {\n        state.tokens[state.tokens.length - 1].type = tt._enum;\n        tsParseEnumDeclaration();\n        return true;\n      }\n      break;\n    case ContextualKeyword._interface:\n      if (tsCheckLineTerminator(isBeforeToken) && match(tt.name)) {\n        // `next` is true in \"export\" and \"declare\" contexts, so we want to remove that token\n        // as well.\n        const oldIsType = pushTypeContext(isBeforeToken ? 2 : 1);\n        tsParseInterfaceDeclaration();\n        popTypeContext(oldIsType);\n        return true;\n      }\n      break;\n    case ContextualKeyword._module:\n      if (tsCheckLineTerminator(isBeforeToken)) {\n        if (match(tt.string)) {\n          const oldIsType = pushTypeContext(isBeforeToken ? 2 : 1);\n          tsParseAmbientExternalModuleDeclaration();\n          popTypeContext(oldIsType);\n          return true;\n        } else if (match(tt.name)) {\n          const oldIsType = pushTypeContext(isBeforeToken ? 2 : 1);\n          tsParseModuleOrNamespaceDeclaration();\n          popTypeContext(oldIsType);\n          return true;\n        }\n      }\n      break;\n    case ContextualKeyword._namespace:\n      if (tsCheckLineTerminator(isBeforeToken) && match(tt.name)) {\n        const oldIsType = pushTypeContext(isBeforeToken ? 2 : 1);\n        tsParseModuleOrNamespaceDeclaration();\n        popTypeContext(oldIsType);\n        return true;\n      }\n      break;\n    case ContextualKeyword._type:\n      if (tsCheckLineTerminator(isBeforeToken) && match(tt.name)) {\n        const oldIsType = pushTypeContext(isBeforeToken ? 2 : 1);\n        tsParseTypeAliasDeclaration();\n        popTypeContext(oldIsType);\n        return true;\n      }\n      break;\n    default:\n      break;\n  }\n  return false;\n}\nfunction tsCheckLineTerminator(isBeforeToken) {\n  if (isBeforeToken) {\n    // Babel checks hasFollowingLineBreak here and returns false, but this\n    // doesn't actually come up, e.g. `export interface` can never be on its own\n    // line in valid code.\n    next();\n    return true;\n  } else {\n    return !isLineTerminator();\n  }\n}\n\n// Returns true if there was a generic async arrow function.\nfunction tsTryParseGenericAsyncArrowFunction() {\n  const snapshot = state.snapshot();\n  tsParseTypeParameters();\n  parseFunctionParams();\n  tsTryParseTypeOrTypePredicateAnnotation();\n  expect(tt.arrow);\n  if (state.error) {\n    state.restoreFromSnapshot(snapshot);\n    return false;\n  }\n  parseFunctionBody(true);\n  return true;\n}\n\n/**\n * If necessary, hack the tokenizer state so that this bitshift was actually a\n * less-than token, then keep parsing. This should only be used in situations\n * where we restore from snapshot on error (which reverts this change) or\n * where bitshift would be illegal anyway (e.g. in a class \"extends\" clause).\n *\n * This hack is useful to handle situations like foo<<T>() => void>() where\n * there can legitimately be two open-angle-brackets in a row in TS.\n */\nfunction tsParseTypeArgumentsWithPossibleBitshift() {\n  if (state.type === tt.bitShiftL) {\n    state.pos -= 1;\n    finishToken(tt.lessThan);\n  }\n  tsParseTypeArguments();\n}\nfunction tsParseTypeArguments() {\n  const oldIsType = pushTypeContext(0);\n  expect(tt.lessThan);\n  while (!match(tt.greaterThan) && !state.error) {\n    tsParseType();\n    eat(tt.comma);\n  }\n  if (!oldIsType) {\n    // If the type arguments are present in an expression context, e.g.\n    // f<number>(), then the > sign should be tokenized as a non-type token.\n    // In particular, f(a < b, c >= d) should parse the >= as a single token,\n    // resulting in a syntax error and fallback to the non-type-args\n    // interpretation. In the success case, even though the > is tokenized as a\n    // non-type token, it still must be marked as a type token so that it is\n    // erased.\n    popTypeContext(oldIsType);\n    rescan_gt();\n    expect(tt.greaterThan);\n    state.tokens[state.tokens.length - 1].isType = true;\n  } else {\n    expect(tt.greaterThan);\n    popTypeContext(oldIsType);\n  }\n}\nexport function tsIsDeclarationStart() {\n  if (match(tt.name)) {\n    switch (state.contextualKeyword) {\n      case ContextualKeyword._abstract:\n      case ContextualKeyword._declare:\n      case ContextualKeyword._enum:\n      case ContextualKeyword._interface:\n      case ContextualKeyword._module:\n      case ContextualKeyword._namespace:\n      case ContextualKeyword._type:\n        return true;\n      default:\n        break;\n    }\n  }\n  return false;\n}\n\n// ======================================================\n// OVERRIDES\n// ======================================================\n\nexport function tsParseFunctionBodyAndFinish(functionStart, funcContextId) {\n  // For arrow functions, `parseArrow` handles the return type itself.\n  if (match(tt.colon)) {\n    tsParseTypeOrTypePredicateAnnotation(tt.colon);\n  }\n\n  // The original code checked the node type to make sure this function type allows a missing\n  // body, but we skip that to avoid sending around the node type. We instead just use the\n  // allowExpressionBody boolean to make sure it's not an arrow function.\n  if (!match(tt.braceL) && isLineTerminator()) {\n    // Retroactively mark the function declaration as a type.\n    let i = state.tokens.length - 1;\n    while (i >= 0 && (state.tokens[i].start >= functionStart || state.tokens[i].type === tt._default || state.tokens[i].type === tt._export)) {\n      state.tokens[i].isType = true;\n      i--;\n    }\n    return;\n  }\n  parseFunctionBody(false, funcContextId);\n}\nexport function tsParseSubscript(startTokenIndex, noCalls, stopState) {\n  if (!hasPrecedingLineBreak() && eat(tt.bang)) {\n    state.tokens[state.tokens.length - 1].type = tt.nonNullAssertion;\n    return;\n  }\n  if (match(tt.lessThan) || match(tt.bitShiftL)) {\n    // There are number of things we are going to \"maybe\" parse, like type arguments on\n    // tagged template expressions. If any of them fail, walk it back and continue.\n    const snapshot = state.snapshot();\n    if (!noCalls && atPossibleAsync()) {\n      // Almost certainly this is a generic async function `async <T>() => ...\n      // But it might be a call with a type argument `async<T>();`\n      const asyncArrowFn = tsTryParseGenericAsyncArrowFunction();\n      if (asyncArrowFn) {\n        return;\n      }\n    }\n    tsParseTypeArgumentsWithPossibleBitshift();\n    if (!noCalls && eat(tt.parenL)) {\n      // With f<T>(), the subscriptStartIndex marker is on the ( token.\n      state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex;\n      parseCallExpressionArguments();\n    } else if (match(tt.backQuote)) {\n      // Tagged template with a type argument.\n      parseTemplate();\n    } else if (\n    // The remaining possible case is an instantiation expression, e.g.\n    // Array<number> . Check for a few cases that would disqualify it and\n    // cause us to bail out.\n    // a<b>>c is not (a<b>)>c, but a<(b>>c)\n    state.type === tt.greaterThan ||\n    // a<b>c is (a<b)>c\n    state.type !== tt.parenL && Boolean(state.type & TokenType.IS_EXPRESSION_START) && !hasPrecedingLineBreak()) {\n      // Bail out. We have something like a<b>c, which is not an expression with\n      // type arguments but an (a < b) > c comparison.\n      unexpected();\n    }\n    if (state.error) {\n      state.restoreFromSnapshot(snapshot);\n    } else {\n      return;\n    }\n  } else if (!noCalls && match(tt.questionDot) && lookaheadType() === tt.lessThan) {\n    // If we see f?.<, then this must be an optional call with a type argument.\n    next();\n    state.tokens[startTokenIndex].isOptionalChainStart = true;\n    // With f?.<T>(), the subscriptStartIndex marker is on the ?. token.\n    state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex;\n    tsParseTypeArguments();\n    expect(tt.parenL);\n    parseCallExpressionArguments();\n  }\n  baseParseSubscript(startTokenIndex, noCalls, stopState);\n}\nexport function tsTryParseExport() {\n  if (eat(tt._import)) {\n    // One of these cases:\n    // export import A = B;\n    // export import type A = require(\"A\");\n    if (isContextual(ContextualKeyword._type) && lookaheadType() !== tt.eq) {\n      // Eat a `type` token, unless it's actually an identifier name.\n      expectContextual(ContextualKeyword._type);\n    }\n    tsParseImportEqualsDeclaration();\n    return true;\n  } else if (eat(tt.eq)) {\n    // `export = x;`\n    parseExpression();\n    semicolon();\n    return true;\n  } else if (eatContextual(ContextualKeyword._as)) {\n    // `export as namespace A;`\n    // See `parseNamespaceExportDeclaration` in TypeScript's own parser\n    expectContextual(ContextualKeyword._namespace);\n    parseIdentifier();\n    semicolon();\n    return true;\n  } else {\n    if (isContextual(ContextualKeyword._type)) {\n      const nextType = lookaheadType();\n      // export type {foo} from 'a';\n      // export type * from 'a';'\n      // export type * as ns from 'a';'\n      if (nextType === tt.braceL || nextType === tt.star) {\n        next();\n      }\n    }\n    return false;\n  }\n}\n\n/**\n * Parse a TS import specifier, which may be prefixed with \"type\" and may be of\n * the form `foo as bar`.\n *\n * The number of identifier-like tokens we see happens to be enough to uniquely\n * identify the form, so simply count the number of identifiers rather than\n * matching the words `type` or `as`. This is particularly important because\n * `type` and `as` could each actually be plain identifiers rather than\n * keywords.\n */\nexport function tsParseImportSpecifier() {\n  parseIdentifier();\n  if (match(tt.comma) || match(tt.braceR)) {\n    // import {foo}\n    state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportDeclaration;\n    return;\n  }\n  parseIdentifier();\n  if (match(tt.comma) || match(tt.braceR)) {\n    // import {type foo}\n    state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportDeclaration;\n    state.tokens[state.tokens.length - 2].isType = true;\n    state.tokens[state.tokens.length - 1].isType = true;\n    return;\n  }\n  parseIdentifier();\n  if (match(tt.comma) || match(tt.braceR)) {\n    // import {foo as bar}\n    state.tokens[state.tokens.length - 3].identifierRole = IdentifierRole.ImportAccess;\n    state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportDeclaration;\n    return;\n  }\n  parseIdentifier();\n  // import {type foo as bar}\n  state.tokens[state.tokens.length - 3].identifierRole = IdentifierRole.ImportAccess;\n  state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportDeclaration;\n  state.tokens[state.tokens.length - 4].isType = true;\n  state.tokens[state.tokens.length - 3].isType = true;\n  state.tokens[state.tokens.length - 2].isType = true;\n  state.tokens[state.tokens.length - 1].isType = true;\n}\n\n/**\n * Just like named import specifiers, export specifiers can have from 1 to 4\n * tokens, inclusive, and the number of tokens determines the role of each token.\n */\nexport function tsParseExportSpecifier() {\n  parseIdentifier();\n  if (match(tt.comma) || match(tt.braceR)) {\n    // export {foo}\n    state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ExportAccess;\n    return;\n  }\n  parseIdentifier();\n  if (match(tt.comma) || match(tt.braceR)) {\n    // export {type foo}\n    state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ExportAccess;\n    state.tokens[state.tokens.length - 2].isType = true;\n    state.tokens[state.tokens.length - 1].isType = true;\n    return;\n  }\n  parseIdentifier();\n  if (match(tt.comma) || match(tt.braceR)) {\n    // export {foo as bar}\n    state.tokens[state.tokens.length - 3].identifierRole = IdentifierRole.ExportAccess;\n    return;\n  }\n  parseIdentifier();\n  // export {type foo as bar}\n  state.tokens[state.tokens.length - 3].identifierRole = IdentifierRole.ExportAccess;\n  state.tokens[state.tokens.length - 4].isType = true;\n  state.tokens[state.tokens.length - 3].isType = true;\n  state.tokens[state.tokens.length - 2].isType = true;\n  state.tokens[state.tokens.length - 1].isType = true;\n}\nexport function tsTryParseExportDefaultExpression() {\n  if (isContextual(ContextualKeyword._abstract) && lookaheadType() === tt._class) {\n    state.type = tt._abstract;\n    next(); // Skip \"abstract\"\n    parseClass(true, true);\n    return true;\n  }\n  if (isContextual(ContextualKeyword._interface)) {\n    // Make sure \"export default\" are considered type tokens so the whole thing is removed.\n    const oldIsType = pushTypeContext(2);\n    tsParseDeclaration(ContextualKeyword._interface, true);\n    popTypeContext(oldIsType);\n    return true;\n  }\n  return false;\n}\nexport function tsTryParseStatementContent() {\n  if (state.type === tt._const) {\n    const ahead = lookaheadTypeAndKeyword();\n    if (ahead.type === tt.name && ahead.contextualKeyword === ContextualKeyword._enum) {\n      expect(tt._const);\n      expectContextual(ContextualKeyword._enum);\n      state.tokens[state.tokens.length - 1].type = tt._enum;\n      tsParseEnumDeclaration();\n      return true;\n    }\n  }\n  return false;\n}\nexport function tsTryParseClassMemberWithIsStatic(isStatic) {\n  const memberStartIndexAfterStatic = state.tokens.length;\n  tsParseModifiers([ContextualKeyword._abstract, ContextualKeyword._readonly, ContextualKeyword._declare, ContextualKeyword._static, ContextualKeyword._override]);\n  const modifiersEndIndex = state.tokens.length;\n  const found = tsTryParseIndexSignature();\n  if (found) {\n    // Index signatures are type declarations, so set the modifier tokens as\n    // type tokens. Most tokens could be assumed to be type tokens, but `static`\n    // is ambiguous unless we set it explicitly here.\n    const memberStartIndex = isStatic ? memberStartIndexAfterStatic - 1 : memberStartIndexAfterStatic;\n    for (let i = memberStartIndex; i < modifiersEndIndex; i++) {\n      state.tokens[i].isType = true;\n    }\n    return true;\n  }\n  return false;\n}\n\n// Note: The reason we do this in `parseIdentifierStatement` and not `parseStatement`\n// is that e.g. `type()` is valid JS, so we must try parsing that first.\n// If it's really a type, we will parse `type` as the statement, and can correct it here\n// by parsing the rest.\nexport function tsParseIdentifierStatement(contextualKeyword) {\n  const matched = tsParseExpressionStatement(contextualKeyword);\n  if (!matched) {\n    semicolon();\n  }\n}\nexport function tsParseExportDeclaration() {\n  // \"export declare\" is equivalent to just \"export\".\n  const isDeclare = eatContextual(ContextualKeyword._declare);\n  if (isDeclare) {\n    state.tokens[state.tokens.length - 1].type = tt._declare;\n  }\n  let matchedDeclaration = false;\n  if (match(tt.name)) {\n    if (isDeclare) {\n      const oldIsType = pushTypeContext(2);\n      matchedDeclaration = tsTryParseExportDeclaration();\n      popTypeContext(oldIsType);\n    } else {\n      matchedDeclaration = tsTryParseExportDeclaration();\n    }\n  }\n  if (!matchedDeclaration) {\n    if (isDeclare) {\n      const oldIsType = pushTypeContext(2);\n      parseStatement(true);\n      popTypeContext(oldIsType);\n    } else {\n      parseStatement(true);\n    }\n  }\n}\nexport function tsAfterParseClassSuper(hasSuper) {\n  if (hasSuper && (match(tt.lessThan) || match(tt.bitShiftL))) {\n    tsParseTypeArgumentsWithPossibleBitshift();\n  }\n  if (eatContextual(ContextualKeyword._implements)) {\n    state.tokens[state.tokens.length - 1].type = tt._implements;\n    const oldIsType = pushTypeContext(1);\n    tsParseHeritageClause();\n    popTypeContext(oldIsType);\n  }\n}\nexport function tsStartParseObjPropValue() {\n  tsTryParseTypeParameters();\n}\nexport function tsStartParseFunctionParams() {\n  tsTryParseTypeParameters();\n}\n\n// `let x: number;`\nexport function tsAfterParseVarHead() {\n  const oldIsType = pushTypeContext(0);\n  if (!hasPrecedingLineBreak()) {\n    eat(tt.bang);\n  }\n  tsTryParseTypeAnnotation();\n  popTypeContext(oldIsType);\n}\n\n// parse the return type of an async arrow function - let foo = (async (): number => {});\nexport function tsStartParseAsyncArrowFromCallExpression() {\n  if (match(tt.colon)) {\n    tsParseTypeAnnotation();\n  }\n}\n\n// Returns true if the expression was an arrow function.\nexport function tsParseMaybeAssign(noIn, isWithinParens) {\n  // Note: When the JSX plugin is on, type assertions (`<T> x`) aren't valid syntax.\n  if (isJSXEnabled) {\n    return tsParseMaybeAssignWithJSX(noIn, isWithinParens);\n  } else {\n    return tsParseMaybeAssignWithoutJSX(noIn, isWithinParens);\n  }\n}\nexport function tsParseMaybeAssignWithJSX(noIn, isWithinParens) {\n  if (!match(tt.lessThan)) {\n    return baseParseMaybeAssign(noIn, isWithinParens);\n  }\n\n  // Prefer to parse JSX if possible. But may be an arrow fn.\n  const snapshot = state.snapshot();\n  let wasArrow = baseParseMaybeAssign(noIn, isWithinParens);\n  if (state.error) {\n    state.restoreFromSnapshot(snapshot);\n  } else {\n    return wasArrow;\n  }\n\n  // Otherwise, try as type-parameterized arrow function.\n  state.type = tt.typeParameterStart;\n  // This is similar to TypeScript's `tryParseParenthesizedArrowFunctionExpression`.\n  tsParseTypeParameters();\n  wasArrow = baseParseMaybeAssign(noIn, isWithinParens);\n  if (!wasArrow) {\n    unexpected();\n  }\n  return wasArrow;\n}\nexport function tsParseMaybeAssignWithoutJSX(noIn, isWithinParens) {\n  if (!match(tt.lessThan)) {\n    return baseParseMaybeAssign(noIn, isWithinParens);\n  }\n  const snapshot = state.snapshot();\n  // This is similar to TypeScript's `tryParseParenthesizedArrowFunctionExpression`.\n  tsParseTypeParameters();\n  const wasArrow = baseParseMaybeAssign(noIn, isWithinParens);\n  if (!wasArrow) {\n    unexpected();\n  }\n  if (state.error) {\n    state.restoreFromSnapshot(snapshot);\n  } else {\n    return wasArrow;\n  }\n\n  // Try parsing a type cast instead of an arrow function.\n  // This will start with a type assertion (via parseMaybeUnary).\n  // But don't directly call `tsParseTypeAssertion` because we want to handle any binary after it.\n  return baseParseMaybeAssign(noIn, isWithinParens);\n}\nexport function tsParseArrow() {\n  if (match(tt.colon)) {\n    // This is different from how the TS parser does it.\n    // TS uses lookahead. Babylon parses it as a parenthesized expression and converts.\n    const snapshot = state.snapshot();\n    tsParseTypeOrTypePredicateAnnotation(tt.colon);\n    if (canInsertSemicolon()) unexpected();\n    if (!match(tt.arrow)) unexpected();\n    if (state.error) {\n      state.restoreFromSnapshot(snapshot);\n    }\n  }\n  return eat(tt.arrow);\n}\n\n// Allow type annotations inside of a parameter list.\nexport function tsParseAssignableListItemTypes() {\n  const oldIsType = pushTypeContext(0);\n  eat(tt.question);\n  tsTryParseTypeAnnotation();\n  popTypeContext(oldIsType);\n}\nexport function tsParseMaybeDecoratorArguments() {\n  if (match(tt.lessThan) || match(tt.bitShiftL)) {\n    tsParseTypeArgumentsWithPossibleBitshift();\n  }\n  baseParseMaybeDecoratorArguments();\n}","map":{"version":3,"names":["eat","finishToken","IdentifierRole","lookaheadType","lookaheadTypeAndKeyword","match","next","nextTemplateToken","popTypeContext","pushTypeContext","rescan_gt","ContextualKeyword","TokenType","tt","isJSXEnabled","state","atPossibleAsync","baseParseMaybeAssign","baseParseSubscript","parseCallExpressionArguments","parseExprAtom","parseExpression","parseFunctionBody","parseIdentifier","parseLiteral","parseMaybeAssign","parseMaybeUnary","parsePropertyName","parseTemplate","parseBindingIdentifier","parseBindingList","parseImportedIdentifier","baseParseMaybeDecoratorArguments","parseBlockBody","parseClass","parseFunction","parseFunctionParams","parseStatement","parseVarStatement","canInsertSemicolon","eatContextual","expect","expectContextual","hasPrecedingLineBreak","isContextual","isLineTerminator","isLookaheadContextual","semicolon","unexpected","nextJSXTagToken","tsIsIdentifier","name","isLiteralPropertyName","Boolean","type","IS_KEYWORD","string","num","bigint","decimal","tsNextTokenCanFollowModifier","snapshot","canFollowModifier","bracketL","braceL","star","ellipsis","hash","restoreFromSnapshot","tsParseModifiers","allowedModifiers","modifier","tsParseModifier","contextualKeyword","indexOf","_readonly","tokens","length","_abstract","_static","_public","_private","_protected","_override","_declare","tsParseEntityName","dot","tsParseTypeReference","lessThan","tsParseTypeArguments","tsParseThisTypePredicate","tsParseTypeAnnotation","tsParseThisTypeNode","tsParseTypeQuery","_typeof","_import","tsParseImportType","parenL","parenR","tsParseTypeParameter","_const","hadIn","_in","hadOut","_out","_extends","tsParseType","eq","tsTryParseTypeParameters","tsParseTypeParameters","oldIsType","typeParameterStart","greaterThan","error","comma","tsFillSignature","returnToken","returnTokenRequired","arrow","scopeDepth","tsParseBindingListForSignature","tsParseTypeOrTypePredicateAnnotation","isBlockScope","tsParseTypeMemberSemicolon","tsParseSignatureMember","colon","tsIsUnambiguouslyIndexSignature","isIndexSignature","tsTryParseIndexSignature","bracketR","tsTryParseTypeAnnotation","tsParsePropertyOrMethodSignature","isReadonly","question","tsParseTypeMember","_new","readonly","found","_get","_set","tsParseTypeLiteral","tsParseObjectTypeMembers","braceR","tsLookaheadIsStartOfMappedType","isStartOfMappedType","tsIsStartOfMappedType","plus","minus","tsParseMappedTypeParameter","tsParseMappedType","_as","tsTryParseType","tsParseTupleType","tsParseTupleElementType","tsParseParenthesizedType","tsParseTemplateLiteralType","backQuote","dollarBraceL","FunctionType","TSFunctionType","TSConstructorType","TSAbstractConstructorType","tsParseFunctionOrConstructorType","oldInDisallowConditionalTypesContext","inDisallowConditionalTypesContext","tsParseNonArrayType","_void","_null","_true","_false","_this","_is","tsParseArrayTypeOrHigher","tsParseInferType","_infer","tsParseTypeOperatorOrHigher","_keyof","_unique","tsParseIntersectionTypeOrHigher","bitwiseAND","tsParseUnionTypeOrHigher","bitwiseOR","tsIsStartOfFunctionType","tsLookaheadIsUnambiguouslyStartOfFunctionType","tsSkipParameterStart","depth","isUnambiguouslyStartOfFunctionType","tsIsUnambiguouslyStartOfFunctionType","finishedReturn","tsParseTypePredicateOrAssertsPrefix","tsTryParseTypeOrTypePredicateAnnotation","_asserts","tsParseNonConditionalType","isAbstractConstructorSignature","tsParseTypeAssertion","tsTryParseJSXTypeArgument","jsxTagStart","tsParseHeritageClause","tsParseExpressionWithTypeArguments","tsParseInterfaceDeclaration","tsParseTypeAliasDeclaration","tsParseEnumMember","eqIndex","rhsEndIndex","tsParseEnumDeclaration","tsParseModuleBlock","tsParseModuleOrNamespaceDeclaration","tsParseAmbientExternalModuleDeclaration","_global","tsParseImportEqualsDeclaration","tsParseModuleReference","tsIsExternalModuleReference","_require","tsParseExternalModuleReference","tsTryParseDeclare","_function","functionStart","start","_class","_enum","_var","_let","matched","tsParseDeclaration","tsTryParseExportDeclaration","tsParseExpressionStatement","declareTokenIndex","isBeforeToken","tsCheckLineTerminator","_interface","_module","_namespace","_type","tsTryParseGenericAsyncArrowFunction","tsParseTypeArgumentsWithPossibleBitshift","bitShiftL","pos","isType","tsIsDeclarationStart","tsParseFunctionBodyAndFinish","funcContextId","i","_default","_export","tsParseSubscript","startTokenIndex","noCalls","stopState","bang","nonNullAssertion","asyncArrowFn","subscriptStartIndex","IS_EXPRESSION_START","questionDot","isOptionalChainStart","tsTryParseExport","nextType","tsParseImportSpecifier","identifierRole","ImportDeclaration","ImportAccess","tsParseExportSpecifier","ExportAccess","tsTryParseExportDefaultExpression","tsTryParseStatementContent","ahead","tsTryParseClassMemberWithIsStatic","isStatic","memberStartIndexAfterStatic","modifiersEndIndex","memberStartIndex","tsParseIdentifierStatement","tsParseExportDeclaration","isDeclare","matchedDeclaration","tsAfterParseClassSuper","hasSuper","_implements","tsStartParseObjPropValue","tsStartParseFunctionParams","tsAfterParseVarHead","tsStartParseAsyncArrowFromCallExpression","tsParseMaybeAssign","noIn","isWithinParens","tsParseMaybeAssignWithJSX","tsParseMaybeAssignWithoutJSX","wasArrow","tsParseArrow","tsParseAssignableListItemTypes","tsParseMaybeDecoratorArguments"],"sources":["C:/Users/user/Desktop/000newport/node_modules/sucrase/dist/esm/parser/plugins/typescript.js"],"sourcesContent":["import {\n  eat,\n  finishToken,\n  IdentifierRole,\n  lookaheadType,\n  lookaheadTypeAndKeyword,\n  match,\n  next,\n  nextTemplateToken,\n  popTypeContext,\n  pushTypeContext,\n  rescan_gt,\n} from \"../tokenizer/index\";\nimport {ContextualKeyword} from \"../tokenizer/keywords\";\nimport {TokenType, TokenType as tt} from \"../tokenizer/types\";\nimport {isJSXEnabled, state} from \"../traverser/base\";\nimport {\n  atPossibleAsync,\n  baseParseMaybeAssign,\n  baseParseSubscript,\n  parseCallExpressionArguments,\n  parseExprAtom,\n  parseExpression,\n  parseFunctionBody,\n  parseIdentifier,\n  parseLiteral,\n  parseMaybeAssign,\n  parseMaybeUnary,\n  parsePropertyName,\n  parseTemplate,\n\n} from \"../traverser/expression\";\nimport {parseBindingIdentifier, parseBindingList, parseImportedIdentifier} from \"../traverser/lval\";\nimport {\n  baseParseMaybeDecoratorArguments,\n  parseBlockBody,\n  parseClass,\n  parseFunction,\n  parseFunctionParams,\n  parseStatement,\n  parseVarStatement,\n} from \"../traverser/statement\";\nimport {\n  canInsertSemicolon,\n  eatContextual,\n  expect,\n  expectContextual,\n  hasPrecedingLineBreak,\n  isContextual,\n  isLineTerminator,\n  isLookaheadContextual,\n  semicolon,\n  unexpected,\n} from \"../traverser/util\";\nimport {nextJSXTagToken} from \"./jsx\";\n\nfunction tsIsIdentifier() {\n  // TODO: actually a bit more complex in TypeScript, but shouldn't matter.\n  // See https://github.com/Microsoft/TypeScript/issues/15008\n  return match(tt.name);\n}\n\nfunction isLiteralPropertyName() {\n  return (\n    match(tt.name) ||\n    Boolean(state.type & TokenType.IS_KEYWORD) ||\n    match(tt.string) ||\n    match(tt.num) ||\n    match(tt.bigint) ||\n    match(tt.decimal)\n  );\n}\n\nfunction tsNextTokenCanFollowModifier() {\n  // Note: TypeScript's implementation is much more complicated because\n  // more things are considered modifiers there.\n  // This implementation only handles modifiers not handled by babylon itself. And \"static\".\n  // TODO: Would be nice to avoid lookahead. Want a hasLineBreakUpNext() method...\n  const snapshot = state.snapshot();\n\n  next();\n  const canFollowModifier =\n    (match(tt.bracketL) ||\n      match(tt.braceL) ||\n      match(tt.star) ||\n      match(tt.ellipsis) ||\n      match(tt.hash) ||\n      isLiteralPropertyName()) &&\n    !hasPrecedingLineBreak();\n\n  if (canFollowModifier) {\n    return true;\n  } else {\n    state.restoreFromSnapshot(snapshot);\n    return false;\n  }\n}\n\nexport function tsParseModifiers(allowedModifiers) {\n  while (true) {\n    const modifier = tsParseModifier(allowedModifiers);\n    if (modifier === null) {\n      break;\n    }\n  }\n}\n\n/** Parses a modifier matching one the given modifier names. */\nexport function tsParseModifier(\n  allowedModifiers,\n) {\n  if (!match(tt.name)) {\n    return null;\n  }\n\n  const modifier = state.contextualKeyword;\n  if (allowedModifiers.indexOf(modifier) !== -1 && tsNextTokenCanFollowModifier()) {\n    switch (modifier) {\n      case ContextualKeyword._readonly:\n        state.tokens[state.tokens.length - 1].type = tt._readonly;\n        break;\n      case ContextualKeyword._abstract:\n        state.tokens[state.tokens.length - 1].type = tt._abstract;\n        break;\n      case ContextualKeyword._static:\n        state.tokens[state.tokens.length - 1].type = tt._static;\n        break;\n      case ContextualKeyword._public:\n        state.tokens[state.tokens.length - 1].type = tt._public;\n        break;\n      case ContextualKeyword._private:\n        state.tokens[state.tokens.length - 1].type = tt._private;\n        break;\n      case ContextualKeyword._protected:\n        state.tokens[state.tokens.length - 1].type = tt._protected;\n        break;\n      case ContextualKeyword._override:\n        state.tokens[state.tokens.length - 1].type = tt._override;\n        break;\n      case ContextualKeyword._declare:\n        state.tokens[state.tokens.length - 1].type = tt._declare;\n        break;\n      default:\n        break;\n    }\n    return modifier;\n  }\n  return null;\n}\n\nfunction tsParseEntityName() {\n  parseIdentifier();\n  while (eat(tt.dot)) {\n    parseIdentifier();\n  }\n}\n\nfunction tsParseTypeReference() {\n  tsParseEntityName();\n  if (!hasPrecedingLineBreak() && match(tt.lessThan)) {\n    tsParseTypeArguments();\n  }\n}\n\nfunction tsParseThisTypePredicate() {\n  next();\n  tsParseTypeAnnotation();\n}\n\nfunction tsParseThisTypeNode() {\n  next();\n}\n\nfunction tsParseTypeQuery() {\n  expect(tt._typeof);\n  if (match(tt._import)) {\n    tsParseImportType();\n  } else {\n    tsParseEntityName();\n  }\n  if (!hasPrecedingLineBreak() && match(tt.lessThan)) {\n    tsParseTypeArguments();\n  }\n}\n\nfunction tsParseImportType() {\n  expect(tt._import);\n  expect(tt.parenL);\n  expect(tt.string);\n  expect(tt.parenR);\n  if (eat(tt.dot)) {\n    tsParseEntityName();\n  }\n  if (match(tt.lessThan)) {\n    tsParseTypeArguments();\n  }\n}\n\nfunction tsParseTypeParameter() {\n  eat(tt._const);\n  const hadIn = eat(tt._in);\n  const hadOut = eatContextual(ContextualKeyword._out);\n  eat(tt._const);\n  if ((hadIn || hadOut) && !match(tt.name)) {\n    // The \"in\" or \"out\" keyword must have actually been the type parameter\n    // name, so set it as the name.\n    state.tokens[state.tokens.length - 1].type = tt.name;\n  } else {\n    parseIdentifier();\n  }\n\n  if (eat(tt._extends)) {\n    tsParseType();\n  }\n  if (eat(tt.eq)) {\n    tsParseType();\n  }\n}\n\nexport function tsTryParseTypeParameters() {\n  if (match(tt.lessThan)) {\n    tsParseTypeParameters();\n  }\n}\n\nfunction tsParseTypeParameters() {\n  const oldIsType = pushTypeContext(0);\n  if (match(tt.lessThan) || match(tt.typeParameterStart)) {\n    next();\n  } else {\n    unexpected();\n  }\n\n  while (!eat(tt.greaterThan) && !state.error) {\n    tsParseTypeParameter();\n    eat(tt.comma);\n  }\n  popTypeContext(oldIsType);\n}\n\n// Note: In TypeScript implementation we must provide `yieldContext` and `awaitContext`,\n// but here it's always false, because this is only used for types.\nfunction tsFillSignature(returnToken) {\n  // Arrow fns *must* have return token (`=>`). Normal functions can omit it.\n  const returnTokenRequired = returnToken === tt.arrow;\n  tsTryParseTypeParameters();\n  expect(tt.parenL);\n  // Create a scope even though we're doing type parsing so we don't accidentally\n  // treat params as top-level bindings.\n  state.scopeDepth++;\n  tsParseBindingListForSignature(false /* isBlockScope */);\n  state.scopeDepth--;\n  if (returnTokenRequired) {\n    tsParseTypeOrTypePredicateAnnotation(returnToken);\n  } else if (match(returnToken)) {\n    tsParseTypeOrTypePredicateAnnotation(returnToken);\n  }\n}\n\nfunction tsParseBindingListForSignature(isBlockScope) {\n  parseBindingList(tt.parenR, isBlockScope);\n}\n\nfunction tsParseTypeMemberSemicolon() {\n  if (!eat(tt.comma)) {\n    semicolon();\n  }\n}\n\nfunction tsParseSignatureMember() {\n  tsFillSignature(tt.colon);\n  tsParseTypeMemberSemicolon();\n}\n\nfunction tsIsUnambiguouslyIndexSignature() {\n  const snapshot = state.snapshot();\n  next(); // Skip '{'\n  const isIndexSignature = eat(tt.name) && match(tt.colon);\n  state.restoreFromSnapshot(snapshot);\n  return isIndexSignature;\n}\n\nfunction tsTryParseIndexSignature() {\n  if (!(match(tt.bracketL) && tsIsUnambiguouslyIndexSignature())) {\n    return false;\n  }\n\n  const oldIsType = pushTypeContext(0);\n\n  expect(tt.bracketL);\n  parseIdentifier();\n  tsParseTypeAnnotation();\n  expect(tt.bracketR);\n\n  tsTryParseTypeAnnotation();\n  tsParseTypeMemberSemicolon();\n\n  popTypeContext(oldIsType);\n  return true;\n}\n\nfunction tsParsePropertyOrMethodSignature(isReadonly) {\n  eat(tt.question);\n\n  if (!isReadonly && (match(tt.parenL) || match(tt.lessThan))) {\n    tsFillSignature(tt.colon);\n    tsParseTypeMemberSemicolon();\n  } else {\n    tsTryParseTypeAnnotation();\n    tsParseTypeMemberSemicolon();\n  }\n}\n\nfunction tsParseTypeMember() {\n  if (match(tt.parenL) || match(tt.lessThan)) {\n    // call signature\n    tsParseSignatureMember();\n    return;\n  }\n  if (match(tt._new)) {\n    next();\n    if (match(tt.parenL) || match(tt.lessThan)) {\n      // constructor signature\n      tsParseSignatureMember();\n    } else {\n      tsParsePropertyOrMethodSignature(false);\n    }\n    return;\n  }\n  const readonly = !!tsParseModifier([ContextualKeyword._readonly]);\n\n  const found = tsTryParseIndexSignature();\n  if (found) {\n    return;\n  }\n  if (\n    (isContextual(ContextualKeyword._get) || isContextual(ContextualKeyword._set)) &&\n    tsNextTokenCanFollowModifier()\n  ) {\n    // This is a getter/setter on a type. The tsNextTokenCanFollowModifier\n    // function already called next() for us, so continue parsing the name.\n  }\n  parsePropertyName(-1 /* Types don't need context IDs. */);\n  tsParsePropertyOrMethodSignature(readonly);\n}\n\nfunction tsParseTypeLiteral() {\n  tsParseObjectTypeMembers();\n}\n\nfunction tsParseObjectTypeMembers() {\n  expect(tt.braceL);\n  while (!eat(tt.braceR) && !state.error) {\n    tsParseTypeMember();\n  }\n}\n\nfunction tsLookaheadIsStartOfMappedType() {\n  const snapshot = state.snapshot();\n  const isStartOfMappedType = tsIsStartOfMappedType();\n  state.restoreFromSnapshot(snapshot);\n  return isStartOfMappedType;\n}\n\nfunction tsIsStartOfMappedType() {\n  next();\n  if (eat(tt.plus) || eat(tt.minus)) {\n    return isContextual(ContextualKeyword._readonly);\n  }\n  if (isContextual(ContextualKeyword._readonly)) {\n    next();\n  }\n  if (!match(tt.bracketL)) {\n    return false;\n  }\n  next();\n  if (!tsIsIdentifier()) {\n    return false;\n  }\n  next();\n  return match(tt._in);\n}\n\nfunction tsParseMappedTypeParameter() {\n  parseIdentifier();\n  expect(tt._in);\n  tsParseType();\n}\n\nfunction tsParseMappedType() {\n  expect(tt.braceL);\n  if (match(tt.plus) || match(tt.minus)) {\n    next();\n    expectContextual(ContextualKeyword._readonly);\n  } else {\n    eatContextual(ContextualKeyword._readonly);\n  }\n  expect(tt.bracketL);\n  tsParseMappedTypeParameter();\n  if (eatContextual(ContextualKeyword._as)) {\n    tsParseType();\n  }\n  expect(tt.bracketR);\n  if (match(tt.plus) || match(tt.minus)) {\n    next();\n    expect(tt.question);\n  } else {\n    eat(tt.question);\n  }\n  tsTryParseType();\n  semicolon();\n  expect(tt.braceR);\n}\n\nfunction tsParseTupleType() {\n  expect(tt.bracketL);\n  while (!eat(tt.bracketR) && !state.error) {\n    // Do not validate presence of either none or only labeled elements\n    tsParseTupleElementType();\n    eat(tt.comma);\n  }\n}\n\nfunction tsParseTupleElementType() {\n  // parses `...TsType[]`\n  if (eat(tt.ellipsis)) {\n    tsParseType();\n  } else {\n    // parses `TsType?`\n    tsParseType();\n    eat(tt.question);\n  }\n\n  // The type we parsed above was actually a label\n  if (eat(tt.colon)) {\n    // Labeled tuple types must affix the label with `...` or `?`, so no need to handle those here\n    tsParseType();\n  }\n}\n\nfunction tsParseParenthesizedType() {\n  expect(tt.parenL);\n  tsParseType();\n  expect(tt.parenR);\n}\n\nfunction tsParseTemplateLiteralType() {\n  // Finish `, read quasi\n  nextTemplateToken();\n  // Finish quasi, read ${\n  nextTemplateToken();\n  while (!match(tt.backQuote) && !state.error) {\n    expect(tt.dollarBraceL);\n    tsParseType();\n    // Finish }, read quasi\n    nextTemplateToken();\n    // Finish quasi, read either ${ or `\n    nextTemplateToken();\n  }\n  next();\n}\n\nvar FunctionType; (function (FunctionType) {\n  const TSFunctionType = 0; FunctionType[FunctionType[\"TSFunctionType\"] = TSFunctionType] = \"TSFunctionType\";\n  const TSConstructorType = TSFunctionType + 1; FunctionType[FunctionType[\"TSConstructorType\"] = TSConstructorType] = \"TSConstructorType\";\n  const TSAbstractConstructorType = TSConstructorType + 1; FunctionType[FunctionType[\"TSAbstractConstructorType\"] = TSAbstractConstructorType] = \"TSAbstractConstructorType\";\n})(FunctionType || (FunctionType = {}));\n\nfunction tsParseFunctionOrConstructorType(type) {\n  if (type === FunctionType.TSAbstractConstructorType) {\n    expectContextual(ContextualKeyword._abstract);\n  }\n  if (type === FunctionType.TSConstructorType || type === FunctionType.TSAbstractConstructorType) {\n    expect(tt._new);\n  }\n  const oldInDisallowConditionalTypesContext = state.inDisallowConditionalTypesContext;\n  state.inDisallowConditionalTypesContext = false;\n  tsFillSignature(tt.arrow);\n  state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext;\n}\n\nfunction tsParseNonArrayType() {\n  switch (state.type) {\n    case tt.name:\n      tsParseTypeReference();\n      return;\n    case tt._void:\n    case tt._null:\n      next();\n      return;\n    case tt.string:\n    case tt.num:\n    case tt.bigint:\n    case tt.decimal:\n    case tt._true:\n    case tt._false:\n      parseLiteral();\n      return;\n    case tt.minus:\n      next();\n      parseLiteral();\n      return;\n    case tt._this: {\n      tsParseThisTypeNode();\n      if (isContextual(ContextualKeyword._is) && !hasPrecedingLineBreak()) {\n        tsParseThisTypePredicate();\n      }\n      return;\n    }\n    case tt._typeof:\n      tsParseTypeQuery();\n      return;\n    case tt._import:\n      tsParseImportType();\n      return;\n    case tt.braceL:\n      if (tsLookaheadIsStartOfMappedType()) {\n        tsParseMappedType();\n      } else {\n        tsParseTypeLiteral();\n      }\n      return;\n    case tt.bracketL:\n      tsParseTupleType();\n      return;\n    case tt.parenL:\n      tsParseParenthesizedType();\n      return;\n    case tt.backQuote:\n      tsParseTemplateLiteralType();\n      return;\n    default:\n      if (state.type & TokenType.IS_KEYWORD) {\n        next();\n        state.tokens[state.tokens.length - 1].type = tt.name;\n        return;\n      }\n      break;\n  }\n\n  unexpected();\n}\n\nfunction tsParseArrayTypeOrHigher() {\n  tsParseNonArrayType();\n  while (!hasPrecedingLineBreak() && eat(tt.bracketL)) {\n    if (!eat(tt.bracketR)) {\n      // If we hit ] immediately, this is an array type, otherwise it's an indexed access type.\n      tsParseType();\n      expect(tt.bracketR);\n    }\n  }\n}\n\nfunction tsParseInferType() {\n  expectContextual(ContextualKeyword._infer);\n  parseIdentifier();\n  if (match(tt._extends)) {\n    // Infer type constraints introduce an ambiguity about whether the \"extends\"\n    // is a constraint for this infer type or is another conditional type.\n    const snapshot = state.snapshot();\n    expect(tt._extends);\n    const oldInDisallowConditionalTypesContext = state.inDisallowConditionalTypesContext;\n    state.inDisallowConditionalTypesContext = true;\n    tsParseType();\n    state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext;\n    if (state.error || (!state.inDisallowConditionalTypesContext && match(tt.question))) {\n      state.restoreFromSnapshot(snapshot);\n    }\n  }\n}\n\nfunction tsParseTypeOperatorOrHigher() {\n  if (\n    isContextual(ContextualKeyword._keyof) ||\n    isContextual(ContextualKeyword._unique) ||\n    isContextual(ContextualKeyword._readonly)\n  ) {\n    next();\n    tsParseTypeOperatorOrHigher();\n  } else if (isContextual(ContextualKeyword._infer)) {\n    tsParseInferType();\n  } else {\n    const oldInDisallowConditionalTypesContext = state.inDisallowConditionalTypesContext;\n    state.inDisallowConditionalTypesContext = false;\n    tsParseArrayTypeOrHigher();\n    state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext;\n  }\n}\n\nfunction tsParseIntersectionTypeOrHigher() {\n  eat(tt.bitwiseAND);\n  tsParseTypeOperatorOrHigher();\n  if (match(tt.bitwiseAND)) {\n    while (eat(tt.bitwiseAND)) {\n      tsParseTypeOperatorOrHigher();\n    }\n  }\n}\n\nfunction tsParseUnionTypeOrHigher() {\n  eat(tt.bitwiseOR);\n  tsParseIntersectionTypeOrHigher();\n  if (match(tt.bitwiseOR)) {\n    while (eat(tt.bitwiseOR)) {\n      tsParseIntersectionTypeOrHigher();\n    }\n  }\n}\n\nfunction tsIsStartOfFunctionType() {\n  if (match(tt.lessThan)) {\n    return true;\n  }\n  return match(tt.parenL) && tsLookaheadIsUnambiguouslyStartOfFunctionType();\n}\n\nfunction tsSkipParameterStart() {\n  if (match(tt.name) || match(tt._this)) {\n    next();\n    return true;\n  }\n  // If this is a possible array/object destructure, walk to the matching bracket/brace.\n  // The next token after will tell us definitively whether this is a function param.\n  if (match(tt.braceL) || match(tt.bracketL)) {\n    let depth = 1;\n    next();\n    while (depth > 0 && !state.error) {\n      if (match(tt.braceL) || match(tt.bracketL)) {\n        depth++;\n      } else if (match(tt.braceR) || match(tt.bracketR)) {\n        depth--;\n      }\n      next();\n    }\n    return true;\n  }\n  return false;\n}\n\nfunction tsLookaheadIsUnambiguouslyStartOfFunctionType() {\n  const snapshot = state.snapshot();\n  const isUnambiguouslyStartOfFunctionType = tsIsUnambiguouslyStartOfFunctionType();\n  state.restoreFromSnapshot(snapshot);\n  return isUnambiguouslyStartOfFunctionType;\n}\n\nfunction tsIsUnambiguouslyStartOfFunctionType() {\n  next();\n  if (match(tt.parenR) || match(tt.ellipsis)) {\n    // ( )\n    // ( ...\n    return true;\n  }\n  if (tsSkipParameterStart()) {\n    if (match(tt.colon) || match(tt.comma) || match(tt.question) || match(tt.eq)) {\n      // ( xxx :\n      // ( xxx ,\n      // ( xxx ?\n      // ( xxx =\n      return true;\n    }\n    if (match(tt.parenR)) {\n      next();\n      if (match(tt.arrow)) {\n        // ( xxx ) =>\n        return true;\n      }\n    }\n  }\n  return false;\n}\n\nfunction tsParseTypeOrTypePredicateAnnotation(returnToken) {\n  const oldIsType = pushTypeContext(0);\n  expect(returnToken);\n  const finishedReturn = tsParseTypePredicateOrAssertsPrefix();\n  if (!finishedReturn) {\n    tsParseType();\n  }\n  popTypeContext(oldIsType);\n}\n\nfunction tsTryParseTypeOrTypePredicateAnnotation() {\n  if (match(tt.colon)) {\n    tsParseTypeOrTypePredicateAnnotation(tt.colon);\n  }\n}\n\nexport function tsTryParseTypeAnnotation() {\n  if (match(tt.colon)) {\n    tsParseTypeAnnotation();\n  }\n}\n\nfunction tsTryParseType() {\n  if (eat(tt.colon)) {\n    tsParseType();\n  }\n}\n\n/**\n * Detect a few special return syntax cases: `x is T`, `asserts x`, `asserts x is T`,\n * `asserts this is T`.\n *\n * Returns true if we parsed the return type, false if there's still a type to be parsed.\n */\nfunction tsParseTypePredicateOrAssertsPrefix() {\n  const snapshot = state.snapshot();\n  if (isContextual(ContextualKeyword._asserts)) {\n    // Normally this is `asserts x is T`, but at this point, it might be `asserts is T` (a user-\n    // defined type guard on the `asserts` variable) or just a type called `asserts`.\n    next();\n    if (eatContextual(ContextualKeyword._is)) {\n      // If we see `asserts is`, then this must be of the form `asserts is T`, since\n      // `asserts is is T` isn't valid.\n      tsParseType();\n      return true;\n    } else if (tsIsIdentifier() || match(tt._this)) {\n      next();\n      if (eatContextual(ContextualKeyword._is)) {\n        // If we see `is`, then this is `asserts x is T`. Otherwise, it's `asserts x`.\n        tsParseType();\n      }\n      return true;\n    } else {\n      // Regular type, so bail out and start type parsing from scratch.\n      state.restoreFromSnapshot(snapshot);\n      return false;\n    }\n  } else if (tsIsIdentifier() || match(tt._this)) {\n    // This is a regular identifier, which may or may not have \"is\" after it.\n    next();\n    if (isContextual(ContextualKeyword._is) && !hasPrecedingLineBreak()) {\n      next();\n      tsParseType();\n      return true;\n    } else {\n      // Regular type, so bail out and start type parsing from scratch.\n      state.restoreFromSnapshot(snapshot);\n      return false;\n    }\n  }\n  return false;\n}\n\nexport function tsParseTypeAnnotation() {\n  const oldIsType = pushTypeContext(0);\n  expect(tt.colon);\n  tsParseType();\n  popTypeContext(oldIsType);\n}\n\nexport function tsParseType() {\n  tsParseNonConditionalType();\n  if (state.inDisallowConditionalTypesContext || hasPrecedingLineBreak() || !eat(tt._extends)) {\n    return;\n  }\n  // extends type\n  const oldInDisallowConditionalTypesContext = state.inDisallowConditionalTypesContext;\n  state.inDisallowConditionalTypesContext = true;\n  tsParseNonConditionalType();\n  state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext;\n\n  expect(tt.question);\n  // true type\n  tsParseType();\n  expect(tt.colon);\n  // false type\n  tsParseType();\n}\n\nfunction isAbstractConstructorSignature() {\n  return isContextual(ContextualKeyword._abstract) && lookaheadType() === tt._new;\n}\n\nexport function tsParseNonConditionalType() {\n  if (tsIsStartOfFunctionType()) {\n    tsParseFunctionOrConstructorType(FunctionType.TSFunctionType);\n    return;\n  }\n  if (match(tt._new)) {\n    // As in `new () => Date`\n    tsParseFunctionOrConstructorType(FunctionType.TSConstructorType);\n    return;\n  } else if (isAbstractConstructorSignature()) {\n    // As in `abstract new () => Date`\n    tsParseFunctionOrConstructorType(FunctionType.TSAbstractConstructorType);\n    return;\n  }\n  tsParseUnionTypeOrHigher();\n}\n\nexport function tsParseTypeAssertion() {\n  const oldIsType = pushTypeContext(1);\n  tsParseType();\n  expect(tt.greaterThan);\n  popTypeContext(oldIsType);\n  parseMaybeUnary();\n}\n\nexport function tsTryParseJSXTypeArgument() {\n  if (eat(tt.jsxTagStart)) {\n    state.tokens[state.tokens.length - 1].type = tt.typeParameterStart;\n    const oldIsType = pushTypeContext(1);\n    while (!match(tt.greaterThan) && !state.error) {\n      tsParseType();\n      eat(tt.comma);\n    }\n    // Process >, but the one after needs to be parsed JSX-style.\n    nextJSXTagToken();\n    popTypeContext(oldIsType);\n  }\n}\n\nfunction tsParseHeritageClause() {\n  while (!match(tt.braceL) && !state.error) {\n    tsParseExpressionWithTypeArguments();\n    eat(tt.comma);\n  }\n}\n\nfunction tsParseExpressionWithTypeArguments() {\n  // Note: TS uses parseLeftHandSideExpressionOrHigher,\n  // then has grammar errors later if it's not an EntityName.\n  tsParseEntityName();\n  if (match(tt.lessThan)) {\n    tsParseTypeArguments();\n  }\n}\n\nfunction tsParseInterfaceDeclaration() {\n  parseBindingIdentifier(false);\n  tsTryParseTypeParameters();\n  if (eat(tt._extends)) {\n    tsParseHeritageClause();\n  }\n  tsParseObjectTypeMembers();\n}\n\nfunction tsParseTypeAliasDeclaration() {\n  parseBindingIdentifier(false);\n  tsTryParseTypeParameters();\n  expect(tt.eq);\n  tsParseType();\n  semicolon();\n}\n\nfunction tsParseEnumMember() {\n  // Computed property names are grammar errors in an enum, so accept just string literal or identifier.\n  if (match(tt.string)) {\n    parseLiteral();\n  } else {\n    parseIdentifier();\n  }\n  if (eat(tt.eq)) {\n    const eqIndex = state.tokens.length - 1;\n    parseMaybeAssign();\n    state.tokens[eqIndex].rhsEndIndex = state.tokens.length;\n  }\n}\n\nfunction tsParseEnumDeclaration() {\n  parseBindingIdentifier(false);\n  expect(tt.braceL);\n  while (!eat(tt.braceR) && !state.error) {\n    tsParseEnumMember();\n    eat(tt.comma);\n  }\n}\n\nfunction tsParseModuleBlock() {\n  expect(tt.braceL);\n  parseBlockBody(/* end */ tt.braceR);\n}\n\nfunction tsParseModuleOrNamespaceDeclaration() {\n  parseBindingIdentifier(false);\n  if (eat(tt.dot)) {\n    tsParseModuleOrNamespaceDeclaration();\n  } else {\n    tsParseModuleBlock();\n  }\n}\n\nfunction tsParseAmbientExternalModuleDeclaration() {\n  if (isContextual(ContextualKeyword._global)) {\n    parseIdentifier();\n  } else if (match(tt.string)) {\n    parseExprAtom();\n  } else {\n    unexpected();\n  }\n\n  if (match(tt.braceL)) {\n    tsParseModuleBlock();\n  } else {\n    semicolon();\n  }\n}\n\nexport function tsParseImportEqualsDeclaration() {\n  parseImportedIdentifier();\n  expect(tt.eq);\n  tsParseModuleReference();\n  semicolon();\n}\n\nfunction tsIsExternalModuleReference() {\n  return isContextual(ContextualKeyword._require) && lookaheadType() === tt.parenL;\n}\n\nfunction tsParseModuleReference() {\n  if (tsIsExternalModuleReference()) {\n    tsParseExternalModuleReference();\n  } else {\n    tsParseEntityName();\n  }\n}\n\nfunction tsParseExternalModuleReference() {\n  expectContextual(ContextualKeyword._require);\n  expect(tt.parenL);\n  if (!match(tt.string)) {\n    unexpected();\n  }\n  parseLiteral();\n  expect(tt.parenR);\n}\n\n// Utilities\n\n// Returns true if a statement matched.\nfunction tsTryParseDeclare() {\n  if (isLineTerminator()) {\n    return false;\n  }\n  switch (state.type) {\n    case tt._function: {\n      const oldIsType = pushTypeContext(1);\n      next();\n      // We don't need to precisely get the function start here, since it's only used to mark\n      // the function as a type if it's bodiless, and it's already a type here.\n      const functionStart = state.start;\n      parseFunction(functionStart, /* isStatement */ true);\n      popTypeContext(oldIsType);\n      return true;\n    }\n    case tt._class: {\n      const oldIsType = pushTypeContext(1);\n      parseClass(/* isStatement */ true, /* optionalId */ false);\n      popTypeContext(oldIsType);\n      return true;\n    }\n    case tt._const: {\n      if (match(tt._const) && isLookaheadContextual(ContextualKeyword._enum)) {\n        const oldIsType = pushTypeContext(1);\n        // `const enum = 0;` not allowed because \"enum\" is a strict mode reserved word.\n        expect(tt._const);\n        expectContextual(ContextualKeyword._enum);\n        state.tokens[state.tokens.length - 1].type = tt._enum;\n        tsParseEnumDeclaration();\n        popTypeContext(oldIsType);\n        return true;\n      }\n    }\n    // falls through\n    case tt._var:\n    case tt._let: {\n      const oldIsType = pushTypeContext(1);\n      parseVarStatement(state.type !== tt._var);\n      popTypeContext(oldIsType);\n      return true;\n    }\n    case tt.name: {\n      const oldIsType = pushTypeContext(1);\n      const contextualKeyword = state.contextualKeyword;\n      let matched = false;\n      if (contextualKeyword === ContextualKeyword._global) {\n        tsParseAmbientExternalModuleDeclaration();\n        matched = true;\n      } else {\n        matched = tsParseDeclaration(contextualKeyword, /* isBeforeToken */ true);\n      }\n      popTypeContext(oldIsType);\n      return matched;\n    }\n    default:\n      return false;\n  }\n}\n\n// Note: this won't be called unless the keyword is allowed in `shouldParseExportDeclaration`.\n// Returns true if it matched a declaration.\nfunction tsTryParseExportDeclaration() {\n  return tsParseDeclaration(state.contextualKeyword, /* isBeforeToken */ true);\n}\n\n// Returns true if it matched a statement.\nfunction tsParseExpressionStatement(contextualKeyword) {\n  switch (contextualKeyword) {\n    case ContextualKeyword._declare: {\n      const declareTokenIndex = state.tokens.length - 1;\n      const matched = tsTryParseDeclare();\n      if (matched) {\n        state.tokens[declareTokenIndex].type = tt._declare;\n        return true;\n      }\n      break;\n    }\n    case ContextualKeyword._global:\n      // `global { }` (with no `declare`) may appear inside an ambient module declaration.\n      // Would like to use tsParseAmbientExternalModuleDeclaration here, but already ran past \"global\".\n      if (match(tt.braceL)) {\n        tsParseModuleBlock();\n        return true;\n      }\n      break;\n\n    default:\n      return tsParseDeclaration(contextualKeyword, /* isBeforeToken */ false);\n  }\n  return false;\n}\n\n/**\n * Common code for parsing a declaration.\n *\n * isBeforeToken indicates that the current parser state is at the contextual\n * keyword (and that it is not yet emitted) rather than reading the token after\n * it. When isBeforeToken is true, we may be preceded by an `export` token and\n * should include that token in a type context we create, e.g. to handle\n * `export interface` or `export type`. (This is a bit of a hack and should be\n * cleaned up at some point.)\n *\n * Returns true if it matched a declaration.\n */\nfunction tsParseDeclaration(contextualKeyword, isBeforeToken) {\n  switch (contextualKeyword) {\n    case ContextualKeyword._abstract:\n      if (tsCheckLineTerminator(isBeforeToken) && match(tt._class)) {\n        state.tokens[state.tokens.length - 1].type = tt._abstract;\n        parseClass(/* isStatement */ true, /* optionalId */ false);\n        return true;\n      }\n      break;\n\n    case ContextualKeyword._enum:\n      if (tsCheckLineTerminator(isBeforeToken) && match(tt.name)) {\n        state.tokens[state.tokens.length - 1].type = tt._enum;\n        tsParseEnumDeclaration();\n        return true;\n      }\n      break;\n\n    case ContextualKeyword._interface:\n      if (tsCheckLineTerminator(isBeforeToken) && match(tt.name)) {\n        // `next` is true in \"export\" and \"declare\" contexts, so we want to remove that token\n        // as well.\n        const oldIsType = pushTypeContext(isBeforeToken ? 2 : 1);\n        tsParseInterfaceDeclaration();\n        popTypeContext(oldIsType);\n        return true;\n      }\n      break;\n\n    case ContextualKeyword._module:\n      if (tsCheckLineTerminator(isBeforeToken)) {\n        if (match(tt.string)) {\n          const oldIsType = pushTypeContext(isBeforeToken ? 2 : 1);\n          tsParseAmbientExternalModuleDeclaration();\n          popTypeContext(oldIsType);\n          return true;\n        } else if (match(tt.name)) {\n          const oldIsType = pushTypeContext(isBeforeToken ? 2 : 1);\n          tsParseModuleOrNamespaceDeclaration();\n          popTypeContext(oldIsType);\n          return true;\n        }\n      }\n      break;\n\n    case ContextualKeyword._namespace:\n      if (tsCheckLineTerminator(isBeforeToken) && match(tt.name)) {\n        const oldIsType = pushTypeContext(isBeforeToken ? 2 : 1);\n        tsParseModuleOrNamespaceDeclaration();\n        popTypeContext(oldIsType);\n        return true;\n      }\n      break;\n\n    case ContextualKeyword._type:\n      if (tsCheckLineTerminator(isBeforeToken) && match(tt.name)) {\n        const oldIsType = pushTypeContext(isBeforeToken ? 2 : 1);\n        tsParseTypeAliasDeclaration();\n        popTypeContext(oldIsType);\n        return true;\n      }\n      break;\n\n    default:\n      break;\n  }\n  return false;\n}\n\nfunction tsCheckLineTerminator(isBeforeToken) {\n  if (isBeforeToken) {\n    // Babel checks hasFollowingLineBreak here and returns false, but this\n    // doesn't actually come up, e.g. `export interface` can never be on its own\n    // line in valid code.\n    next();\n    return true;\n  } else {\n    return !isLineTerminator();\n  }\n}\n\n// Returns true if there was a generic async arrow function.\nfunction tsTryParseGenericAsyncArrowFunction() {\n  const snapshot = state.snapshot();\n\n  tsParseTypeParameters();\n  parseFunctionParams();\n  tsTryParseTypeOrTypePredicateAnnotation();\n  expect(tt.arrow);\n\n  if (state.error) {\n    state.restoreFromSnapshot(snapshot);\n    return false;\n  }\n\n  parseFunctionBody(true);\n  return true;\n}\n\n/**\n * If necessary, hack the tokenizer state so that this bitshift was actually a\n * less-than token, then keep parsing. This should only be used in situations\n * where we restore from snapshot on error (which reverts this change) or\n * where bitshift would be illegal anyway (e.g. in a class \"extends\" clause).\n *\n * This hack is useful to handle situations like foo<<T>() => void>() where\n * there can legitimately be two open-angle-brackets in a row in TS.\n */\nfunction tsParseTypeArgumentsWithPossibleBitshift() {\n  if (state.type === tt.bitShiftL) {\n    state.pos -= 1;\n    finishToken(tt.lessThan);\n  }\n  tsParseTypeArguments();\n}\n\nfunction tsParseTypeArguments() {\n  const oldIsType = pushTypeContext(0);\n  expect(tt.lessThan);\n  while (!match(tt.greaterThan) && !state.error) {\n    tsParseType();\n    eat(tt.comma);\n  }\n  if (!oldIsType) {\n    // If the type arguments are present in an expression context, e.g.\n    // f<number>(), then the > sign should be tokenized as a non-type token.\n    // In particular, f(a < b, c >= d) should parse the >= as a single token,\n    // resulting in a syntax error and fallback to the non-type-args\n    // interpretation. In the success case, even though the > is tokenized as a\n    // non-type token, it still must be marked as a type token so that it is\n    // erased.\n    popTypeContext(oldIsType);\n    rescan_gt();\n    expect(tt.greaterThan);\n    state.tokens[state.tokens.length - 1].isType = true;\n  } else {\n    expect(tt.greaterThan);\n    popTypeContext(oldIsType);\n  }\n}\n\nexport function tsIsDeclarationStart() {\n  if (match(tt.name)) {\n    switch (state.contextualKeyword) {\n      case ContextualKeyword._abstract:\n      case ContextualKeyword._declare:\n      case ContextualKeyword._enum:\n      case ContextualKeyword._interface:\n      case ContextualKeyword._module:\n      case ContextualKeyword._namespace:\n      case ContextualKeyword._type:\n        return true;\n      default:\n        break;\n    }\n  }\n\n  return false;\n}\n\n// ======================================================\n// OVERRIDES\n// ======================================================\n\nexport function tsParseFunctionBodyAndFinish(functionStart, funcContextId) {\n  // For arrow functions, `parseArrow` handles the return type itself.\n  if (match(tt.colon)) {\n    tsParseTypeOrTypePredicateAnnotation(tt.colon);\n  }\n\n  // The original code checked the node type to make sure this function type allows a missing\n  // body, but we skip that to avoid sending around the node type. We instead just use the\n  // allowExpressionBody boolean to make sure it's not an arrow function.\n  if (!match(tt.braceL) && isLineTerminator()) {\n    // Retroactively mark the function declaration as a type.\n    let i = state.tokens.length - 1;\n    while (\n      i >= 0 &&\n      (state.tokens[i].start >= functionStart ||\n        state.tokens[i].type === tt._default ||\n        state.tokens[i].type === tt._export)\n    ) {\n      state.tokens[i].isType = true;\n      i--;\n    }\n    return;\n  }\n\n  parseFunctionBody(false, funcContextId);\n}\n\nexport function tsParseSubscript(\n  startTokenIndex,\n  noCalls,\n  stopState,\n) {\n  if (!hasPrecedingLineBreak() && eat(tt.bang)) {\n    state.tokens[state.tokens.length - 1].type = tt.nonNullAssertion;\n    return;\n  }\n\n  if (match(tt.lessThan) || match(tt.bitShiftL)) {\n    // There are number of things we are going to \"maybe\" parse, like type arguments on\n    // tagged template expressions. If any of them fail, walk it back and continue.\n    const snapshot = state.snapshot();\n\n    if (!noCalls && atPossibleAsync()) {\n      // Almost certainly this is a generic async function `async <T>() => ...\n      // But it might be a call with a type argument `async<T>();`\n      const asyncArrowFn = tsTryParseGenericAsyncArrowFunction();\n      if (asyncArrowFn) {\n        return;\n      }\n    }\n    tsParseTypeArgumentsWithPossibleBitshift();\n    if (!noCalls && eat(tt.parenL)) {\n      // With f<T>(), the subscriptStartIndex marker is on the ( token.\n      state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex;\n      parseCallExpressionArguments();\n    } else if (match(tt.backQuote)) {\n      // Tagged template with a type argument.\n      parseTemplate();\n    } else if (\n      // The remaining possible case is an instantiation expression, e.g.\n      // Array<number> . Check for a few cases that would disqualify it and\n      // cause us to bail out.\n      // a<b>>c is not (a<b>)>c, but a<(b>>c)\n      state.type === tt.greaterThan ||\n      // a<b>c is (a<b)>c\n      (state.type !== tt.parenL &&\n        Boolean(state.type & TokenType.IS_EXPRESSION_START) &&\n        !hasPrecedingLineBreak())\n    ) {\n      // Bail out. We have something like a<b>c, which is not an expression with\n      // type arguments but an (a < b) > c comparison.\n      unexpected();\n    }\n\n    if (state.error) {\n      state.restoreFromSnapshot(snapshot);\n    } else {\n      return;\n    }\n  } else if (!noCalls && match(tt.questionDot) && lookaheadType() === tt.lessThan) {\n    // If we see f?.<, then this must be an optional call with a type argument.\n    next();\n    state.tokens[startTokenIndex].isOptionalChainStart = true;\n    // With f?.<T>(), the subscriptStartIndex marker is on the ?. token.\n    state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex;\n\n    tsParseTypeArguments();\n    expect(tt.parenL);\n    parseCallExpressionArguments();\n  }\n  baseParseSubscript(startTokenIndex, noCalls, stopState);\n}\n\nexport function tsTryParseExport() {\n  if (eat(tt._import)) {\n    // One of these cases:\n    // export import A = B;\n    // export import type A = require(\"A\");\n    if (isContextual(ContextualKeyword._type) && lookaheadType() !== tt.eq) {\n      // Eat a `type` token, unless it's actually an identifier name.\n      expectContextual(ContextualKeyword._type);\n    }\n    tsParseImportEqualsDeclaration();\n    return true;\n  } else if (eat(tt.eq)) {\n    // `export = x;`\n    parseExpression();\n    semicolon();\n    return true;\n  } else if (eatContextual(ContextualKeyword._as)) {\n    // `export as namespace A;`\n    // See `parseNamespaceExportDeclaration` in TypeScript's own parser\n    expectContextual(ContextualKeyword._namespace);\n    parseIdentifier();\n    semicolon();\n    return true;\n  } else {\n    if (isContextual(ContextualKeyword._type)) {\n      const nextType = lookaheadType();\n      // export type {foo} from 'a';\n      // export type * from 'a';'\n      // export type * as ns from 'a';'\n      if (nextType === tt.braceL || nextType === tt.star) {\n        next();\n      }\n    }\n    return false;\n  }\n}\n\n/**\n * Parse a TS import specifier, which may be prefixed with \"type\" and may be of\n * the form `foo as bar`.\n *\n * The number of identifier-like tokens we see happens to be enough to uniquely\n * identify the form, so simply count the number of identifiers rather than\n * matching the words `type` or `as`. This is particularly important because\n * `type` and `as` could each actually be plain identifiers rather than\n * keywords.\n */\nexport function tsParseImportSpecifier() {\n  parseIdentifier();\n  if (match(tt.comma) || match(tt.braceR)) {\n    // import {foo}\n    state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportDeclaration;\n    return;\n  }\n  parseIdentifier();\n  if (match(tt.comma) || match(tt.braceR)) {\n    // import {type foo}\n    state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportDeclaration;\n    state.tokens[state.tokens.length - 2].isType = true;\n    state.tokens[state.tokens.length - 1].isType = true;\n    return;\n  }\n  parseIdentifier();\n  if (match(tt.comma) || match(tt.braceR)) {\n    // import {foo as bar}\n    state.tokens[state.tokens.length - 3].identifierRole = IdentifierRole.ImportAccess;\n    state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportDeclaration;\n    return;\n  }\n  parseIdentifier();\n  // import {type foo as bar}\n  state.tokens[state.tokens.length - 3].identifierRole = IdentifierRole.ImportAccess;\n  state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportDeclaration;\n  state.tokens[state.tokens.length - 4].isType = true;\n  state.tokens[state.tokens.length - 3].isType = true;\n  state.tokens[state.tokens.length - 2].isType = true;\n  state.tokens[state.tokens.length - 1].isType = true;\n}\n\n/**\n * Just like named import specifiers, export specifiers can have from 1 to 4\n * tokens, inclusive, and the number of tokens determines the role of each token.\n */\nexport function tsParseExportSpecifier() {\n  parseIdentifier();\n  if (match(tt.comma) || match(tt.braceR)) {\n    // export {foo}\n    state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ExportAccess;\n    return;\n  }\n  parseIdentifier();\n  if (match(tt.comma) || match(tt.braceR)) {\n    // export {type foo}\n    state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ExportAccess;\n    state.tokens[state.tokens.length - 2].isType = true;\n    state.tokens[state.tokens.length - 1].isType = true;\n    return;\n  }\n  parseIdentifier();\n  if (match(tt.comma) || match(tt.braceR)) {\n    // export {foo as bar}\n    state.tokens[state.tokens.length - 3].identifierRole = IdentifierRole.ExportAccess;\n    return;\n  }\n  parseIdentifier();\n  // export {type foo as bar}\n  state.tokens[state.tokens.length - 3].identifierRole = IdentifierRole.ExportAccess;\n  state.tokens[state.tokens.length - 4].isType = true;\n  state.tokens[state.tokens.length - 3].isType = true;\n  state.tokens[state.tokens.length - 2].isType = true;\n  state.tokens[state.tokens.length - 1].isType = true;\n}\n\nexport function tsTryParseExportDefaultExpression() {\n  if (isContextual(ContextualKeyword._abstract) && lookaheadType() === tt._class) {\n    state.type = tt._abstract;\n    next(); // Skip \"abstract\"\n    parseClass(true, true);\n    return true;\n  }\n  if (isContextual(ContextualKeyword._interface)) {\n    // Make sure \"export default\" are considered type tokens so the whole thing is removed.\n    const oldIsType = pushTypeContext(2);\n    tsParseDeclaration(ContextualKeyword._interface, true);\n    popTypeContext(oldIsType);\n    return true;\n  }\n  return false;\n}\n\nexport function tsTryParseStatementContent() {\n  if (state.type === tt._const) {\n    const ahead = lookaheadTypeAndKeyword();\n    if (ahead.type === tt.name && ahead.contextualKeyword === ContextualKeyword._enum) {\n      expect(tt._const);\n      expectContextual(ContextualKeyword._enum);\n      state.tokens[state.tokens.length - 1].type = tt._enum;\n      tsParseEnumDeclaration();\n      return true;\n    }\n  }\n  return false;\n}\n\nexport function tsTryParseClassMemberWithIsStatic(isStatic) {\n  const memberStartIndexAfterStatic = state.tokens.length;\n  tsParseModifiers([\n    ContextualKeyword._abstract,\n    ContextualKeyword._readonly,\n    ContextualKeyword._declare,\n    ContextualKeyword._static,\n    ContextualKeyword._override,\n  ]);\n\n  const modifiersEndIndex = state.tokens.length;\n  const found = tsTryParseIndexSignature();\n  if (found) {\n    // Index signatures are type declarations, so set the modifier tokens as\n    // type tokens. Most tokens could be assumed to be type tokens, but `static`\n    // is ambiguous unless we set it explicitly here.\n    const memberStartIndex = isStatic\n      ? memberStartIndexAfterStatic - 1\n      : memberStartIndexAfterStatic;\n    for (let i = memberStartIndex; i < modifiersEndIndex; i++) {\n      state.tokens[i].isType = true;\n    }\n    return true;\n  }\n  return false;\n}\n\n// Note: The reason we do this in `parseIdentifierStatement` and not `parseStatement`\n// is that e.g. `type()` is valid JS, so we must try parsing that first.\n// If it's really a type, we will parse `type` as the statement, and can correct it here\n// by parsing the rest.\nexport function tsParseIdentifierStatement(contextualKeyword) {\n  const matched = tsParseExpressionStatement(contextualKeyword);\n  if (!matched) {\n    semicolon();\n  }\n}\n\nexport function tsParseExportDeclaration() {\n  // \"export declare\" is equivalent to just \"export\".\n  const isDeclare = eatContextual(ContextualKeyword._declare);\n  if (isDeclare) {\n    state.tokens[state.tokens.length - 1].type = tt._declare;\n  }\n\n  let matchedDeclaration = false;\n  if (match(tt.name)) {\n    if (isDeclare) {\n      const oldIsType = pushTypeContext(2);\n      matchedDeclaration = tsTryParseExportDeclaration();\n      popTypeContext(oldIsType);\n    } else {\n      matchedDeclaration = tsTryParseExportDeclaration();\n    }\n  }\n  if (!matchedDeclaration) {\n    if (isDeclare) {\n      const oldIsType = pushTypeContext(2);\n      parseStatement(true);\n      popTypeContext(oldIsType);\n    } else {\n      parseStatement(true);\n    }\n  }\n}\n\nexport function tsAfterParseClassSuper(hasSuper) {\n  if (hasSuper && (match(tt.lessThan) || match(tt.bitShiftL))) {\n    tsParseTypeArgumentsWithPossibleBitshift();\n  }\n  if (eatContextual(ContextualKeyword._implements)) {\n    state.tokens[state.tokens.length - 1].type = tt._implements;\n    const oldIsType = pushTypeContext(1);\n    tsParseHeritageClause();\n    popTypeContext(oldIsType);\n  }\n}\n\nexport function tsStartParseObjPropValue() {\n  tsTryParseTypeParameters();\n}\n\nexport function tsStartParseFunctionParams() {\n  tsTryParseTypeParameters();\n}\n\n// `let x: number;`\nexport function tsAfterParseVarHead() {\n  const oldIsType = pushTypeContext(0);\n  if (!hasPrecedingLineBreak()) {\n    eat(tt.bang);\n  }\n  tsTryParseTypeAnnotation();\n  popTypeContext(oldIsType);\n}\n\n// parse the return type of an async arrow function - let foo = (async (): number => {});\nexport function tsStartParseAsyncArrowFromCallExpression() {\n  if (match(tt.colon)) {\n    tsParseTypeAnnotation();\n  }\n}\n\n// Returns true if the expression was an arrow function.\nexport function tsParseMaybeAssign(noIn, isWithinParens) {\n  // Note: When the JSX plugin is on, type assertions (`<T> x`) aren't valid syntax.\n  if (isJSXEnabled) {\n    return tsParseMaybeAssignWithJSX(noIn, isWithinParens);\n  } else {\n    return tsParseMaybeAssignWithoutJSX(noIn, isWithinParens);\n  }\n}\n\nexport function tsParseMaybeAssignWithJSX(noIn, isWithinParens) {\n  if (!match(tt.lessThan)) {\n    return baseParseMaybeAssign(noIn, isWithinParens);\n  }\n\n  // Prefer to parse JSX if possible. But may be an arrow fn.\n  const snapshot = state.snapshot();\n  let wasArrow = baseParseMaybeAssign(noIn, isWithinParens);\n  if (state.error) {\n    state.restoreFromSnapshot(snapshot);\n  } else {\n    return wasArrow;\n  }\n\n  // Otherwise, try as type-parameterized arrow function.\n  state.type = tt.typeParameterStart;\n  // This is similar to TypeScript's `tryParseParenthesizedArrowFunctionExpression`.\n  tsParseTypeParameters();\n  wasArrow = baseParseMaybeAssign(noIn, isWithinParens);\n  if (!wasArrow) {\n    unexpected();\n  }\n\n  return wasArrow;\n}\n\nexport function tsParseMaybeAssignWithoutJSX(noIn, isWithinParens) {\n  if (!match(tt.lessThan)) {\n    return baseParseMaybeAssign(noIn, isWithinParens);\n  }\n\n  const snapshot = state.snapshot();\n  // This is similar to TypeScript's `tryParseParenthesizedArrowFunctionExpression`.\n  tsParseTypeParameters();\n  const wasArrow = baseParseMaybeAssign(noIn, isWithinParens);\n  if (!wasArrow) {\n    unexpected();\n  }\n  if (state.error) {\n    state.restoreFromSnapshot(snapshot);\n  } else {\n    return wasArrow;\n  }\n\n  // Try parsing a type cast instead of an arrow function.\n  // This will start with a type assertion (via parseMaybeUnary).\n  // But don't directly call `tsParseTypeAssertion` because we want to handle any binary after it.\n  return baseParseMaybeAssign(noIn, isWithinParens);\n}\n\nexport function tsParseArrow() {\n  if (match(tt.colon)) {\n    // This is different from how the TS parser does it.\n    // TS uses lookahead. Babylon parses it as a parenthesized expression and converts.\n    const snapshot = state.snapshot();\n\n    tsParseTypeOrTypePredicateAnnotation(tt.colon);\n    if (canInsertSemicolon()) unexpected();\n    if (!match(tt.arrow)) unexpected();\n\n    if (state.error) {\n      state.restoreFromSnapshot(snapshot);\n    }\n  }\n  return eat(tt.arrow);\n}\n\n// Allow type annotations inside of a parameter list.\nexport function tsParseAssignableListItemTypes() {\n  const oldIsType = pushTypeContext(0);\n  eat(tt.question);\n  tsTryParseTypeAnnotation();\n  popTypeContext(oldIsType);\n}\n\nexport function tsParseMaybeDecoratorArguments() {\n  if (match(tt.lessThan) || match(tt.bitShiftL)) {\n    tsParseTypeArgumentsWithPossibleBitshift();\n  }\n  baseParseMaybeDecoratorArguments();\n}\n"],"mappings":"AAAA,SACEA,GAAG,EACHC,WAAW,EACXC,cAAc,EACdC,aAAa,EACbC,uBAAuB,EACvBC,KAAK,EACLC,IAAI,EACJC,iBAAiB,EACjBC,cAAc,EACdC,eAAe,EACfC,SAAS,QACJ,oBAAoB;AAC3B,SAAQC,iBAAiB,QAAO,uBAAuB;AACvD,SAAQC,SAAS,EAAEA,SAAS,IAAIC,EAAE,QAAO,oBAAoB;AAC7D,SAAQC,YAAY,EAAEC,KAAK,QAAO,mBAAmB;AACrD,SACEC,eAAe,EACfC,oBAAoB,EACpBC,kBAAkB,EAClBC,4BAA4B,EAC5BC,aAAa,EACbC,eAAe,EACfC,iBAAiB,EACjBC,eAAe,EACfC,YAAY,EACZC,gBAAgB,EAChBC,eAAe,EACfC,iBAAiB,EACjBC,aAAa,QAER,yBAAyB;AAChC,SAAQC,sBAAsB,EAAEC,gBAAgB,EAAEC,uBAAuB,QAAO,mBAAmB;AACnG,SACEC,gCAAgC,EAChCC,cAAc,EACdC,UAAU,EACVC,aAAa,EACbC,mBAAmB,EACnBC,cAAc,EACdC,iBAAiB,QACZ,wBAAwB;AAC/B,SACEC,kBAAkB,E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