ヤミRoot VoidGate
User / IP
:
216.73.216.143
Host / Server
:
146.88.233.70 / dev.loger.cm
System
:
Linux hybrid1120.fr.ns.planethoster.net 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
logercm
/
dev.loger.cm
/
fixtures
/
assert
/
Viewing: parser.tar
CHANGELOG.md 0000644 00000112536 15120211212 0006350 0 ustar 00 # Changelog > **Tags:** > - :boom: [Breaking Change] > - :eyeglasses: [Spec Compliance] > - :rocket: [New Feature] > - :bug: [Bug Fix] > - :memo: [Documentation] > - :house: [Internal] > - :nail_care: [Polish] > Semver Policy: https://github.com/babel/babel/tree/main/packages/babel-parser#semver _Note: Gaps between patch versions are faulty, broken or test releases._ See the [Babel Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) for the pre-6.8.0 version Changelog. ## 6.17.1 (2017-05-10) ### :bug: Bug Fix * Fix typo in flow spread operator error (Brian Ng) * Fixed invalid number literal parsing ([#473](https://github.com/babel/babylon/pull/473)) (Alex Kuzmenko) * Fix number parser ([#433](https://github.com/babel/babylon/pull/433)) (Alex Kuzmenko) * Ensure non pattern shorthand props are checked for reserved words ([#479](https://github.com/babel/babylon/pull/479)) (Brian Ng) * Remove jsx context when parsing arrow functions ([#475](https://github.com/babel/babylon/pull/475)) (Brian Ng) * Allow super in class properties ([#499](https://github.com/babel/babylon/pull/499)) (Brian Ng) * Allow flow class field to be named constructor ([#510](https://github.com/babel/babylon/pull/510)) (Brian Ng) ## 6.17.0 (2017-04-20) ### :bug: Bug Fix * Cherry-pick #418 to 6.x ([#476](https://github.com/babel/babylon/pull/476)) (Sebastian McKenzie) * Add support for invalid escapes in tagged templates ([#274](https://github.com/babel/babylon/pull/274)) (Kevin Gibbons) * Throw error if new.target is used outside of a function ([#402](https://github.com/babel/babylon/pull/402)) (Brian Ng) * Fix parsing of class properties ([#351](https://github.com/babel/babylon/pull/351)) (Kevin Gibbons) * Fix parsing yield with dynamicImport ([#383](https://github.com/babel/babylon/pull/383)) (Brian Ng) * Ensure consistent start args for parseParenItem ([#386](https://github.com/babel/babylon/pull/386)) (Brian Ng) ## 7.0.0-beta.8 (2017-04-04) ### New Feature * Add support for flow type spread (#418) (Conrad Buck) * Allow statics in flow interfaces (#427) (Brian Ng) ### Bug Fix * Fix predicate attachment to match flow parser (#428) (Brian Ng) * Add extra.raw back to JSXText and JSXAttribute (#344) (Alex Rattray) * Fix rest parameters with array and objects (#424) (Brian Ng) * Fix number parser (#433) (Alex Kuzmenko) ### Docs * Fix CONTRIBUTING.md [skip ci] (#432) (Alex Kuzmenko) ### Internal * Use babel-register script when running babel smoke tests (#442) (Brian Ng) ## 7.0.0-beta.7 (2017-03-22) ### Spec Compliance * Remove babylon plugin for template revision since it's stage-4 (#426) (Henry Zhu) ### Bug Fix * Fix push-pop logic in flow (#405) (Daniel Tschinder) ## 7.0.0-beta.6 (2017-03-21) ### New Feature * Add support for invalid escapes in tagged templates (#274) (Kevin Gibbons) ### Polish * Improves error message when super is called outside of constructor (#408) (Arshabh Kumar Agarwal) ### Docs * [7.0] Moved value field in spec from ObjectMember to ObjectProperty as ObjectMethod's don't have it (#415) [skip ci] (James Browning) ## 7.0.0-beta.5 (2017-03-21) ### Bug Fix * Throw error if new.target is used outside of a function (#402) (Brian Ng) * Fix parsing of class properties (#351) (Kevin Gibbons) ### Other * Test runner: Detect extra property in 'actual' but not in 'expected'. (#407) (Andy) * Optimize travis builds (#419) (Daniel Tschinder) * Update codecov to 2.0 (#412) (Daniel Tschinder) * Fix spec for ClassMethod: It doesn't have a function, it *is* a function. (#406) [skip ci] (Andy) * Changed Non-existent RestPattern to RestElement which is what is actually parsed (#409) [skip ci] (James Browning) * Upgrade flow to 0.41 (Daniel Tschinder) * Fix watch command (#403) (Brian Ng) * Update yarn lock (Daniel Tschinder) * Fix watch command (#403) (Brian Ng) * chore(package): update flow-bin to version 0.41.0 (#395) (greenkeeper[bot]) * Add estree test for correct order of directives (Daniel Tschinder) * Add DoExpression to spec (#364) (Alex Kuzmenko) * Mention cloning of repository in CONTRIBUTING.md (#391) [skip ci] (Sumedh Nimkarde) * Explain how to run only one test (#389) [skip ci] (Aaron Ang) ## 7.0.0-beta.4 (2017-03-01) * Don't consume async when checking for async func decl (#377) (Brian Ng) * add `ranges` option [skip ci] (Henry Zhu) * Don't parse class properties without initializers when classProperties is disabled and Flow is enabled (#300) (Andrew Levine) ## 7.0.0-beta.3 (2017-02-28) - [7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement (#384) - Merge changes from 6.x ## 7.0.0-beta.2 (2017-02-20) - estree: correctly change literals in all cases (#368) (Daniel Tschinder) ## 7.0.0-beta.1 (2017-02-20) - Fix negative number literal typeannotations (#366) (Daniel Tschinder) - Update contributing with more test info [skip ci] (#355) (Brian Ng) ## 7.0.0-beta.0 (2017-02-15) - Reintroduce Variance node (#333) (Daniel Tschinder) - Rename NumericLiteralTypeAnnotation to NumberLiteralTypeAnnotation (#332) (Charles Pick) - [7.0] Remove ForAwaitStatement, add await flag to ForOfStatement (#349) (Brandon Dail) - chore(package): update ava to version 0.18.0 (#345) (greenkeeper[bot]) - chore(package): update babel-plugin-istanbul to version 4.0.0 (#350) (greenkeeper[bot]) - Change location of ObjectTypeIndexer to match flow (#228) (Daniel Tschinder) - Rename flow AST Type ExistentialTypeParam to ExistsTypeAnnotation (#322) (Toru Kobayashi) - Revert "Temporary rollback for erroring on trailing comma with spread (#154)" (#290) (Daniel Tschinder) - Remove classConstructorCall plugin (#291) (Brian Ng) - Update yarn.lock (Daniel Tschinder) - Update cross-env to 3.x (Daniel Tschinder) - [7.0] Remove node 0.10, 0.12 and 5 from Travis (#284) (Sergey Rubanov) - Remove `String.fromCodePoint` shim (#279) (Mathias Bynens) ## 6.16.1 (2017-02-23) ### :bug: Regression - Revert "Fix export default async function to be FunctionDeclaration" ([#375](https://github.com/babel/babylon/pull/375)) Need to modify Babel for this AST node change, so moving to 7.0. - Revert "Don't parse class properties without initializers when classProperties plugin is disabled, and Flow is enabled" ([#376](https://github.com/babel/babylon/pull/376)) [react-native](https://github.com/facebook/react-native/issues/12542) broke with this so we reverted. ## 6.16.0 (2017-02-23) ### :rocket: New Feature ***ESTree*** compatibility as plugin ([#277](https://github.com/babel/babylon/pull/277)) (Daniel Tschinder) We finally introduce a new compatibility layer for ESTree. To put babylon into ESTree-compatible mode the new plugin `estree` can be enabled. In this mode the parser will output an AST that is compliant to the specs of [ESTree](https://github.com/estree/estree/) We highly recommend everyone who uses babylon outside of babel to use this plugin. This will make it much easier for users to switch between different ESTree-compatible parsers. We so far tested several projects with different parsers and exchanged their parser to babylon and in nearly all cases it worked out of the box. Some other estree-compatible parsers include `acorn`, `esprima`, `espree`, `flow-parser`, etc. To enable `estree` mode simply add the plugin in the config: ```json { "plugins": [ "estree" ] } ``` If you want to migrate your project from non-ESTree mode to ESTree, have a look at our [Readme](https://github.com/babel/babylon/#output), where all deviations are mentioned. Add a parseExpression public method ([#213](https://github.com/babel/babylon/pull/213)) (jeromew) Babylon exports a new function to parse a single expression ```js import { parseExpression } from 'babylon'; const ast = parseExpression('x || y && z', options); ``` The returned AST will only consist of the expression. The options are the same as for `parse()` Add startLine option ([#346](https://github.com/babel/babylon/pull/346)) (Raphael Mu) A new option was added to babylon allowing to change the initial linenumber for the first line which is usually `1`. Changing this for example to `100` will make line `1` of the input source to be marked as line `100`, line `2` as `101`, line `3` as `102`, ... Function predicate declaration ([#103](https://github.com/babel/babylon/pull/103)) (Panagiotis Vekris) Added support for function predicates which flow introduced in version 0.33.0 ```js declare function is_number(x: mixed): boolean %checks(typeof x === "number"); ``` Allow imports in declare module ([#315](https://github.com/babel/babylon/pull/315)) (Daniel Tschinder) Added support for imports within module declarations which flow introduced in version 0.37.0 ```js declare module "C" { import type { DT } from "D"; declare export type CT = { D: DT }; } ``` ### :eyeglasses: Spec Compliance Forbid semicolons after decorators in classes ([#352](https://github.com/babel/babylon/pull/352)) (Kevin Gibbons) This example now correctly throws an error when there is a semicolon after the decorator: ```js class A { @a; foo(){} } ``` Keywords are not allowed as local specifier ([#307](https://github.com/babel/babylon/pull/307)) (Daniel Tschinder) Using keywords in imports is not allowed anymore: ```js import { default } from "foo"; import { a as debugger } from "foo"; ``` Do not allow overwritting of primitive types ([#314](https://github.com/babel/babylon/pull/314)) (Daniel Tschinder) In flow it is now forbidden to overwrite the primitive types `"any"`, `"mixed"`, `"empty"`, `"bool"`, `"boolean"`, `"number"`, `"string"`, `"void"` and `"null"` with your own type declaration. Disallow import type { type a } from … ([#305](https://github.com/babel/babylon/pull/305)) (Daniel Tschinder) The following code now correctly throws an error ```js import type { type a } from "foo"; ``` Don't parse class properties without initializers when classProperties is disabled and Flow is enabled ([#300](https://github.com/babel/babylon/pull/300)) (Andrew Levine) Ensure that you enable the `classProperties` plugin in order to enable correct parsing of class properties. Prior to this version it was possible to parse them by enabling the `flow` plugin but this was not intended the behaviour. If you enable the flow plugin you can only define the type of the class properties, but not initialize them. Fix export default async function to be FunctionDeclaration ([#324](https://github.com/babel/babylon/pull/324)) (Daniel Tschinder) Parsing the following code now returns a `FunctionDeclaration` AST node instead of `FunctionExpression`. ```js export default async function bar() {}; ``` ### :nail_care: Polish Improve error message on attempt to destructure named import ([#288](https://github.com/babel/babylon/pull/288)) (Brian Ng) ### :bug: Bug Fix Fix negative number literal typeannotations ([#366](https://github.com/babel/babylon/pull/366)) (Daniel Tschinder) Ensure takeDecorators is called on exported class ([#358](https://github.com/babel/babylon/pull/358)) (Brian Ng) ESTree: correctly change literals in all cases ([#368](https://github.com/babel/babylon/pull/368)) (Daniel Tschinder) Correctly convert RestProperty to Assignable ([#339](https://github.com/babel/babylon/pull/339)) (Daniel Tschinder) Fix #321 by allowing question marks in type params ([#338](https://github.com/babel/babylon/pull/338)) (Daniel Tschinder) Fix #336 by correctly setting arrow-param ([#337](https://github.com/babel/babylon/pull/337)) (Daniel Tschinder) Fix parse error when destructuring `set` with default value ([#317](https://github.com/babel/babylon/pull/317)) (Brian Ng) Fix ObjectTypeCallProperty static ([#298](https://github.com/babel/babylon/pull/298)) (Dan Harper) ### :house: Internal Fix generator-method-with-computed-name spec ([#360](https://github.com/babel/babylon/pull/360)) (Alex Rattray) Fix flow type-parameter-declaration test with unintended semantic ([#361](https://github.com/babel/babylon/pull/361)) (Alex Rattray) Cleanup and splitup parser functions ([#295](https://github.com/babel/babylon/pull/295)) (Daniel Tschinder) chore(package): update flow-bin to version 0.38.0 ([#313](https://github.com/babel/babylon/pull/313)) (greenkeeper[bot]) Call inner function instead of 1:1 copy to plugin ([#294](https://github.com/babel/babylon/pull/294)) (Daniel Tschinder) Update eslint-config-babel to the latest version 🚀 ([#299](https://github.com/babel/babylon/pull/299)) (greenkeeper[bot]) Update eslint-config-babel to the latest version 🚀 ([#293](https://github.com/babel/babylon/pull/293)) (greenkeeper[bot]) devDeps: remove eslint-plugin-babel ([#292](https://github.com/babel/babylon/pull/292)) (Kai Cataldo) Correct indent eslint rule config ([#276](https://github.com/babel/babylon/pull/276)) (Daniel Tschinder) Fail tests that have expected.json and throws-option ([#285](https://github.com/babel/babylon/pull/285)) (Daniel Tschinder) ### :memo: Documentation Update contributing with more test info [skip ci] ([#355](https://github.com/babel/babylon/pull/355)) (Brian Ng) Update API documentation ([#330](https://github.com/babel/babylon/pull/330)) (Timothy Gu) Added keywords to package.json ([#323](https://github.com/babel/babylon/pull/323)) (Dmytro) AST spec: fix casing of `RegExpLiteral` ([#318](https://github.com/babel/babylon/pull/318)) (Mathias Bynens) ## 6.15.0 (2017-01-10) ### :eyeglasses: Spec Compliance Add support for Flow shorthand import type ([#267](https://github.com/babel/babylon/pull/267)) (Jeff Morrison) This change implements flows new shorthand import syntax and where previously you had to write this code: ```js import {someValue} from "blah"; import type {someType} from "blah"; import typeof {someOtherValue} from "blah"; ``` you can now write it like this: ```js import { someValue, type someType, typeof someOtherValue, } from "blah"; ``` For more information look at [this](https://github.com/facebook/flow/pull/2890) pull request. flow: allow leading pipes in all positions ([#256](https://github.com/babel/babylon/pull/256)) (Vladimir Kurchatkin) This change now allows a leading pipe everywhere types can be used: ```js var f = (x): | 1 | 2 => 1; ``` Throw error when exporting non-declaration ([#241](https://github.com/babel/babylon/pull/241)) (Kai Cataldo) Previously babylon parsed the following exports, although they are not valid: ```js export typeof foo; export new Foo(); export function() {}; export for (;;); export while(foo); ``` ### :bug: Bug Fix Don't set inType flag when parsing property names ([#266](https://github.com/babel/babylon/pull/266)) (Vladimir Kurchatkin) This fixes parsing of this case: ```js const map = { [age <= 17] : 'Too young' }; ``` Fix source location for JSXEmptyExpression nodes (fixes #248) ([#249](https://github.com/babel/babylon/pull/249)) (James Long) The following case produced an invalid AST ```js <div>{/* foo */}</div> ``` Use fromCodePoint to convert high value unicode entities ([#243](https://github.com/babel/babylon/pull/243)) (Ryan Duffy) When high value unicode entities (e.g. 💩) were used in the input source code they are now correctly encoded in the resulting AST. Rename folder to avoid Windows-illegal characters ([#281](https://github.com/babel/babylon/pull/281)) (Ryan Plant) Allow this.state.clone() when parsing decorators ([#262](https://github.com/babel/babylon/pull/262)) (Alex Rattray) ### :house: Internal User external-helpers ([#254](https://github.com/babel/babylon/pull/254)) (Daniel Tschinder) Add watch script for dev ([#234](https://github.com/babel/babylon/pull/234)) (Kai Cataldo) Freeze current plugins list for "*" option, and remove from README.md ([#245](https://github.com/babel/babylon/pull/245)) (Andrew Levine) Prepare tests for multiple fixture runners. ([#240](https://github.com/babel/babylon/pull/240)) (Daniel Tschinder) Add some test coverage for decorators stage-0 plugin ([#250](https://github.com/babel/babylon/pull/250)) (Andrew Levine) Refactor tokenizer types file ([#263](https://github.com/babel/babylon/pull/263)) (Sven SAULEAU) Update eslint-config-babel to the latest version 🚀 ([#273](https://github.com/babel/babylon/pull/273)) (greenkeeper[bot]) chore(package): update rollup to version 0.41.0 ([#272](https://github.com/babel/babylon/pull/272)) (greenkeeper[bot]) chore(package): update flow-bin to version 0.37.0 ([#255](https://github.com/babel/babylon/pull/255)) (greenkeeper[bot]) ## 6.14.1 (2016-11-17) ### :bug: Bug Fix Allow `"plugins": ["*"]` ([#229](https://github.com/babel/babylon/pull/229)) (Daniel Tschinder) ```js { "plugins": ["*"] } ``` Will include all parser plugins instead of specifying each one individually. Useful for tools like babel-eslint, jscodeshift, and ast-explorer. ## 6.14.0 (2016-11-16) ### :eyeglasses: Spec Compliance Throw error for reserved words `enum` and `await` ([#195](https://github.com/babel/babylon/pull/195)) (Kai Cataldo) [11.6.2.2 Future Reserved Words](http://www.ecma-international.org/ecma-262/6.0/#sec-future-reserved-words) Babylon will throw for more reserved words such as `enum` or `await` (in strict mode). ``` class enum {} // throws class await {} // throws in strict mode (module) ``` Optional names for function types and object type indexers ([#197](https://github.com/babel/babylon/pull/197)) (Gabe Levi) So where you used to have to write ```js type A = (x: string, y: boolean) => number; type B = (z: string) => number; type C = { [key: string]: number }; ``` you can now write (with flow 0.34.0) ```js type A = (string, boolean) => number; type B = string => number; type C = { [string]: number }; ``` Parse flow nested array type annotations like `number[][]` ([#219](https://github.com/babel/babylon/pull/219)) (Bernhard Häussner) Supports these form now of specifying array types: ```js var a: number[][][][]; var b: string[][]; ``` ### :bug: Bug Fix Correctly eat semicolon at the end of `DelcareModuleExports` ([#223](https://github.com/babel/babylon/pull/223)) (Daniel Tschinder) ``` declare module "foo" { declare module.exports: number } declare module "foo" { declare module.exports: number; } // also allowed now ``` ### :house: Internal * Count Babel tests towards Babylon code coverage ([#182](https://github.com/babel/babylon/pull/182)) (Moti Zilberman) * Fix strange line endings ([#214](https://github.com/babel/babylon/pull/214)) (Thomas Grainger) * Add node 7 (Daniel Tschinder) * chore(package): update flow-bin to version 0.34.0 ([#204](https://github.com/babel/babylon/pull/204)) (Greenkeeper) ## v6.13.1 (2016-10-26) ### :nail_care: Polish - Use rollup for bundling to speed up startup time ([#190](https://github.com/babel/babylon/pull/190)) ([@drewml](https://github.com/DrewML)) ```js const babylon = require('babylon'); const ast = babylon.parse('var foo = "lol";'); ``` With that test case, there was a ~95ms savings by removing the need for node to build/traverse the dependency graph. **Without bundling**  **With bundling**  - add clean command [skip ci] ([#201](https://github.com/babel/babylon/pull/201)) (Henry Zhu) - add ForAwaitStatement (async generator already added) [skip ci] ([#196](https://github.com/babel/babylon/pull/196)) (Henry Zhu) ## v6.13.0 (2016-10-21) ### :eyeglasses: Spec Compliance Property variance type annotations for Flow plugin ([#161](https://github.com/babel/babylon/pull/161)) (Sam Goldman) > See https://flowtype.org/docs/variance.html for more information ```js type T = { +p: T }; interface T { -p: T }; declare class T { +[k:K]: V }; class T { -[k:K]: V }; class C2 { +p: T = e }; ``` Raise error on duplicate definition of __proto__ ([#183](https://github.com/babel/babylon/pull/183)) (Moti Zilberman) ```js ({ __proto__: 1, __proto__: 2 }) // Throws an error now ``` ### :bug: Bug Fix Flow: Allow class properties to be named `static` ([#184](https://github.com/babel/babylon/pull/184)) (Moti Zilberman) ```js declare class A { static: T; } ``` Allow "async" as identifier for object literal property shorthand ([#187](https://github.com/babel/babylon/pull/187)) (Andrew Levine) ```js var foo = { async, bar }; ``` ### :nail_care: Polish Fix flowtype and add inType to state ([#189](https://github.com/babel/babylon/pull/189)) (Daniel Tschinder) > This improves the performance slightly (because of hidden classes) ### :house: Internal Fix .gitattributes line ending setting ([#191](https://github.com/babel/babylon/pull/191)) (Moti Zilberman) Increase test coverage ([#175](https://github.com/babel/babylon/pull/175) (Moti Zilberman) Readd missin .eslinignore for IDEs (Daniel Tschinder) Error on missing expected.json fixture in CI ([#188](https://github.com/babel/babylon/pull/188)) (Moti Zilberman) Add .gitattributes and .editorconfig for LF line endings ([#179](https://github.com/babel/babylon/pull/179)) (Moti Zilberman) Fixes two tests that are failing after the merge of #172 ([#177](https://github.com/babel/babylon/pull/177)) (Moti Zilberman) ## v6.12.0 (2016-10-14) ### :eyeglasses: Spec Compliance Implement import() syntax ([#163](https://github.com/babel/babylon/pull/163)) (Jordan Gensler) #### Dynamic Import - Proposal Repo: https://github.com/domenic/proposal-dynamic-import - Championed by [@domenic](https://github.com/domenic) - stage-2 - [sept-28 tc39 notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-09/sept-28.md#113a-import) > This repository contains a proposal for adding a "function-like" import() module loading syntactic form to JavaScript ```js import(`./section-modules/${link.dataset.entryModule}.js`) .then(module => { module.loadPageInto(main); }) ``` Add EmptyTypeAnnotation ([#171](https://github.com/babel/babylon/pull/171)) (Sam Goldman) #### EmptyTypeAnnotation Just wasn't covered before. ```js type T = empty; ``` ### :bug: Bug Fix Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels) ```js // was failing due to sparse array export const { foo: [ ,, qux7 ] } = bar; ``` Allow keyword in Flow object declaration property names with type parameters ([#146](https://github.com/babel/babylon/pull/146)) (Dan Harper) ```js declare class X { foobar<T>(): void; static foobar<T>(): void; } ``` Allow keyword in object/class property names with Flow type parameters ([#145](https://github.com/babel/babylon/pull/145)) (Dan Harper) ```js class Foo { delete<T>(item: T): T { return item; } } ``` Allow typeAnnotations for yield expressions ([#174](https://github.com/babel/babylon/pull/174))) (Daniel Tschinder) ```js function *foo() { const x = (yield 5: any); } ``` ### :nail_care: Polish Annotate more errors with expected token ([#172](https://github.com/babel/babylon/pull/172))) (Moti Zilberman) ```js // Unexpected token, expected ; (1:6) { set 1 } ``` ### :house: Internal Remove kcheck ([#173](https://github.com/babel/babylon/pull/173))) (Daniel Tschinder) Also run flow, linting, babel tests on separate instances (add back node 0.10) ## v6.11.6 (2016-10-12) ### :bug: Bug Fix/Regression Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels) ```js // was failing with `Cannot read property 'type' of null` because of null identifiers export const { foo: [ ,, qux7 ] } = bar; ``` ## v6.11.5 (2016-10-12) ### :eyeglasses: Spec Compliance Fix: Check for duplicate named exports in exported destructuring assignments ([#144](https://github.com/babel/babylon/pull/144)) (Kai Cataldo) ```js // `foo` has already been exported. Exported identifiers must be unique. (2:20) export function foo() {}; export const { a: [{foo}] } = bar; ``` Fix: Check for duplicate named exports in exported rest elements/properties ([#164](https://github.com/babel/babylon/pull/164)) (Kai Cataldo) ```js // `foo` has already been exported. Exported identifiers must be unique. (2:22) export const foo = 1; export const [bar, ...foo] = baz; ``` ### :bug: Bug Fix Fix: Allow identifier `async` for default param in arrow expression ([#165](https://github.com/babel/babylon/pull/165)) (Kai Cataldo) ```js // this is ok now const test = ({async = true}) => {}; ``` ### :nail_care: Polish Babylon will now print out the token it's expecting if there's a `SyntaxError` ([#150](https://github.com/babel/babylon/pull/150)) (Daniel Tschinder) ```bash # So in the case of a missing ending curly (`}`) Module build failed: SyntaxError: Unexpected token, expected } (30:0) 28 | } 29 | > 30 | | ^ ``` ## v6.11.4 (2016-10-03) Temporary rollback for erroring on trailing comma with spread (#154) (Henry Zhu) ## v6.11.3 (2016-10-01) ### :eyeglasses: Spec Compliance Add static errors for object rest (#149) ([@danez](https://github.com/danez)) > https://github.com/sebmarkbage/ecmascript-rest-spread Object rest copies the *rest* of properties from the right hand side `obj` starting from the left to right. ```js let { x, y, ...z } = { x: 1, y: 2, z: 3 }; // x = 1 // y = 2 // z = { z: 3 } ``` #### New Syntax Errors: **SyntaxError**: The rest element has to be the last element when destructuring (1:10) ```bash > 1 | let { ...x, y, z } = { x: 1, y: 2, z: 3}; | ^ # Previous behavior: # x = { x: 1, y: 2, z: 3 } # y = 2 # z = 3 ``` Before, this was just a more verbose way of shallow copying `obj` since it doesn't actually do what you think. **SyntaxError**: Cannot have multiple rest elements when destructuring (1:13) ```bash > 1 | let { x, ...y, ...z } = { x: 1, y: 2, z: 3}; | ^ # Previous behavior: # x = 1 # y = { y: 2, z: 3 } # z = { y: 2, z: 3 } ``` Before y and z would just be the same value anyway so there is no reason to need to have both. **SyntaxError**: A trailing comma is not permitted after the rest element (1:16) ```js let { x, y, ...z, } = obj; ``` The rationale for this is that the use case for trailing comma is that you can add something at the end without affecting the line above. Since a RestProperty always has to be the last property it doesn't make sense. --- get / set are valid property names in default assignment (#142) ([@jezell](https://github.com/jezell)) ```js // valid function something({ set = null, get = null }) {} ``` ## v6.11.2 (2016-09-23) ### Bug Fix - [#139](https://github.com/babel/babylon/issues/139) Don't do the duplicate check if not an identifier (#140) @hzoo ```js // regression with duplicate export check SyntaxError: ./typography.js: `undefined` has already been exported. Exported identifiers must be unique. (22:13) 20 | 21 | export const { rhythm } = typography; > 22 | export const { TypographyStyle } = typography ``` Bail out for now, and make a change to account for destructuring in the next release. ## 6.11.1 (2016-09-22) ### Bug Fix - [#137](https://github.com/babel/babylon/pull/137) - Fix a regression with duplicate exports - it was erroring on all keys in `Object.prototype`. @danez ```javascript export toString from './toString'; ``` ```bash `toString` has already been exported. Exported identifiers must be unique. (1:7) > 1 | export toString from './toString'; | ^ 2 | ``` ## 6.11.0 (2016-09-22) ### Spec Compliance (will break CI) - Disallow duplicate named exports ([#107](https://github.com/babel/babylon/pull/107)) @kaicataldo ```js // Only one default export allowed per module. (2:9) export default function() {}; export { foo as default }; // Only one default export allowed per module. (2:0) export default {}; export default function() {}; // `Foo` has already been exported. Exported identifiers must be unique. (2:0) export { Foo }; export class Foo {}; ``` ### New Feature (Syntax) - Add support for computed class property names ([#121](https://github.com/babel/babylon/pull/121)) @motiz88 ```js // AST interface ClassProperty <: Node { type: "ClassProperty"; key: Identifier; value: Expression; computed: boolean; // added } ``` ```js // with "plugins": ["classProperties"] class Foo { [x] ['y'] } class Bar { [p] [m] () {} } ``` ### Bug Fix - Fix `static` property falling through in the declare class Flow AST ([#135](https://github.com/babel/babylon/pull/135)) @danharper ```js declare class X { a: number; static b: number; // static c: number; // this was being marked as static in the AST as well } ``` ### Polish - Rephrase "assigning/binding to rvalue" errors to include context ([#119](https://github.com/babel/babylon/pull/119)) @motiz88 ```js // Used to error with: // SyntaxError: Assigning to rvalue (1:0) // Now: // Invalid left-hand side in assignment expression (1:0) 3 = 4 // Invalid left-hand side in for-in statement (1:5) for (+i in {}); ``` ### Internal - Fix call to `this.parseMaybeAssign` with correct arguments ([#133](https://github.com/babel/babylon/pull/133)) @danez - Add semver note to changelog ([#131](https://github.com/babel/babylon/pull/131)) @hzoo ## 6.10.0 (2016-09-19) > We plan to include some spec compliance bugs in patch versions. An example was the multiple default exports issue. ### Spec Compliance * Implement ES2016 check for simple parameter list in strict mode ([#106](https://github.com/babel/babylon/pull/106)) (Timothy Gu) > It is a Syntax Error if ContainsUseStrict of FunctionBody is true and IsSimpleParameterList of FormalParameters is false. https://tc39.github.io/ecma262/2016/#sec-function-definitions-static-semantics-early-errors More Context: [tc39-notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2015-07/july-29.md#611-the-scope-of-use-strict-with-respect-to-destructuring-in-parameter-lists) For example: ```js // this errors because it uses destructuring and default parameters // in a function with a "use strict" directive function a([ option1, option2 ] = []) { "use strict"; } ``` The solution would be to use a top level "use strict" or to remove the destructuring or default parameters when using a function + "use strict" or to. ### New Feature * Exact object type annotations for Flow plugin ([#104](https://github.com/babel/babylon/pull/104)) (Basil Hosmer) Added to flow in https://github.com/facebook/flow/commit/c710c40aa2a115435098d6c0dfeaadb023cd39b8 Looks like: ```js var a : {| x: number, y: string |} = { x: 0, y: 'foo' }; ``` ### Bug Fixes * Include `typeParameter` location in `ArrowFunctionExpression` ([#126](https://github.com/babel/babylon/pull/126)) (Daniel Tschinder) * Error on invalid flow type annotation with default assignment ([#122](https://github.com/babel/babylon/pull/122)) (Dan Harper) * Fix Flow return types on arrow functions ([#124](https://github.com/babel/babylon/pull/124)) (Dan Harper) ### Misc * Add tests for export extensions ([#127](https://github.com/babel/babylon/pull/127)) (Daniel Tschinder) * Fix Contributing guidelines [skip ci] (Daniel Tschinder) ## 6.9.2 (2016-09-09) The only change is to remove the `babel-runtime` dependency by compiling with Babel's ES2015 loose mode. So using babylon standalone should be smaller. ## 6.9.1 (2016-08-23) This release contains mainly small bugfixes but also updates babylons default mode to es2017. The features for `exponentiationOperator`, `asyncFunctions` and `trailingFunctionCommas` which previously needed to be activated via plugin are now enabled by default and the plugins are now no-ops. ### Bug Fixes - Fix issues with default object params in async functions ([#96](https://github.com/babel/babylon/pull/96)) @danez - Fix issues with flow-types and async function ([#95](https://github.com/babel/babylon/pull/95)) @danez - Fix arrow functions with destructuring, types & default value ([#94](https://github.com/babel/babylon/pull/94)) @danharper - Fix declare class with qualified type identifier ([#97](https://github.com/babel/babylon/pull/97)) @danez - Remove exponentiationOperator, asyncFunctions, trailingFunctionCommas plugins and enable them by default ([#98](https://github.com/babel/babylon/pull/98)) @danez ## 6.9.0 (2016-08-16) ### New syntax support - Add JSX spread children ([#42](https://github.com/babel/babylon/pull/42)) @calebmer (Be aware that React is not going to support this syntax) ```js <div> {...todos.map(todo => <Todo key={todo.id} todo={todo}/>)} </div> ``` - Add support for declare module.exports ([#72](https://github.com/babel/babylon/pull/72)) @danez ```js declare module "foo" { declare module.exports: {} } ``` ### New Features - If supplied, attach filename property to comment node loc. ([#80](https://github.com/babel/babylon/pull/80)) @divmain - Add identifier name to node loc field ([#90](https://github.com/babel/babylon/pull/90)) @kittens ### Bug Fixes - Fix exponential operator to behave according to spec ([#75](https://github.com/babel/babylon/pull/75)) @danez - Fix lookahead to not add comments to arrays which are not cloned ([#76](https://github.com/babel/babylon/pull/76)) @danez - Fix accidental fall-through in Flow type parsing. ([#82](https://github.com/babel/babylon/pull/82)) @xiemaisi - Only allow declares inside declare module ([#73](https://github.com/babel/babylon/pull/73)) @danez - Small fix for parsing type parameter declarations ([#83](https://github.com/babel/babylon/pull/83)) @gabelevi - Fix arrow param locations with flow types ([#57](https://github.com/babel/babylon/pull/57)) @danez - Fixes SyntaxError position with flow optional type ([#65](https://github.com/babel/babylon/pull/65)) @danez ### Internal - Add codecoverage to tests @danez - Fix tests to not save expected output if we expect the test to fail @danez - Make a shallow clone of babel for testing @danez - chore(package): update cross-env to version 2.0.0 ([#77](https://github.com/babel/babylon/pull/77)) @greenkeeperio-bot - chore(package): update ava to version 0.16.0 ([#86](https://github.com/babel/babylon/pull/86)) @greenkeeperio-bot - chore(package): update babel-plugin-istanbul to version 2.0.0 ([#89](https://github.com/babel/babylon/pull/89)) @greenkeeperio-bot - chore(package): update nyc to version 8.0.0 ([#88](https://github.com/babel/babylon/pull/88)) @greenkeeperio-bot ## 6.8.4 (2016-07-06) ### Bug Fixes - Fix the location of params, when flow and default value used ([#68](https://github.com/babel/babylon/pull/68)) @danez ## 6.8.3 (2016-07-02) ### Bug Fixes - Fix performance regression introduced in 6.8.2 with conditionals ([#63](https://github.com/babel/babylon/pull/63)) @danez ## 6.8.2 (2016-06-24) ### Bug Fixes - Fix parse error with yielding jsx elements in generators `function* it() { yield <a></a>; }` ([#31](https://github.com/babel/babylon/pull/31)) @eldereal - When cloning nodes do not clone its comments ([#24](https://github.com/babel/babylon/pull/24)) @danez - Fix parse errors when using arrow functions with an spread element and return type `(...props): void => {}` ([#10](https://github.com/babel/babylon/pull/10)) @danez - Fix leading comments added from previous node ([#23](https://github.com/babel/babylon/pull/23)) @danez - Fix parse errors with flow's optional arguments `(arg?) => {}` ([#19](https://github.com/babel/babylon/pull/19)) @danez - Support negative numeric type literals @kittens - Remove line terminator restriction after await keyword @kittens - Remove grouped type arrow restriction as it seems flow no longer has it @kittens - Fix parse error with generic methods that have the name `get` or `set` `class foo { get() {} }` ([#55](https://github.com/babel/babylon/pull/55)) @vkurchatkin - Fix parse error with arrow functions that have flow type parameter declarations `<T>(x: T): T => x;` ([#54](https://github.com/babel/babylon/pull/54)) @gabelevi ### Documentation - Document AST differences from ESTree ([#41](https://github.com/babel/babylon/pull/41)) @nene - Move ast spec from babel/babel ([#46](https://github.com/babel/babylon/pull/46)) @hzoo ### Internal - Enable skipped tests ([#16](https://github.com/babel/babylon/pull/16)) @danez - Add script to test latest version of babylon with babel ([#21](https://github.com/babel/babylon/pull/21)) @danez - Upgrade test runner ava @kittens - Add missing generate-identifier-regex script @kittens - Rename parser context types @kittens - Add node v6 to travis testing @hzoo - Update to Unicode v9 ([#45](https://github.com/babel/babylon/pull/45)) @mathiasbynens ## 6.8.1 (2016-06-06) ### New Feature - Parse type parameter declarations with defaults like `type Foo<T = string> = T` ### Bug Fixes - Type parameter declarations need 1 or more type parameters. - The existential type `*` is not a valid type parameter. - The existential type `*` is a primary type ### Spec Compliance - The param list for type parameter declarations now consists of `TypeParameter` nodes - New `TypeParameter` AST Node (replaces using the `Identifier` node before) ``` interface TypeParameter <: Node { bound: TypeAnnotation; default: TypeAnnotation; name: string; variance: "plus" | "minus"; } ``` ## 6.8.0 (2016-05-02) #### New Feature ##### Parse Method Parameter Decorators ([#12](https://github.com/babel/babylon/pull/12)) > [Method Parameter Decorators](https://goo.gl/8MmCMG) is now a TC39 [stage 0 proposal](https://github.com/tc39/ecma262/blob/master/stage0.md). Examples: ```js class Foo { constructor(@foo() x, @bar({ a: 123 }) @baz() y) {} } export default function func(@foo() x, @bar({ a: 123 }) @baz() y) {} var obj = { method(@foo() x, @bar({ a: 123 }) @baz() y) {} }; ``` ##### Parse for-await statements (w/ `asyncGenerators` plugin) ([#17](https://github.com/babel/babylon/pull/17)) There is also a new node type, `ForAwaitStatement`. > [Async generators and for-await](https://github.com/tc39/proposal-async-iteration) are now a [stage 2 proposal](https://github.com/tc39/ecma262#current-proposals). Example: ```js async function f() { for await (let x of y); } ``` LICENSE 0000644 00000002076 15120211212 0005541 0 ustar 00 Copyright (C) 2012-2014 by various contributors (see AUTHORS) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. README.md 0000644 00000000653 15120211212 0006012 0 ustar 00 # @babel/parser > A JavaScript parser See our website [@babel/parser](https://babeljs.io/docs/en/babel-parser) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20parser%20(babylon)%22+is%3Aopen) associated with this package. ## Install Using npm: ```sh npm install --save-dev @babel/parser ``` or using yarn: ```sh yarn add @babel/parser --dev ``` bin/babel-parser.js 0000644 00000000510 15120211212 0010170 0 ustar 00 #!/usr/bin/env node /* eslint no-var: 0 */ var parser = require(".."); var fs = require("fs"); var filename = process.argv[2]; if (!filename) { console.error("no filename specified"); } else { var file = fs.readFileSync(filename, "utf8"); var ast = parser.parse(file); console.log(JSON.stringify(ast, null, " ")); } index.cjs 0000644 00000000157 15120211212 0006342 0 ustar 00 try { module.exports = require("./lib/index.cjs"); } catch { module.exports = require("./lib/index.js"); } lib/index.js 0000644 00001700303 15120211212 0006746 0 ustar 00 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } class Position { constructor(line, col, index) { this.line = void 0; this.column = void 0; this.index = void 0; this.line = line; this.column = col; this.index = index; } } class SourceLocation { constructor(start, end) { this.start = void 0; this.end = void 0; this.filename = void 0; this.identifierName = void 0; this.start = start; this.end = end; } } function createPositionWithColumnOffset(position, columnOffset) { const { line, column, index } = position; return new Position(line, column + columnOffset, index + columnOffset); } var ParseErrorCode = { SyntaxError: "BABEL_PARSER_SYNTAX_ERROR", SourceTypeModuleError: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED" }; const reflect = (keys, last = keys.length - 1) => ({ get() { return keys.reduce((object, key) => object[key], this); }, set(value) { keys.reduce((item, key, i) => i === last ? item[key] = value : item[key], this); } }); const instantiate = (constructor, properties, descriptors) => Object.keys(descriptors).map(key => [key, descriptors[key]]).filter(([, descriptor]) => !!descriptor).map(([key, descriptor]) => [key, typeof descriptor === "function" ? { value: descriptor, enumerable: false } : typeof descriptor.reflect === "string" ? Object.assign({}, descriptor, reflect(descriptor.reflect.split("."))) : descriptor]).reduce((instance, [key, descriptor]) => Object.defineProperty(instance, key, Object.assign({ configurable: true }, descriptor)), Object.assign(new constructor(), properties)); var ModuleErrors = { ImportMetaOutsideModule: { message: `import.meta may appear only with 'sourceType: "module"'`, code: ParseErrorCode.SourceTypeModuleError }, ImportOutsideModule: { message: `'import' and 'export' may appear only with 'sourceType: "module"'`, code: ParseErrorCode.SourceTypeModuleError } }; const NodeDescriptions = { ArrayPattern: "array destructuring pattern", AssignmentExpression: "assignment expression", AssignmentPattern: "assignment expression", ArrowFunctionExpression: "arrow function expression", ConditionalExpression: "conditional expression", CatchClause: "catch clause", ForOfStatement: "for-of statement", ForInStatement: "for-in statement", ForStatement: "for-loop", FormalParameters: "function parameter list", Identifier: "identifier", ImportSpecifier: "import specifier", ImportDefaultSpecifier: "import default specifier", ImportNamespaceSpecifier: "import namespace specifier", ObjectPattern: "object destructuring pattern", ParenthesizedExpression: "parenthesized expression", RestElement: "rest element", UpdateExpression: { true: "prefix operation", false: "postfix operation" }, VariableDeclarator: "variable declaration", YieldExpression: "yield expression" }; const toNodeDescription = ({ type, prefix }) => type === "UpdateExpression" ? NodeDescriptions.UpdateExpression[String(prefix)] : NodeDescriptions[type]; var StandardErrors = { AccessorIsGenerator: ({ kind }) => `A ${kind}ter cannot be a generator.`, ArgumentsInClass: "'arguments' is only allowed in functions and class methods.", AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block.", AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function.", AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block.", AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.", AwaitUsingNotInAsyncContext: "'await using' is only allowed within async functions and at the top levels of modules.", AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.", AwaitNotInAsyncFunction: "'await' is only allowed within async functions.", BadGetterArity: "A 'get' accessor must not have any formal parameters.", BadSetterArity: "A 'set' accessor must have exactly one formal parameter.", BadSetterRestParameter: "A 'set' accessor function argument must not be a rest parameter.", ConstructorClassField: "Classes may not have a field named 'constructor'.", ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.", ConstructorIsAccessor: "Class constructor may not be an accessor.", ConstructorIsAsync: "Constructor can't be an async function.", ConstructorIsGenerator: "Constructor can't be a generator.", DeclarationMissingInitializer: ({ kind }) => `Missing initializer in ${kind} declaration.`, DecoratorArgumentsOutsideParentheses: "Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.", DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.", DecoratorsBeforeAfterExport: "Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.", DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?", DecoratorExportClass: "Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.", DecoratorSemicolon: "Decorators must not be followed by a semicolon.", DecoratorStaticBlock: "Decorators can't be used with a static block.", DeletePrivateField: "Deleting a private field is not allowed.", DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.", DuplicateConstructor: "Duplicate constructor in the same class.", DuplicateDefaultExport: "Only one default export allowed per module.", DuplicateExport: ({ exportName }) => `\`${exportName}\` has already been exported. Exported identifiers must be unique.`, DuplicateProto: "Redefinition of __proto__ property.", DuplicateRegExpFlags: "Duplicate regular expression flag.", ElementAfterRest: "Rest element must be last element.", EscapedCharNotAnIdentifier: "Invalid Unicode escape.", ExportBindingIsString: ({ localName, exportName }) => `A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${localName}' as '${exportName}' } from 'some-module'\`?`, ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.", ForInOfLoopInitializer: ({ type }) => `'${type === "ForInStatement" ? "for-in" : "for-of"}' loop variable declaration may not have an initializer.`, ForInUsing: "For-in loop may not start with 'using' declaration.", ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.", ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.", GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block.", IllegalBreakContinue: ({ type }) => `Unsyntactic ${type === "BreakStatement" ? "break" : "continue"}.`, IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.", IllegalReturn: "'return' outside of function.", ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.", ImportBindingIsString: ({ importName }) => `A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${importName}" as foo }\`?`, ImportCallArgumentTrailingComma: "Trailing comma is disallowed inside import(...) arguments.", ImportCallArity: ({ maxArgumentCount }) => `\`import()\` requires exactly ${maxArgumentCount === 1 ? "one argument" : "one or two arguments"}.`, ImportCallNotNewExpression: "Cannot use new with import(...).", ImportCallSpreadArgument: "`...` is not allowed in `import()`.", ImportJSONBindingNotDefault: "A JSON module can only be imported with `default`.", ImportReflectionHasAssertion: "`import module x` cannot have assertions.", ImportReflectionNotBinding: 'Only `import module x from "./module"` is valid.', IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.", InvalidBigIntLiteral: "Invalid BigIntLiteral.", InvalidCodePoint: "Code point out of bounds.", InvalidCoverInitializedName: "Invalid shorthand property initializer.", InvalidDecimal: "Invalid decimal.", InvalidDigit: ({ radix }) => `Expected number in radix ${radix}.`, InvalidEscapeSequence: "Bad character escape sequence.", InvalidEscapeSequenceTemplate: "Invalid escape sequence in template.", InvalidEscapedReservedWord: ({ reservedWord }) => `Escape sequence in keyword ${reservedWord}.`, InvalidIdentifier: ({ identifierName }) => `Invalid identifier ${identifierName}.`, InvalidLhs: ({ ancestor }) => `Invalid left-hand side in ${toNodeDescription(ancestor)}.`, InvalidLhsBinding: ({ ancestor }) => `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`, InvalidNumber: "Invalid number.", InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.", InvalidOrUnexpectedToken: ({ unexpected }) => `Unexpected character '${unexpected}'.`, InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern.", InvalidPrivateFieldResolution: ({ identifierName }) => `Private name #${identifierName} is not defined.`, InvalidPropertyBindingPattern: "Binding member expression.", InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions.", InvalidRestAssignmentPattern: "Invalid rest operator's argument.", LabelRedeclaration: ({ labelName }) => `Label '${labelName}' is already declared.`, LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations.", LineTerminatorBeforeArrow: "No line break is allowed before '=>'.", MalformedRegExpFlags: "Invalid regular expression flag.", MissingClassName: "A class name is required.", MissingEqInAssignment: "Only '=' operator can be used for specifying default value.", MissingSemicolon: "Missing semicolon.", MissingPlugin: ({ missingPlugin }) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`, MissingOneOfPlugins: ({ missingPlugin }) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`, MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.", MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.", ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.", ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values.", ModuleAttributesWithDuplicateKeys: ({ key }) => `Duplicate key "${key}" is not allowed in module attributes.`, ModuleExportNameHasLoneSurrogate: ({ surrogateCharCode }) => `An export name cannot include a lone surrogate, found '\\u${surrogateCharCode.toString(16)}'.`, ModuleExportUndefined: ({ localName }) => `Export '${localName}' is not defined.`, MultipleDefaultsInSwitch: "Multiple default clauses.", NewlineAfterThrow: "Illegal newline after throw.", NoCatchOrFinally: "Missing catch or finally clause.", NumberIdentifier: "Identifier directly after number.", NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.", ObsoleteAwaitStar: "'await*' has been removed from the async functions proposal. Use Promise.all() instead.", OptionalChainingNoNew: "Constructors in/after an Optional Chain are not allowed.", OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain.", OverrideOnConstructor: "'override' modifier cannot appear on a constructor declaration.", ParamDupe: "Argument name clash.", PatternHasAccessor: "Object pattern can't contain getter or setter.", PatternHasMethod: "Object pattern can't contain methods.", PrivateInExpectedIn: ({ identifierName }) => `Private names are only allowed in property accesses (\`obj.#${identifierName}\`) or in \`in\` expressions (\`#${identifierName} in obj\`).`, PrivateNameRedeclaration: ({ identifierName }) => `Duplicate private name #${identifierName}.`, RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", RecordNoProto: "'__proto__' is not allowed in Record expressions.", RestTrailingComma: "Unexpected trailing comma after rest element.", SloppyFunction: "In non-strict mode code, functions can only be declared at top level or inside a block.", SloppyFunctionAnnexB: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.", StaticPrototype: "Classes may not have static property named prototype.", SuperNotAllowed: "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?", SuperPrivateField: "Private fields can't be accessed on super.", TrailingDecorator: "Decorators must be attached to a class element.", TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", UnexpectedArgumentPlaceholder: "Unexpected argument placeholder.", UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.', UnexpectedDigitAfterHash: "Unexpected digit after hash token.", UnexpectedImportExport: "'import' and 'export' may only appear at the top level.", UnexpectedKeyword: ({ keyword }) => `Unexpected keyword '${keyword}'.`, UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.", UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context.", UnexpectedNewTarget: "`new.target` can only be used in functions or class properties.", UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits.", UnexpectedPrivateField: "Unexpected private name.", UnexpectedReservedWord: ({ reservedWord }) => `Unexpected reserved word '${reservedWord}'.`, UnexpectedSuper: "'super' is only allowed in object methods and classes.", UnexpectedToken: ({ expected, unexpected }) => `Unexpected token${unexpected ? ` '${unexpected}'.` : ""}${expected ? `, expected "${expected}"` : ""}`, UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.", UnexpectedUsingDeclaration: "Using declaration cannot appear in the top level when source type is `script`.", UnsupportedBind: "Binding should be performed on object property.", UnsupportedDecoratorExport: "A decorated export must export a class declaration.", UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.", UnsupportedImport: "`import` can only be used in `import()` or `import.meta`.", UnsupportedMetaProperty: ({ target, onlyValidPropertyName }) => `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`, UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters.", UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties.", UnsupportedSuper: "'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).", UnterminatedComment: "Unterminated comment.", UnterminatedRegExp: "Unterminated regular expression.", UnterminatedString: "Unterminated string constant.", UnterminatedTemplate: "Unterminated template.", UsingDeclarationHasBindingPattern: "Using declaration cannot have destructuring patterns.", VarRedeclaration: ({ identifierName }) => `Identifier '${identifierName}' has already been declared.`, YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.", YieldInParameter: "Yield expression is not allowed in formal parameters.", ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0." }; var StrictModeErrors = { StrictDelete: "Deleting local variable in strict mode.", StrictEvalArguments: ({ referenceName }) => `Assigning to '${referenceName}' in strict mode.`, StrictEvalArgumentsBinding: ({ bindingName }) => `Binding '${bindingName}' in strict mode.`, StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block.", StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'.", StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.", StrictWith: "'with' in strict mode." }; const UnparenthesizedPipeBodyDescriptions = new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]); var PipelineOperatorErrors = { PipeBodyIsTighter: "Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.", PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.', PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.", PipeTopicUnconfiguredToken: ({ token }) => `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${token}" }.`, PipeTopicUnused: "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.", PipeUnparenthesizedBody: ({ type }) => `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({ type })}; please wrap it in parentheses.`, PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.', PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression.", PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression.", PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference.", PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.", PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.' }; const _excluded$1 = ["toMessage"], _excluded2$1 = ["message"]; function toParseErrorConstructor(_ref) { let { toMessage } = _ref, properties = _objectWithoutPropertiesLoose(_ref, _excluded$1); return function constructor({ loc, details }) { return instantiate(SyntaxError, Object.assign({}, properties, { loc }), { clone(overrides = {}) { const loc = overrides.loc || {}; return constructor({ loc: new Position("line" in loc ? loc.line : this.loc.line, "column" in loc ? loc.column : this.loc.column, "index" in loc ? loc.index : this.loc.index), details: Object.assign({}, this.details, overrides.details) }); }, details: { value: details, enumerable: false }, message: { get() { return `${toMessage(this.details)} (${this.loc.line}:${this.loc.column})`; }, set(value) { Object.defineProperty(this, "message", { value }); } }, pos: { reflect: "loc.index", enumerable: true }, missingPlugin: "missingPlugin" in details && { reflect: "details.missingPlugin", enumerable: true } }); }; } function ParseErrorEnum(argument, syntaxPlugin) { if (Array.isArray(argument)) { return parseErrorTemplates => ParseErrorEnum(parseErrorTemplates, argument[0]); } const ParseErrorConstructors = {}; for (const reasonCode of Object.keys(argument)) { const template = argument[reasonCode]; const _ref2 = typeof template === "string" ? { message: () => template } : typeof template === "function" ? { message: template } : template, { message } = _ref2, rest = _objectWithoutPropertiesLoose(_ref2, _excluded2$1); const toMessage = typeof message === "string" ? () => message : message; ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({ code: ParseErrorCode.SyntaxError, reasonCode, toMessage }, syntaxPlugin ? { syntaxPlugin } : {}, rest)); } return ParseErrorConstructors; } const Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors)); const { defineProperty } = Object; const toUnenumerable = (object, key) => defineProperty(object, key, { enumerable: false, value: object[key] }); function toESTreeLocation(node) { node.loc.start && toUnenumerable(node.loc.start, "index"); node.loc.end && toUnenumerable(node.loc.end, "index"); return node; } var estree = superClass => class ESTreeParserMixin extends superClass { parse() { const file = toESTreeLocation(super.parse()); if (this.options.tokens) { file.tokens = file.tokens.map(toESTreeLocation); } return file; } parseRegExpLiteral({ pattern, flags }) { let regex = null; try { regex = new RegExp(pattern, flags); } catch (e) {} const node = this.estreeParseLiteral(regex); node.regex = { pattern, flags }; return node; } parseBigIntLiteral(value) { let bigInt; try { bigInt = BigInt(value); } catch (_unused) { bigInt = null; } const node = this.estreeParseLiteral(bigInt); node.bigint = String(node.value || value); return node; } parseDecimalLiteral(value) { const decimal = null; const node = this.estreeParseLiteral(decimal); node.decimal = String(node.value || value); return node; } estreeParseLiteral(value) { return this.parseLiteral(value, "Literal"); } parseStringLiteral(value) { return this.estreeParseLiteral(value); } parseNumericLiteral(value) { return this.estreeParseLiteral(value); } parseNullLiteral() { return this.estreeParseLiteral(null); } parseBooleanLiteral(value) { return this.estreeParseLiteral(value); } directiveToStmt(directive) { const expression = directive.value; delete directive.value; expression.type = "Literal"; expression.raw = expression.extra.raw; expression.value = expression.extra.expressionValue; const stmt = directive; stmt.type = "ExpressionStatement"; stmt.expression = expression; stmt.directive = expression.extra.rawValue; delete expression.extra; return stmt; } initFunction(node, isAsync) { super.initFunction(node, isAsync); node.expression = false; } checkDeclaration(node) { if (node != null && this.isObjectProperty(node)) { this.checkDeclaration(node.value); } else { super.checkDeclaration(node); } } getObjectOrClassMethodParams(method) { return method.value.params; } isValidDirective(stmt) { var _stmt$expression$extr; return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized); } parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) { super.parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse); const directiveStatements = node.directives.map(d => this.directiveToStmt(d)); node.body = directiveStatements.concat(node.body); delete node.directives; } pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true); if (method.typeParameters) { method.value.typeParameters = method.typeParameters; delete method.typeParameters; } classBody.body.push(method); } parsePrivateName() { const node = super.parsePrivateName(); { if (!this.getPluginOption("estree", "classFeatures")) { return node; } } return this.convertPrivateNameToPrivateIdentifier(node); } convertPrivateNameToPrivateIdentifier(node) { const name = super.getPrivateNameSV(node); node = node; delete node.id; node.name = name; node.type = "PrivateIdentifier"; return node; } isPrivateName(node) { { if (!this.getPluginOption("estree", "classFeatures")) { return super.isPrivateName(node); } } return node.type === "PrivateIdentifier"; } getPrivateNameSV(node) { { if (!this.getPluginOption("estree", "classFeatures")) { return super.getPrivateNameSV(node); } } return node.name; } parseLiteral(value, type) { const node = super.parseLiteral(value, type); node.raw = node.extra.raw; delete node.extra; return node; } parseFunctionBody(node, allowExpression, isMethod = false) { super.parseFunctionBody(node, allowExpression, isMethod); node.expression = node.body.type !== "BlockStatement"; } parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { let funcNode = this.startNode(); funcNode.kind = node.kind; funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); funcNode.type = "FunctionExpression"; delete funcNode.kind; node.value = funcNode; if (type === "ClassPrivateMethod") { node.computed = false; } return this.finishNode(node, "MethodDefinition"); } parseClassProperty(...args) { const propertyNode = super.parseClassProperty(...args); { if (!this.getPluginOption("estree", "classFeatures")) { return propertyNode; } } propertyNode.type = "PropertyDefinition"; return propertyNode; } parseClassPrivateProperty(...args) { const propertyNode = super.parseClassPrivateProperty(...args); { if (!this.getPluginOption("estree", "classFeatures")) { return propertyNode; } } propertyNode.type = "PropertyDefinition"; propertyNode.computed = false; return propertyNode; } parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor); if (node) { node.type = "Property"; if (node.kind === "method") { node.kind = "init"; } node.shorthand = false; } return node; } parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) { const node = super.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors); if (node) { node.kind = "init"; node.type = "Property"; } return node; } isValidLVal(type, isUnparenthesizedInAssign, binding) { return type === "Property" ? "value" : super.isValidLVal(type, isUnparenthesizedInAssign, binding); } isAssignable(node, isBinding) { if (node != null && this.isObjectProperty(node)) { return this.isAssignable(node.value, isBinding); } return super.isAssignable(node, isBinding); } toAssignable(node, isLHS = false) { if (node != null && this.isObjectProperty(node)) { const { key, value } = node; if (this.isPrivateName(key)) { this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start); } this.toAssignable(value, isLHS); } else { super.toAssignable(node, isLHS); } } toAssignableObjectExpressionProp(prop, isLast, isLHS) { if (prop.kind === "get" || prop.kind === "set") { this.raise(Errors.PatternHasAccessor, { at: prop.key }); } else if (prop.method) { this.raise(Errors.PatternHasMethod, { at: prop.key }); } else { super.toAssignableObjectExpressionProp(prop, isLast, isLHS); } } finishCallExpression(unfinished, optional) { const node = super.finishCallExpression(unfinished, optional); if (node.callee.type === "Import") { node.type = "ImportExpression"; node.source = node.arguments[0]; if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) { var _node$arguments$; node.attributes = (_node$arguments$ = node.arguments[1]) != null ? _node$arguments$ : null; } delete node.arguments; delete node.callee; } return node; } toReferencedArguments(node) { if (node.type === "ImportExpression") { return; } super.toReferencedArguments(node); } parseExport(unfinished, decorators) { const exportStartLoc = this.state.lastTokStartLoc; const node = super.parseExport(unfinished, decorators); switch (node.type) { case "ExportAllDeclaration": node.exported = null; break; case "ExportNamedDeclaration": if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") { node.type = "ExportAllDeclaration"; node.exported = node.specifiers[0].exported; delete node.specifiers; } case "ExportDefaultDeclaration": { var _declaration$decorato; const { declaration } = node; if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && ((_declaration$decorato = declaration.decorators) == null ? void 0 : _declaration$decorato.length) > 0 && declaration.start === node.start) { this.resetStartLocation(node, exportStartLoc); } } break; } return node; } parseSubscript(base, startLoc, noCalls, state) { const node = super.parseSubscript(base, startLoc, noCalls, state); if (state.optionalChainMember) { if (node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression") { node.type = node.type.substring(8); } if (state.stop) { const chain = this.startNodeAtNode(node); chain.expression = node; return this.finishNode(chain, "ChainExpression"); } } else if (node.type === "MemberExpression" || node.type === "CallExpression") { node.optional = false; } return node; } hasPropertyAsPrivateName(node) { if (node.type === "ChainExpression") { node = node.expression; } return super.hasPropertyAsPrivateName(node); } isObjectProperty(node) { return node.type === "Property" && node.kind === "init" && !node.method; } isObjectMethod(node) { return node.method || node.kind === "get" || node.kind === "set"; } finishNodeAt(node, type, endLoc) { return toESTreeLocation(super.finishNodeAt(node, type, endLoc)); } resetStartLocation(node, startLoc) { super.resetStartLocation(node, startLoc); toESTreeLocation(node); } resetEndLocation(node, endLoc = this.state.lastTokEndLoc) { super.resetEndLocation(node, endLoc); toESTreeLocation(node); } }; class TokContext { constructor(token, preserveSpace) { this.token = void 0; this.preserveSpace = void 0; this.token = token; this.preserveSpace = !!preserveSpace; } } const types = { brace: new TokContext("{"), j_oTag: new TokContext("<tag"), j_cTag: new TokContext("</tag"), j_expr: new TokContext("<tag>...</tag>", true) }; { types.template = new TokContext("`", true); } const beforeExpr = true; const startsExpr = true; const isLoop = true; const isAssign = true; const prefix = true; const postfix = true; class ExportedTokenType { constructor(label, conf = {}) { this.label = void 0; this.keyword = void 0; this.beforeExpr = void 0; this.startsExpr = void 0; this.rightAssociative = void 0; this.isLoop = void 0; this.isAssign = void 0; this.prefix = void 0; this.postfix = void 0; this.binop = void 0; this.label = label; this.keyword = conf.keyword; this.beforeExpr = !!conf.beforeExpr; this.startsExpr = !!conf.startsExpr; this.rightAssociative = !!conf.rightAssociative; this.isLoop = !!conf.isLoop; this.isAssign = !!conf.isAssign; this.prefix = !!conf.prefix; this.postfix = !!conf.postfix; this.binop = conf.binop != null ? conf.binop : null; { this.updateContext = null; } } } const keywords$1 = new Map(); function createKeyword(name, options = {}) { options.keyword = name; const token = createToken(name, options); keywords$1.set(name, token); return token; } function createBinop(name, binop) { return createToken(name, { beforeExpr, binop }); } let tokenTypeCounter = -1; const tokenTypes = []; const tokenLabels = []; const tokenBinops = []; const tokenBeforeExprs = []; const tokenStartsExprs = []; const tokenPrefixes = []; function createToken(name, options = {}) { var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix; ++tokenTypeCounter; tokenLabels.push(name); tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1); tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false); tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false); tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false); tokenTypes.push(new ExportedTokenType(name, options)); return tokenTypeCounter; } function createKeywordLike(name, options = {}) { var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2; ++tokenTypeCounter; keywords$1.set(name, tokenTypeCounter); tokenLabels.push(name); tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1); tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false); tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false); tokenPrefixes.push((_options$prefix2 = options.prefix) != null ? _options$prefix2 : false); tokenTypes.push(new ExportedTokenType("name", options)); return tokenTypeCounter; } const tt = { bracketL: createToken("[", { beforeExpr, startsExpr }), bracketHashL: createToken("#[", { beforeExpr, startsExpr }), bracketBarL: createToken("[|", { beforeExpr, startsExpr }), bracketR: createToken("]"), bracketBarR: createToken("|]"), braceL: createToken("{", { beforeExpr, startsExpr }), braceBarL: createToken("{|", { beforeExpr, startsExpr }), braceHashL: createToken("#{", { beforeExpr, startsExpr }), braceR: createToken("}"), braceBarR: createToken("|}"), parenL: createToken("(", { beforeExpr, startsExpr }), parenR: createToken(")"), comma: createToken(",", { beforeExpr }), semi: createToken(";", { beforeExpr }), colon: createToken(":", { beforeExpr }), doubleColon: createToken("::", { beforeExpr }), dot: createToken("."), question: createToken("?", { beforeExpr }), questionDot: createToken("?."), arrow: createToken("=>", { beforeExpr }), template: createToken("template"), ellipsis: createToken("...", { beforeExpr }), backQuote: createToken("`", { startsExpr }), dollarBraceL: createToken("${", { beforeExpr, startsExpr }), templateTail: createToken("...`", { startsExpr }), templateNonTail: createToken("...${", { beforeExpr, startsExpr }), at: createToken("@"), hash: createToken("#", { startsExpr }), interpreterDirective: createToken("#!..."), eq: createToken("=", { beforeExpr, isAssign }), assign: createToken("_=", { beforeExpr, isAssign }), slashAssign: createToken("_=", { beforeExpr, isAssign }), xorAssign: createToken("_=", { beforeExpr, isAssign }), moduloAssign: createToken("_=", { beforeExpr, isAssign }), incDec: createToken("++/--", { prefix, postfix, startsExpr }), bang: createToken("!", { beforeExpr, prefix, startsExpr }), tilde: createToken("~", { beforeExpr, prefix, startsExpr }), doubleCaret: createToken("^^", { startsExpr }), doubleAt: createToken("@@", { startsExpr }), pipeline: createBinop("|>", 0), nullishCoalescing: createBinop("??", 1), logicalOR: createBinop("||", 1), logicalAND: createBinop("&&", 2), bitwiseOR: createBinop("|", 3), bitwiseXOR: createBinop("^", 4), bitwiseAND: createBinop("&", 5), equality: createBinop("==/!=/===/!==", 6), lt: createBinop("</>/<=/>=", 7), gt: createBinop("</>/<=/>=", 7), relational: createBinop("</>/<=/>=", 7), bitShift: createBinop("<</>>/>>>", 8), bitShiftL: createBinop("<</>>/>>>", 8), bitShiftR: createBinop("<</>>/>>>", 8), plusMin: createToken("+/-", { beforeExpr, binop: 9, prefix, startsExpr }), modulo: createToken("%", { binop: 10, startsExpr }), star: createToken("*", { binop: 10 }), slash: createBinop("/", 10), exponent: createToken("**", { beforeExpr, binop: 11, rightAssociative: true }), _in: createKeyword("in", { beforeExpr, binop: 7 }), _instanceof: createKeyword("instanceof", { beforeExpr, binop: 7 }), _break: createKeyword("break"), _case: createKeyword("case", { beforeExpr }), _catch: createKeyword("catch"), _continue: createKeyword("continue"), _debugger: createKeyword("debugger"), _default: createKeyword("default", { beforeExpr }), _else: createKeyword("else", { beforeExpr }), _finally: createKeyword("finally"), _function: createKeyword("function", { startsExpr }), _if: createKeyword("if"), _return: createKeyword("return", { beforeExpr }), _switch: createKeyword("switch"), _throw: createKeyword("throw", { beforeExpr, prefix, startsExpr }), _try: createKeyword("try"), _var: createKeyword("var"), _const: createKeyword("const"), _with: createKeyword("with"), _new: createKeyword("new", { beforeExpr, startsExpr }), _this: createKeyword("this", { startsExpr }), _super: createKeyword("super", { startsExpr }), _class: createKeyword("class", { startsExpr }), _extends: createKeyword("extends", { beforeExpr }), _export: createKeyword("export"), _import: createKeyword("import", { startsExpr }), _null: createKeyword("null", { startsExpr }), _true: createKeyword("true", { startsExpr }), _false: createKeyword("false", { startsExpr }), _typeof: createKeyword("typeof", { beforeExpr, prefix, startsExpr }), _void: createKeyword("void", { beforeExpr, prefix, startsExpr }), _delete: createKeyword("delete", { beforeExpr, prefix, startsExpr }), _do: createKeyword("do", { isLoop, beforeExpr }), _for: createKeyword("for", { isLoop }), _while: createKeyword("while", { isLoop }), _as: createKeywordLike("as", { startsExpr }), _assert: createKeywordLike("assert", { startsExpr }), _async: createKeywordLike("async", { startsExpr }), _await: createKeywordLike("await", { startsExpr }), _from: createKeywordLike("from", { startsExpr }), _get: createKeywordLike("get", { startsExpr }), _let: createKeywordLike("let", { startsExpr }), _meta: createKeywordLike("meta", { startsExpr }), _of: createKeywordLike("of", { startsExpr }), _sent: createKeywordLike("sent", { startsExpr }), _set: createKeywordLike("set", { startsExpr }), _static: createKeywordLike("static", { startsExpr }), _using: createKeywordLike("using", { startsExpr }), _yield: createKeywordLike("yield", { startsExpr }), _asserts: createKeywordLike("asserts", { startsExpr }), _checks: createKeywordLike("checks", { startsExpr }), _exports: createKeywordLike("exports", { startsExpr }), _global: createKeywordLike("global", { startsExpr }), _implements: createKeywordLike("implements", { startsExpr }), _intrinsic: createKeywordLike("intrinsic", { startsExpr }), _infer: createKeywordLike("infer", { startsExpr }), _is: createKeywordLike("is", { startsExpr }), _mixins: createKeywordLike("mixins", { startsExpr }), _proto: createKeywordLike("proto", { startsExpr }), _require: createKeywordLike("require", { startsExpr }), _satisfies: createKeywordLike("satisfies", { startsExpr }), _keyof: createKeywordLike("keyof", { startsExpr }), _readonly: createKeywordLike("readonly", { startsExpr }), _unique: createKeywordLike("unique", { startsExpr }), _abstract: createKeywordLike("abstract", { startsExpr }), _declare: createKeywordLike("declare", { startsExpr }), _enum: createKeywordLike("enum", { startsExpr }), _module: createKeywordLike("module", { startsExpr }), _namespace: createKeywordLike("namespace", { startsExpr }), _interface: createKeywordLike("interface", { startsExpr }), _type: createKeywordLike("type", { startsExpr }), _opaque: createKeywordLike("opaque", { startsExpr }), name: createToken("name", { startsExpr }), string: createToken("string", { startsExpr }), num: createToken("num", { startsExpr }), bigint: createToken("bigint", { startsExpr }), decimal: createToken("decimal", { startsExpr }), regexp: createToken("regexp", { startsExpr }), privateName: createToken("#name", { startsExpr }), eof: createToken("eof"), jsxName: createToken("jsxName"), jsxText: createToken("jsxText", { beforeExpr: true }), jsxTagStart: createToken("jsxTagStart", { startsExpr: true }), jsxTagEnd: createToken("jsxTagEnd"), placeholder: createToken("%%", { startsExpr: true }) }; function tokenIsIdentifier(token) { return token >= 93 && token <= 130; } function tokenKeywordOrIdentifierIsKeyword(token) { return token <= 92; } function tokenIsKeywordOrIdentifier(token) { return token >= 58 && token <= 130; } function tokenIsLiteralPropertyName(token) { return token >= 58 && token <= 134; } function tokenComesBeforeExpression(token) { return tokenBeforeExprs[token]; } function tokenCanStartExpression(token) { return tokenStartsExprs[token]; } function tokenIsAssignment(token) { return token >= 29 && token <= 33; } function tokenIsFlowInterfaceOrTypeOrOpaque(token) { return token >= 127 && token <= 129; } function tokenIsLoop(token) { return token >= 90 && token <= 92; } function tokenIsKeyword(token) { return token >= 58 && token <= 92; } function tokenIsOperator(token) { return token >= 39 && token <= 59; } function tokenIsPostfix(token) { return token === 34; } function tokenIsPrefix(token) { return tokenPrefixes[token]; } function tokenIsTSTypeOperator(token) { return token >= 119 && token <= 121; } function tokenIsTSDeclarationStart(token) { return token >= 122 && token <= 128; } function tokenLabelName(token) { return tokenLabels[token]; } function tokenOperatorPrecedence(token) { return tokenBinops[token]; } function tokenIsRightAssociative(token) { return token === 57; } function tokenIsTemplate(token) { return token >= 24 && token <= 25; } function getExportedToken(token) { return tokenTypes[token]; } { tokenTypes[8].updateContext = context => { context.pop(); }; tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = context => { context.push(types.brace); }; tokenTypes[22].updateContext = context => { if (context[context.length - 1] === types.template) { context.pop(); } else { context.push(types.template); } }; tokenTypes[140].updateContext = context => { context.push(types.j_expr, types.j_oTag); }; } let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938, 6, 4191]; const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; function isInAstralSet(code, set) { let pos = 0x10000; for (let i = 0, length = set.length; i < length; i += 2) { pos += set[i]; if (pos > code) return false; pos += set[i + 1]; if (pos >= code) return true; } return false; } function isIdentifierStart(code) { if (code < 65) return code === 36; if (code <= 90) return true; if (code < 97) return code === 95; if (code <= 122) return true; if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); } return isInAstralSet(code, astralIdentifierStartCodes); } function isIdentifierChar(code) { if (code < 48) return code === 36; if (code < 58) return true; if (code < 65) return false; if (code <= 90) return true; if (code < 97) return code === 95; if (code <= 122) return true; if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); } return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); } const reservedWords = { keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], strictBind: ["eval", "arguments"] }; const keywords = new Set(reservedWords.keyword); const reservedWordsStrictSet = new Set(reservedWords.strict); const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); function isReservedWord(word, inModule) { return inModule && word === "await" || word === "enum"; } function isStrictReservedWord(word, inModule) { return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); } function isStrictBindOnlyReservedWord(word) { return reservedWordsStrictBindSet.has(word); } function isStrictBindReservedWord(word, inModule) { return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); } function isKeyword(word) { return keywords.has(word); } function isIteratorStart(current, next, next2) { return current === 64 && next === 64 && isIdentifierStart(next2); } const reservedWordLikeSet = new Set(["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete", "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "eval", "arguments", "enum", "await"]); function canBeReservedWord(word) { return reservedWordLikeSet.has(word); } const SCOPE_OTHER = 0b000000000, SCOPE_PROGRAM = 0b000000001, SCOPE_FUNCTION = 0b000000010, SCOPE_ARROW = 0b000000100, SCOPE_SIMPLE_CATCH = 0b000001000, SCOPE_SUPER = 0b000010000, SCOPE_DIRECT_SUPER = 0b000100000, SCOPE_CLASS = 0b001000000, SCOPE_STATIC_BLOCK = 0b010000000, SCOPE_TS_MODULE = 0b100000000, SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_STATIC_BLOCK | SCOPE_TS_MODULE; const BIND_KIND_VALUE = 0b0000000000001, BIND_KIND_TYPE = 0b0000000000010, BIND_SCOPE_VAR = 0b0000000000100, BIND_SCOPE_LEXICAL = 0b0000000001000, BIND_SCOPE_FUNCTION = 0b0000000010000, BIND_FLAGS_NONE = 0b00000001000000, BIND_FLAGS_CLASS = 0b00000010000000, BIND_FLAGS_TS_ENUM = 0b00000100000000, BIND_FLAGS_TS_CONST_ENUM = 0b00001000000000, BIND_FLAGS_TS_EXPORT_ONLY = 0b00010000000000, BIND_FLAGS_FLOW_DECLARE_FN = 0b00100000000000, BIND_FLAGS_TS_IMPORT = 0b01000000000000, BIND_FLAGS_NO_LET_IN_LEXICAL = 0b10000000000000; const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS | BIND_FLAGS_NO_LET_IN_LEXICAL, BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | BIND_FLAGS_NO_LET_IN_LEXICAL, BIND_CATCH_PARAM = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0, BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0, BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0, BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS, BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0, BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM | BIND_FLAGS_NO_LET_IN_LEXICAL, BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY, BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE, BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE, BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM, BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY, BIND_TS_TYPE_IMPORT = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_TS_IMPORT, BIND_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN; const CLASS_ELEMENT_FLAG_STATIC = 0b100, CLASS_ELEMENT_KIND_GETTER = 0b010, CLASS_ELEMENT_KIND_SETTER = 0b001, CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER; const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC, CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC, CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER, CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER, CLASS_ELEMENT_OTHER = 0; class Scope { constructor(flags) { this.var = new Set(); this.lexical = new Set(); this.functions = new Set(); this.flags = flags; } } class ScopeHandler { constructor(parser, inModule) { this.parser = void 0; this.scopeStack = []; this.inModule = void 0; this.undefinedExports = new Map(); this.parser = parser; this.inModule = inModule; } get inTopLevel() { return (this.currentScope().flags & SCOPE_PROGRAM) > 0; } get inFunction() { return (this.currentVarScopeFlags() & SCOPE_FUNCTION) > 0; } get allowSuper() { return (this.currentThisScopeFlags() & SCOPE_SUPER) > 0; } get allowDirectSuper() { return (this.currentThisScopeFlags() & SCOPE_DIRECT_SUPER) > 0; } get inClass() { return (this.currentThisScopeFlags() & SCOPE_CLASS) > 0; } get inClassAndNotInNonArrowFunction() { const flags = this.currentThisScopeFlags(); return (flags & SCOPE_CLASS) > 0 && (flags & SCOPE_FUNCTION) === 0; } get inStaticBlock() { for (let i = this.scopeStack.length - 1;; i--) { const { flags } = this.scopeStack[i]; if (flags & SCOPE_STATIC_BLOCK) { return true; } if (flags & (SCOPE_VAR | SCOPE_CLASS)) { return false; } } } get inNonArrowFunction() { return (this.currentThisScopeFlags() & SCOPE_FUNCTION) > 0; } get treatFunctionsAsVar() { return this.treatFunctionsAsVarInScope(this.currentScope()); } createScope(flags) { return new Scope(flags); } enter(flags) { this.scopeStack.push(this.createScope(flags)); } exit() { const scope = this.scopeStack.pop(); return scope.flags; } treatFunctionsAsVarInScope(scope) { return !!(scope.flags & (SCOPE_FUNCTION | SCOPE_STATIC_BLOCK) || !this.parser.inModule && scope.flags & SCOPE_PROGRAM); } declareName(name, bindingType, loc) { let scope = this.currentScope(); if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) { this.checkRedeclarationInScope(scope, name, bindingType, loc); if (bindingType & BIND_SCOPE_FUNCTION) { scope.functions.add(name); } else { scope.lexical.add(name); } if (bindingType & BIND_SCOPE_LEXICAL) { this.maybeExportDefined(scope, name); } } else if (bindingType & BIND_SCOPE_VAR) { for (let i = this.scopeStack.length - 1; i >= 0; --i) { scope = this.scopeStack[i]; this.checkRedeclarationInScope(scope, name, bindingType, loc); scope.var.add(name); this.maybeExportDefined(scope, name); if (scope.flags & SCOPE_VAR) break; } } if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) { this.undefinedExports.delete(name); } } maybeExportDefined(scope, name) { if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) { this.undefinedExports.delete(name); } } checkRedeclarationInScope(scope, name, bindingType, loc) { if (this.isRedeclaredInScope(scope, name, bindingType)) { this.parser.raise(Errors.VarRedeclaration, { at: loc, identifierName: name }); } } isRedeclaredInScope(scope, name, bindingType) { if (!(bindingType & BIND_KIND_VALUE)) return false; if (bindingType & BIND_SCOPE_LEXICAL) { return scope.lexical.has(name) || scope.functions.has(name) || scope.var.has(name); } if (bindingType & BIND_SCOPE_FUNCTION) { return scope.lexical.has(name) || !this.treatFunctionsAsVarInScope(scope) && scope.var.has(name); } return scope.lexical.has(name) && !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical.values().next().value === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name); } checkLocalExport(id) { const { name } = id; const topLevelScope = this.scopeStack[0]; if (!topLevelScope.lexical.has(name) && !topLevelScope.var.has(name) && !topLevelScope.functions.has(name)) { this.undefinedExports.set(name, id.loc.start); } } currentScope() { return this.scopeStack[this.scopeStack.length - 1]; } currentVarScopeFlags() { for (let i = this.scopeStack.length - 1;; i--) { const { flags } = this.scopeStack[i]; if (flags & SCOPE_VAR) { return flags; } } } currentThisScopeFlags() { for (let i = this.scopeStack.length - 1;; i--) { const { flags } = this.scopeStack[i]; if (flags & (SCOPE_VAR | SCOPE_CLASS) && !(flags & SCOPE_ARROW)) { return flags; } } } } class FlowScope extends Scope { constructor(...args) { super(...args); this.declareFunctions = new Set(); } } class FlowScopeHandler extends ScopeHandler { createScope(flags) { return new FlowScope(flags); } declareName(name, bindingType, loc) { const scope = this.currentScope(); if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) { this.checkRedeclarationInScope(scope, name, bindingType, loc); this.maybeExportDefined(scope, name); scope.declareFunctions.add(name); return; } super.declareName(name, bindingType, loc); } isRedeclaredInScope(scope, name, bindingType) { if (super.isRedeclaredInScope(scope, name, bindingType)) return true; if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) { return !scope.declareFunctions.has(name) && (scope.lexical.has(name) || scope.functions.has(name)); } return false; } checkLocalExport(id) { if (!this.scopeStack[0].declareFunctions.has(id.name)) { super.checkLocalExport(id); } } } class BaseParser { constructor() { this.sawUnambiguousESM = false; this.ambiguousScriptDifferentAst = false; } hasPlugin(pluginConfig) { if (typeof pluginConfig === "string") { return this.plugins.has(pluginConfig); } else { const [pluginName, pluginOptions] = pluginConfig; if (!this.hasPlugin(pluginName)) { return false; } const actualOptions = this.plugins.get(pluginName); for (const key of Object.keys(pluginOptions)) { if ((actualOptions == null ? void 0 : actualOptions[key]) !== pluginOptions[key]) { return false; } } return true; } } getPluginOption(plugin, name) { var _this$plugins$get; return (_this$plugins$get = this.plugins.get(plugin)) == null ? void 0 : _this$plugins$get[name]; } } function setTrailingComments(node, comments) { if (node.trailingComments === undefined) { node.trailingComments = comments; } else { node.trailingComments.unshift(...comments); } } function setLeadingComments(node, comments) { if (node.leadingComments === undefined) { node.leadingComments = comments; } else { node.leadingComments.unshift(...comments); } } function setInnerComments(node, comments) { if (node.innerComments === undefined) { node.innerComments = comments; } else { node.innerComments.unshift(...comments); } } function adjustInnerComments(node, elements, commentWS) { let lastElement = null; let i = elements.length; while (lastElement === null && i > 0) { lastElement = elements[--i]; } if (lastElement === null || lastElement.start > commentWS.start) { setInnerComments(node, commentWS.comments); } else { setTrailingComments(lastElement, commentWS.comments); } } class CommentsParser extends BaseParser { addComment(comment) { if (this.filename) comment.loc.filename = this.filename; this.state.comments.push(comment); } processComment(node) { const { commentStack } = this.state; const commentStackLength = commentStack.length; if (commentStackLength === 0) return; let i = commentStackLength - 1; const lastCommentWS = commentStack[i]; if (lastCommentWS.start === node.end) { lastCommentWS.leadingNode = node; i--; } const { start: nodeStart } = node; for (; i >= 0; i--) { const commentWS = commentStack[i]; const commentEnd = commentWS.end; if (commentEnd > nodeStart) { commentWS.containingNode = node; this.finalizeComment(commentWS); commentStack.splice(i, 1); } else { if (commentEnd === nodeStart) { commentWS.trailingNode = node; } break; } } } finalizeComment(commentWS) { const { comments } = commentWS; if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) { if (commentWS.leadingNode !== null) { setTrailingComments(commentWS.leadingNode, comments); } if (commentWS.trailingNode !== null) { setLeadingComments(commentWS.trailingNode, comments); } } else { const { containingNode: node, start: commentStart } = commentWS; if (this.input.charCodeAt(commentStart - 1) === 44) { switch (node.type) { case "ObjectExpression": case "ObjectPattern": case "RecordExpression": adjustInnerComments(node, node.properties, commentWS); break; case "CallExpression": case "OptionalCallExpression": adjustInnerComments(node, node.arguments, commentWS); break; case "FunctionDeclaration": case "FunctionExpression": case "ArrowFunctionExpression": case "ObjectMethod": case "ClassMethod": case "ClassPrivateMethod": adjustInnerComments(node, node.params, commentWS); break; case "ArrayExpression": case "ArrayPattern": case "TupleExpression": adjustInnerComments(node, node.elements, commentWS); break; case "ExportNamedDeclaration": case "ImportDeclaration": adjustInnerComments(node, node.specifiers, commentWS); break; default: { setInnerComments(node, comments); } } } else { setInnerComments(node, comments); } } } finalizeRemainingComments() { const { commentStack } = this.state; for (let i = commentStack.length - 1; i >= 0; i--) { this.finalizeComment(commentStack[i]); } this.state.commentStack = []; } resetPreviousNodeTrailingComments(node) { const { commentStack } = this.state; const { length } = commentStack; if (length === 0) return; const commentWS = commentStack[length - 1]; if (commentWS.leadingNode === node) { commentWS.leadingNode = null; } } resetPreviousIdentifierLeadingComments(node) { const { commentStack } = this.state; const { length } = commentStack; if (length === 0) return; if (commentStack[length - 1].trailingNode === node) { commentStack[length - 1].trailingNode = null; } else if (length >= 2 && commentStack[length - 2].trailingNode === node) { commentStack[length - 2].trailingNode = null; } } takeSurroundingComments(node, start, end) { const { commentStack } = this.state; const commentStackLength = commentStack.length; if (commentStackLength === 0) return; let i = commentStackLength - 1; for (; i >= 0; i--) { const commentWS = commentStack[i]; const commentEnd = commentWS.end; const commentStart = commentWS.start; if (commentStart === end) { commentWS.leadingNode = node; } else if (commentEnd === start) { commentWS.trailingNode = node; } else if (commentEnd < start) { break; } } } } const lineBreak = /\r\n?|[\n\u2028\u2029]/; const lineBreakG = new RegExp(lineBreak.source, "g"); function isNewLine(code) { switch (code) { case 10: case 13: case 8232: case 8233: return true; default: return false; } } const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g; const skipWhiteSpaceToLineBreak = new RegExp("(?=(" + skipWhiteSpaceInLine.source + "))\\1" + /(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source, "y"); function isWhitespace(code) { switch (code) { case 0x0009: case 0x000b: case 0x000c: case 32: case 160: case 5760: case 0x2000: case 0x2001: case 0x2002: case 0x2003: case 0x2004: case 0x2005: case 0x2006: case 0x2007: case 0x2008: case 0x2009: case 0x200a: case 0x202f: case 0x205f: case 0x3000: case 0xfeff: return true; default: return false; } } class State { constructor() { this.strict = void 0; this.curLine = void 0; this.lineStart = void 0; this.startLoc = void 0; this.endLoc = void 0; this.errors = []; this.potentialArrowAt = -1; this.noArrowAt = []; this.noArrowParamsConversionAt = []; this.maybeInArrowParameters = false; this.inType = false; this.noAnonFunctionType = false; this.hasFlowComment = false; this.isAmbientContext = false; this.inAbstractClass = false; this.inDisallowConditionalTypesContext = false; this.topicContext = { maxNumOfResolvableTopics: 0, maxTopicIndex: null }; this.soloAwait = false; this.inFSharpPipelineDirectBody = false; this.labels = []; this.comments = []; this.commentStack = []; this.pos = 0; this.type = 137; this.value = null; this.start = 0; this.end = 0; this.lastTokEndLoc = null; this.lastTokStartLoc = null; this.lastTokStart = 0; this.context = [types.brace]; this.canStartJSXElement = true; this.containsEsc = false; this.firstInvalidTemplateEscapePos = null; this.strictErrors = new Map(); this.tokensLength = 0; } init({ strictMode, sourceType, startLine, startColumn }) { this.strict = strictMode === false ? false : strictMode === true ? true : sourceType === "module"; this.curLine = startLine; this.lineStart = -startColumn; this.startLoc = this.endLoc = new Position(startLine, startColumn, 0); } curPosition() { return new Position(this.curLine, this.pos - this.lineStart, this.pos); } clone(skipArrays) { const state = new State(); const keys = Object.keys(this); for (let i = 0, length = keys.length; i < length; i++) { const key = keys[i]; let val = this[key]; if (!skipArrays && Array.isArray(val)) { val = val.slice(); } state[key] = val; } return state; } } var _isDigit = function isDigit(code) { return code >= 48 && code <= 57; }; const forbiddenNumericSeparatorSiblings = { decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]), hex: new Set([46, 88, 95, 120]) }; const isAllowedNumericSeparatorSibling = { bin: ch => ch === 48 || ch === 49, oct: ch => ch >= 48 && ch <= 55, dec: ch => ch >= 48 && ch <= 57, hex: ch => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102 }; function readStringContents(type, input, pos, lineStart, curLine, errors) { const initialPos = pos; const initialLineStart = lineStart; const initialCurLine = curLine; let out = ""; let firstInvalidLoc = null; let chunkStart = pos; const { length } = input; for (;;) { if (pos >= length) { errors.unterminated(initialPos, initialLineStart, initialCurLine); out += input.slice(chunkStart, pos); break; } const ch = input.charCodeAt(pos); if (isStringEnd(type, ch, input, pos)) { out += input.slice(chunkStart, pos); break; } if (ch === 92) { out += input.slice(chunkStart, pos); const res = readEscapedChar(input, pos, lineStart, curLine, type === "template", errors); if (res.ch === null && !firstInvalidLoc) { firstInvalidLoc = { pos, lineStart, curLine }; } else { out += res.ch; } ({ pos, lineStart, curLine } = res); chunkStart = pos; } else if (ch === 8232 || ch === 8233) { ++pos; ++curLine; lineStart = pos; } else if (ch === 10 || ch === 13) { if (type === "template") { out += input.slice(chunkStart, pos) + "\n"; ++pos; if (ch === 13 && input.charCodeAt(pos) === 10) { ++pos; } ++curLine; chunkStart = lineStart = pos; } else { errors.unterminated(initialPos, initialLineStart, initialCurLine); } } else { ++pos; } } return { pos, str: out, firstInvalidLoc, lineStart, curLine, containsInvalid: !!firstInvalidLoc }; } function isStringEnd(type, ch, input, pos) { if (type === "template") { return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123; } return ch === (type === "double" ? 34 : 39); } function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) { const throwOnInvalid = !inTemplate; pos++; const res = ch => ({ pos, ch, lineStart, curLine }); const ch = input.charCodeAt(pos++); switch (ch) { case 110: return res("\n"); case 114: return res("\r"); case 120: { let code; ({ code, pos } = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors)); return res(code === null ? null : String.fromCharCode(code)); } case 117: { let code; ({ code, pos } = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors)); return res(code === null ? null : String.fromCodePoint(code)); } case 116: return res("\t"); case 98: return res("\b"); case 118: return res("\u000b"); case 102: return res("\f"); case 13: if (input.charCodeAt(pos) === 10) { ++pos; } case 10: lineStart = pos; ++curLine; case 8232: case 8233: return res(""); case 56: case 57: if (inTemplate) { return res(null); } else { errors.strictNumericEscape(pos - 1, lineStart, curLine); } default: if (ch >= 48 && ch <= 55) { const startPos = pos - 1; const match = input.slice(startPos, pos + 2).match(/^[0-7]+/); let octalStr = match[0]; let octal = parseInt(octalStr, 8); if (octal > 255) { octalStr = octalStr.slice(0, -1); octal = parseInt(octalStr, 8); } pos += octalStr.length - 1; const next = input.charCodeAt(pos); if (octalStr !== "0" || next === 56 || next === 57) { if (inTemplate) { return res(null); } else { errors.strictNumericEscape(startPos, lineStart, curLine); } } return res(String.fromCharCode(octal)); } return res(String.fromCharCode(ch)); } } function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) { const initialPos = pos; let n; ({ n, pos } = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid)); if (n === null) { if (throwOnInvalid) { errors.invalidEscapeSequence(initialPos, lineStart, curLine); } else { pos = initialPos - 1; } } return { code: n, pos }; } function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) { const start = pos; const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct; const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin; let invalid = false; let total = 0; for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) { const code = input.charCodeAt(pos); let val; if (code === 95 && allowNumSeparator !== "bail") { const prev = input.charCodeAt(pos - 1); const next = input.charCodeAt(pos + 1); if (!allowNumSeparator) { if (bailOnError) return { n: null, pos }; errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine); } else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) { if (bailOnError) return { n: null, pos }; errors.unexpectedNumericSeparator(pos, lineStart, curLine); } ++pos; continue; } if (code >= 97) { val = code - 97 + 10; } else if (code >= 65) { val = code - 65 + 10; } else if (_isDigit(code)) { val = code - 48; } else { val = Infinity; } if (val >= radix) { if (val <= 9 && bailOnError) { return { n: null, pos }; } else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) { val = 0; } else if (forceLen) { val = 0; invalid = true; } else { break; } } ++pos; total = total * radix + val; } if (pos === start || len != null && pos - start !== len || invalid) { return { n: null, pos }; } return { n: total, pos }; } function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) { const ch = input.charCodeAt(pos); let code; if (ch === 123) { ++pos; ({ code, pos } = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors)); ++pos; if (code !== null && code > 0x10ffff) { if (throwOnInvalid) { errors.invalidCodePoint(pos, lineStart, curLine); } else { return { code: null, pos }; } } } else { ({ code, pos } = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors)); } return { code, pos }; } const _excluded = ["at"], _excluded2 = ["at"]; function buildPosition(pos, lineStart, curLine) { return new Position(curLine, pos - lineStart, pos); } const VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100, 118]); class Token { constructor(state) { this.type = state.type; this.value = state.value; this.start = state.start; this.end = state.end; this.loc = new SourceLocation(state.startLoc, state.endLoc); } } class Tokenizer extends CommentsParser { constructor(options, input) { super(); this.isLookahead = void 0; this.tokens = []; this.errorHandlers_readInt = { invalidDigit: (pos, lineStart, curLine, radix) => { if (!this.options.errorRecovery) return false; this.raise(Errors.InvalidDigit, { at: buildPosition(pos, lineStart, curLine), radix }); return true; }, numericSeparatorInEscapeSequence: this.errorBuilder(Errors.NumericSeparatorInEscapeSequence), unexpectedNumericSeparator: this.errorBuilder(Errors.UnexpectedNumericSeparator) }; this.errorHandlers_readCodePoint = Object.assign({}, this.errorHandlers_readInt, { invalidEscapeSequence: this.errorBuilder(Errors.InvalidEscapeSequence), invalidCodePoint: this.errorBuilder(Errors.InvalidCodePoint) }); this.errorHandlers_readStringContents_string = Object.assign({}, this.errorHandlers_readCodePoint, { strictNumericEscape: (pos, lineStart, curLine) => { this.recordStrictModeErrors(Errors.StrictNumericEscape, { at: buildPosition(pos, lineStart, curLine) }); }, unterminated: (pos, lineStart, curLine) => { throw this.raise(Errors.UnterminatedString, { at: buildPosition(pos - 1, lineStart, curLine) }); } }); this.errorHandlers_readStringContents_template = Object.assign({}, this.errorHandlers_readCodePoint, { strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape), unterminated: (pos, lineStart, curLine) => { throw this.raise(Errors.UnterminatedTemplate, { at: buildPosition(pos, lineStart, curLine) }); } }); this.state = new State(); this.state.init(options); this.input = input; this.length = input.length; this.isLookahead = false; } pushToken(token) { this.tokens.length = this.state.tokensLength; this.tokens.push(token); ++this.state.tokensLength; } next() { this.checkKeywordEscapes(); if (this.options.tokens) { this.pushToken(new Token(this.state)); } this.state.lastTokStart = this.state.start; this.state.lastTokEndLoc = this.state.endLoc; this.state.lastTokStartLoc = this.state.startLoc; this.nextToken(); } eat(type) { if (this.match(type)) { this.next(); return true; } else { return false; } } match(type) { return this.state.type === type; } createLookaheadState(state) { return { pos: state.pos, value: null, type: state.type, start: state.start, end: state.end, context: [this.curContext()], inType: state.inType, startLoc: state.startLoc, lastTokEndLoc: state.lastTokEndLoc, curLine: state.curLine, lineStart: state.lineStart, curPosition: state.curPosition }; } lookahead() { const old = this.state; this.state = this.createLookaheadState(old); this.isLookahead = true; this.nextToken(); this.isLookahead = false; const curr = this.state; this.state = old; return curr; } nextTokenStart() { return this.nextTokenStartSince(this.state.pos); } nextTokenStartSince(pos) { skipWhiteSpace.lastIndex = pos; return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos; } lookaheadCharCode() { return this.input.charCodeAt(this.nextTokenStart()); } nextTokenInLineStart() { return this.nextTokenInLineStartSince(this.state.pos); } nextTokenInLineStartSince(pos) { skipWhiteSpaceInLine.lastIndex = pos; return skipWhiteSpaceInLine.test(this.input) ? skipWhiteSpaceInLine.lastIndex : pos; } lookaheadInLineCharCode() { return this.input.charCodeAt(this.nextTokenInLineStart()); } codePointAtPos(pos) { let cp = this.input.charCodeAt(pos); if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) { const trail = this.input.charCodeAt(pos); if ((trail & 0xfc00) === 0xdc00) { cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); } } return cp; } setStrict(strict) { this.state.strict = strict; if (strict) { this.state.strictErrors.forEach(([toParseError, at]) => this.raise(toParseError, { at })); this.state.strictErrors.clear(); } } curContext() { return this.state.context[this.state.context.length - 1]; } nextToken() { this.skipSpace(); this.state.start = this.state.pos; if (!this.isLookahead) this.state.startLoc = this.state.curPosition(); if (this.state.pos >= this.length) { this.finishToken(137); return; } this.getTokenFromCode(this.codePointAtPos(this.state.pos)); } skipBlockComment(commentEnd) { let startLoc; if (!this.isLookahead) startLoc = this.state.curPosition(); const start = this.state.pos; const end = this.input.indexOf(commentEnd, start + 2); if (end === -1) { throw this.raise(Errors.UnterminatedComment, { at: this.state.curPosition() }); } this.state.pos = end + commentEnd.length; lineBreakG.lastIndex = start + 2; while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) { ++this.state.curLine; this.state.lineStart = lineBreakG.lastIndex; } if (this.isLookahead) return; const comment = { type: "CommentBlock", value: this.input.slice(start + 2, end), start, end: end + commentEnd.length, loc: new SourceLocation(startLoc, this.state.curPosition()) }; if (this.options.tokens) this.pushToken(comment); return comment; } skipLineComment(startSkip) { const start = this.state.pos; let startLoc; if (!this.isLookahead) startLoc = this.state.curPosition(); let ch = this.input.charCodeAt(this.state.pos += startSkip); if (this.state.pos < this.length) { while (!isNewLine(ch) && ++this.state.pos < this.length) { ch = this.input.charCodeAt(this.state.pos); } } if (this.isLookahead) return; const end = this.state.pos; const value = this.input.slice(start + startSkip, end); const comment = { type: "CommentLine", value, start, end, loc: new SourceLocation(startLoc, this.state.curPosition()) }; if (this.options.tokens) this.pushToken(comment); return comment; } skipSpace() { const spaceStart = this.state.pos; const comments = []; loop: while (this.state.pos < this.length) { const ch = this.input.charCodeAt(this.state.pos); switch (ch) { case 32: case 160: case 9: ++this.state.pos; break; case 13: if (this.input.charCodeAt(this.state.pos + 1) === 10) { ++this.state.pos; } case 10: case 8232: case 8233: ++this.state.pos; ++this.state.curLine; this.state.lineStart = this.state.pos; break; case 47: switch (this.input.charCodeAt(this.state.pos + 1)) { case 42: { const comment = this.skipBlockComment("*/"); if (comment !== undefined) { this.addComment(comment); if (this.options.attachComment) comments.push(comment); } break; } case 47: { const comment = this.skipLineComment(2); if (comment !== undefined) { this.addComment(comment); if (this.options.attachComment) comments.push(comment); } break; } default: break loop; } break; default: if (isWhitespace(ch)) { ++this.state.pos; } else if (ch === 45 && !this.inModule && this.options.annexB) { const pos = this.state.pos; if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) { const comment = this.skipLineComment(3); if (comment !== undefined) { this.addComment(comment); if (this.options.attachComment) comments.push(comment); } } else { break loop; } } else if (ch === 60 && !this.inModule && this.options.annexB) { const pos = this.state.pos; if (this.input.charCodeAt(pos + 1) === 33 && this.input.charCodeAt(pos + 2) === 45 && this.input.charCodeAt(pos + 3) === 45) { const comment = this.skipLineComment(4); if (comment !== undefined) { this.addComment(comment); if (this.options.attachComment) comments.push(comment); } } else { break loop; } } else { break loop; } } } if (comments.length > 0) { const end = this.state.pos; const commentWhitespace = { start: spaceStart, end, comments, leadingNode: null, trailingNode: null, containingNode: null }; this.state.commentStack.push(commentWhitespace); } } finishToken(type, val) { this.state.end = this.state.pos; this.state.endLoc = this.state.curPosition(); const prevType = this.state.type; this.state.type = type; this.state.value = val; if (!this.isLookahead) { this.updateContext(prevType); } } replaceToken(type) { this.state.type = type; this.updateContext(); } readToken_numberSign() { if (this.state.pos === 0 && this.readToken_interpreter()) { return; } const nextPos = this.state.pos + 1; const next = this.codePointAtPos(nextPos); if (next >= 48 && next <= 57) { throw this.raise(Errors.UnexpectedDigitAfterHash, { at: this.state.curPosition() }); } if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) { this.expectPlugin("recordAndTuple"); if (this.getPluginOption("recordAndTuple", "syntaxType") === "bar") { throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType, { at: this.state.curPosition() }); } this.state.pos += 2; if (next === 123) { this.finishToken(7); } else { this.finishToken(1); } } else if (isIdentifierStart(next)) { ++this.state.pos; this.finishToken(136, this.readWord1(next)); } else if (next === 92) { ++this.state.pos; this.finishToken(136, this.readWord1()); } else { this.finishOp(27, 1); } } readToken_dot() { const next = this.input.charCodeAt(this.state.pos + 1); if (next >= 48 && next <= 57) { this.readNumber(true); return; } if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) { this.state.pos += 3; this.finishToken(21); } else { ++this.state.pos; this.finishToken(16); } } readToken_slash() { const next = this.input.charCodeAt(this.state.pos + 1); if (next === 61) { this.finishOp(31, 2); } else { this.finishOp(56, 1); } } readToken_interpreter() { if (this.state.pos !== 0 || this.length < 2) return false; let ch = this.input.charCodeAt(this.state.pos + 1); if (ch !== 33) return false; const start = this.state.pos; this.state.pos += 1; while (!isNewLine(ch) && ++this.state.pos < this.length) { ch = this.input.charCodeAt(this.state.pos); } const value = this.input.slice(start + 2, this.state.pos); this.finishToken(28, value); return true; } readToken_mult_modulo(code) { let type = code === 42 ? 55 : 54; let width = 1; let next = this.input.charCodeAt(this.state.pos + 1); if (code === 42 && next === 42) { width++; next = this.input.charCodeAt(this.state.pos + 2); type = 57; } if (next === 61 && !this.state.inType) { width++; type = code === 37 ? 33 : 30; } this.finishOp(type, width); } readToken_pipe_amp(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (next === code) { if (this.input.charCodeAt(this.state.pos + 2) === 61) { this.finishOp(30, 3); } else { this.finishOp(code === 124 ? 41 : 42, 2); } return; } if (code === 124) { if (next === 62) { this.finishOp(39, 2); return; } if (this.hasPlugin("recordAndTuple") && next === 125) { if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType, { at: this.state.curPosition() }); } this.state.pos += 2; this.finishToken(9); return; } if (this.hasPlugin("recordAndTuple") && next === 93) { if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, { at: this.state.curPosition() }); } this.state.pos += 2; this.finishToken(4); return; } } if (next === 61) { this.finishOp(30, 2); return; } this.finishOp(code === 124 ? 43 : 45, 1); } readToken_caret() { const next = this.input.charCodeAt(this.state.pos + 1); if (next === 61 && !this.state.inType) { this.finishOp(32, 2); } else if (next === 94 && this.hasPlugin(["pipelineOperator", { proposal: "hack", topicToken: "^^" }])) { this.finishOp(37, 2); const lookaheadCh = this.input.codePointAt(this.state.pos); if (lookaheadCh === 94) { this.unexpected(); } } else { this.finishOp(44, 1); } } readToken_atSign() { const next = this.input.charCodeAt(this.state.pos + 1); if (next === 64 && this.hasPlugin(["pipelineOperator", { proposal: "hack", topicToken: "@@" }])) { this.finishOp(38, 2); } else { this.finishOp(26, 1); } } readToken_plus_min(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (next === code) { this.finishOp(34, 2); return; } if (next === 61) { this.finishOp(30, 2); } else { this.finishOp(53, 1); } } readToken_lt() { const { pos } = this.state; const next = this.input.charCodeAt(pos + 1); if (next === 60) { if (this.input.charCodeAt(pos + 2) === 61) { this.finishOp(30, 3); return; } this.finishOp(51, 2); return; } if (next === 61) { this.finishOp(49, 2); return; } this.finishOp(47, 1); } readToken_gt() { const { pos } = this.state; const next = this.input.charCodeAt(pos + 1); if (next === 62) { const size = this.input.charCodeAt(pos + 2) === 62 ? 3 : 2; if (this.input.charCodeAt(pos + size) === 61) { this.finishOp(30, size + 1); return; } this.finishOp(52, size); return; } if (next === 61) { this.finishOp(49, 2); return; } this.finishOp(48, 1); } readToken_eq_excl(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (next === 61) { this.finishOp(46, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2); return; } if (code === 61 && next === 62) { this.state.pos += 2; this.finishToken(19); return; } this.finishOp(code === 61 ? 29 : 35, 1); } readToken_question() { const next = this.input.charCodeAt(this.state.pos + 1); const next2 = this.input.charCodeAt(this.state.pos + 2); if (next === 63) { if (next2 === 61) { this.finishOp(30, 3); } else { this.finishOp(40, 2); } } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) { this.state.pos += 2; this.finishToken(18); } else { ++this.state.pos; this.finishToken(17); } } getTokenFromCode(code) { switch (code) { case 46: this.readToken_dot(); return; case 40: ++this.state.pos; this.finishToken(10); return; case 41: ++this.state.pos; this.finishToken(11); return; case 59: ++this.state.pos; this.finishToken(13); return; case 44: ++this.state.pos; this.finishToken(12); return; case 91: if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { throw this.raise(Errors.TupleExpressionBarIncorrectStartSyntaxType, { at: this.state.curPosition() }); } this.state.pos += 2; this.finishToken(2); } else { ++this.state.pos; this.finishToken(0); } return; case 93: ++this.state.pos; this.finishToken(3); return; case 123: if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { throw this.raise(Errors.RecordExpressionBarIncorrectStartSyntaxType, { at: this.state.curPosition() }); } this.state.pos += 2; this.finishToken(6); } else { ++this.state.pos; this.finishToken(5); } return; case 125: ++this.state.pos; this.finishToken(8); return; case 58: if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) { this.finishOp(15, 2); } else { ++this.state.pos; this.finishToken(14); } return; case 63: this.readToken_question(); return; case 96: this.readTemplateToken(); return; case 48: { const next = this.input.charCodeAt(this.state.pos + 1); if (next === 120 || next === 88) { this.readRadixNumber(16); return; } if (next === 111 || next === 79) { this.readRadixNumber(8); return; } if (next === 98 || next === 66) { this.readRadixNumber(2); return; } } case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: this.readNumber(false); return; case 34: case 39: this.readString(code); return; case 47: this.readToken_slash(); return; case 37: case 42: this.readToken_mult_modulo(code); return; case 124: case 38: this.readToken_pipe_amp(code); return; case 94: this.readToken_caret(); return; case 43: case 45: this.readToken_plus_min(code); return; case 60: this.readToken_lt(); return; case 62: this.readToken_gt(); return; case 61: case 33: this.readToken_eq_excl(code); return; case 126: this.finishOp(36, 1); return; case 64: this.readToken_atSign(); return; case 35: this.readToken_numberSign(); return; case 92: this.readWord(); return; default: if (isIdentifierStart(code)) { this.readWord(code); return; } } throw this.raise(Errors.InvalidOrUnexpectedToken, { at: this.state.curPosition(), unexpected: String.fromCodePoint(code) }); } finishOp(type, size) { const str = this.input.slice(this.state.pos, this.state.pos + size); this.state.pos += size; this.finishToken(type, str); } readRegexp() { const startLoc = this.state.startLoc; const start = this.state.start + 1; let escaped, inClass; let { pos } = this.state; for (;; ++pos) { if (pos >= this.length) { throw this.raise(Errors.UnterminatedRegExp, { at: createPositionWithColumnOffset(startLoc, 1) }); } const ch = this.input.charCodeAt(pos); if (isNewLine(ch)) { throw this.raise(Errors.UnterminatedRegExp, { at: createPositionWithColumnOffset(startLoc, 1) }); } if (escaped) { escaped = false; } else { if (ch === 91) { inClass = true; } else if (ch === 93 && inClass) { inClass = false; } else if (ch === 47 && !inClass) { break; } escaped = ch === 92; } } const content = this.input.slice(start, pos); ++pos; let mods = ""; const nextPos = () => createPositionWithColumnOffset(startLoc, pos + 2 - start); while (pos < this.length) { const cp = this.codePointAtPos(pos); const char = String.fromCharCode(cp); if (VALID_REGEX_FLAGS.has(cp)) { if (cp === 118) { if (mods.includes("u")) { this.raise(Errors.IncompatibleRegExpUVFlags, { at: nextPos() }); } } else if (cp === 117) { if (mods.includes("v")) { this.raise(Errors.IncompatibleRegExpUVFlags, { at: nextPos() }); } } if (mods.includes(char)) { this.raise(Errors.DuplicateRegExpFlags, { at: nextPos() }); } } else if (isIdentifierChar(cp) || cp === 92) { this.raise(Errors.MalformedRegExpFlags, { at: nextPos() }); } else { break; } ++pos; mods += char; } this.state.pos = pos; this.finishToken(135, { pattern: content, flags: mods }); } readInt(radix, len, forceLen = false, allowNumSeparator = true) { const { n, pos } = readInt(this.input, this.state.pos, this.state.lineStart, this.state.curLine, radix, len, forceLen, allowNumSeparator, this.errorHandlers_readInt, false); this.state.pos = pos; return n; } readRadixNumber(radix) { const startLoc = this.state.curPosition(); let isBigInt = false; this.state.pos += 2; const val = this.readInt(radix); if (val == null) { this.raise(Errors.InvalidDigit, { at: createPositionWithColumnOffset(startLoc, 2), radix }); } const next = this.input.charCodeAt(this.state.pos); if (next === 110) { ++this.state.pos; isBigInt = true; } else if (next === 109) { throw this.raise(Errors.InvalidDecimal, { at: startLoc }); } if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { throw this.raise(Errors.NumberIdentifier, { at: this.state.curPosition() }); } if (isBigInt) { const str = this.input.slice(startLoc.index, this.state.pos).replace(/[_n]/g, ""); this.finishToken(133, str); return; } this.finishToken(132, val); } readNumber(startsWithDot) { const start = this.state.pos; const startLoc = this.state.curPosition(); let isFloat = false; let isBigInt = false; let isDecimal = false; let hasExponent = false; let isOctal = false; if (!startsWithDot && this.readInt(10) === null) { this.raise(Errors.InvalidNumber, { at: this.state.curPosition() }); } const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48; if (hasLeadingZero) { const integer = this.input.slice(start, this.state.pos); this.recordStrictModeErrors(Errors.StrictOctalLiteral, { at: startLoc }); if (!this.state.strict) { const underscorePos = integer.indexOf("_"); if (underscorePos > 0) { this.raise(Errors.ZeroDigitNumericSeparator, { at: createPositionWithColumnOffset(startLoc, underscorePos) }); } } isOctal = hasLeadingZero && !/[89]/.test(integer); } let next = this.input.charCodeAt(this.state.pos); if (next === 46 && !isOctal) { ++this.state.pos; this.readInt(10); isFloat = true; next = this.input.charCodeAt(this.state.pos); } if ((next === 69 || next === 101) && !isOctal) { next = this.input.charCodeAt(++this.state.pos); if (next === 43 || next === 45) { ++this.state.pos; } if (this.readInt(10) === null) { this.raise(Errors.InvalidOrMissingExponent, { at: startLoc }); } isFloat = true; hasExponent = true; next = this.input.charCodeAt(this.state.pos); } if (next === 110) { if (isFloat || hasLeadingZero) { this.raise(Errors.InvalidBigIntLiteral, { at: startLoc }); } ++this.state.pos; isBigInt = true; } if (next === 109) { this.expectPlugin("decimal", this.state.curPosition()); if (hasExponent || hasLeadingZero) { this.raise(Errors.InvalidDecimal, { at: startLoc }); } ++this.state.pos; isDecimal = true; } if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { throw this.raise(Errors.NumberIdentifier, { at: this.state.curPosition() }); } const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, ""); if (isBigInt) { this.finishToken(133, str); return; } if (isDecimal) { this.finishToken(134, str); return; } const val = isOctal ? parseInt(str, 8) : parseFloat(str); this.finishToken(132, val); } readCodePoint(throwOnInvalid) { const { code, pos } = readCodePoint(this.input, this.state.pos, this.state.lineStart, this.state.curLine, throwOnInvalid, this.errorHandlers_readCodePoint); this.state.pos = pos; return code; } readString(quote) { const { str, pos, curLine, lineStart } = readStringContents(quote === 34 ? "double" : "single", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_string); this.state.pos = pos + 1; this.state.lineStart = lineStart; this.state.curLine = curLine; this.finishToken(131, str); } readTemplateContinuation() { if (!this.match(8)) { this.unexpected(null, 8); } this.state.pos--; this.readTemplateToken(); } readTemplateToken() { const opening = this.input[this.state.pos]; const { str, firstInvalidLoc, pos, curLine, lineStart } = readStringContents("template", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_template); this.state.pos = pos + 1; this.state.lineStart = lineStart; this.state.curLine = curLine; if (firstInvalidLoc) { this.state.firstInvalidTemplateEscapePos = new Position(firstInvalidLoc.curLine, firstInvalidLoc.pos - firstInvalidLoc.lineStart, firstInvalidLoc.pos); } if (this.input.codePointAt(pos) === 96) { this.finishToken(24, firstInvalidLoc ? null : opening + str + "`"); } else { this.state.pos++; this.finishToken(25, firstInvalidLoc ? null : opening + str + "${"); } } recordStrictModeErrors(toParseError, { at }) { const index = at.index; if (this.state.strict && !this.state.strictErrors.has(index)) { this.raise(toParseError, { at }); } else { this.state.strictErrors.set(index, [toParseError, at]); } } readWord1(firstCode) { this.state.containsEsc = false; let word = ""; const start = this.state.pos; let chunkStart = this.state.pos; if (firstCode !== undefined) { this.state.pos += firstCode <= 0xffff ? 1 : 2; } while (this.state.pos < this.length) { const ch = this.codePointAtPos(this.state.pos); if (isIdentifierChar(ch)) { this.state.pos += ch <= 0xffff ? 1 : 2; } else if (ch === 92) { this.state.containsEsc = true; word += this.input.slice(chunkStart, this.state.pos); const escStart = this.state.curPosition(); const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar; if (this.input.charCodeAt(++this.state.pos) !== 117) { this.raise(Errors.MissingUnicodeEscape, { at: this.state.curPosition() }); chunkStart = this.state.pos - 1; continue; } ++this.state.pos; const esc = this.readCodePoint(true); if (esc !== null) { if (!identifierCheck(esc)) { this.raise(Errors.EscapedCharNotAnIdentifier, { at: escStart }); } word += String.fromCodePoint(esc); } chunkStart = this.state.pos; } else { break; } } return word + this.input.slice(chunkStart, this.state.pos); } readWord(firstCode) { const word = this.readWord1(firstCode); const type = keywords$1.get(word); if (type !== undefined) { this.finishToken(type, tokenLabelName(type)); } else { this.finishToken(130, word); } } checkKeywordEscapes() { const { type } = this.state; if (tokenIsKeyword(type) && this.state.containsEsc) { this.raise(Errors.InvalidEscapedReservedWord, { at: this.state.startLoc, reservedWord: tokenLabelName(type) }); } } raise(toParseError, raiseProperties) { const { at } = raiseProperties, details = _objectWithoutPropertiesLoose(raiseProperties, _excluded); const loc = at instanceof Position ? at : at.loc.start; const error = toParseError({ loc, details }); if (!this.options.errorRecovery) throw error; if (!this.isLookahead) this.state.errors.push(error); return error; } raiseOverwrite(toParseError, raiseProperties) { const { at } = raiseProperties, details = _objectWithoutPropertiesLoose(raiseProperties, _excluded2); const loc = at instanceof Position ? at : at.loc.start; const pos = loc.index; const errors = this.state.errors; for (let i = errors.length - 1; i >= 0; i--) { const error = errors[i]; if (error.loc.index === pos) { return errors[i] = toParseError({ loc, details }); } if (error.loc.index < pos) break; } return this.raise(toParseError, raiseProperties); } updateContext(prevType) {} unexpected(loc, type) { throw this.raise(Errors.UnexpectedToken, { expected: type ? tokenLabelName(type) : null, at: loc != null ? loc : this.state.startLoc }); } expectPlugin(pluginName, loc) { if (this.hasPlugin(pluginName)) { return true; } throw this.raise(Errors.MissingPlugin, { at: loc != null ? loc : this.state.startLoc, missingPlugin: [pluginName] }); } expectOnePlugin(pluginNames) { if (!pluginNames.some(name => this.hasPlugin(name))) { throw this.raise(Errors.MissingOneOfPlugins, { at: this.state.startLoc, missingPlugin: pluginNames }); } } errorBuilder(error) { return (pos, lineStart, curLine) => { this.raise(error, { at: buildPosition(pos, lineStart, curLine) }); }; } } class ClassScope { constructor() { this.privateNames = new Set(); this.loneAccessors = new Map(); this.undefinedPrivateNames = new Map(); } } class ClassScopeHandler { constructor(parser) { this.parser = void 0; this.stack = []; this.undefinedPrivateNames = new Map(); this.parser = parser; } current() { return this.stack[this.stack.length - 1]; } enter() { this.stack.push(new ClassScope()); } exit() { const oldClassScope = this.stack.pop(); const current = this.current(); for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) { if (current) { if (!current.undefinedPrivateNames.has(name)) { current.undefinedPrivateNames.set(name, loc); } } else { this.parser.raise(Errors.InvalidPrivateFieldResolution, { at: loc, identifierName: name }); } } } declarePrivateName(name, elementType, loc) { const { privateNames, loneAccessors, undefinedPrivateNames } = this.current(); let redefined = privateNames.has(name); if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) { const accessor = redefined && loneAccessors.get(name); if (accessor) { const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC; const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC; const oldKind = accessor & CLASS_ELEMENT_KIND_ACCESSOR; const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR; redefined = oldKind === newKind || oldStatic !== newStatic; if (!redefined) loneAccessors.delete(name); } else if (!redefined) { loneAccessors.set(name, elementType); } } if (redefined) { this.parser.raise(Errors.PrivateNameRedeclaration, { at: loc, identifierName: name }); } privateNames.add(name); undefinedPrivateNames.delete(name); } usePrivateName(name, loc) { let classScope; for (classScope of this.stack) { if (classScope.privateNames.has(name)) return; } if (classScope) { classScope.undefinedPrivateNames.set(name, loc); } else { this.parser.raise(Errors.InvalidPrivateFieldResolution, { at: loc, identifierName: name }); } } } const kExpression = 0, kMaybeArrowParameterDeclaration = 1, kMaybeAsyncArrowParameterDeclaration = 2, kParameterDeclaration = 3; class ExpressionScope { constructor(type = kExpression) { this.type = void 0; this.type = type; } canBeArrowParameterDeclaration() { return this.type === kMaybeAsyncArrowParameterDeclaration || this.type === kMaybeArrowParameterDeclaration; } isCertainlyParameterDeclaration() { return this.type === kParameterDeclaration; } } class ArrowHeadParsingScope extends ExpressionScope { constructor(type) { super(type); this.declarationErrors = new Map(); } recordDeclarationError(ParsingErrorClass, { at }) { const index = at.index; this.declarationErrors.set(index, [ParsingErrorClass, at]); } clearDeclarationError(index) { this.declarationErrors.delete(index); } iterateErrors(iterator) { this.declarationErrors.forEach(iterator); } } class ExpressionScopeHandler { constructor(parser) { this.parser = void 0; this.stack = [new ExpressionScope()]; this.parser = parser; } enter(scope) { this.stack.push(scope); } exit() { this.stack.pop(); } recordParameterInitializerError(toParseError, { at: node }) { const origin = { at: node.loc.start }; const { stack } = this; let i = stack.length - 1; let scope = stack[i]; while (!scope.isCertainlyParameterDeclaration()) { if (scope.canBeArrowParameterDeclaration()) { scope.recordDeclarationError(toParseError, origin); } else { return; } scope = stack[--i]; } this.parser.raise(toParseError, origin); } recordArrowParameterBindingError(error, { at: node }) { const { stack } = this; const scope = stack[stack.length - 1]; const origin = { at: node.loc.start }; if (scope.isCertainlyParameterDeclaration()) { this.parser.raise(error, origin); } else if (scope.canBeArrowParameterDeclaration()) { scope.recordDeclarationError(error, origin); } else { return; } } recordAsyncArrowParametersError({ at }) { const { stack } = this; let i = stack.length - 1; let scope = stack[i]; while (scope.canBeArrowParameterDeclaration()) { if (scope.type === kMaybeAsyncArrowParameterDeclaration) { scope.recordDeclarationError(Errors.AwaitBindingIdentifier, { at }); } scope = stack[--i]; } } validateAsPattern() { const { stack } = this; const currentScope = stack[stack.length - 1]; if (!currentScope.canBeArrowParameterDeclaration()) return; currentScope.iterateErrors(([toParseError, loc]) => { this.parser.raise(toParseError, { at: loc }); let i = stack.length - 2; let scope = stack[i]; while (scope.canBeArrowParameterDeclaration()) { scope.clearDeclarationError(loc.index); scope = stack[--i]; } }); } } function newParameterDeclarationScope() { return new ExpressionScope(kParameterDeclaration); } function newArrowHeadScope() { return new ArrowHeadParsingScope(kMaybeArrowParameterDeclaration); } function newAsyncArrowScope() { return new ArrowHeadParsingScope(kMaybeAsyncArrowParameterDeclaration); } function newExpressionScope() { return new ExpressionScope(); } const PARAM = 0b0000, PARAM_YIELD = 0b0001, PARAM_AWAIT = 0b0010, PARAM_RETURN = 0b0100, PARAM_IN = 0b1000; class ProductionParameterHandler { constructor() { this.stacks = []; } enter(flags) { this.stacks.push(flags); } exit() { this.stacks.pop(); } currentFlags() { return this.stacks[this.stacks.length - 1]; } get hasAwait() { return (this.currentFlags() & PARAM_AWAIT) > 0; } get hasYield() { return (this.currentFlags() & PARAM_YIELD) > 0; } get hasReturn() { return (this.currentFlags() & PARAM_RETURN) > 0; } get hasIn() { return (this.currentFlags() & PARAM_IN) > 0; } } function functionFlags(isAsync, isGenerator) { return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0); } class UtilParser extends Tokenizer { addExtra(node, key, value, enumerable = true) { if (!node) return; const extra = node.extra = node.extra || {}; if (enumerable) { extra[key] = value; } else { Object.defineProperty(extra, key, { enumerable, value }); } } isContextual(token) { return this.state.type === token && !this.state.containsEsc; } isUnparsedContextual(nameStart, name) { const nameEnd = nameStart + name.length; if (this.input.slice(nameStart, nameEnd) === name) { const nextCh = this.input.charCodeAt(nameEnd); return !(isIdentifierChar(nextCh) || (nextCh & 0xfc00) === 0xd800); } return false; } isLookaheadContextual(name) { const next = this.nextTokenStart(); return this.isUnparsedContextual(next, name); } eatContextual(token) { if (this.isContextual(token)) { this.next(); return true; } return false; } expectContextual(token, toParseError) { if (!this.eatContextual(token)) { if (toParseError != null) { throw this.raise(toParseError, { at: this.state.startLoc }); } this.unexpected(null, token); } } canInsertSemicolon() { return this.match(137) || this.match(8) || this.hasPrecedingLineBreak(); } hasPrecedingLineBreak() { return lineBreak.test(this.input.slice(this.state.lastTokEndLoc.index, this.state.start)); } hasFollowingLineBreak() { skipWhiteSpaceToLineBreak.lastIndex = this.state.end; return skipWhiteSpaceToLineBreak.test(this.input); } isLineTerminator() { return this.eat(13) || this.canInsertSemicolon(); } semicolon(allowAsi = true) { if (allowAsi ? this.isLineTerminator() : this.eat(13)) return; this.raise(Errors.MissingSemicolon, { at: this.state.lastTokEndLoc }); } expect(type, loc) { this.eat(type) || this.unexpected(loc, type); } tryParse(fn, oldState = this.state.clone()) { const abortSignal = { node: null }; try { const node = fn((node = null) => { abortSignal.node = node; throw abortSignal; }); if (this.state.errors.length > oldState.errors.length) { const failState = this.state; this.state = oldState; this.state.tokensLength = failState.tokensLength; return { node, error: failState.errors[oldState.errors.length], thrown: false, aborted: false, failState }; } return { node, error: null, thrown: false, aborted: false, failState: null }; } catch (error) { const failState = this.state; this.state = oldState; if (error instanceof SyntaxError) { return { node: null, error, thrown: true, aborted: false, failState }; } if (error === abortSignal) { return { node: abortSignal.node, error: null, thrown: false, aborted: true, failState }; } throw error; } } checkExpressionErrors(refExpressionErrors, andThrow) { if (!refExpressionErrors) return false; const { shorthandAssignLoc, doubleProtoLoc, privateKeyLoc, optionalParametersLoc } = refExpressionErrors; const hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc; if (!andThrow) { return hasErrors; } if (shorthandAssignLoc != null) { this.raise(Errors.InvalidCoverInitializedName, { at: shorthandAssignLoc }); } if (doubleProtoLoc != null) { this.raise(Errors.DuplicateProto, { at: doubleProtoLoc }); } if (privateKeyLoc != null) { this.raise(Errors.UnexpectedPrivateField, { at: privateKeyLoc }); } if (optionalParametersLoc != null) { this.unexpected(optionalParametersLoc); } } isLiteralPropertyName() { return tokenIsLiteralPropertyName(this.state.type); } isPrivateName(node) { return node.type === "PrivateName"; } getPrivateNameSV(node) { return node.id.name; } hasPropertyAsPrivateName(node) { return (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") && this.isPrivateName(node.property); } isObjectProperty(node) { return node.type === "ObjectProperty"; } isObjectMethod(node) { return node.type === "ObjectMethod"; } initializeScopes(inModule = this.options.sourceType === "module") { const oldLabels = this.state.labels; this.state.labels = []; const oldExportedIdentifiers = this.exportedIdentifiers; this.exportedIdentifiers = new Set(); const oldInModule = this.inModule; this.inModule = inModule; const oldScope = this.scope; const ScopeHandler = this.getScopeHandler(); this.scope = new ScopeHandler(this, inModule); const oldProdParam = this.prodParam; this.prodParam = new ProductionParameterHandler(); const oldClassScope = this.classScope; this.classScope = new ClassScopeHandler(this); const oldExpressionScope = this.expressionScope; this.expressionScope = new ExpressionScopeHandler(this); return () => { this.state.labels = oldLabels; this.exportedIdentifiers = oldExportedIdentifiers; this.inModule = oldInModule; this.scope = oldScope; this.prodParam = oldProdParam; this.classScope = oldClassScope; this.expressionScope = oldExpressionScope; }; } enterInitialScopes() { let paramFlags = PARAM; if (this.inModule) { paramFlags |= PARAM_AWAIT; } this.scope.enter(SCOPE_PROGRAM); this.prodParam.enter(paramFlags); } checkDestructuringPrivate(refExpressionErrors) { const { privateKeyLoc } = refExpressionErrors; if (privateKeyLoc !== null) { this.expectPlugin("destructuringPrivate", privateKeyLoc); } } } class ExpressionErrors { constructor() { this.shorthandAssignLoc = null; this.doubleProtoLoc = null; this.privateKeyLoc = null; this.optionalParametersLoc = null; } } class Node { constructor(parser, pos, loc) { this.type = ""; this.start = pos; this.end = 0; this.loc = new SourceLocation(loc); if (parser != null && parser.options.ranges) this.range = [pos, 0]; if (parser != null && parser.filename) this.loc.filename = parser.filename; } } const NodePrototype = Node.prototype; { NodePrototype.__clone = function () { const newNode = new Node(undefined, this.start, this.loc.start); const keys = Object.keys(this); for (let i = 0, length = keys.length; i < length; i++) { const key = keys[i]; if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") { newNode[key] = this[key]; } } return newNode; }; } function clonePlaceholder(node) { return cloneIdentifier(node); } function cloneIdentifier(node) { const { type, start, end, loc, range, extra, name } = node; const cloned = Object.create(NodePrototype); cloned.type = type; cloned.start = start; cloned.end = end; cloned.loc = loc; cloned.range = range; cloned.extra = extra; cloned.name = name; if (type === "Placeholder") { cloned.expectedNode = node.expectedNode; } return cloned; } function cloneStringLiteral(node) { const { type, start, end, loc, range, extra } = node; if (type === "Placeholder") { return clonePlaceholder(node); } const cloned = Object.create(NodePrototype); cloned.type = type; cloned.start = start; cloned.end = end; cloned.loc = loc; cloned.range = range; if (node.raw !== undefined) { cloned.raw = node.raw; } else { cloned.extra = extra; } cloned.value = node.value; return cloned; } class NodeUtils extends UtilParser { startNode() { return new Node(this, this.state.start, this.state.startLoc); } startNodeAt(loc) { return new Node(this, loc.index, loc); } startNodeAtNode(type) { return this.startNodeAt(type.loc.start); } finishNode(node, type) { return this.finishNodeAt(node, type, this.state.lastTokEndLoc); } finishNodeAt(node, type, endLoc) { node.type = type; node.end = endLoc.index; node.loc.end = endLoc; if (this.options.ranges) node.range[1] = endLoc.index; if (this.options.attachComment) this.processComment(node); return node; } resetStartLocation(node, startLoc) { node.start = startLoc.index; node.loc.start = startLoc; if (this.options.ranges) node.range[0] = startLoc.index; } resetEndLocation(node, endLoc = this.state.lastTokEndLoc) { node.end = endLoc.index; node.loc.end = endLoc; if (this.options.ranges) node.range[1] = endLoc.index; } resetStartLocationFromNode(node, locationNode) { this.resetStartLocation(node, locationNode.loc.start); } } const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]); const FlowErrors = ParseErrorEnum`flow`({ AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.", AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.", AssignReservedType: ({ reservedType }) => `Cannot overwrite reserved type ${reservedType}.`, DeclareClassElement: "The `declare` modifier can only appear on class fields.", DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.", DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement.", EnumBooleanMemberNotInitialized: ({ memberName, enumName }) => `Boolean enum members need to be initialized. Use either \`${memberName} = true,\` or \`${memberName} = false,\` in enum \`${enumName}\`.`, EnumDuplicateMemberName: ({ memberName, enumName }) => `Enum member names need to be unique, but the name \`${memberName}\` has already been used before in enum \`${enumName}\`.`, EnumInconsistentMemberValues: ({ enumName }) => `Enum \`${enumName}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`, EnumInvalidExplicitType: ({ invalidEnumType, enumName }) => `Enum type \`${invalidEnumType}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, EnumInvalidExplicitTypeUnknownSupplied: ({ enumName }) => `Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, EnumInvalidMemberInitializerPrimaryType: ({ enumName, memberName, explicitType }) => `Enum \`${enumName}\` has type \`${explicitType}\`, so the initializer of \`${memberName}\` needs to be a ${explicitType} literal.`, EnumInvalidMemberInitializerSymbolType: ({ enumName, memberName }) => `Symbol enum members cannot be initialized. Use \`${memberName},\` in enum \`${enumName}\`.`, EnumInvalidMemberInitializerUnknownType: ({ enumName, memberName }) => `The enum member initializer for \`${memberName}\` needs to be a literal (either a boolean, number, or string) in enum \`${enumName}\`.`, EnumInvalidMemberName: ({ enumName, memberName, suggestion }) => `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${memberName}\`, consider using \`${suggestion}\`, in enum \`${enumName}\`.`, EnumNumberMemberNotInitialized: ({ enumName, memberName }) => `Number enum members need to be initialized, e.g. \`${memberName} = 1\` in enum \`${enumName}\`.`, EnumStringMemberInconsistentlyInitailized: ({ enumName }) => `String enum members need to consistently either all use initializers, or use no initializers, in enum \`${enumName}\`.`, GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.", ImportReflectionHasImportType: "An `import module` declaration can not use `type` or `typeof` keyword.", ImportTypeShorthandOnlyInPureImport: "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.", InexactInsideExact: "Explicit inexact syntax cannot appear inside an explicit exact object type.", InexactInsideNonObject: "Explicit inexact syntax cannot appear in class or interface definitions.", InexactVariance: "Explicit inexact syntax cannot have variance.", InvalidNonTypeImportInDeclareModule: "Imports within a `declare module` body must always be `import type` or `import typeof`.", MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.", NestedDeclareModule: "`declare module` cannot be used inside another `declare module`.", NestedFlowComment: "Cannot have a flow comment inside another flow comment.", PatternIsOptional: Object.assign({ message: "A binding pattern parameter cannot be optional in an implementation signature." }, { reasonCode: "OptionalBindingPattern" }), SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.", SpreadVariance: "Spread properties cannot have variance.", ThisParamAnnotationRequired: "A type annotation is required for the `this` parameter.", ThisParamBannedInConstructor: "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.", ThisParamMayNotBeOptional: "The `this` parameter cannot be optional.", ThisParamMustBeFirst: "The `this` parameter must be the first function parameter.", ThisParamNoDefault: "The `this` parameter may not have a default value.", TypeBeforeInitializer: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", TypeCastInPattern: "The type cast expression is expected to be wrapped with parenthesis.", UnexpectedExplicitInexactInObject: "Explicit inexact syntax must appear at the end of an inexact object.", UnexpectedReservedType: ({ reservedType }) => `Unexpected reserved type ${reservedType}.`, UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new.", UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.", UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions.", UnexpectedSubtractionOperand: 'Unexpected token, expected "number" or "bigint".', UnexpectedTokenAfterTypeParameter: "Expected an arrow function after this type parameter declaration.", UnexpectedTypeParameterBeforeAsyncArrowFunction: "Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.", UnsupportedDeclareExportKind: ({ unsupportedExportKind, suggestion }) => `\`declare export ${unsupportedExportKind}\` is not supported. Use \`${suggestion}\` instead.`, UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module.", UnterminatedFlowComment: "Unterminated flow-comment." }); function isEsModuleType(bodyElement) { return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration"); } function hasTypeImportKind(node) { return node.importKind === "type" || node.importKind === "typeof"; } const exportSuggestions = { const: "declare export var", let: "declare export var", type: "export type", interface: "export interface" }; function partition(list, test) { const list1 = []; const list2 = []; for (let i = 0; i < list.length; i++) { (test(list[i], i, list) ? list1 : list2).push(list[i]); } return [list1, list2]; } const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/; var flow = superClass => class FlowParserMixin extends superClass { constructor(...args) { super(...args); this.flowPragma = undefined; } getScopeHandler() { return FlowScopeHandler; } shouldParseTypes() { return this.getPluginOption("flow", "all") || this.flowPragma === "flow"; } shouldParseEnums() { return !!this.getPluginOption("flow", "enums"); } finishToken(type, val) { if (type !== 131 && type !== 13 && type !== 28) { if (this.flowPragma === undefined) { this.flowPragma = null; } } super.finishToken(type, val); } addComment(comment) { if (this.flowPragma === undefined) { const matches = FLOW_PRAGMA_REGEX.exec(comment.value); if (!matches) ;else if (matches[1] === "flow") { this.flowPragma = "flow"; } else if (matches[1] === "noflow") { this.flowPragma = "noflow"; } else { throw new Error("Unexpected flow pragma"); } } super.addComment(comment); } flowParseTypeInitialiser(tok) { const oldInType = this.state.inType; this.state.inType = true; this.expect(tok || 14); const type = this.flowParseType(); this.state.inType = oldInType; return type; } flowParsePredicate() { const node = this.startNode(); const moduloLoc = this.state.startLoc; this.next(); this.expectContextual(108); if (this.state.lastTokStart > moduloLoc.index + 1) { this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, { at: moduloLoc }); } if (this.eat(10)) { node.value = super.parseExpression(); this.expect(11); return this.finishNode(node, "DeclaredPredicate"); } else { return this.finishNode(node, "InferredPredicate"); } } flowParseTypeAndPredicateInitialiser() { const oldInType = this.state.inType; this.state.inType = true; this.expect(14); let type = null; let predicate = null; if (this.match(54)) { this.state.inType = oldInType; predicate = this.flowParsePredicate(); } else { type = this.flowParseType(); this.state.inType = oldInType; if (this.match(54)) { predicate = this.flowParsePredicate(); } } return [type, predicate]; } flowParseDeclareClass(node) { this.next(); this.flowParseInterfaceish(node, true); return this.finishNode(node, "DeclareClass"); } flowParseDeclareFunction(node) { this.next(); const id = node.id = this.parseIdentifier(); const typeNode = this.startNode(); const typeContainer = this.startNode(); if (this.match(47)) { typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); } else { typeNode.typeParameters = null; } this.expect(10); const tmp = this.flowParseFunctionTypeParams(); typeNode.params = tmp.params; typeNode.rest = tmp.rest; typeNode.this = tmp._this; this.expect(11); [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); this.resetEndLocation(id); this.semicolon(); this.scope.declareName(node.id.name, BIND_FLOW_DECLARE_FN, node.id.loc.start); return this.finishNode(node, "DeclareFunction"); } flowParseDeclare(node, insideModule) { if (this.match(80)) { return this.flowParseDeclareClass(node); } else if (this.match(68)) { return this.flowParseDeclareFunction(node); } else if (this.match(74)) { return this.flowParseDeclareVariable(node); } else if (this.eatContextual(125)) { if (this.match(16)) { return this.flowParseDeclareModuleExports(node); } else { if (insideModule) { this.raise(FlowErrors.NestedDeclareModule, { at: this.state.lastTokStartLoc }); } return this.flowParseDeclareModule(node); } } else if (this.isContextual(128)) { return this.flowParseDeclareTypeAlias(node); } else if (this.isContextual(129)) { return this.flowParseDeclareOpaqueType(node); } else if (this.isContextual(127)) { return this.flowParseDeclareInterface(node); } else if (this.match(82)) { return this.flowParseDeclareExportDeclaration(node, insideModule); } else { this.unexpected(); } } flowParseDeclareVariable(node) { this.next(); node.id = this.flowParseTypeAnnotatableIdentifier(true); this.scope.declareName(node.id.name, BIND_VAR, node.id.loc.start); this.semicolon(); return this.finishNode(node, "DeclareVariable"); } flowParseDeclareModule(node) { this.scope.enter(SCOPE_OTHER); if (this.match(131)) { node.id = super.parseExprAtom(); } else { node.id = this.parseIdentifier(); } const bodyNode = node.body = this.startNode(); const body = bodyNode.body = []; this.expect(5); while (!this.match(8)) { let bodyNode = this.startNode(); if (this.match(83)) { this.next(); if (!this.isContextual(128) && !this.match(87)) { this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, { at: this.state.lastTokStartLoc }); } super.parseImport(bodyNode); } else { this.expectContextual(123, FlowErrors.UnsupportedStatementInDeclareModule); bodyNode = this.flowParseDeclare(bodyNode, true); } body.push(bodyNode); } this.scope.exit(); this.expect(8); this.finishNode(bodyNode, "BlockStatement"); let kind = null; let hasModuleExport = false; body.forEach(bodyElement => { if (isEsModuleType(bodyElement)) { if (kind === "CommonJS") { this.raise(FlowErrors.AmbiguousDeclareModuleKind, { at: bodyElement }); } kind = "ES"; } else if (bodyElement.type === "DeclareModuleExports") { if (hasModuleExport) { this.raise(FlowErrors.DuplicateDeclareModuleExports, { at: bodyElement }); } if (kind === "ES") { this.raise(FlowErrors.AmbiguousDeclareModuleKind, { at: bodyElement }); } kind = "CommonJS"; hasModuleExport = true; } }); node.kind = kind || "CommonJS"; return this.finishNode(node, "DeclareModule"); } flowParseDeclareExportDeclaration(node, insideModule) { this.expect(82); if (this.eat(65)) { if (this.match(68) || this.match(80)) { node.declaration = this.flowParseDeclare(this.startNode()); } else { node.declaration = this.flowParseType(); this.semicolon(); } node.default = true; return this.finishNode(node, "DeclareExportDeclaration"); } else { if (this.match(75) || this.isLet() || (this.isContextual(128) || this.isContextual(127)) && !insideModule) { const label = this.state.value; throw this.raise(FlowErrors.UnsupportedDeclareExportKind, { at: this.state.startLoc, unsupportedExportKind: label, suggestion: exportSuggestions[label] }); } if (this.match(74) || this.match(68) || this.match(80) || this.isContextual(129)) { node.declaration = this.flowParseDeclare(this.startNode()); node.default = false; return this.finishNode(node, "DeclareExportDeclaration"); } else if (this.match(55) || this.match(5) || this.isContextual(127) || this.isContextual(128) || this.isContextual(129)) { node = this.parseExport(node, null); if (node.type === "ExportNamedDeclaration") { node.type = "ExportDeclaration"; node.default = false; delete node.exportKind; } node.type = "Declare" + node.type; return node; } } this.unexpected(); } flowParseDeclareModuleExports(node) { this.next(); this.expectContextual(109); node.typeAnnotation = this.flowParseTypeAnnotation(); this.semicolon(); return this.finishNode(node, "DeclareModuleExports"); } flowParseDeclareTypeAlias(node) { this.next(); const finished = this.flowParseTypeAlias(node); finished.type = "DeclareTypeAlias"; return finished; } flowParseDeclareOpaqueType(node) { this.next(); const finished = this.flowParseOpaqueType(node, true); finished.type = "DeclareOpaqueType"; return finished; } flowParseDeclareInterface(node) { this.next(); this.flowParseInterfaceish(node, false); return this.finishNode(node, "DeclareInterface"); } flowParseInterfaceish(node, isClass) { node.id = this.flowParseRestrictedIdentifier(!isClass, true); this.scope.declareName(node.id.name, isClass ? BIND_FUNCTION : BIND_LEXICAL, node.id.loc.start); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } else { node.typeParameters = null; } node.extends = []; if (this.eat(81)) { do { node.extends.push(this.flowParseInterfaceExtends()); } while (!isClass && this.eat(12)); } if (isClass) { node.implements = []; node.mixins = []; if (this.eatContextual(115)) { do { node.mixins.push(this.flowParseInterfaceExtends()); } while (this.eat(12)); } if (this.eatContextual(111)) { do { node.implements.push(this.flowParseInterfaceExtends()); } while (this.eat(12)); } } node.body = this.flowParseObjectType({ allowStatic: isClass, allowExact: false, allowSpread: false, allowProto: isClass, allowInexact: false }); } flowParseInterfaceExtends() { const node = this.startNode(); node.id = this.flowParseQualifiedTypeIdentifier(); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterInstantiation(); } else { node.typeParameters = null; } return this.finishNode(node, "InterfaceExtends"); } flowParseInterface(node) { this.flowParseInterfaceish(node, false); return this.finishNode(node, "InterfaceDeclaration"); } checkNotUnderscore(word) { if (word === "_") { this.raise(FlowErrors.UnexpectedReservedUnderscore, { at: this.state.startLoc }); } } checkReservedType(word, startLoc, declaration) { if (!reservedTypes.has(word)) return; this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, { at: startLoc, reservedType: word }); } flowParseRestrictedIdentifier(liberal, declaration) { this.checkReservedType(this.state.value, this.state.startLoc, declaration); return this.parseIdentifier(liberal); } flowParseTypeAlias(node) { node.id = this.flowParseRestrictedIdentifier(false, true); this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } else { node.typeParameters = null; } node.right = this.flowParseTypeInitialiser(29); this.semicolon(); return this.finishNode(node, "TypeAlias"); } flowParseOpaqueType(node, declare) { this.expectContextual(128); node.id = this.flowParseRestrictedIdentifier(true, true); this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } else { node.typeParameters = null; } node.supertype = null; if (this.match(14)) { node.supertype = this.flowParseTypeInitialiser(14); } node.impltype = null; if (!declare) { node.impltype = this.flowParseTypeInitialiser(29); } this.semicolon(); return this.finishNode(node, "OpaqueType"); } flowParseTypeParameter(requireDefault = false) { const nodeStartLoc = this.state.startLoc; const node = this.startNode(); const variance = this.flowParseVariance(); const ident = this.flowParseTypeAnnotatableIdentifier(); node.name = ident.name; node.variance = variance; node.bound = ident.typeAnnotation; if (this.match(29)) { this.eat(29); node.default = this.flowParseType(); } else { if (requireDefault) { this.raise(FlowErrors.MissingTypeParamDefault, { at: nodeStartLoc }); } } return this.finishNode(node, "TypeParameter"); } flowParseTypeParameterDeclaration() { const oldInType = this.state.inType; const node = this.startNode(); node.params = []; this.state.inType = true; if (this.match(47) || this.match(140)) { this.next(); } else { this.unexpected(); } let defaultRequired = false; do { const typeParameter = this.flowParseTypeParameter(defaultRequired); node.params.push(typeParameter); if (typeParameter.default) { defaultRequired = true; } if (!this.match(48)) { this.expect(12); } } while (!this.match(48)); this.expect(48); this.state.inType = oldInType; return this.finishNode(node, "TypeParameterDeclaration"); } flowParseTypeParameterInstantiation() { const node = this.startNode(); const oldInType = this.state.inType; node.params = []; this.state.inType = true; this.expect(47); const oldNoAnonFunctionType = this.state.noAnonFunctionType; this.state.noAnonFunctionType = false; while (!this.match(48)) { node.params.push(this.flowParseType()); if (!this.match(48)) { this.expect(12); } } this.state.noAnonFunctionType = oldNoAnonFunctionType; this.expect(48); this.state.inType = oldInType; return this.finishNode(node, "TypeParameterInstantiation"); } flowParseTypeParameterInstantiationCallOrNew() { const node = this.startNode(); const oldInType = this.state.inType; node.params = []; this.state.inType = true; this.expect(47); while (!this.match(48)) { node.params.push(this.flowParseTypeOrImplicitInstantiation()); if (!this.match(48)) { this.expect(12); } } this.expect(48); this.state.inType = oldInType; return this.finishNode(node, "TypeParameterInstantiation"); } flowParseInterfaceType() { const node = this.startNode(); this.expectContextual(127); node.extends = []; if (this.eat(81)) { do { node.extends.push(this.flowParseInterfaceExtends()); } while (this.eat(12)); } node.body = this.flowParseObjectType({ allowStatic: false, allowExact: false, allowSpread: false, allowProto: false, allowInexact: false }); return this.finishNode(node, "InterfaceTypeAnnotation"); } flowParseObjectPropertyKey() { return this.match(132) || this.match(131) ? super.parseExprAtom() : this.parseIdentifier(true); } flowParseObjectTypeIndexer(node, isStatic, variance) { node.static = isStatic; if (this.lookahead().type === 14) { node.id = this.flowParseObjectPropertyKey(); node.key = this.flowParseTypeInitialiser(); } else { node.id = null; node.key = this.flowParseType(); } this.expect(3); node.value = this.flowParseTypeInitialiser(); node.variance = variance; return this.finishNode(node, "ObjectTypeIndexer"); } flowParseObjectTypeInternalSlot(node, isStatic) { node.static = isStatic; node.id = this.flowParseObjectPropertyKey(); this.expect(3); this.expect(3); if (this.match(47) || this.match(10)) { node.method = true; node.optional = false; node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start)); } else { node.method = false; if (this.eat(17)) { node.optional = true; } node.value = this.flowParseTypeInitialiser(); } return this.finishNode(node, "ObjectTypeInternalSlot"); } flowParseObjectTypeMethodish(node) { node.params = []; node.rest = null; node.typeParameters = null; node.this = null; if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } this.expect(10); if (this.match(78)) { node.this = this.flowParseFunctionTypeParam(true); node.this.name = null; if (!this.match(11)) { this.expect(12); } } while (!this.match(11) && !this.match(21)) { node.params.push(this.flowParseFunctionTypeParam(false)); if (!this.match(11)) { this.expect(12); } } if (this.eat(21)) { node.rest = this.flowParseFunctionTypeParam(false); } this.expect(11); node.returnType = this.flowParseTypeInitialiser(); return this.finishNode(node, "FunctionTypeAnnotation"); } flowParseObjectTypeCallProperty(node, isStatic) { const valueNode = this.startNode(); node.static = isStatic; node.value = this.flowParseObjectTypeMethodish(valueNode); return this.finishNode(node, "ObjectTypeCallProperty"); } flowParseObjectType({ allowStatic, allowExact, allowSpread, allowProto, allowInexact }) { const oldInType = this.state.inType; this.state.inType = true; const nodeStart = this.startNode(); nodeStart.callProperties = []; nodeStart.properties = []; nodeStart.indexers = []; nodeStart.internalSlots = []; let endDelim; let exact; let inexact = false; if (allowExact && this.match(6)) { this.expect(6); endDelim = 9; exact = true; } else { this.expect(5); endDelim = 8; exact = false; } nodeStart.exact = exact; while (!this.match(endDelim)) { let isStatic = false; let protoStartLoc = null; let inexactStartLoc = null; const node = this.startNode(); if (allowProto && this.isContextual(116)) { const lookahead = this.lookahead(); if (lookahead.type !== 14 && lookahead.type !== 17) { this.next(); protoStartLoc = this.state.startLoc; allowStatic = false; } } if (allowStatic && this.isContextual(104)) { const lookahead = this.lookahead(); if (lookahead.type !== 14 && lookahead.type !== 17) { this.next(); isStatic = true; } } const variance = this.flowParseVariance(); if (this.eat(0)) { if (protoStartLoc != null) { this.unexpected(protoStartLoc); } if (this.eat(0)) { if (variance) { this.unexpected(variance.loc.start); } nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic)); } else { nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); } } else if (this.match(10) || this.match(47)) { if (protoStartLoc != null) { this.unexpected(protoStartLoc); } if (variance) { this.unexpected(variance.loc.start); } nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); } else { let kind = "init"; if (this.isContextual(98) || this.isContextual(103)) { const lookahead = this.lookahead(); if (tokenIsLiteralPropertyName(lookahead.type)) { kind = this.state.value; this.next(); } } const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact); if (propOrInexact === null) { inexact = true; inexactStartLoc = this.state.lastTokStartLoc; } else { nodeStart.properties.push(propOrInexact); } } this.flowObjectTypeSemicolon(); if (inexactStartLoc && !this.match(8) && !this.match(9)) { this.raise(FlowErrors.UnexpectedExplicitInexactInObject, { at: inexactStartLoc }); } } this.expect(endDelim); if (allowSpread) { nodeStart.inexact = inexact; } const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); this.state.inType = oldInType; return out; } flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact) { if (this.eat(21)) { const isInexactToken = this.match(12) || this.match(13) || this.match(8) || this.match(9); if (isInexactToken) { if (!allowSpread) { this.raise(FlowErrors.InexactInsideNonObject, { at: this.state.lastTokStartLoc }); } else if (!allowInexact) { this.raise(FlowErrors.InexactInsideExact, { at: this.state.lastTokStartLoc }); } if (variance) { this.raise(FlowErrors.InexactVariance, { at: variance }); } return null; } if (!allowSpread) { this.raise(FlowErrors.UnexpectedSpreadType, { at: this.state.lastTokStartLoc }); } if (protoStartLoc != null) { this.unexpected(protoStartLoc); } if (variance) { this.raise(FlowErrors.SpreadVariance, { at: variance }); } node.argument = this.flowParseType(); return this.finishNode(node, "ObjectTypeSpreadProperty"); } else { node.key = this.flowParseObjectPropertyKey(); node.static = isStatic; node.proto = protoStartLoc != null; node.kind = kind; let optional = false; if (this.match(47) || this.match(10)) { node.method = true; if (protoStartLoc != null) { this.unexpected(protoStartLoc); } if (variance) { this.unexpected(variance.loc.start); } node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start)); if (kind === "get" || kind === "set") { this.flowCheckGetterSetterParams(node); } if (!allowSpread && node.key.name === "constructor" && node.value.this) { this.raise(FlowErrors.ThisParamBannedInConstructor, { at: node.value.this }); } } else { if (kind !== "init") this.unexpected(); node.method = false; if (this.eat(17)) { optional = true; } node.value = this.flowParseTypeInitialiser(); node.variance = variance; } node.optional = optional; return this.finishNode(node, "ObjectTypeProperty"); } } flowCheckGetterSetterParams(property) { const paramCount = property.kind === "get" ? 0 : 1; const length = property.value.params.length + (property.value.rest ? 1 : 0); if (property.value.this) { this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, { at: property.value.this }); } if (length !== paramCount) { this.raise(property.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, { at: property }); } if (property.kind === "set" && property.value.rest) { this.raise(Errors.BadSetterRestParameter, { at: property }); } } flowObjectTypeSemicolon() { if (!this.eat(13) && !this.eat(12) && !this.match(8) && !this.match(9)) { this.unexpected(); } } flowParseQualifiedTypeIdentifier(startLoc, id) { var _startLoc; (_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc; let node = id || this.flowParseRestrictedIdentifier(true); while (this.eat(16)) { const node2 = this.startNodeAt(startLoc); node2.qualification = node; node2.id = this.flowParseRestrictedIdentifier(true); node = this.finishNode(node2, "QualifiedTypeIdentifier"); } return node; } flowParseGenericType(startLoc, id) { const node = this.startNodeAt(startLoc); node.typeParameters = null; node.id = this.flowParseQualifiedTypeIdentifier(startLoc, id); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterInstantiation(); } return this.finishNode(node, "GenericTypeAnnotation"); } flowParseTypeofType() { const node = this.startNode(); this.expect(87); node.argument = this.flowParsePrimaryType(); return this.finishNode(node, "TypeofTypeAnnotation"); } flowParseTupleType() { const node = this.startNode(); node.types = []; this.expect(0); while (this.state.pos < this.length && !this.match(3)) { node.types.push(this.flowParseType()); if (this.match(3)) break; this.expect(12); } this.expect(3); return this.finishNode(node, "TupleTypeAnnotation"); } flowParseFunctionTypeParam(first) { let name = null; let optional = false; let typeAnnotation = null; const node = this.startNode(); const lh = this.lookahead(); const isThis = this.state.type === 78; if (lh.type === 14 || lh.type === 17) { if (isThis && !first) { this.raise(FlowErrors.ThisParamMustBeFirst, { at: node }); } name = this.parseIdentifier(isThis); if (this.eat(17)) { optional = true; if (isThis) { this.raise(FlowErrors.ThisParamMayNotBeOptional, { at: node }); } } typeAnnotation = this.flowParseTypeInitialiser(); } else { typeAnnotation = this.flowParseType(); } node.name = name; node.optional = optional; node.typeAnnotation = typeAnnotation; return this.finishNode(node, "FunctionTypeParam"); } reinterpretTypeAsFunctionTypeParam(type) { const node = this.startNodeAt(type.loc.start); node.name = null; node.optional = false; node.typeAnnotation = type; return this.finishNode(node, "FunctionTypeParam"); } flowParseFunctionTypeParams(params = []) { let rest = null; let _this = null; if (this.match(78)) { _this = this.flowParseFunctionTypeParam(true); _this.name = null; if (!this.match(11)) { this.expect(12); } } while (!this.match(11) && !this.match(21)) { params.push(this.flowParseFunctionTypeParam(false)); if (!this.match(11)) { this.expect(12); } } if (this.eat(21)) { rest = this.flowParseFunctionTypeParam(false); } return { params, rest, _this }; } flowIdentToTypeAnnotation(startLoc, node, id) { switch (id.name) { case "any": return this.finishNode(node, "AnyTypeAnnotation"); case "bool": case "boolean": return this.finishNode(node, "BooleanTypeAnnotation"); case "mixed": return this.finishNode(node, "MixedTypeAnnotation"); case "empty": return this.finishNode(node, "EmptyTypeAnnotation"); case "number": return this.finishNode(node, "NumberTypeAnnotation"); case "string": return this.finishNode(node, "StringTypeAnnotation"); case "symbol": return this.finishNode(node, "SymbolTypeAnnotation"); default: this.checkNotUnderscore(id.name); return this.flowParseGenericType(startLoc, id); } } flowParsePrimaryType() { const startLoc = this.state.startLoc; const node = this.startNode(); let tmp; let type; let isGroupedType = false; const oldNoAnonFunctionType = this.state.noAnonFunctionType; switch (this.state.type) { case 5: return this.flowParseObjectType({ allowStatic: false, allowExact: false, allowSpread: true, allowProto: false, allowInexact: true }); case 6: return this.flowParseObjectType({ allowStatic: false, allowExact: true, allowSpread: true, allowProto: false, allowInexact: false }); case 0: this.state.noAnonFunctionType = false; type = this.flowParseTupleType(); this.state.noAnonFunctionType = oldNoAnonFunctionType; return type; case 47: node.typeParameters = this.flowParseTypeParameterDeclaration(); this.expect(10); tmp = this.flowParseFunctionTypeParams(); node.params = tmp.params; node.rest = tmp.rest; node.this = tmp._this; this.expect(11); this.expect(19); node.returnType = this.flowParseType(); return this.finishNode(node, "FunctionTypeAnnotation"); case 10: this.next(); if (!this.match(11) && !this.match(21)) { if (tokenIsIdentifier(this.state.type) || this.match(78)) { const token = this.lookahead().type; isGroupedType = token !== 17 && token !== 14; } else { isGroupedType = true; } } if (isGroupedType) { this.state.noAnonFunctionType = false; type = this.flowParseType(); this.state.noAnonFunctionType = oldNoAnonFunctionType; if (this.state.noAnonFunctionType || !(this.match(12) || this.match(11) && this.lookahead().type === 19)) { this.expect(11); return type; } else { this.eat(12); } } if (type) { tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]); } else { tmp = this.flowParseFunctionTypeParams(); } node.params = tmp.params; node.rest = tmp.rest; node.this = tmp._this; this.expect(11); this.expect(19); node.returnType = this.flowParseType(); node.typeParameters = null; return this.finishNode(node, "FunctionTypeAnnotation"); case 131: return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); case 85: case 86: node.value = this.match(85); this.next(); return this.finishNode(node, "BooleanLiteralTypeAnnotation"); case 53: if (this.state.value === "-") { this.next(); if (this.match(132)) { return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node); } if (this.match(133)) { return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node); } throw this.raise(FlowErrors.UnexpectedSubtractionOperand, { at: this.state.startLoc }); } this.unexpected(); return; case 132: return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); case 133: return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); case 88: this.next(); return this.finishNode(node, "VoidTypeAnnotation"); case 84: this.next(); return this.finishNode(node, "NullLiteralTypeAnnotation"); case 78: this.next(); return this.finishNode(node, "ThisTypeAnnotation"); case 55: this.next(); return this.finishNode(node, "ExistsTypeAnnotation"); case 87: return this.flowParseTypeofType(); default: if (tokenIsKeyword(this.state.type)) { const label = tokenLabelName(this.state.type); this.next(); return super.createIdentifier(node, label); } else if (tokenIsIdentifier(this.state.type)) { if (this.isContextual(127)) { return this.flowParseInterfaceType(); } return this.flowIdentToTypeAnnotation(startLoc, node, this.parseIdentifier()); } } this.unexpected(); } flowParsePostfixType() { const startLoc = this.state.startLoc; let type = this.flowParsePrimaryType(); let seenOptionalIndexedAccess = false; while ((this.match(0) || this.match(18)) && !this.canInsertSemicolon()) { const node = this.startNodeAt(startLoc); const optional = this.eat(18); seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional; this.expect(0); if (!optional && this.match(3)) { node.elementType = type; this.next(); type = this.finishNode(node, "ArrayTypeAnnotation"); } else { node.objectType = type; node.indexType = this.flowParseType(); this.expect(3); if (seenOptionalIndexedAccess) { node.optional = optional; type = this.finishNode(node, "OptionalIndexedAccessType"); } else { type = this.finishNode(node, "IndexedAccessType"); } } } return type; } flowParsePrefixType() { const node = this.startNode(); if (this.eat(17)) { node.typeAnnotation = this.flowParsePrefixType(); return this.finishNode(node, "NullableTypeAnnotation"); } else { return this.flowParsePostfixType(); } } flowParseAnonFunctionWithoutParens() { const param = this.flowParsePrefixType(); if (!this.state.noAnonFunctionType && this.eat(19)) { const node = this.startNodeAt(param.loc.start); node.params = [this.reinterpretTypeAsFunctionTypeParam(param)]; node.rest = null; node.this = null; node.returnType = this.flowParseType(); node.typeParameters = null; return this.finishNode(node, "FunctionTypeAnnotation"); } return param; } flowParseIntersectionType() { const node = this.startNode(); this.eat(45); const type = this.flowParseAnonFunctionWithoutParens(); node.types = [type]; while (this.eat(45)) { node.types.push(this.flowParseAnonFunctionWithoutParens()); } return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); } flowParseUnionType() { const node = this.startNode(); this.eat(43); const type = this.flowParseIntersectionType(); node.types = [type]; while (this.eat(43)) { node.types.push(this.flowParseIntersectionType()); } return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); } flowParseType() { const oldInType = this.state.inType; this.state.inType = true; const type = this.flowParseUnionType(); this.state.inType = oldInType; return type; } flowParseTypeOrImplicitInstantiation() { if (this.state.type === 130 && this.state.value === "_") { const startLoc = this.state.startLoc; const node = this.parseIdentifier(); return this.flowParseGenericType(startLoc, node); } else { return this.flowParseType(); } } flowParseTypeAnnotation() { const node = this.startNode(); node.typeAnnotation = this.flowParseTypeInitialiser(); return this.finishNode(node, "TypeAnnotation"); } flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) { const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier(); if (this.match(14)) { ident.typeAnnotation = this.flowParseTypeAnnotation(); this.resetEndLocation(ident); } return ident; } typeCastToParameter(node) { node.expression.typeAnnotation = node.typeAnnotation; this.resetEndLocation(node.expression, node.typeAnnotation.loc.end); return node.expression; } flowParseVariance() { let variance = null; if (this.match(53)) { variance = this.startNode(); if (this.state.value === "+") { variance.kind = "plus"; } else { variance.kind = "minus"; } this.next(); return this.finishNode(variance, "Variance"); } return variance; } parseFunctionBody(node, allowExpressionBody, isMethod = false) { if (allowExpressionBody) { this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod)); return; } super.parseFunctionBody(node, false, isMethod); } parseFunctionBodyAndFinish(node, type, isMethod = false) { if (this.match(14)) { const typeNode = this.startNode(); [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null; } return super.parseFunctionBodyAndFinish(node, type, isMethod); } parseStatementLike(flags) { if (this.state.strict && this.isContextual(127)) { const lookahead = this.lookahead(); if (tokenIsKeywordOrIdentifier(lookahead.type)) { const node = this.startNode(); this.next(); return this.flowParseInterface(node); } } else if (this.shouldParseEnums() && this.isContextual(124)) { const node = this.startNode(); this.next(); return this.flowParseEnumDeclaration(node); } const stmt = super.parseStatementLike(flags); if (this.flowPragma === undefined && !this.isValidDirective(stmt)) { this.flowPragma = null; } return stmt; } parseExpressionStatement(node, expr, decorators) { if (expr.type === "Identifier") { if (expr.name === "declare") { if (this.match(80) || tokenIsIdentifier(this.state.type) || this.match(68) || this.match(74) || this.match(82)) { return this.flowParseDeclare(node); } } else if (tokenIsIdentifier(this.state.type)) { if (expr.name === "interface") { return this.flowParseInterface(node); } else if (expr.name === "type") { return this.flowParseTypeAlias(node); } else if (expr.name === "opaque") { return this.flowParseOpaqueType(node, false); } } } return super.parseExpressionStatement(node, expr, decorators); } shouldParseExportDeclaration() { const { type } = this.state; if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 124) { return !this.state.containsEsc; } return super.shouldParseExportDeclaration(); } isExportDefaultSpecifier() { const { type } = this.state; if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 124) { return this.state.containsEsc; } return super.isExportDefaultSpecifier(); } parseExportDefaultExpression() { if (this.shouldParseEnums() && this.isContextual(124)) { const node = this.startNode(); this.next(); return this.flowParseEnumDeclaration(node); } return super.parseExportDefaultExpression(); } parseConditional(expr, startLoc, refExpressionErrors) { if (!this.match(17)) return expr; if (this.state.maybeInArrowParameters) { const nextCh = this.lookaheadCharCode(); if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) { this.setOptionalParametersError(refExpressionErrors); return expr; } } this.expect(17); const state = this.state.clone(); const originalNoArrowAt = this.state.noArrowAt; const node = this.startNodeAt(startLoc); let { consequent, failed } = this.tryParseConditionalConsequent(); let [valid, invalid] = this.getArrowLikeExpressions(consequent); if (failed || invalid.length > 0) { const noArrowAt = [...originalNoArrowAt]; if (invalid.length > 0) { this.state = state; this.state.noArrowAt = noArrowAt; for (let i = 0; i < invalid.length; i++) { noArrowAt.push(invalid[i].start); } ({ consequent, failed } = this.tryParseConditionalConsequent()); [valid, invalid] = this.getArrowLikeExpressions(consequent); } if (failed && valid.length > 1) { this.raise(FlowErrors.AmbiguousConditionalArrow, { at: state.startLoc }); } if (failed && valid.length === 1) { this.state = state; noArrowAt.push(valid[0].start); this.state.noArrowAt = noArrowAt; ({ consequent, failed } = this.tryParseConditionalConsequent()); } } this.getArrowLikeExpressions(consequent, true); this.state.noArrowAt = originalNoArrowAt; this.expect(14); node.test = expr; node.consequent = consequent; node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined)); return this.finishNode(node, "ConditionalExpression"); } tryParseConditionalConsequent() { this.state.noArrowParamsConversionAt.push(this.state.start); const consequent = this.parseMaybeAssignAllowIn(); const failed = !this.match(14); this.state.noArrowParamsConversionAt.pop(); return { consequent, failed }; } getArrowLikeExpressions(node, disallowInvalid) { const stack = [node]; const arrows = []; while (stack.length !== 0) { const node = stack.pop(); if (node.type === "ArrowFunctionExpression") { if (node.typeParameters || !node.returnType) { this.finishArrowValidation(node); } else { arrows.push(node); } stack.push(node.body); } else if (node.type === "ConditionalExpression") { stack.push(node.consequent); stack.push(node.alternate); } } if (disallowInvalid) { arrows.forEach(node => this.finishArrowValidation(node)); return [arrows, []]; } return partition(arrows, node => node.params.every(param => this.isAssignable(param, true))); } finishArrowValidation(node) { var _node$extra; this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, false); this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW); super.checkParams(node, false, true); this.scope.exit(); } forwardNoArrowParamsConversionAt(node, parse) { let result; if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { this.state.noArrowParamsConversionAt.push(this.state.start); result = parse(); this.state.noArrowParamsConversionAt.pop(); } else { result = parse(); } return result; } parseParenItem(node, startLoc) { node = super.parseParenItem(node, startLoc); if (this.eat(17)) { node.optional = true; this.resetEndLocation(node); } if (this.match(14)) { const typeCastNode = this.startNodeAt(startLoc); typeCastNode.expression = node; typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); return this.finishNode(typeCastNode, "TypeCastExpression"); } return node; } assertModuleNodeAllowed(node) { if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") { return; } super.assertModuleNodeAllowed(node); } parseExportDeclaration(node) { if (this.isContextual(128)) { node.exportKind = "type"; const declarationNode = this.startNode(); this.next(); if (this.match(5)) { node.specifiers = this.parseExportSpecifiers(true); super.parseExportFrom(node); return null; } else { return this.flowParseTypeAlias(declarationNode); } } else if (this.isContextual(129)) { node.exportKind = "type"; const declarationNode = this.startNode(); this.next(); return this.flowParseOpaqueType(declarationNode, false); } else if (this.isContextual(127)) { node.exportKind = "type"; const declarationNode = this.startNode(); this.next(); return this.flowParseInterface(declarationNode); } else if (this.shouldParseEnums() && this.isContextual(124)) { node.exportKind = "value"; const declarationNode = this.startNode(); this.next(); return this.flowParseEnumDeclaration(declarationNode); } else { return super.parseExportDeclaration(node); } } eatExportStar(node) { if (super.eatExportStar(node)) return true; if (this.isContextual(128) && this.lookahead().type === 55) { node.exportKind = "type"; this.next(); this.next(); return true; } return false; } maybeParseExportNamespaceSpecifier(node) { const { startLoc } = this.state; const hasNamespace = super.maybeParseExportNamespaceSpecifier(node); if (hasNamespace && node.exportKind === "type") { this.unexpected(startLoc); } return hasNamespace; } parseClassId(node, isStatement, optionalId) { super.parseClassId(node, isStatement, optionalId); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } } parseClassMember(classBody, member, state) { const { startLoc } = this.state; if (this.isContextual(123)) { if (super.parseClassMemberFromModifier(classBody, member)) { return; } member.declare = true; } super.parseClassMember(classBody, member, state); if (member.declare) { if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") { this.raise(FlowErrors.DeclareClassElement, { at: startLoc }); } else if (member.value) { this.raise(FlowErrors.DeclareClassFieldInitializer, { at: member.value }); } } } isIterator(word) { return word === "iterator" || word === "asyncIterator"; } readIterator() { const word = super.readWord1(); const fullWord = "@@" + word; if (!this.isIterator(word) || !this.state.inType) { this.raise(Errors.InvalidIdentifier, { at: this.state.curPosition(), identifierName: fullWord }); } this.finishToken(130, fullWord); } getTokenFromCode(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (code === 123 && next === 124) { this.finishOp(6, 2); } else if (this.state.inType && (code === 62 || code === 60)) { this.finishOp(code === 62 ? 48 : 47, 1); } else if (this.state.inType && code === 63) { if (next === 46) { this.finishOp(18, 2); } else { this.finishOp(17, 1); } } else if (isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))) { this.state.pos += 2; this.readIterator(); } else { super.getTokenFromCode(code); } } isAssignable(node, isBinding) { if (node.type === "TypeCastExpression") { return this.isAssignable(node.expression, isBinding); } else { return super.isAssignable(node, isBinding); } } toAssignable(node, isLHS = false) { if (!isLHS && node.type === "AssignmentExpression" && node.left.type === "TypeCastExpression") { node.left = this.typeCastToParameter(node.left); } super.toAssignable(node, isLHS); } toAssignableList(exprList, trailingCommaLoc, isLHS) { for (let i = 0; i < exprList.length; i++) { const expr = exprList[i]; if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") { exprList[i] = this.typeCastToParameter(expr); } } super.toAssignableList(exprList, trailingCommaLoc, isLHS); } toReferencedList(exprList, isParenthesizedExpr) { for (let i = 0; i < exprList.length; i++) { var _expr$extra; const expr = exprList[i]; if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) { this.raise(FlowErrors.TypeCastInPattern, { at: expr.typeAnnotation }); } } return exprList; } parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); if (canBePattern && !this.state.maybeInArrowParameters) { this.toReferencedList(node.elements); } return node; } isValidLVal(type, isParenthesized, binding) { return type === "TypeCastExpression" || super.isValidLVal(type, isParenthesized, binding); } parseClassProperty(node) { if (this.match(14)) { node.typeAnnotation = this.flowParseTypeAnnotation(); } return super.parseClassProperty(node); } parseClassPrivateProperty(node) { if (this.match(14)) { node.typeAnnotation = this.flowParseTypeAnnotation(); } return super.parseClassPrivateProperty(node); } isClassMethod() { return this.match(47) || super.isClassMethod(); } isClassProperty() { return this.match(14) || super.isClassProperty(); } isNonstaticConstructor(method) { return !this.match(14) && super.isNonstaticConstructor(method); } pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { if (method.variance) { this.unexpected(method.variance.loc.start); } delete method.variance; if (this.match(47)) { method.typeParameters = this.flowParseTypeParameterDeclaration(); } super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); if (method.params && isConstructor) { const params = method.params; if (params.length > 0 && this.isThisParam(params[0])) { this.raise(FlowErrors.ThisParamBannedInConstructor, { at: method }); } } else if (method.type === "MethodDefinition" && isConstructor && method.value.params) { const params = method.value.params; if (params.length > 0 && this.isThisParam(params[0])) { this.raise(FlowErrors.ThisParamBannedInConstructor, { at: method }); } } } pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { if (method.variance) { this.unexpected(method.variance.loc.start); } delete method.variance; if (this.match(47)) { method.typeParameters = this.flowParseTypeParameterDeclaration(); } super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); } parseClassSuper(node) { super.parseClassSuper(node); if (node.superClass && this.match(47)) { node.superTypeParameters = this.flowParseTypeParameterInstantiation(); } if (this.isContextual(111)) { this.next(); const implemented = node.implements = []; do { const node = this.startNode(); node.id = this.flowParseRestrictedIdentifier(true); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterInstantiation(); } else { node.typeParameters = null; } implemented.push(this.finishNode(node, "ClassImplements")); } while (this.eat(12)); } } checkGetterSetterParams(method) { super.checkGetterSetterParams(method); const params = this.getObjectOrClassMethodParams(method); if (params.length > 0) { const param = params[0]; if (this.isThisParam(param) && method.kind === "get") { this.raise(FlowErrors.GetterMayNotHaveThisParam, { at: param }); } else if (this.isThisParam(param)) { this.raise(FlowErrors.SetterMayNotHaveThisParam, { at: param }); } } } parsePropertyNamePrefixOperator(node) { node.variance = this.flowParseVariance(); } parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { if (prop.variance) { this.unexpected(prop.variance.loc.start); } delete prop.variance; let typeParameters; if (this.match(47) && !isAccessor) { typeParameters = this.flowParseTypeParameterDeclaration(); if (!this.match(10)) this.unexpected(); } const result = super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); if (typeParameters) { (result.value || result).typeParameters = typeParameters; } return result; } parseAssignableListItemTypes(param) { if (this.eat(17)) { if (param.type !== "Identifier") { this.raise(FlowErrors.PatternIsOptional, { at: param }); } if (this.isThisParam(param)) { this.raise(FlowErrors.ThisParamMayNotBeOptional, { at: param }); } param.optional = true; } if (this.match(14)) { param.typeAnnotation = this.flowParseTypeAnnotation(); } else if (this.isThisParam(param)) { this.raise(FlowErrors.ThisParamAnnotationRequired, { at: param }); } if (this.match(29) && this.isThisParam(param)) { this.raise(FlowErrors.ThisParamNoDefault, { at: param }); } this.resetEndLocation(param); return param; } parseMaybeDefault(startLoc, left) { const node = super.parseMaybeDefault(startLoc, left); if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { this.raise(FlowErrors.TypeBeforeInitializer, { at: node.typeAnnotation }); } return node; } checkImportReflection(node) { super.checkImportReflection(node); if (node.module && node.importKind !== "value") { this.raise(FlowErrors.ImportReflectionHasImportType, { at: node.specifiers[0].loc.start }); } } parseImportSpecifierLocal(node, specifier, type) { specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier(); node.specifiers.push(this.finishImportSpecifier(specifier, type)); } isPotentialImportPhase(isExport) { if (super.isPotentialImportPhase(isExport)) return true; if (this.isContextual(128)) { if (!isExport) return true; const ch = this.lookaheadCharCode(); return ch === 123 || ch === 42; } return !isExport && this.isContextual(87); } applyImportPhase(node, isExport, phase, loc) { super.applyImportPhase(node, isExport, phase, loc); if (isExport) { if (!phase && this.match(65)) { return; } node.exportKind = phase === "type" ? phase : "value"; } else { if (phase === "type" && this.match(55)) this.unexpected(); node.importKind = phase === "type" || phase === "typeof" ? phase : "value"; } } parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { const firstIdent = specifier.imported; let specifierTypeKind = null; if (firstIdent.type === "Identifier") { if (firstIdent.name === "type") { specifierTypeKind = "type"; } else if (firstIdent.name === "typeof") { specifierTypeKind = "typeof"; } } let isBinding = false; if (this.isContextual(93) && !this.isLookaheadContextual("as")) { const as_ident = this.parseIdentifier(true); if (specifierTypeKind !== null && !tokenIsKeywordOrIdentifier(this.state.type)) { specifier.imported = as_ident; specifier.importKind = specifierTypeKind; specifier.local = cloneIdentifier(as_ident); } else { specifier.imported = firstIdent; specifier.importKind = null; specifier.local = this.parseIdentifier(); } } else { if (specifierTypeKind !== null && tokenIsKeywordOrIdentifier(this.state.type)) { specifier.imported = this.parseIdentifier(true); specifier.importKind = specifierTypeKind; } else { if (importedIsString) { throw this.raise(Errors.ImportBindingIsString, { at: specifier, importName: firstIdent.value }); } specifier.imported = firstIdent; specifier.importKind = null; } if (this.eatContextual(93)) { specifier.local = this.parseIdentifier(); } else { isBinding = true; specifier.local = cloneIdentifier(specifier.imported); } } const specifierIsTypeImport = hasTypeImportKind(specifier); if (isInTypeOnlyImport && specifierIsTypeImport) { this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, { at: specifier }); } if (isInTypeOnlyImport || specifierIsTypeImport) { this.checkReservedType(specifier.local.name, specifier.local.loc.start, true); } if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) { this.checkReservedWord(specifier.local.name, specifier.loc.start, true, true); } return this.finishImportSpecifier(specifier, "ImportSpecifier"); } parseBindingAtom() { switch (this.state.type) { case 78: return this.parseIdentifier(true); default: return super.parseBindingAtom(); } } parseFunctionParams(node, isConstructor) { const kind = node.kind; if (kind !== "get" && kind !== "set" && this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } super.parseFunctionParams(node, isConstructor); } parseVarId(decl, kind) { super.parseVarId(decl, kind); if (this.match(14)) { decl.id.typeAnnotation = this.flowParseTypeAnnotation(); this.resetEndLocation(decl.id); } } parseAsyncArrowFromCallExpression(node, call) { if (this.match(14)) { const oldNoAnonFunctionType = this.state.noAnonFunctionType; this.state.noAnonFunctionType = true; node.returnType = this.flowParseTypeAnnotation(); this.state.noAnonFunctionType = oldNoAnonFunctionType; } return super.parseAsyncArrowFromCallExpression(node, call); } shouldParseAsyncArrow() { return this.match(14) || super.shouldParseAsyncArrow(); } parseMaybeAssign(refExpressionErrors, afterLeftParse) { var _jsx; let state = null; let jsx; if (this.hasPlugin("jsx") && (this.match(140) || this.match(47))) { state = this.state.clone(); jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); if (!jsx.error) return jsx.node; const { context } = this.state; const currentContext = context[context.length - 1]; if (currentContext === types.j_oTag || currentContext === types.j_expr) { context.pop(); } } if ((_jsx = jsx) != null && _jsx.error || this.match(47)) { var _jsx2, _jsx3; state = state || this.state.clone(); let typeParameters; const arrow = this.tryParse(abort => { var _arrowExpression$extr; typeParameters = this.flowParseTypeParameterDeclaration(); const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => { const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse); this.resetStartLocationFromNode(result, typeParameters); return result; }); if ((_arrowExpression$extr = arrowExpression.extra) != null && _arrowExpression$extr.parenthesized) abort(); const expr = this.maybeUnwrapTypeCastExpression(arrowExpression); if (expr.type !== "ArrowFunctionExpression") abort(); expr.typeParameters = typeParameters; this.resetStartLocationFromNode(expr, typeParameters); return arrowExpression; }, state); let arrowExpression = null; if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") { if (!arrow.error && !arrow.aborted) { if (arrow.node.async) { this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, { at: typeParameters }); } return arrow.node; } arrowExpression = arrow.node; } if ((_jsx2 = jsx) != null && _jsx2.node) { this.state = jsx.failState; return jsx.node; } if (arrowExpression) { this.state = arrow.failState; return arrowExpression; } if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error; if (arrow.thrown) throw arrow.error; throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, { at: typeParameters }); } return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); } parseArrow(node) { if (this.match(14)) { const result = this.tryParse(() => { const oldNoAnonFunctionType = this.state.noAnonFunctionType; this.state.noAnonFunctionType = true; const typeNode = this.startNode(); [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); this.state.noAnonFunctionType = oldNoAnonFunctionType; if (this.canInsertSemicolon()) this.unexpected(); if (!this.match(19)) this.unexpected(); return typeNode; }); if (result.thrown) return null; if (result.error) this.state = result.failState; node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null; } return super.parseArrow(node); } shouldParseArrow(params) { return this.match(14) || super.shouldParseArrow(params); } setArrowFunctionParameters(node, params) { if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { node.params = params; } else { super.setArrowFunctionParameters(node, params); } } checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { return; } for (let i = 0; i < node.params.length; i++) { if (this.isThisParam(node.params[i]) && i > 0) { this.raise(FlowErrors.ThisParamMustBeFirst, { at: node.params[i] }); } } super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged); } parseParenAndDistinguishExpression(canBeArrow) { return super.parseParenAndDistinguishExpression(canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1); } parseSubscripts(base, startLoc, noCalls) { if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.indexOf(startLoc.index) !== -1) { this.next(); const node = this.startNodeAt(startLoc); node.callee = base; node.arguments = super.parseCallExpressionArguments(11, false); base = this.finishNode(node, "CallExpression"); } else if (base.type === "Identifier" && base.name === "async" && this.match(47)) { const state = this.state.clone(); const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(), state); if (!arrow.error && !arrow.aborted) return arrow.node; const result = this.tryParse(() => super.parseSubscripts(base, startLoc, noCalls), state); if (result.node && !result.error) return result.node; if (arrow.node) { this.state = arrow.failState; return arrow.node; } if (result.node) { this.state = result.failState; return result.node; } throw arrow.error || result.error; } return super.parseSubscripts(base, startLoc, noCalls); } parseSubscript(base, startLoc, noCalls, subscriptState) { if (this.match(18) && this.isLookaheadToken_lt()) { subscriptState.optionalChainMember = true; if (noCalls) { subscriptState.stop = true; return base; } this.next(); const node = this.startNodeAt(startLoc); node.callee = base; node.typeArguments = this.flowParseTypeParameterInstantiation(); this.expect(10); node.arguments = this.parseCallExpressionArguments(11, false); node.optional = true; return this.finishCallExpression(node, true); } else if (!noCalls && this.shouldParseTypes() && this.match(47)) { const node = this.startNodeAt(startLoc); node.callee = base; const result = this.tryParse(() => { node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(); this.expect(10); node.arguments = super.parseCallExpressionArguments(11, false); if (subscriptState.optionalChainMember) { node.optional = false; } return this.finishCallExpression(node, subscriptState.optionalChainMember); }); if (result.node) { if (result.error) this.state = result.failState; return result.node; } } return super.parseSubscript(base, startLoc, noCalls, subscriptState); } parseNewCallee(node) { super.parseNewCallee(node); let targs = null; if (this.shouldParseTypes() && this.match(47)) { targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node; } node.typeArguments = targs; } parseAsyncArrowWithTypeParameters(startLoc) { const node = this.startNodeAt(startLoc); this.parseFunctionParams(node, false); if (!this.parseArrow(node)) return; return super.parseArrowExpression(node, undefined, true); } readToken_mult_modulo(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (code === 42 && next === 47 && this.state.hasFlowComment) { this.state.hasFlowComment = false; this.state.pos += 2; this.nextToken(); return; } super.readToken_mult_modulo(code); } readToken_pipe_amp(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (code === 124 && next === 125) { this.finishOp(9, 2); return; } super.readToken_pipe_amp(code); } parseTopLevel(file, program) { const fileNode = super.parseTopLevel(file, program); if (this.state.hasFlowComment) { this.raise(FlowErrors.UnterminatedFlowComment, { at: this.state.curPosition() }); } return fileNode; } skipBlockComment() { if (this.hasPlugin("flowComments") && this.skipFlowComment()) { if (this.state.hasFlowComment) { throw this.raise(FlowErrors.NestedFlowComment, { at: this.state.startLoc }); } this.hasFlowCommentCompletion(); const commentSkip = this.skipFlowComment(); if (commentSkip) { this.state.pos += commentSkip; this.state.hasFlowComment = true; } return; } return super.skipBlockComment(this.state.hasFlowComment ? "*-/" : "*/"); } skipFlowComment() { const { pos } = this.state; let shiftToFirstNonWhiteSpace = 2; while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) { shiftToFirstNonWhiteSpace++; } const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos); const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1); if (ch2 === 58 && ch3 === 58) { return shiftToFirstNonWhiteSpace + 2; } if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") { return shiftToFirstNonWhiteSpace + 12; } if (ch2 === 58 && ch3 !== 58) { return shiftToFirstNonWhiteSpace; } return false; } hasFlowCommentCompletion() { const end = this.input.indexOf("*/", this.state.pos); if (end === -1) { throw this.raise(Errors.UnterminatedComment, { at: this.state.curPosition() }); } } flowEnumErrorBooleanMemberNotInitialized(loc, { enumName, memberName }) { this.raise(FlowErrors.EnumBooleanMemberNotInitialized, { at: loc, memberName, enumName }); } flowEnumErrorInvalidMemberInitializer(loc, enumContext) { return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, Object.assign({ at: loc }, enumContext)); } flowEnumErrorNumberMemberNotInitialized(loc, { enumName, memberName }) { this.raise(FlowErrors.EnumNumberMemberNotInitialized, { at: loc, enumName, memberName }); } flowEnumErrorStringMemberInconsistentlyInitailized(node, { enumName }) { this.raise(FlowErrors.EnumStringMemberInconsistentlyInitailized, { at: node, enumName }); } flowEnumMemberInit() { const startLoc = this.state.startLoc; const endOfInit = () => this.match(12) || this.match(8); switch (this.state.type) { case 132: { const literal = this.parseNumericLiteral(this.state.value); if (endOfInit()) { return { type: "number", loc: literal.loc.start, value: literal }; } return { type: "invalid", loc: startLoc }; } case 131: { const literal = this.parseStringLiteral(this.state.value); if (endOfInit()) { return { type: "string", loc: literal.loc.start, value: literal }; } return { type: "invalid", loc: startLoc }; } case 85: case 86: { const literal = this.parseBooleanLiteral(this.match(85)); if (endOfInit()) { return { type: "boolean", loc: literal.loc.start, value: literal }; } return { type: "invalid", loc: startLoc }; } default: return { type: "invalid", loc: startLoc }; } } flowEnumMemberRaw() { const loc = this.state.startLoc; const id = this.parseIdentifier(true); const init = this.eat(29) ? this.flowEnumMemberInit() : { type: "none", loc }; return { id, init }; } flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) { const { explicitType } = context; if (explicitType === null) { return; } if (explicitType !== expectedType) { this.flowEnumErrorInvalidMemberInitializer(loc, context); } } flowEnumMembers({ enumName, explicitType }) { const seenNames = new Set(); const members = { booleanMembers: [], numberMembers: [], stringMembers: [], defaultedMembers: [] }; let hasUnknownMembers = false; while (!this.match(8)) { if (this.eat(21)) { hasUnknownMembers = true; break; } const memberNode = this.startNode(); const { id, init } = this.flowEnumMemberRaw(); const memberName = id.name; if (memberName === "") { continue; } if (/^[a-z]/.test(memberName)) { this.raise(FlowErrors.EnumInvalidMemberName, { at: id, memberName, suggestion: memberName[0].toUpperCase() + memberName.slice(1), enumName }); } if (seenNames.has(memberName)) { this.raise(FlowErrors.EnumDuplicateMemberName, { at: id, memberName, enumName }); } seenNames.add(memberName); const context = { enumName, explicitType, memberName }; memberNode.id = id; switch (init.type) { case "boolean": { this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "boolean"); memberNode.init = init.value; members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember")); break; } case "number": { this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "number"); memberNode.init = init.value; members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember")); break; } case "string": { this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "string"); memberNode.init = init.value; members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember")); break; } case "invalid": { throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context); } case "none": { switch (explicitType) { case "boolean": this.flowEnumErrorBooleanMemberNotInitialized(init.loc, context); break; case "number": this.flowEnumErrorNumberMemberNotInitialized(init.loc, context); break; default: members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember")); } } } if (!this.match(8)) { this.expect(12); } } return { members, hasUnknownMembers }; } flowEnumStringMembers(initializedMembers, defaultedMembers, { enumName }) { if (initializedMembers.length === 0) { return defaultedMembers; } else if (defaultedMembers.length === 0) { return initializedMembers; } else if (defaultedMembers.length > initializedMembers.length) { for (const member of initializedMembers) { this.flowEnumErrorStringMemberInconsistentlyInitailized(member, { enumName }); } return defaultedMembers; } else { for (const member of defaultedMembers) { this.flowEnumErrorStringMemberInconsistentlyInitailized(member, { enumName }); } return initializedMembers; } } flowEnumParseExplicitType({ enumName }) { if (!this.eatContextual(101)) return null; if (!tokenIsIdentifier(this.state.type)) { throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, { at: this.state.startLoc, enumName }); } const { value } = this.state; this.next(); if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") { this.raise(FlowErrors.EnumInvalidExplicitType, { at: this.state.startLoc, enumName, invalidEnumType: value }); } return value; } flowEnumBody(node, id) { const enumName = id.name; const nameLoc = id.loc.start; const explicitType = this.flowEnumParseExplicitType({ enumName }); this.expect(5); const { members, hasUnknownMembers } = this.flowEnumMembers({ enumName, explicitType }); node.hasUnknownMembers = hasUnknownMembers; switch (explicitType) { case "boolean": node.explicitType = true; node.members = members.booleanMembers; this.expect(8); return this.finishNode(node, "EnumBooleanBody"); case "number": node.explicitType = true; node.members = members.numberMembers; this.expect(8); return this.finishNode(node, "EnumNumberBody"); case "string": node.explicitType = true; node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { enumName }); this.expect(8); return this.finishNode(node, "EnumStringBody"); case "symbol": node.members = members.defaultedMembers; this.expect(8); return this.finishNode(node, "EnumSymbolBody"); default: { const empty = () => { node.members = []; this.expect(8); return this.finishNode(node, "EnumStringBody"); }; node.explicitType = false; const boolsLen = members.booleanMembers.length; const numsLen = members.numberMembers.length; const strsLen = members.stringMembers.length; const defaultedLen = members.defaultedMembers.length; if (!boolsLen && !numsLen && !strsLen && !defaultedLen) { return empty(); } else if (!boolsLen && !numsLen) { node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { enumName }); this.expect(8); return this.finishNode(node, "EnumStringBody"); } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) { for (const member of members.defaultedMembers) { this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, { enumName, memberName: member.id.name }); } node.members = members.booleanMembers; this.expect(8); return this.finishNode(node, "EnumBooleanBody"); } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) { for (const member of members.defaultedMembers) { this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, { enumName, memberName: member.id.name }); } node.members = members.numberMembers; this.expect(8); return this.finishNode(node, "EnumNumberBody"); } else { this.raise(FlowErrors.EnumInconsistentMemberValues, { at: nameLoc, enumName }); return empty(); } } } } flowParseEnumDeclaration(node) { const id = this.parseIdentifier(); node.id = id; node.body = this.flowEnumBody(this.startNode(), id); return this.finishNode(node, "EnumDeclaration"); } isLookaheadToken_lt() { const next = this.nextTokenStart(); if (this.input.charCodeAt(next) === 60) { const afterNext = this.input.charCodeAt(next + 1); return afterNext !== 60 && afterNext !== 61; } return false; } maybeUnwrapTypeCastExpression(node) { return node.type === "TypeCastExpression" ? node.expression : node; } }; const entities = { __proto__: null, quot: "\u0022", amp: "&", apos: "\u0027", lt: "<", gt: ">", nbsp: "\u00A0", iexcl: "\u00A1", cent: "\u00A2", pound: "\u00A3", curren: "\u00A4", yen: "\u00A5", brvbar: "\u00A6", sect: "\u00A7", uml: "\u00A8", copy: "\u00A9", ordf: "\u00AA", laquo: "\u00AB", not: "\u00AC", shy: "\u00AD", reg: "\u00AE", macr: "\u00AF", deg: "\u00B0", plusmn: "\u00B1", sup2: "\u00B2", sup3: "\u00B3", acute: "\u00B4", micro: "\u00B5", para: "\u00B6", middot: "\u00B7", cedil: "\u00B8", sup1: "\u00B9", ordm: "\u00BA", raquo: "\u00BB", frac14: "\u00BC", frac12: "\u00BD", frac34: "\u00BE", iquest: "\u00BF", Agrave: "\u00C0", Aacute: "\u00C1", Acirc: "\u00C2", Atilde: "\u00C3", Auml: "\u00C4", Aring: "\u00C5", AElig: "\u00C6", Ccedil: "\u00C7", Egrave: "\u00C8", Eacute: "\u00C9", Ecirc: "\u00CA", Euml: "\u00CB", Igrave: "\u00CC", Iacute: "\u00CD", Icirc: "\u00CE", Iuml: "\u00CF", ETH: "\u00D0", Ntilde: "\u00D1", Ograve: "\u00D2", Oacute: "\u00D3", Ocirc: "\u00D4", Otilde: "\u00D5", Ouml: "\u00D6", times: "\u00D7", Oslash: "\u00D8", Ugrave: "\u00D9", Uacute: "\u00DA", Ucirc: "\u00DB", Uuml: "\u00DC", Yacute: "\u00DD", THORN: "\u00DE", szlig: "\u00DF", agrave: "\u00E0", aacute: "\u00E1", acirc: "\u00E2", atilde: "\u00E3", auml: "\u00E4", aring: "\u00E5", aelig: "\u00E6", ccedil: "\u00E7", egrave: "\u00E8", eacute: "\u00E9", ecirc: "\u00EA", euml: "\u00EB", igrave: "\u00EC", iacute: "\u00ED", icirc: "\u00EE", iuml: "\u00EF", eth: "\u00F0", ntilde: "\u00F1", ograve: "\u00F2", oacute: "\u00F3", ocirc: "\u00F4", otilde: "\u00F5", ouml: "\u00F6", divide: "\u00F7", oslash: "\u00F8", ugrave: "\u00F9", uacute: "\u00FA", ucirc: "\u00FB", uuml: "\u00FC", yacute: "\u00FD", thorn: "\u00FE", yuml: "\u00FF", OElig: "\u0152", oelig: "\u0153", Scaron: "\u0160", scaron: "\u0161", Yuml: "\u0178", fnof: "\u0192", circ: "\u02C6", tilde: "\u02DC", Alpha: "\u0391", Beta: "\u0392", Gamma: "\u0393", Delta: "\u0394", Epsilon: "\u0395", Zeta: "\u0396", Eta: "\u0397", Theta: "\u0398", Iota: "\u0399", Kappa: "\u039A", Lambda: "\u039B", Mu: "\u039C", Nu: "\u039D", Xi: "\u039E", Omicron: "\u039F", Pi: "\u03A0", Rho: "\u03A1", Sigma: "\u03A3", Tau: "\u03A4", Upsilon: "\u03A5", Phi: "\u03A6", Chi: "\u03A7", Psi: "\u03A8", Omega: "\u03A9", alpha: "\u03B1", beta: "\u03B2", gamma: "\u03B3", delta: "\u03B4", epsilon: "\u03B5", zeta: "\u03B6", eta: "\u03B7", theta: "\u03B8", iota: "\u03B9", kappa: "\u03BA", lambda: "\u03BB", mu: "\u03BC", nu: "\u03BD", xi: "\u03BE", omicron: "\u03BF", pi: "\u03C0", rho: "\u03C1", sigmaf: "\u03C2", sigma: "\u03C3", tau: "\u03C4", upsilon: "\u03C5", phi: "\u03C6", chi: "\u03C7", psi: "\u03C8", omega: "\u03C9", thetasym: "\u03D1", upsih: "\u03D2", piv: "\u03D6", ensp: "\u2002", emsp: "\u2003", thinsp: "\u2009", zwnj: "\u200C", zwj: "\u200D", lrm: "\u200E", rlm: "\u200F", ndash: "\u2013", mdash: "\u2014", lsquo: "\u2018", rsquo: "\u2019", sbquo: "\u201A", ldquo: "\u201C", rdquo: "\u201D", bdquo: "\u201E", dagger: "\u2020", Dagger: "\u2021", bull: "\u2022", hellip: "\u2026", permil: "\u2030", prime: "\u2032", Prime: "\u2033", lsaquo: "\u2039", rsaquo: "\u203A", oline: "\u203E", frasl: "\u2044", euro: "\u20AC", image: "\u2111", weierp: "\u2118", real: "\u211C", trade: "\u2122", alefsym: "\u2135", larr: "\u2190", uarr: "\u2191", rarr: "\u2192", darr: "\u2193", harr: "\u2194", crarr: "\u21B5", lArr: "\u21D0", uArr: "\u21D1", rArr: "\u21D2", dArr: "\u21D3", hArr: "\u21D4", forall: "\u2200", part: "\u2202", exist: "\u2203", empty: "\u2205", nabla: "\u2207", isin: "\u2208", notin: "\u2209", ni: "\u220B", prod: "\u220F", sum: "\u2211", minus: "\u2212", lowast: "\u2217", radic: "\u221A", prop: "\u221D", infin: "\u221E", ang: "\u2220", and: "\u2227", or: "\u2228", cap: "\u2229", cup: "\u222A", int: "\u222B", there4: "\u2234", sim: "\u223C", cong: "\u2245", asymp: "\u2248", ne: "\u2260", equiv: "\u2261", le: "\u2264", ge: "\u2265", sub: "\u2282", sup: "\u2283", nsub: "\u2284", sube: "\u2286", supe: "\u2287", oplus: "\u2295", otimes: "\u2297", perp: "\u22A5", sdot: "\u22C5", lceil: "\u2308", rceil: "\u2309", lfloor: "\u230A", rfloor: "\u230B", lang: "\u2329", rang: "\u232A", loz: "\u25CA", spades: "\u2660", clubs: "\u2663", hearts: "\u2665", diams: "\u2666" }; const JsxErrors = ParseErrorEnum`jsx`({ AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.", MissingClosingTagElement: ({ openingTagName }) => `Expected corresponding JSX closing tag for <${openingTagName}>.`, MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.", UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?", UnexpectedToken: ({ unexpected, HTMLEntity }) => `Unexpected token \`${unexpected}\`. Did you mean \`${HTMLEntity}\` or \`{'${unexpected}'}\`?`, UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text.", UnterminatedJsxContent: "Unterminated JSX contents.", UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?" }); function isFragment(object) { return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false; } function getQualifiedJSXName(object) { if (object.type === "JSXIdentifier") { return object.name; } if (object.type === "JSXNamespacedName") { return object.namespace.name + ":" + object.name.name; } if (object.type === "JSXMemberExpression") { return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); } throw new Error("Node had unexpected type: " + object.type); } var jsx = superClass => class JSXParserMixin extends superClass { jsxReadToken() { let out = ""; let chunkStart = this.state.pos; for (;;) { if (this.state.pos >= this.length) { throw this.raise(JsxErrors.UnterminatedJsxContent, { at: this.state.startLoc }); } const ch = this.input.charCodeAt(this.state.pos); switch (ch) { case 60: case 123: if (this.state.pos === this.state.start) { if (ch === 60 && this.state.canStartJSXElement) { ++this.state.pos; this.finishToken(140); } else { super.getTokenFromCode(ch); } return; } out += this.input.slice(chunkStart, this.state.pos); this.finishToken(139, out); return; case 38: out += this.input.slice(chunkStart, this.state.pos); out += this.jsxReadEntity(); chunkStart = this.state.pos; break; case 62: case 125: default: if (isNewLine(ch)) { out += this.input.slice(chunkStart, this.state.pos); out += this.jsxReadNewLine(true); chunkStart = this.state.pos; } else { ++this.state.pos; } } } } jsxReadNewLine(normalizeCRLF) { const ch = this.input.charCodeAt(this.state.pos); let out; ++this.state.pos; if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { ++this.state.pos; out = normalizeCRLF ? "\n" : "\r\n"; } else { out = String.fromCharCode(ch); } ++this.state.curLine; this.state.lineStart = this.state.pos; return out; } jsxReadString(quote) { let out = ""; let chunkStart = ++this.state.pos; for (;;) { if (this.state.pos >= this.length) { throw this.raise(Errors.UnterminatedString, { at: this.state.startLoc }); } const ch = this.input.charCodeAt(this.state.pos); if (ch === quote) break; if (ch === 38) { out += this.input.slice(chunkStart, this.state.pos); out += this.jsxReadEntity(); chunkStart = this.state.pos; } else if (isNewLine(ch)) { out += this.input.slice(chunkStart, this.state.pos); out += this.jsxReadNewLine(false); chunkStart = this.state.pos; } else { ++this.state.pos; } } out += this.input.slice(chunkStart, this.state.pos++); this.finishToken(131, out); } jsxReadEntity() { const startPos = ++this.state.pos; if (this.codePointAtPos(this.state.pos) === 35) { ++this.state.pos; let radix = 10; if (this.codePointAtPos(this.state.pos) === 120) { radix = 16; ++this.state.pos; } const codePoint = this.readInt(radix, undefined, false, "bail"); if (codePoint !== null && this.codePointAtPos(this.state.pos) === 59) { ++this.state.pos; return String.fromCodePoint(codePoint); } } else { let count = 0; let semi = false; while (count++ < 10 && this.state.pos < this.length && !(semi = this.codePointAtPos(this.state.pos) == 59)) { ++this.state.pos; } if (semi) { const desc = this.input.slice(startPos, this.state.pos); const entity = entities[desc]; ++this.state.pos; if (entity) { return entity; } } } this.state.pos = startPos; return "&"; } jsxReadWord() { let ch; const start = this.state.pos; do { ch = this.input.charCodeAt(++this.state.pos); } while (isIdentifierChar(ch) || ch === 45); this.finishToken(138, this.input.slice(start, this.state.pos)); } jsxParseIdentifier() { const node = this.startNode(); if (this.match(138)) { node.name = this.state.value; } else if (tokenIsKeyword(this.state.type)) { node.name = tokenLabelName(this.state.type); } else { this.unexpected(); } this.next(); return this.finishNode(node, "JSXIdentifier"); } jsxParseNamespacedName() { const startLoc = this.state.startLoc; const name = this.jsxParseIdentifier(); if (!this.eat(14)) return name; const node = this.startNodeAt(startLoc); node.namespace = name; node.name = this.jsxParseIdentifier(); return this.finishNode(node, "JSXNamespacedName"); } jsxParseElementName() { const startLoc = this.state.startLoc; let node = this.jsxParseNamespacedName(); if (node.type === "JSXNamespacedName") { return node; } while (this.eat(16)) { const newNode = this.startNodeAt(startLoc); newNode.object = node; newNode.property = this.jsxParseIdentifier(); node = this.finishNode(newNode, "JSXMemberExpression"); } return node; } jsxParseAttributeValue() { let node; switch (this.state.type) { case 5: node = this.startNode(); this.setContext(types.brace); this.next(); node = this.jsxParseExpressionContainer(node, types.j_oTag); if (node.expression.type === "JSXEmptyExpression") { this.raise(JsxErrors.AttributeIsEmpty, { at: node }); } return node; case 140: case 131: return this.parseExprAtom(); default: throw this.raise(JsxErrors.UnsupportedJsxValue, { at: this.state.startLoc }); } } jsxParseEmptyExpression() { const node = this.startNodeAt(this.state.lastTokEndLoc); return this.finishNodeAt(node, "JSXEmptyExpression", this.state.startLoc); } jsxParseSpreadChild(node) { this.next(); node.expression = this.parseExpression(); this.setContext(types.j_expr); this.state.canStartJSXElement = true; this.expect(8); return this.finishNode(node, "JSXSpreadChild"); } jsxParseExpressionContainer(node, previousContext) { if (this.match(8)) { node.expression = this.jsxParseEmptyExpression(); } else { const expression = this.parseExpression(); node.expression = expression; } this.setContext(previousContext); this.state.canStartJSXElement = true; this.expect(8); return this.finishNode(node, "JSXExpressionContainer"); } jsxParseAttribute() { const node = this.startNode(); if (this.match(5)) { this.setContext(types.brace); this.next(); this.expect(21); node.argument = this.parseMaybeAssignAllowIn(); this.setContext(types.j_oTag); this.state.canStartJSXElement = true; this.expect(8); return this.finishNode(node, "JSXSpreadAttribute"); } node.name = this.jsxParseNamespacedName(); node.value = this.eat(29) ? this.jsxParseAttributeValue() : null; return this.finishNode(node, "JSXAttribute"); } jsxParseOpeningElementAt(startLoc) { const node = this.startNodeAt(startLoc); if (this.eat(141)) { return this.finishNode(node, "JSXOpeningFragment"); } node.name = this.jsxParseElementName(); return this.jsxParseOpeningElementAfterName(node); } jsxParseOpeningElementAfterName(node) { const attributes = []; while (!this.match(56) && !this.match(141)) { attributes.push(this.jsxParseAttribute()); } node.attributes = attributes; node.selfClosing = this.eat(56); this.expect(141); return this.finishNode(node, "JSXOpeningElement"); } jsxParseClosingElementAt(startLoc) { const node = this.startNodeAt(startLoc); if (this.eat(141)) { return this.finishNode(node, "JSXClosingFragment"); } node.name = this.jsxParseElementName(); this.expect(141); return this.finishNode(node, "JSXClosingElement"); } jsxParseElementAt(startLoc) { const node = this.startNodeAt(startLoc); const children = []; const openingElement = this.jsxParseOpeningElementAt(startLoc); let closingElement = null; if (!openingElement.selfClosing) { contents: for (;;) { switch (this.state.type) { case 140: startLoc = this.state.startLoc; this.next(); if (this.eat(56)) { closingElement = this.jsxParseClosingElementAt(startLoc); break contents; } children.push(this.jsxParseElementAt(startLoc)); break; case 139: children.push(this.parseExprAtom()); break; case 5: { const node = this.startNode(); this.setContext(types.brace); this.next(); if (this.match(21)) { children.push(this.jsxParseSpreadChild(node)); } else { children.push(this.jsxParseExpressionContainer(node, types.j_expr)); } break; } default: this.unexpected(); } } if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) { this.raise(JsxErrors.MissingClosingTagFragment, { at: closingElement }); } else if (!isFragment(openingElement) && isFragment(closingElement)) { this.raise(JsxErrors.MissingClosingTagElement, { at: closingElement, openingTagName: getQualifiedJSXName(openingElement.name) }); } else if (!isFragment(openingElement) && !isFragment(closingElement)) { if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { this.raise(JsxErrors.MissingClosingTagElement, { at: closingElement, openingTagName: getQualifiedJSXName(openingElement.name) }); } } } if (isFragment(openingElement)) { node.openingFragment = openingElement; node.closingFragment = closingElement; } else { node.openingElement = openingElement; node.closingElement = closingElement; } node.children = children; if (this.match(47)) { throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, { at: this.state.startLoc }); } return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement"); } jsxParseElement() { const startLoc = this.state.startLoc; this.next(); return this.jsxParseElementAt(startLoc); } setContext(newContext) { const { context } = this.state; context[context.length - 1] = newContext; } parseExprAtom(refExpressionErrors) { if (this.match(139)) { return this.parseLiteral(this.state.value, "JSXText"); } else if (this.match(140)) { return this.jsxParseElement(); } else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) { this.replaceToken(140); return this.jsxParseElement(); } else { return super.parseExprAtom(refExpressionErrors); } } skipSpace() { const curContext = this.curContext(); if (!curContext.preserveSpace) super.skipSpace(); } getTokenFromCode(code) { const context = this.curContext(); if (context === types.j_expr) { this.jsxReadToken(); return; } if (context === types.j_oTag || context === types.j_cTag) { if (isIdentifierStart(code)) { this.jsxReadWord(); return; } if (code === 62) { ++this.state.pos; this.finishToken(141); return; } if ((code === 34 || code === 39) && context === types.j_oTag) { this.jsxReadString(code); return; } } if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) { ++this.state.pos; this.finishToken(140); return; } super.getTokenFromCode(code); } updateContext(prevType) { const { context, type } = this.state; if (type === 56 && prevType === 140) { context.splice(-2, 2, types.j_cTag); this.state.canStartJSXElement = false; } else if (type === 140) { context.push(types.j_oTag); } else if (type === 141) { const out = context[context.length - 1]; if (out === types.j_oTag && prevType === 56 || out === types.j_cTag) { context.pop(); this.state.canStartJSXElement = context[context.length - 1] === types.j_expr; } else { this.setContext(types.j_expr); this.state.canStartJSXElement = true; } } else { this.state.canStartJSXElement = tokenComesBeforeExpression(type); } } }; class TypeScriptScope extends Scope { constructor(...args) { super(...args); this.types = new Set(); this.enums = new Set(); this.constEnums = new Set(); this.classes = new Set(); this.exportOnlyBindings = new Set(); } } class TypeScriptScopeHandler extends ScopeHandler { constructor(...args) { super(...args); this.importsStack = []; } createScope(flags) { this.importsStack.push(new Set()); return new TypeScriptScope(flags); } enter(flags) { if (flags == SCOPE_TS_MODULE) { this.importsStack.push(new Set()); } super.enter(flags); } exit() { const flags = super.exit(); if (flags == SCOPE_TS_MODULE) { this.importsStack.pop(); } return flags; } hasImport(name, allowShadow) { const len = this.importsStack.length; if (this.importsStack[len - 1].has(name)) { return true; } if (!allowShadow && len > 1) { for (let i = 0; i < len - 1; i++) { if (this.importsStack[i].has(name)) return true; } } return false; } declareName(name, bindingType, loc) { if (bindingType & BIND_FLAGS_TS_IMPORT) { if (this.hasImport(name, true)) { this.parser.raise(Errors.VarRedeclaration, { at: loc, identifierName: name }); } this.importsStack[this.importsStack.length - 1].add(name); return; } const scope = this.currentScope(); if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) { this.maybeExportDefined(scope, name); scope.exportOnlyBindings.add(name); return; } super.declareName(name, bindingType, loc); if (bindingType & BIND_KIND_TYPE) { if (!(bindingType & BIND_KIND_VALUE)) { this.checkRedeclarationInScope(scope, name, bindingType, loc); this.maybeExportDefined(scope, name); } scope.types.add(name); } if (bindingType & BIND_FLAGS_TS_ENUM) scope.enums.add(name); if (bindingType & BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.add(name); if (bindingType & BIND_FLAGS_CLASS) scope.classes.add(name); } isRedeclaredInScope(scope, name, bindingType) { if (scope.enums.has(name)) { if (bindingType & BIND_FLAGS_TS_ENUM) { const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM); const wasConst = scope.constEnums.has(name); return isConst !== wasConst; } return true; } if (bindingType & BIND_FLAGS_CLASS && scope.classes.has(name)) { if (scope.lexical.has(name)) { return !!(bindingType & BIND_KIND_VALUE); } else { return false; } } if (bindingType & BIND_KIND_TYPE && scope.types.has(name)) { return true; } return super.isRedeclaredInScope(scope, name, bindingType); } checkLocalExport(id) { const { name } = id; if (this.hasImport(name)) return; const len = this.scopeStack.length; for (let i = len - 1; i >= 0; i--) { const scope = this.scopeStack[i]; if (scope.types.has(name) || scope.exportOnlyBindings.has(name)) return; } super.checkLocalExport(id); } } const getOwn$1 = (object, key) => Object.hasOwnProperty.call(object, key) && object[key]; const unwrapParenthesizedExpression = node => { return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node; }; class LValParser extends NodeUtils { toAssignable(node, isLHS = false) { var _node$extra, _node$extra3; let parenthesized = undefined; if (node.type === "ParenthesizedExpression" || (_node$extra = node.extra) != null && _node$extra.parenthesized) { parenthesized = unwrapParenthesizedExpression(node); if (isLHS) { if (parenthesized.type === "Identifier") { this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, { at: node }); } else if (parenthesized.type !== "MemberExpression") { this.raise(Errors.InvalidParenthesizedAssignment, { at: node }); } } else { this.raise(Errors.InvalidParenthesizedAssignment, { at: node }); } } switch (node.type) { case "Identifier": case "ObjectPattern": case "ArrayPattern": case "AssignmentPattern": case "RestElement": break; case "ObjectExpression": node.type = "ObjectPattern"; for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) { var _node$extra2; const prop = node.properties[i]; const isLast = i === last; this.toAssignableObjectExpressionProp(prop, isLast, isLHS); if (isLast && prop.type === "RestElement" && (_node$extra2 = node.extra) != null && _node$extra2.trailingCommaLoc) { this.raise(Errors.RestTrailingComma, { at: node.extra.trailingCommaLoc }); } } break; case "ObjectProperty": { const { key, value } = node; if (this.isPrivateName(key)) { this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start); } this.toAssignable(value, isLHS); break; } case "SpreadElement": { throw new Error("Internal @babel/parser error (this is a bug, please report it)." + " SpreadElement should be converted by .toAssignable's caller."); } case "ArrayExpression": node.type = "ArrayPattern"; this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingCommaLoc, isLHS); break; case "AssignmentExpression": if (node.operator !== "=") { this.raise(Errors.MissingEqInAssignment, { at: node.left.loc.end }); } node.type = "AssignmentPattern"; delete node.operator; this.toAssignable(node.left, isLHS); break; case "ParenthesizedExpression": this.toAssignable(parenthesized, isLHS); break; } } toAssignableObjectExpressionProp(prop, isLast, isLHS) { if (prop.type === "ObjectMethod") { this.raise(prop.kind === "get" || prop.kind === "set" ? Errors.PatternHasAccessor : Errors.PatternHasMethod, { at: prop.key }); } else if (prop.type === "SpreadElement") { prop.type = "RestElement"; const arg = prop.argument; this.checkToRestConversion(arg, false); this.toAssignable(arg, isLHS); if (!isLast) { this.raise(Errors.RestTrailingComma, { at: prop }); } } else { this.toAssignable(prop, isLHS); } } toAssignableList(exprList, trailingCommaLoc, isLHS) { const end = exprList.length - 1; for (let i = 0; i <= end; i++) { const elt = exprList[i]; if (!elt) continue; if (elt.type === "SpreadElement") { elt.type = "RestElement"; const arg = elt.argument; this.checkToRestConversion(arg, true); this.toAssignable(arg, isLHS); } else { this.toAssignable(elt, isLHS); } if (elt.type === "RestElement") { if (i < end) { this.raise(Errors.RestTrailingComma, { at: elt }); } else if (trailingCommaLoc) { this.raise(Errors.RestTrailingComma, { at: trailingCommaLoc }); } } } } isAssignable(node, isBinding) { switch (node.type) { case "Identifier": case "ObjectPattern": case "ArrayPattern": case "AssignmentPattern": case "RestElement": return true; case "ObjectExpression": { const last = node.properties.length - 1; return node.properties.every((prop, i) => { return prop.type !== "ObjectMethod" && (i === last || prop.type !== "SpreadElement") && this.isAssignable(prop); }); } case "ObjectProperty": return this.isAssignable(node.value); case "SpreadElement": return this.isAssignable(node.argument); case "ArrayExpression": return node.elements.every(element => element === null || this.isAssignable(element)); case "AssignmentExpression": return node.operator === "="; case "ParenthesizedExpression": return this.isAssignable(node.expression); case "MemberExpression": case "OptionalMemberExpression": return !isBinding; default: return false; } } toReferencedList(exprList, isParenthesizedExpr) { return exprList; } toReferencedListDeep(exprList, isParenthesizedExpr) { this.toReferencedList(exprList, isParenthesizedExpr); for (const expr of exprList) { if ((expr == null ? void 0 : expr.type) === "ArrayExpression") { this.toReferencedListDeep(expr.elements); } } } parseSpread(refExpressionErrors) { const node = this.startNode(); this.next(); node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined); return this.finishNode(node, "SpreadElement"); } parseRestBinding() { const node = this.startNode(); this.next(); node.argument = this.parseBindingAtom(); return this.finishNode(node, "RestElement"); } parseBindingAtom() { switch (this.state.type) { case 0: { const node = this.startNode(); this.next(); node.elements = this.parseBindingList(3, 93, 1); return this.finishNode(node, "ArrayPattern"); } case 5: return this.parseObjectLike(8, true); } return this.parseIdentifier(); } parseBindingList(close, closeCharCode, flags) { const allowEmpty = flags & 1; const elts = []; let first = true; while (!this.eat(close)) { if (first) { first = false; } else { this.expect(12); } if (allowEmpty && this.match(12)) { elts.push(null); } else if (this.eat(close)) { break; } else if (this.match(21)) { elts.push(this.parseAssignableListItemTypes(this.parseRestBinding(), flags)); if (!this.checkCommaAfterRest(closeCharCode)) { this.expect(close); break; } } else { const decorators = []; if (this.match(26) && this.hasPlugin("decorators")) { this.raise(Errors.UnsupportedParameterDecorator, { at: this.state.startLoc }); } while (this.match(26)) { decorators.push(this.parseDecorator()); } elts.push(this.parseAssignableListItem(flags, decorators)); } } return elts; } parseBindingRestProperty(prop) { this.next(); prop.argument = this.parseIdentifier(); this.checkCommaAfterRest(125); return this.finishNode(prop, "RestElement"); } parseBindingProperty() { const prop = this.startNode(); const { type, startLoc } = this.state; if (type === 21) { return this.parseBindingRestProperty(prop); } else if (type === 136) { this.expectPlugin("destructuringPrivate", startLoc); this.classScope.usePrivateName(this.state.value, startLoc); prop.key = this.parsePrivateName(); } else { this.parsePropertyName(prop); } prop.method = false; return this.parseObjPropValue(prop, startLoc, false, false, true, false); } parseAssignableListItem(flags, decorators) { const left = this.parseMaybeDefault(); this.parseAssignableListItemTypes(left, flags); const elt = this.parseMaybeDefault(left.loc.start, left); if (decorators.length) { left.decorators = decorators; } return elt; } parseAssignableListItemTypes(param, flags) { return param; } parseMaybeDefault(startLoc, left) { var _startLoc, _left; (_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc; left = (_left = left) != null ? _left : this.parseBindingAtom(); if (!this.eat(29)) return left; const node = this.startNodeAt(startLoc); node.left = left; node.right = this.parseMaybeAssignAllowIn(); return this.finishNode(node, "AssignmentPattern"); } isValidLVal(type, isUnparenthesizedInAssign, binding) { return getOwn$1({ AssignmentPattern: "left", RestElement: "argument", ObjectProperty: "value", ParenthesizedExpression: "expression", ArrayPattern: "elements", ObjectPattern: "properties" }, type); } checkLVal(expression, { in: ancestor, binding = BIND_NONE, checkClashes = false, strictModeChanged = false, hasParenthesizedAncestor = false }) { var _expression$extra; const type = expression.type; if (this.isObjectMethod(expression)) return; if (type === "MemberExpression") { if (binding !== BIND_NONE) { this.raise(Errors.InvalidPropertyBindingPattern, { at: expression }); } return; } if (type === "Identifier") { this.checkIdentifier(expression, binding, strictModeChanged); const { name } = expression; if (checkClashes) { if (checkClashes.has(name)) { this.raise(Errors.ParamDupe, { at: expression }); } else { checkClashes.add(name); } } return; } const validity = this.isValidLVal(type, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding); if (validity === true) return; if (validity === false) { const ParseErrorClass = binding === BIND_NONE ? Errors.InvalidLhs : Errors.InvalidLhsBinding; this.raise(ParseErrorClass, { at: expression, ancestor }); return; } const [key, isParenthesizedExpression] = Array.isArray(validity) ? validity : [validity, type === "ParenthesizedExpression"]; const nextAncestor = type === "ArrayPattern" || type === "ObjectPattern" || type === "ParenthesizedExpression" ? { type } : ancestor; for (const child of [].concat(expression[key])) { if (child) { this.checkLVal(child, { in: nextAncestor, binding, checkClashes, strictModeChanged, hasParenthesizedAncestor: isParenthesizedExpression }); } } } checkIdentifier(at, bindingType, strictModeChanged = false) { if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name))) { if (bindingType === BIND_NONE) { this.raise(Errors.StrictEvalArguments, { at, referenceName: at.name }); } else { this.raise(Errors.StrictEvalArgumentsBinding, { at, bindingName: at.name }); } } if (bindingType & BIND_FLAGS_NO_LET_IN_LEXICAL && at.name === "let") { this.raise(Errors.LetInLexicalBinding, { at }); } if (!(bindingType & BIND_NONE)) { this.declareNameFromIdentifier(at, bindingType); } } declareNameFromIdentifier(identifier, binding) { this.scope.declareName(identifier.name, binding, identifier.loc.start); } checkToRestConversion(node, allowPattern) { switch (node.type) { case "ParenthesizedExpression": this.checkToRestConversion(node.expression, allowPattern); break; case "Identifier": case "MemberExpression": break; case "ArrayExpression": case "ObjectExpression": if (allowPattern) break; default: this.raise(Errors.InvalidRestAssignmentPattern, { at: node }); } } checkCommaAfterRest(close) { if (!this.match(12)) { return false; } this.raise(this.lookaheadCharCode() === close ? Errors.RestTrailingComma : Errors.ElementAfterRest, { at: this.state.startLoc }); return true; } } const getOwn = (object, key) => Object.hasOwnProperty.call(object, key) && object[key]; function nonNull(x) { if (x == null) { throw new Error(`Unexpected ${x} value.`); } return x; } function assert(x) { if (!x) { throw new Error("Assert fail"); } } const TSErrors = ParseErrorEnum`typescript`({ AbstractMethodHasImplementation: ({ methodName }) => `Method '${methodName}' cannot have an implementation because it is marked abstract.`, AbstractPropertyHasInitializer: ({ propertyName }) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`, AccesorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.", AccesorCannotHaveTypeParameters: "An accessor cannot have type parameters.", AccessorCannotBeOptional: "An 'accessor' property cannot be declared optional.", ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.", ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.", ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.", ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.", DeclareAccessor: ({ kind }) => `'declare' is not allowed in ${kind}ters.`, DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.", DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.", DuplicateAccessibilityModifier: ({ modifier }) => `Accessibility modifier already seen.`, DuplicateModifier: ({ modifier }) => `Duplicate modifier: '${modifier}'.`, EmptyHeritageClauseType: ({ token }) => `'${token}' list cannot be empty.`, EmptyTypeArguments: "Type argument list cannot be empty.", EmptyTypeParameters: "Type parameter list cannot be empty.", ExpectedAmbientAfterExportDeclare: "'export declare' must be followed by an ambient declaration.", ImportAliasHasImportType: "An import alias can not use 'import type'.", ImportReflectionHasImportType: "An `import module` declaration can not use `type` modifier", IncompatibleModifiers: ({ modifiers }) => `'${modifiers[0]}' modifier cannot be used with '${modifiers[1]}' modifier.`, IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier.", IndexSignatureHasAccessibility: ({ modifier }) => `Index signatures cannot have an accessibility modifier ('${modifier}').`, IndexSignatureHasDeclare: "Index signatures cannot have the 'declare' modifier.", IndexSignatureHasOverride: "'override' modifier cannot appear on an index signature.", IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier.", InitializerNotAllowedInAmbientContext: "Initializers are not allowed in ambient contexts.", InvalidModifierOnTypeMember: ({ modifier }) => `'${modifier}' modifier cannot appear on a type member.`, InvalidModifierOnTypeParameter: ({ modifier }) => `'${modifier}' modifier cannot appear on a type parameter.`, InvalidModifierOnTypeParameterPositions: ({ modifier }) => `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`, InvalidModifiersOrder: ({ orderedModifiers }) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`, InvalidPropertyAccessAfterInstantiationExpression: "Invalid property access after an instantiation expression. " + "You can either wrap the instantiation expression in parentheses, or delete the type arguments.", InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.", MissingInterfaceName: "'interface' declarations must be followed by an identifier.", MixedLabeledAndUnlabeledElements: "Tuple members must all have names or all not have names.", NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.", NonClassMethodPropertyHasAbstractModifer: "'abstract' modifier can only appear on a class, method, or property declaration.", OptionalTypeBeforeRequired: "A required element cannot follow an optional element.", OverrideNotInSubClass: "This member cannot have an 'override' modifier because its containing class does not extend another class.", PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.", PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.", PrivateElementHasAccessibility: ({ modifier }) => `Private elements cannot have an accessibility modifier ('${modifier}').`, ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.", ReservedArrowTypeParam: "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.", ReservedTypeAssertion: "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.", SetAccesorCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.", SetAccesorCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.", SetAccesorCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.", SingleTypeParameterWithoutTrailingComma: ({ typeParameterName }) => `Single type parameter ${typeParameterName} should have a trailing comma. Example usage: <${typeParameterName},>.`, StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.", TupleOptionalAfterType: "A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).", TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.", TypeModifierIsUsedInTypeExports: "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.", TypeModifierIsUsedInTypeImports: "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.", UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.", UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.", UnexpectedTypeAnnotation: "Did not expect a type annotation here.", UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.", UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.", UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.", UnsupportedSignatureParameterKind: ({ type }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.` }); function keywordTypeFromName(value) { switch (value) { case "any": return "TSAnyKeyword"; case "boolean": return "TSBooleanKeyword"; case "bigint": return "TSBigIntKeyword"; case "never": return "TSNeverKeyword"; case "number": return "TSNumberKeyword"; case "object": return "TSObjectKeyword"; case "string": return "TSStringKeyword"; case "symbol": return "TSSymbolKeyword"; case "undefined": return "TSUndefinedKeyword"; case "unknown": return "TSUnknownKeyword"; default: return undefined; } } function tsIsAccessModifier(modifier) { return modifier === "private" || modifier === "public" || modifier === "protected"; } function tsIsVarianceAnnotations(modifier) { return modifier === "in" || modifier === "out"; } var typescript = superClass => class TypeScriptParserMixin extends superClass { constructor(...args) { super(...args); this.tsParseInOutModifiers = this.tsParseModifiers.bind(this, { allowedModifiers: ["in", "out"], disallowedModifiers: ["const", "public", "private", "protected", "readonly", "declare", "abstract", "override"], errorTemplate: TSErrors.InvalidModifierOnTypeParameter }); this.tsParseConstModifier = this.tsParseModifiers.bind(this, { allowedModifiers: ["const"], disallowedModifiers: ["in", "out"], errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions }); this.tsParseInOutConstModifiers = this.tsParseModifiers.bind(this, { allowedModifiers: ["in", "out", "const"], disallowedModifiers: ["public", "private", "protected", "readonly", "declare", "abstract", "override"], errorTemplate: TSErrors.InvalidModifierOnTypeParameter }); } getScopeHandler() { return TypeScriptScopeHandler; } tsIsIdentifier() { return tokenIsIdentifier(this.state.type); } tsTokenCanFollowModifier() { return (this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(136) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak(); } tsNextTokenCanFollowModifier() { this.next(); return this.tsTokenCanFollowModifier(); } tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) { if (!tokenIsIdentifier(this.state.type) && this.state.type !== 58 && this.state.type !== 75) { return undefined; } const modifier = this.state.value; if (allowedModifiers.indexOf(modifier) !== -1) { if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) { return undefined; } if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) { return modifier; } } return undefined; } tsParseModifiers({ allowedModifiers, disallowedModifiers, stopOnStartOfClassStaticBlock, errorTemplate = TSErrors.InvalidModifierOnTypeMember }, modified) { const enforceOrder = (loc, modifier, before, after) => { if (modifier === before && modified[after]) { this.raise(TSErrors.InvalidModifiersOrder, { at: loc, orderedModifiers: [before, after] }); } }; const incompatible = (loc, modifier, mod1, mod2) => { if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) { this.raise(TSErrors.IncompatibleModifiers, { at: loc, modifiers: [mod1, mod2] }); } }; for (;;) { const { startLoc } = this.state; const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : []), stopOnStartOfClassStaticBlock); if (!modifier) break; if (tsIsAccessModifier(modifier)) { if (modified.accessibility) { this.raise(TSErrors.DuplicateAccessibilityModifier, { at: startLoc, modifier }); } else { enforceOrder(startLoc, modifier, modifier, "override"); enforceOrder(startLoc, modifier, modifier, "static"); enforceOrder(startLoc, modifier, modifier, "readonly"); modified.accessibility = modifier; } } else if (tsIsVarianceAnnotations(modifier)) { if (modified[modifier]) { this.raise(TSErrors.DuplicateModifier, { at: startLoc, modifier }); } modified[modifier] = true; enforceOrder(startLoc, modifier, "in", "out"); } else { if (Object.hasOwnProperty.call(modified, modifier)) { this.raise(TSErrors.DuplicateModifier, { at: startLoc, modifier }); } else { enforceOrder(startLoc, modifier, "static", "readonly"); enforceOrder(startLoc, modifier, "static", "override"); enforceOrder(startLoc, modifier, "override", "readonly"); enforceOrder(startLoc, modifier, "abstract", "override"); incompatible(startLoc, modifier, "declare", "override"); incompatible(startLoc, modifier, "static", "abstract"); } modified[modifier] = true; } if (disallowedModifiers != null && disallowedModifiers.includes(modifier)) { this.raise(errorTemplate, { at: startLoc, modifier }); } } } tsIsListTerminator(kind) { switch (kind) { case "EnumMembers": case "TypeMembers": return this.match(8); case "HeritageClauseElement": return this.match(5); case "TupleElementTypes": return this.match(3); case "TypeParametersOrArguments": return this.match(48); } } tsParseList(kind, parseElement) { const result = []; while (!this.tsIsListTerminator(kind)) { result.push(parseElement()); } return result; } tsParseDelimitedList(kind, parseElement, refTrailingCommaPos) { return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true, refTrailingCommaPos)); } tsParseDelimitedListWorker(kind, parseElement, expectSuccess, refTrailingCommaPos) { const result = []; let trailingCommaPos = -1; for (;;) { if (this.tsIsListTerminator(kind)) { break; } trailingCommaPos = -1; const element = parseElement(); if (element == null) { return undefined; } result.push(element); if (this.eat(12)) { trailingCommaPos = this.state.lastTokStart; continue; } if (this.tsIsListTerminator(kind)) { break; } if (expectSuccess) { this.expect(12); } return undefined; } if (refTrailingCommaPos) { refTrailingCommaPos.value = trailingCommaPos; } return result; } tsParseBracketedList(kind, parseElement, bracket, skipFirstToken, refTrailingCommaPos) { if (!skipFirstToken) { if (bracket) { this.expect(0); } else { this.expect(47); } } const result = this.tsParseDelimitedList(kind, parseElement, refTrailingCommaPos); if (bracket) { this.expect(3); } else { this.expect(48); } return result; } tsParseImportType() { const node = this.startNode(); this.expect(83); this.expect(10); if (!this.match(131)) { this.raise(TSErrors.UnsupportedImportTypeArgument, { at: this.state.startLoc }); } node.argument = super.parseExprAtom(); this.expect(11); if (this.eat(16)) { node.qualifier = this.tsParseEntityName(); } if (this.match(47)) { node.typeParameters = this.tsParseTypeArguments(); } return this.finishNode(node, "TSImportType"); } tsParseEntityName(allowReservedWords = true) { let entity = this.parseIdentifier(allowReservedWords); while (this.eat(16)) { const node = this.startNodeAtNode(entity); node.left = entity; node.right = this.parseIdentifier(allowReservedWords); entity = this.finishNode(node, "TSQualifiedName"); } return entity; } tsParseTypeReference() { const node = this.startNode(); node.typeName = this.tsParseEntityName(); if (!this.hasPrecedingLineBreak() && this.match(47)) { node.typeParameters = this.tsParseTypeArguments(); } return this.finishNode(node, "TSTypeReference"); } tsParseThisTypePredicate(lhs) { this.next(); const node = this.startNodeAtNode(lhs); node.parameterName = lhs; node.typeAnnotation = this.tsParseTypeAnnotation(false); node.asserts = false; return this.finishNode(node, "TSTypePredicate"); } tsParseThisTypeNode() { const node = this.startNode(); this.next(); return this.finishNode(node, "TSThisType"); } tsParseTypeQuery() { const node = this.startNode(); this.expect(87); if (this.match(83)) { node.exprName = this.tsParseImportType(); } else { node.exprName = this.tsParseEntityName(); } if (!this.hasPrecedingLineBreak() && this.match(47)) { node.typeParameters = this.tsParseTypeArguments(); } return this.finishNode(node, "TSTypeQuery"); } tsParseTypeParameter(parseModifiers) { const node = this.startNode(); parseModifiers(node); node.name = this.tsParseTypeParameterName(); node.constraint = this.tsEatThenParseType(81); node.default = this.tsEatThenParseType(29); return this.finishNode(node, "TSTypeParameter"); } tsTryParseTypeParameters(parseModifiers) { if (this.match(47)) { return this.tsParseTypeParameters(parseModifiers); } } tsParseTypeParameters(parseModifiers) { const node = this.startNode(); if (this.match(47) || this.match(140)) { this.next(); } else { this.unexpected(); } const refTrailingCommaPos = { value: -1 }; node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, parseModifiers), false, true, refTrailingCommaPos); if (node.params.length === 0) { this.raise(TSErrors.EmptyTypeParameters, { at: node }); } if (refTrailingCommaPos.value !== -1) { this.addExtra(node, "trailingComma", refTrailingCommaPos.value); } return this.finishNode(node, "TSTypeParameterDeclaration"); } tsFillSignature(returnToken, signature) { const returnTokenRequired = returnToken === 19; const paramsKey = "parameters"; const returnTypeKey = "typeAnnotation"; signature.typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); this.expect(10); signature[paramsKey] = this.tsParseBindingListForSignature(); if (returnTokenRequired) { signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); } else if (this.match(returnToken)) { signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); } } tsParseBindingListForSignature() { const list = super.parseBindingList(11, 41, 2); for (const pattern of list) { const { type } = pattern; if (type === "AssignmentPattern" || type === "TSParameterProperty") { this.raise(TSErrors.UnsupportedSignatureParameterKind, { at: pattern, type }); } } return list; } tsParseTypeMemberSemicolon() { if (!this.eat(12) && !this.isLineTerminator()) { this.expect(13); } } tsParseSignatureMember(kind, node) { this.tsFillSignature(14, node); this.tsParseTypeMemberSemicolon(); return this.finishNode(node, kind); } tsIsUnambiguouslyIndexSignature() { this.next(); if (tokenIsIdentifier(this.state.type)) { this.next(); return this.match(14); } return false; } tsTryParseIndexSignature(node) { if (!(this.match(0) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) { return; } this.expect(0); const id = this.parseIdentifier(); id.typeAnnotation = this.tsParseTypeAnnotation(); this.resetEndLocation(id); this.expect(3); node.parameters = [id]; const type = this.tsTryParseTypeAnnotation(); if (type) node.typeAnnotation = type; this.tsParseTypeMemberSemicolon(); return this.finishNode(node, "TSIndexSignature"); } tsParsePropertyOrMethodSignature(node, readonly) { if (this.eat(17)) node.optional = true; const nodeAny = node; if (this.match(10) || this.match(47)) { if (readonly) { this.raise(TSErrors.ReadonlyForMethodSignature, { at: node }); } const method = nodeAny; if (method.kind && this.match(47)) { this.raise(TSErrors.AccesorCannotHaveTypeParameters, { at: this.state.curPosition() }); } this.tsFillSignature(14, method); this.tsParseTypeMemberSemicolon(); const paramsKey = "parameters"; const returnTypeKey = "typeAnnotation"; if (method.kind === "get") { if (method[paramsKey].length > 0) { this.raise(Errors.BadGetterArity, { at: this.state.curPosition() }); if (this.isThisParam(method[paramsKey][0])) { this.raise(TSErrors.AccesorCannotDeclareThisParameter, { at: this.state.curPosition() }); } } } else if (method.kind === "set") { if (method[paramsKey].length !== 1) { this.raise(Errors.BadSetterArity, { at: this.state.curPosition() }); } else { const firstParameter = method[paramsKey][0]; if (this.isThisParam(firstParameter)) { this.raise(TSErrors.AccesorCannotDeclareThisParameter, { at: this.state.curPosition() }); } if (firstParameter.type === "Identifier" && firstParameter.optional) { this.raise(TSErrors.SetAccesorCannotHaveOptionalParameter, { at: this.state.curPosition() }); } if (firstParameter.type === "RestElement") { this.raise(TSErrors.SetAccesorCannotHaveRestParameter, { at: this.state.curPosition() }); } } if (method[returnTypeKey]) { this.raise(TSErrors.SetAccesorCannotHaveReturnType, { at: method[returnTypeKey] }); } } else { method.kind = "method"; } return this.finishNode(method, "TSMethodSignature"); } else { const property = nodeAny; if (readonly) property.readonly = true; const type = this.tsTryParseTypeAnnotation(); if (type) property.typeAnnotation = type; this.tsParseTypeMemberSemicolon(); return this.finishNode(property, "TSPropertySignature"); } } tsParseTypeMember() { const node = this.startNode(); if (this.match(10) || this.match(47)) { return this.tsParseSignatureMember("TSCallSignatureDeclaration", node); } if (this.match(77)) { const id = this.startNode(); this.next(); if (this.match(10) || this.match(47)) { return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node); } else { node.key = this.createIdentifier(id, "new"); return this.tsParsePropertyOrMethodSignature(node, false); } } this.tsParseModifiers({ allowedModifiers: ["readonly"], disallowedModifiers: ["declare", "abstract", "private", "protected", "public", "static", "override"] }, node); const idx = this.tsTryParseIndexSignature(node); if (idx) { return idx; } super.parsePropertyName(node); if (!node.computed && node.key.type === "Identifier" && (node.key.name === "get" || node.key.name === "set") && this.tsTokenCanFollowModifier()) { node.kind = node.key.name; super.parsePropertyName(node); } return this.tsParsePropertyOrMethodSignature(node, !!node.readonly); } tsParseTypeLiteral() { const node = this.startNode(); node.members = this.tsParseObjectTypeMembers(); return this.finishNode(node, "TSTypeLiteral"); } tsParseObjectTypeMembers() { this.expect(5); const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this)); this.expect(8); return members; } tsIsStartOfMappedType() { this.next(); if (this.eat(53)) { return this.isContextual(120); } if (this.isContextual(120)) { this.next(); } if (!this.match(0)) { return false; } this.next(); if (!this.tsIsIdentifier()) { return false; } this.next(); return this.match(58); } tsParseMappedTypeParameter() { const node = this.startNode(); node.name = this.tsParseTypeParameterName(); node.constraint = this.tsExpectThenParseType(58); return this.finishNode(node, "TSTypeParameter"); } tsParseMappedType() { const node = this.startNode(); this.expect(5); if (this.match(53)) { node.readonly = this.state.value; this.next(); this.expectContextual(120); } else if (this.eatContextual(120)) { node.readonly = true; } this.expect(0); node.typeParameter = this.tsParseMappedTypeParameter(); node.nameType = this.eatContextual(93) ? this.tsParseType() : null; this.expect(3); if (this.match(53)) { node.optional = this.state.value; this.next(); this.expect(17); } else if (this.eat(17)) { node.optional = true; } node.typeAnnotation = this.tsTryParseType(); this.semicolon(); this.expect(8); return this.finishNode(node, "TSMappedType"); } tsParseTupleType() { const node = this.startNode(); node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false); let seenOptionalElement = false; let labeledElements = null; node.elementTypes.forEach(elementNode => { var _labeledElements; const { type } = elementNode; if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) { this.raise(TSErrors.OptionalTypeBeforeRequired, { at: elementNode }); } seenOptionalElement || (seenOptionalElement = type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType"); let checkType = type; if (type === "TSRestType") { elementNode = elementNode.typeAnnotation; checkType = elementNode.type; } const isLabeled = checkType === "TSNamedTupleMember"; (_labeledElements = labeledElements) != null ? _labeledElements : labeledElements = isLabeled; if (labeledElements !== isLabeled) { this.raise(TSErrors.MixedLabeledAndUnlabeledElements, { at: elementNode }); } }); return this.finishNode(node, "TSTupleType"); } tsParseTupleElementType() { const { startLoc } = this.state; const rest = this.eat(21); let labeled; let label; let optional; let type; const isWord = tokenIsKeywordOrIdentifier(this.state.type); const chAfterWord = isWord ? this.lookaheadCharCode() : null; if (chAfterWord === 58) { labeled = true; optional = false; label = this.parseIdentifier(true); this.expect(14); type = this.tsParseType(); } else if (chAfterWord === 63) { optional = true; const startLoc = this.state.startLoc; const wordName = this.state.value; const typeOrLabel = this.tsParseNonArrayType(); if (this.lookaheadCharCode() === 58) { labeled = true; label = this.createIdentifier(this.startNodeAt(startLoc), wordName); this.expect(17); this.expect(14); type = this.tsParseType(); } else { labeled = false; type = typeOrLabel; this.expect(17); } } else { type = this.tsParseType(); optional = this.eat(17); labeled = this.eat(14); } if (labeled) { let labeledNode; if (label) { labeledNode = this.startNodeAtNode(label); labeledNode.optional = optional; labeledNode.label = label; labeledNode.elementType = type; if (this.eat(17)) { labeledNode.optional = true; this.raise(TSErrors.TupleOptionalAfterType, { at: this.state.lastTokStartLoc }); } } else { labeledNode = this.startNodeAtNode(type); labeledNode.optional = optional; this.raise(TSErrors.InvalidTupleMemberLabel, { at: type }); labeledNode.label = type; labeledNode.elementType = this.tsParseType(); } type = this.finishNode(labeledNode, "TSNamedTupleMember"); } else if (optional) { const optionalTypeNode = this.startNodeAtNode(type); optionalTypeNode.typeAnnotation = type; type = this.finishNode(optionalTypeNode, "TSOptionalType"); } if (rest) { const restNode = this.startNodeAt(startLoc); restNode.typeAnnotation = type; type = this.finishNode(restNode, "TSRestType"); } return type; } tsParseParenthesizedType() { const node = this.startNode(); this.expect(10); node.typeAnnotation = this.tsParseType(); this.expect(11); return this.finishNode(node, "TSParenthesizedType"); } tsParseFunctionOrConstructorType(type, abstract) { const node = this.startNode(); if (type === "TSConstructorType") { node.abstract = !!abstract; if (abstract) this.next(); this.next(); } this.tsInAllowConditionalTypesContext(() => this.tsFillSignature(19, node)); return this.finishNode(node, type); } tsParseLiteralTypeNode() { const node = this.startNode(); switch (this.state.type) { case 132: case 133: case 131: case 85: case 86: node.literal = super.parseExprAtom(); break; default: this.unexpected(); } return this.finishNode(node, "TSLiteralType"); } tsParseTemplateLiteralType() { const node = this.startNode(); node.literal = super.parseTemplate(false); return this.finishNode(node, "TSLiteralType"); } parseTemplateSubstitution() { if (this.state.inType) return this.tsParseType(); return super.parseTemplateSubstitution(); } tsParseThisTypeOrThisTypePredicate() { const thisKeyword = this.tsParseThisTypeNode(); if (this.isContextual(114) && !this.hasPrecedingLineBreak()) { return this.tsParseThisTypePredicate(thisKeyword); } else { return thisKeyword; } } tsParseNonArrayType() { switch (this.state.type) { case 131: case 132: case 133: case 85: case 86: return this.tsParseLiteralTypeNode(); case 53: if (this.state.value === "-") { const node = this.startNode(); const nextToken = this.lookahead(); if (nextToken.type !== 132 && nextToken.type !== 133) { this.unexpected(); } node.literal = this.parseMaybeUnary(); return this.finishNode(node, "TSLiteralType"); } break; case 78: return this.tsParseThisTypeOrThisTypePredicate(); case 87: return this.tsParseTypeQuery(); case 83: return this.tsParseImportType(); case 5: return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral(); case 0: return this.tsParseTupleType(); case 10: return this.tsParseParenthesizedType(); case 25: case 24: return this.tsParseTemplateLiteralType(); default: { const { type } = this.state; if (tokenIsIdentifier(type) || type === 88 || type === 84) { const nodeType = type === 88 ? "TSVoidKeyword" : type === 84 ? "TSNullKeyword" : keywordTypeFromName(this.state.value); if (nodeType !== undefined && this.lookaheadCharCode() !== 46) { const node = this.startNode(); this.next(); return this.finishNode(node, nodeType); } return this.tsParseTypeReference(); } } } this.unexpected(); } tsParseArrayTypeOrHigher() { let type = this.tsParseNonArrayType(); while (!this.hasPrecedingLineBreak() && this.eat(0)) { if (this.match(3)) { const node = this.startNodeAtNode(type); node.elementType = type; this.expect(3); type = this.finishNode(node, "TSArrayType"); } else { const node = this.startNodeAtNode(type); node.objectType = type; node.indexType = this.tsParseType(); this.expect(3); type = this.finishNode(node, "TSIndexedAccessType"); } } return type; } tsParseTypeOperator() { const node = this.startNode(); const operator = this.state.value; this.next(); node.operator = operator; node.typeAnnotation = this.tsParseTypeOperatorOrHigher(); if (operator === "readonly") { this.tsCheckTypeAnnotationForReadOnly(node); } return this.finishNode(node, "TSTypeOperator"); } tsCheckTypeAnnotationForReadOnly(node) { switch (node.typeAnnotation.type) { case "TSTupleType": case "TSArrayType": return; default: this.raise(TSErrors.UnexpectedReadonly, { at: node }); } } tsParseInferType() { const node = this.startNode(); this.expectContextual(113); const typeParameter = this.startNode(); typeParameter.name = this.tsParseTypeParameterName(); typeParameter.constraint = this.tsTryParse(() => this.tsParseConstraintForInferType()); node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter"); return this.finishNode(node, "TSInferType"); } tsParseConstraintForInferType() { if (this.eat(81)) { const constraint = this.tsInDisallowConditionalTypesContext(() => this.tsParseType()); if (this.state.inDisallowConditionalTypesContext || !this.match(17)) { return constraint; } } } tsParseTypeOperatorOrHigher() { const isTypeOperator = tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc; return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(113) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher()); } tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) { const node = this.startNode(); const hasLeadingOperator = this.eat(operator); const types = []; do { types.push(parseConstituentType()); } while (this.eat(operator)); if (types.length === 1 && !hasLeadingOperator) { return types[0]; } node.types = types; return this.finishNode(node, kind); } tsParseIntersectionTypeOrHigher() { return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), 45); } tsParseUnionTypeOrHigher() { return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), 43); } tsIsStartOfFunctionType() { if (this.match(47)) { return true; } return this.match(10) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this)); } tsSkipParameterStart() { if (tokenIsIdentifier(this.state.type) || this.match(78)) { this.next(); return true; } if (this.match(5)) { const { errors } = this.state; const previousErrorCount = errors.length; try { this.parseObjectLike(8, true); return errors.length === previousErrorCount; } catch (_unused) { return false; } } if (this.match(0)) { this.next(); const { errors } = this.state; const previousErrorCount = errors.length; try { super.parseBindingList(3, 93, 1); return errors.length === previousErrorCount; } catch (_unused2) { return false; } } return false; } tsIsUnambiguouslyStartOfFunctionType() { this.next(); if (this.match(11) || this.match(21)) { return true; } if (this.tsSkipParameterStart()) { if (this.match(14) || this.match(12) || this.match(17) || this.match(29)) { return true; } if (this.match(11)) { this.next(); if (this.match(19)) { return true; } } } return false; } tsParseTypeOrTypePredicateAnnotation(returnToken) { return this.tsInType(() => { const t = this.startNode(); this.expect(returnToken); const node = this.startNode(); const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this)); if (asserts && this.match(78)) { let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate(); if (thisTypePredicate.type === "TSThisType") { node.parameterName = thisTypePredicate; node.asserts = true; node.typeAnnotation = null; thisTypePredicate = this.finishNode(node, "TSTypePredicate"); } else { this.resetStartLocationFromNode(thisTypePredicate, node); thisTypePredicate.asserts = true; } t.typeAnnotation = thisTypePredicate; return this.finishNode(t, "TSTypeAnnotation"); } const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this)); if (!typePredicateVariable) { if (!asserts) { return this.tsParseTypeAnnotation(false, t); } node.parameterName = this.parseIdentifier(); node.asserts = asserts; node.typeAnnotation = null; t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); return this.finishNode(t, "TSTypeAnnotation"); } const type = this.tsParseTypeAnnotation(false); node.parameterName = typePredicateVariable; node.typeAnnotation = type; node.asserts = asserts; t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); return this.finishNode(t, "TSTypeAnnotation"); }); } tsTryParseTypeOrTypePredicateAnnotation() { if (this.match(14)) { return this.tsParseTypeOrTypePredicateAnnotation(14); } } tsTryParseTypeAnnotation() { if (this.match(14)) { return this.tsParseTypeAnnotation(); } } tsTryParseType() { return this.tsEatThenParseType(14); } tsParseTypePredicatePrefix() { const id = this.parseIdentifier(); if (this.isContextual(114) && !this.hasPrecedingLineBreak()) { this.next(); return id; } } tsParseTypePredicateAsserts() { if (this.state.type !== 107) { return false; } const containsEsc = this.state.containsEsc; this.next(); if (!tokenIsIdentifier(this.state.type) && !this.match(78)) { return false; } if (containsEsc) { this.raise(Errors.InvalidEscapedReservedWord, { at: this.state.lastTokStartLoc, reservedWord: "asserts" }); } return true; } tsParseTypeAnnotation(eatColon = true, t = this.startNode()) { this.tsInType(() => { if (eatColon) this.expect(14); t.typeAnnotation = this.tsParseType(); }); return this.finishNode(t, "TSTypeAnnotation"); } tsParseType() { assert(this.state.inType); const type = this.tsParseNonConditionalType(); if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(81)) { return type; } const node = this.startNodeAtNode(type); node.checkType = type; node.extendsType = this.tsInDisallowConditionalTypesContext(() => this.tsParseNonConditionalType()); this.expect(17); node.trueType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()); this.expect(14); node.falseType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()); return this.finishNode(node, "TSConditionalType"); } isAbstractConstructorSignature() { return this.isContextual(122) && this.lookahead().type === 77; } tsParseNonConditionalType() { if (this.tsIsStartOfFunctionType()) { return this.tsParseFunctionOrConstructorType("TSFunctionType"); } if (this.match(77)) { return this.tsParseFunctionOrConstructorType("TSConstructorType"); } else if (this.isAbstractConstructorSignature()) { return this.tsParseFunctionOrConstructorType("TSConstructorType", true); } return this.tsParseUnionTypeOrHigher(); } tsParseTypeAssertion() { if (this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) { this.raise(TSErrors.ReservedTypeAssertion, { at: this.state.startLoc }); } const node = this.startNode(); node.typeAnnotation = this.tsInType(() => { this.next(); return this.match(75) ? this.tsParseTypeReference() : this.tsParseType(); }); this.expect(48); node.expression = this.parseMaybeUnary(); return this.finishNode(node, "TSTypeAssertion"); } tsParseHeritageClause(token) { const originalStartLoc = this.state.startLoc; const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", () => { const node = this.startNode(); node.expression = this.tsParseEntityName(); if (this.match(47)) { node.typeParameters = this.tsParseTypeArguments(); } return this.finishNode(node, "TSExpressionWithTypeArguments"); }); if (!delimitedList.length) { this.raise(TSErrors.EmptyHeritageClauseType, { at: originalStartLoc, token }); } return delimitedList; } tsParseInterfaceDeclaration(node, properties = {}) { if (this.hasFollowingLineBreak()) return null; this.expectContextual(127); if (properties.declare) node.declare = true; if (tokenIsIdentifier(this.state.type)) { node.id = this.parseIdentifier(); this.checkIdentifier(node.id, BIND_TS_INTERFACE); } else { node.id = null; this.raise(TSErrors.MissingInterfaceName, { at: this.state.startLoc }); } node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers); if (this.eat(81)) { node.extends = this.tsParseHeritageClause("extends"); } const body = this.startNode(); body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)); node.body = this.finishNode(body, "TSInterfaceBody"); return this.finishNode(node, "TSInterfaceDeclaration"); } tsParseTypeAliasDeclaration(node) { node.id = this.parseIdentifier(); this.checkIdentifier(node.id, BIND_TS_TYPE); node.typeAnnotation = this.tsInType(() => { node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers); this.expect(29); if (this.isContextual(112) && this.lookahead().type !== 16) { const node = this.startNode(); this.next(); return this.finishNode(node, "TSIntrinsicKeyword"); } return this.tsParseType(); }); this.semicolon(); return this.finishNode(node, "TSTypeAliasDeclaration"); } tsInNoContext(cb) { const oldContext = this.state.context; this.state.context = [oldContext[0]]; try { return cb(); } finally { this.state.context = oldContext; } } tsInType(cb) { const oldInType = this.state.inType; this.state.inType = true; try { return cb(); } finally { this.state.inType = oldInType; } } tsInDisallowConditionalTypesContext(cb) { const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext; this.state.inDisallowConditionalTypesContext = true; try { return cb(); } finally { this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; } } tsInAllowConditionalTypesContext(cb) { const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext; this.state.inDisallowConditionalTypesContext = false; try { return cb(); } finally { this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; } } tsEatThenParseType(token) { if (this.match(token)) { return this.tsNextThenParseType(); } } tsExpectThenParseType(token) { return this.tsInType(() => { this.expect(token); return this.tsParseType(); }); } tsNextThenParseType() { return this.tsInType(() => { this.next(); return this.tsParseType(); }); } tsParseEnumMember() { const node = this.startNode(); node.id = this.match(131) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true); if (this.eat(29)) { node.initializer = super.parseMaybeAssignAllowIn(); } return this.finishNode(node, "TSEnumMember"); } tsParseEnumDeclaration(node, properties = {}) { if (properties.const) node.const = true; if (properties.declare) node.declare = true; this.expectContextual(124); node.id = this.parseIdentifier(); this.checkIdentifier(node.id, node.const ? BIND_TS_CONST_ENUM : BIND_TS_ENUM); this.expect(5); node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)); this.expect(8); return this.finishNode(node, "TSEnumDeclaration"); } tsParseModuleBlock() { const node = this.startNode(); this.scope.enter(SCOPE_OTHER); this.expect(5); super.parseBlockOrModuleBlockBody(node.body = [], undefined, true, 8); this.scope.exit(); return this.finishNode(node, "TSModuleBlock"); } tsParseModuleOrNamespaceDeclaration(node, nested = false) { node.id = this.parseIdentifier(); if (!nested) { this.checkIdentifier(node.id, BIND_TS_NAMESPACE); } if (this.eat(16)) { const inner = this.startNode(); this.tsParseModuleOrNamespaceDeclaration(inner, true); node.body = inner; } else { this.scope.enter(SCOPE_TS_MODULE); this.prodParam.enter(PARAM); node.body = this.tsParseModuleBlock(); this.prodParam.exit(); this.scope.exit(); } return this.finishNode(node, "TSModuleDeclaration"); } tsParseAmbientExternalModuleDeclaration(node) { if (this.isContextual(110)) { node.global = true; node.id = this.parseIdentifier(); } else if (this.match(131)) { node.id = super.parseStringLiteral(this.state.value); } else { this.unexpected(); } if (this.match(5)) { this.scope.enter(SCOPE_TS_MODULE); this.prodParam.enter(PARAM); node.body = this.tsParseModuleBlock(); this.prodParam.exit(); this.scope.exit(); } else { this.semicolon(); } return this.finishNode(node, "TSModuleDeclaration"); } tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier, isExport) { node.isExport = isExport || false; node.id = maybeDefaultIdentifier || this.parseIdentifier(); this.checkIdentifier(node.id, BIND_FLAGS_TS_IMPORT); this.expect(29); const moduleReference = this.tsParseModuleReference(); if (node.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") { this.raise(TSErrors.ImportAliasHasImportType, { at: moduleReference }); } node.moduleReference = moduleReference; this.semicolon(); return this.finishNode(node, "TSImportEqualsDeclaration"); } tsIsExternalModuleReference() { return this.isContextual(117) && this.lookaheadCharCode() === 40; } tsParseModuleReference() { return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false); } tsParseExternalModuleReference() { const node = this.startNode(); this.expectContextual(117); this.expect(10); if (!this.match(131)) { this.unexpected(); } node.expression = super.parseExprAtom(); this.expect(11); this.sawUnambiguousESM = true; return this.finishNode(node, "TSExternalModuleReference"); } tsLookAhead(f) { const state = this.state.clone(); const res = f(); this.state = state; return res; } tsTryParseAndCatch(f) { const result = this.tryParse(abort => f() || abort()); if (result.aborted || !result.node) return; if (result.error) this.state = result.failState; return result.node; } tsTryParse(f) { const state = this.state.clone(); const result = f(); if (result !== undefined && result !== false) { return result; } this.state = state; } tsTryParseDeclare(nany) { if (this.isLineTerminator()) { return; } let startType = this.state.type; let kind; if (this.isContextual(99)) { startType = 74; kind = "let"; } return this.tsInAmbientContext(() => { switch (startType) { case 68: nany.declare = true; return super.parseFunctionStatement(nany, false, false); case 80: nany.declare = true; return this.parseClass(nany, true, false); case 124: return this.tsParseEnumDeclaration(nany, { declare: true }); case 110: return this.tsParseAmbientExternalModuleDeclaration(nany); case 75: case 74: if (!this.match(75) || !this.isLookaheadContextual("enum")) { nany.declare = true; return this.parseVarStatement(nany, kind || this.state.value, true); } this.expect(75); return this.tsParseEnumDeclaration(nany, { const: true, declare: true }); case 127: { const result = this.tsParseInterfaceDeclaration(nany, { declare: true }); if (result) return result; } default: if (tokenIsIdentifier(startType)) { return this.tsParseDeclaration(nany, this.state.value, true, null); } } }); } tsTryParseExportDeclaration() { return this.tsParseDeclaration(this.startNode(), this.state.value, true, null); } tsParseExpressionStatement(node, expr, decorators) { switch (expr.name) { case "declare": { const declaration = this.tsTryParseDeclare(node); if (declaration) { declaration.declare = true; } return declaration; } case "global": if (this.match(5)) { this.scope.enter(SCOPE_TS_MODULE); this.prodParam.enter(PARAM); const mod = node; mod.global = true; mod.id = expr; mod.body = this.tsParseModuleBlock(); this.scope.exit(); this.prodParam.exit(); return this.finishNode(mod, "TSModuleDeclaration"); } break; default: return this.tsParseDeclaration(node, expr.name, false, decorators); } } tsParseDeclaration(node, value, next, decorators) { switch (value) { case "abstract": if (this.tsCheckLineTerminator(next) && (this.match(80) || tokenIsIdentifier(this.state.type))) { return this.tsParseAbstractDeclaration(node, decorators); } break; case "module": if (this.tsCheckLineTerminator(next)) { if (this.match(131)) { return this.tsParseAmbientExternalModuleDeclaration(node); } else if (tokenIsIdentifier(this.state.type)) { return this.tsParseModuleOrNamespaceDeclaration(node); } } break; case "namespace": if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) { return this.tsParseModuleOrNamespaceDeclaration(node); } break; case "type": if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) { return this.tsParseTypeAliasDeclaration(node); } break; } } tsCheckLineTerminator(next) { if (next) { if (this.hasFollowingLineBreak()) return false; this.next(); return true; } return !this.isLineTerminator(); } tsTryParseGenericAsyncArrowFunction(startLoc) { if (!this.match(47)) return; const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; this.state.maybeInArrowParameters = true; const res = this.tsTryParseAndCatch(() => { const node = this.startNodeAt(startLoc); node.typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier); super.parseFunctionParams(node); node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation(); this.expect(19); return node; }); this.state.maybeInArrowParameters = oldMaybeInArrowParameters; if (!res) return; return super.parseArrowExpression(res, null, true); } tsParseTypeArgumentsInExpression() { if (this.reScan_lt() !== 47) return; return this.tsParseTypeArguments(); } tsParseTypeArguments() { const node = this.startNode(); node.params = this.tsInType(() => this.tsInNoContext(() => { this.expect(47); return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this)); })); if (node.params.length === 0) { this.raise(TSErrors.EmptyTypeArguments, { at: node }); } else if (!this.state.inType && this.curContext() === types.brace) { this.reScan_lt_gt(); } this.expect(48); return this.finishNode(node, "TSTypeParameterInstantiation"); } tsIsDeclarationStart() { return tokenIsTSDeclarationStart(this.state.type); } isExportDefaultSpecifier() { if (this.tsIsDeclarationStart()) return false; return super.isExportDefaultSpecifier(); } parseAssignableListItem(flags, decorators) { const startLoc = this.state.startLoc; const modified = {}; this.tsParseModifiers({ allowedModifiers: ["public", "private", "protected", "override", "readonly"] }, modified); const accessibility = modified.accessibility; const override = modified.override; const readonly = modified.readonly; if (!(flags & 4) && (accessibility || readonly || override)) { this.raise(TSErrors.UnexpectedParameterModifier, { at: startLoc }); } const left = this.parseMaybeDefault(); this.parseAssignableListItemTypes(left, flags); const elt = this.parseMaybeDefault(left.loc.start, left); if (accessibility || readonly || override) { const pp = this.startNodeAt(startLoc); if (decorators.length) { pp.decorators = decorators; } if (accessibility) pp.accessibility = accessibility; if (readonly) pp.readonly = readonly; if (override) pp.override = override; if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") { this.raise(TSErrors.UnsupportedParameterPropertyKind, { at: pp }); } pp.parameter = elt; return this.finishNode(pp, "TSParameterProperty"); } if (decorators.length) { left.decorators = decorators; } return elt; } isSimpleParameter(node) { return node.type === "TSParameterProperty" && super.isSimpleParameter(node.parameter) || super.isSimpleParameter(node); } tsDisallowOptionalPattern(node) { for (const param of node.params) { if (param.type !== "Identifier" && param.optional && !this.state.isAmbientContext) { this.raise(TSErrors.PatternIsOptional, { at: param }); } } } setArrowFunctionParameters(node, params, trailingCommaLoc) { super.setArrowFunctionParameters(node, params, trailingCommaLoc); this.tsDisallowOptionalPattern(node); } parseFunctionBodyAndFinish(node, type, isMethod = false) { if (this.match(14)) { node.returnType = this.tsParseTypeOrTypePredicateAnnotation(14); } const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" || type === "ClassPrivateMethod" ? "TSDeclareMethod" : undefined; if (bodilessType && !this.match(5) && this.isLineTerminator()) { return this.finishNode(node, bodilessType); } if (bodilessType === "TSDeclareFunction" && this.state.isAmbientContext) { this.raise(TSErrors.DeclareFunctionHasImplementation, { at: node }); if (node.declare) { return super.parseFunctionBodyAndFinish(node, bodilessType, isMethod); } } this.tsDisallowOptionalPattern(node); return super.parseFunctionBodyAndFinish(node, type, isMethod); } registerFunctionStatementId(node) { if (!node.body && node.id) { this.checkIdentifier(node.id, BIND_TS_AMBIENT); } else { super.registerFunctionStatementId(node); } } tsCheckForInvalidTypeCasts(items) { items.forEach(node => { if ((node == null ? void 0 : node.type) === "TSTypeCastExpression") { this.raise(TSErrors.UnexpectedTypeAnnotation, { at: node.typeAnnotation }); } }); } toReferencedList(exprList, isInParens) { this.tsCheckForInvalidTypeCasts(exprList); return exprList; } parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); if (node.type === "ArrayExpression") { this.tsCheckForInvalidTypeCasts(node.elements); } return node; } parseSubscript(base, startLoc, noCalls, state) { if (!this.hasPrecedingLineBreak() && this.match(35)) { this.state.canStartJSXElement = false; this.next(); const nonNullExpression = this.startNodeAt(startLoc); nonNullExpression.expression = base; return this.finishNode(nonNullExpression, "TSNonNullExpression"); } let isOptionalCall = false; if (this.match(18) && this.lookaheadCharCode() === 60) { if (noCalls) { state.stop = true; return base; } state.optionalChainMember = isOptionalCall = true; this.next(); } if (this.match(47) || this.match(51)) { let missingParenErrorLoc; const result = this.tsTryParseAndCatch(() => { if (!noCalls && this.atPossibleAsyncArrow(base)) { const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startLoc); if (asyncArrowFn) { return asyncArrowFn; } } const typeArguments = this.tsParseTypeArgumentsInExpression(); if (!typeArguments) return; if (isOptionalCall && !this.match(10)) { missingParenErrorLoc = this.state.curPosition(); return; } if (tokenIsTemplate(this.state.type)) { const result = super.parseTaggedTemplateExpression(base, startLoc, state); result.typeParameters = typeArguments; return result; } if (!noCalls && this.eat(10)) { const node = this.startNodeAt(startLoc); node.callee = base; node.arguments = this.parseCallExpressionArguments(11, false); this.tsCheckForInvalidTypeCasts(node.arguments); node.typeParameters = typeArguments; if (state.optionalChainMember) { node.optional = isOptionalCall; } return this.finishCallExpression(node, state.optionalChainMember); } const tokenType = this.state.type; if (tokenType === 48 || tokenType === 52 || tokenType !== 10 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) { return; } const node = this.startNodeAt(startLoc); node.expression = base; node.typeParameters = typeArguments; return this.finishNode(node, "TSInstantiationExpression"); }); if (missingParenErrorLoc) { this.unexpected(missingParenErrorLoc, 10); } if (result) { if (result.type === "TSInstantiationExpression" && (this.match(16) || this.match(18) && this.lookaheadCharCode() !== 40)) { this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, { at: this.state.startLoc }); } return result; } } return super.parseSubscript(base, startLoc, noCalls, state); } parseNewCallee(node) { var _callee$extra; super.parseNewCallee(node); const { callee } = node; if (callee.type === "TSInstantiationExpression" && !((_callee$extra = callee.extra) != null && _callee$extra.parenthesized)) { node.typeParameters = callee.typeParameters; node.callee = callee.expression; } } parseExprOp(left, leftStartLoc, minPrec) { let isSatisfies; if (tokenOperatorPrecedence(58) > minPrec && !this.hasPrecedingLineBreak() && (this.isContextual(93) || (isSatisfies = this.isContextual(118)))) { const node = this.startNodeAt(leftStartLoc); node.expression = left; node.typeAnnotation = this.tsInType(() => { this.next(); if (this.match(75)) { if (isSatisfies) { this.raise(Errors.UnexpectedKeyword, { at: this.state.startLoc, keyword: "const" }); } return this.tsParseTypeReference(); } return this.tsParseType(); }); this.finishNode(node, isSatisfies ? "TSSatisfiesExpression" : "TSAsExpression"); this.reScan_lt_gt(); return this.parseExprOp(node, leftStartLoc, minPrec); } return super.parseExprOp(left, leftStartLoc, minPrec); } checkReservedWord(word, startLoc, checkKeywords, isBinding) { if (!this.state.isAmbientContext) { super.checkReservedWord(word, startLoc, checkKeywords, isBinding); } } checkImportReflection(node) { super.checkImportReflection(node); if (node.module && node.importKind !== "value") { this.raise(TSErrors.ImportReflectionHasImportType, { at: node.specifiers[0].loc.start }); } } checkDuplicateExports() {} isPotentialImportPhase(isExport) { if (super.isPotentialImportPhase(isExport)) return true; if (this.isContextual(128)) { const ch = this.lookaheadCharCode(); return isExport ? ch === 123 || ch === 42 : ch !== 61; } return !isExport && this.isContextual(87); } applyImportPhase(node, isExport, phase, loc) { super.applyImportPhase(node, isExport, phase, loc); if (isExport) { node.exportKind = phase === "type" ? "type" : "value"; } else { node.importKind = phase === "type" || phase === "typeof" ? phase : "value"; } } parseImport(node) { if (this.match(131)) { node.importKind = "value"; return super.parseImport(node); } let importNode; if (tokenIsIdentifier(this.state.type) && this.lookaheadCharCode() === 61) { node.importKind = "value"; return this.tsParseImportEqualsDeclaration(node); } else if (this.isContextual(128)) { const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, false); if (this.lookaheadCharCode() === 61) { return this.tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier); } else { importNode = super.parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier); } } else { importNode = super.parseImport(node); } if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") { this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, { at: importNode }); } return importNode; } parseExport(node, decorators) { if (this.match(83)) { this.next(); let maybeDefaultIdentifier = null; if (this.isContextual(128) && this.isPotentialImportPhase(false)) { maybeDefaultIdentifier = this.parseMaybeImportPhase(node, false); } else { node.importKind = "value"; } return this.tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier, true); } else if (this.eat(29)) { const assign = node; assign.expression = super.parseExpression(); this.semicolon(); this.sawUnambiguousESM = true; return this.finishNode(assign, "TSExportAssignment"); } else if (this.eatContextual(93)) { const decl = node; this.expectContextual(126); decl.id = this.parseIdentifier(); this.semicolon(); return this.finishNode(decl, "TSNamespaceExportDeclaration"); } else { return super.parseExport(node, decorators); } } isAbstractClass() { return this.isContextual(122) && this.lookahead().type === 80; } parseExportDefaultExpression() { if (this.isAbstractClass()) { const cls = this.startNode(); this.next(); cls.abstract = true; return this.parseClass(cls, true, true); } if (this.match(127)) { const result = this.tsParseInterfaceDeclaration(this.startNode()); if (result) return result; } return super.parseExportDefaultExpression(); } parseVarStatement(node, kind, allowMissingInitializer = false) { const { isAmbientContext } = this.state; const declaration = super.parseVarStatement(node, kind, allowMissingInitializer || isAmbientContext); if (!isAmbientContext) return declaration; for (const { id, init } of declaration.declarations) { if (!init) continue; if (kind !== "const" || !!id.typeAnnotation) { this.raise(TSErrors.InitializerNotAllowedInAmbientContext, { at: init }); } else if (!isValidAmbientConstInitializer(init, this.hasPlugin("estree"))) { this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, { at: init }); } } return declaration; } parseStatementContent(flags, decorators) { if (this.match(75) && this.isLookaheadContextual("enum")) { const node = this.startNode(); this.expect(75); return this.tsParseEnumDeclaration(node, { const: true }); } if (this.isContextual(124)) { return this.tsParseEnumDeclaration(this.startNode()); } if (this.isContextual(127)) { const result = this.tsParseInterfaceDeclaration(this.startNode()); if (result) return result; } return super.parseStatementContent(flags, decorators); } parseAccessModifier() { return this.tsParseModifier(["public", "protected", "private"]); } tsHasSomeModifiers(member, modifiers) { return modifiers.some(modifier => { if (tsIsAccessModifier(modifier)) { return member.accessibility === modifier; } return !!member[modifier]; }); } tsIsStartOfStaticBlocks() { return this.isContextual(104) && this.lookaheadCharCode() === 123; } parseClassMember(classBody, member, state) { const modifiers = ["declare", "private", "public", "protected", "override", "abstract", "readonly", "static"]; this.tsParseModifiers({ allowedModifiers: modifiers, disallowedModifiers: ["in", "out"], stopOnStartOfClassStaticBlock: true, errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions }, member); const callParseClassMemberWithIsStatic = () => { if (this.tsIsStartOfStaticBlocks()) { this.next(); this.next(); if (this.tsHasSomeModifiers(member, modifiers)) { this.raise(TSErrors.StaticBlockCannotHaveModifier, { at: this.state.curPosition() }); } super.parseClassStaticBlock(classBody, member); } else { this.parseClassMemberWithIsStatic(classBody, member, state, !!member.static); } }; if (member.declare) { this.tsInAmbientContext(callParseClassMemberWithIsStatic); } else { callParseClassMemberWithIsStatic(); } } parseClassMemberWithIsStatic(classBody, member, state, isStatic) { const idx = this.tsTryParseIndexSignature(member); if (idx) { classBody.body.push(idx); if (member.abstract) { this.raise(TSErrors.IndexSignatureHasAbstract, { at: member }); } if (member.accessibility) { this.raise(TSErrors.IndexSignatureHasAccessibility, { at: member, modifier: member.accessibility }); } if (member.declare) { this.raise(TSErrors.IndexSignatureHasDeclare, { at: member }); } if (member.override) { this.raise(TSErrors.IndexSignatureHasOverride, { at: member }); } return; } if (!this.state.inAbstractClass && member.abstract) { this.raise(TSErrors.NonAbstractClassHasAbstractMethod, { at: member }); } if (member.override) { if (!state.hadSuperClass) { this.raise(TSErrors.OverrideNotInSubClass, { at: member }); } } super.parseClassMemberWithIsStatic(classBody, member, state, isStatic); } parsePostMemberNameModifiers(methodOrProp) { const optional = this.eat(17); if (optional) methodOrProp.optional = true; if (methodOrProp.readonly && this.match(10)) { this.raise(TSErrors.ClassMethodHasReadonly, { at: methodOrProp }); } if (methodOrProp.declare && this.match(10)) { this.raise(TSErrors.ClassMethodHasDeclare, { at: methodOrProp }); } } parseExpressionStatement(node, expr, decorators) { const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr, decorators) : undefined; return decl || super.parseExpressionStatement(node, expr, decorators); } shouldParseExportDeclaration() { if (this.tsIsDeclarationStart()) return true; return super.shouldParseExportDeclaration(); } parseConditional(expr, startLoc, refExpressionErrors) { if (!this.state.maybeInArrowParameters || !this.match(17)) { return super.parseConditional(expr, startLoc, refExpressionErrors); } const result = this.tryParse(() => super.parseConditional(expr, startLoc)); if (!result.node) { if (result.error) { super.setOptionalParametersError(refExpressionErrors, result.error); } return expr; } if (result.error) this.state = result.failState; return result.node; } parseParenItem(node, startLoc) { node = super.parseParenItem(node, startLoc); if (this.eat(17)) { node.optional = true; this.resetEndLocation(node); } if (this.match(14)) { const typeCastNode = this.startNodeAt(startLoc); typeCastNode.expression = node; typeCastNode.typeAnnotation = this.tsParseTypeAnnotation(); return this.finishNode(typeCastNode, "TSTypeCastExpression"); } return node; } parseExportDeclaration(node) { if (!this.state.isAmbientContext && this.isContextual(123)) { return this.tsInAmbientContext(() => this.parseExportDeclaration(node)); } const startLoc = this.state.startLoc; const isDeclare = this.eatContextual(123); if (isDeclare && (this.isContextual(123) || !this.shouldParseExportDeclaration())) { throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, { at: this.state.startLoc }); } const isIdentifier = tokenIsIdentifier(this.state.type); const declaration = isIdentifier && this.tsTryParseExportDeclaration() || super.parseExportDeclaration(node); if (!declaration) return null; if (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare) { node.exportKind = "type"; } if (isDeclare) { this.resetStartLocation(declaration, startLoc); declaration.declare = true; } return declaration; } parseClassId(node, isStatement, optionalId, bindingType) { if ((!isStatement || optionalId) && this.isContextual(111)) { return; } super.parseClassId(node, isStatement, optionalId, node.declare ? BIND_TS_AMBIENT : BIND_CLASS); const typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers); if (typeParameters) node.typeParameters = typeParameters; } parseClassPropertyAnnotation(node) { if (!node.optional) { if (this.eat(35)) { node.definite = true; } else if (this.eat(17)) { node.optional = true; } } const type = this.tsTryParseTypeAnnotation(); if (type) node.typeAnnotation = type; } parseClassProperty(node) { this.parseClassPropertyAnnotation(node); if (this.state.isAmbientContext && !(node.readonly && !node.typeAnnotation) && this.match(29)) { this.raise(TSErrors.DeclareClassFieldHasInitializer, { at: this.state.startLoc }); } if (node.abstract && this.match(29)) { const { key } = node; this.raise(TSErrors.AbstractPropertyHasInitializer, { at: this.state.startLoc, propertyName: key.type === "Identifier" && !node.computed ? key.name : `[${this.input.slice(key.start, key.end)}]` }); } return super.parseClassProperty(node); } parseClassPrivateProperty(node) { if (node.abstract) { this.raise(TSErrors.PrivateElementHasAbstract, { at: node }); } if (node.accessibility) { this.raise(TSErrors.PrivateElementHasAccessibility, { at: node, modifier: node.accessibility }); } this.parseClassPropertyAnnotation(node); return super.parseClassPrivateProperty(node); } parseClassAccessorProperty(node) { this.parseClassPropertyAnnotation(node); if (node.optional) { this.raise(TSErrors.AccessorCannotBeOptional, { at: node }); } return super.parseClassAccessorProperty(node); } pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); if (typeParameters && isConstructor) { this.raise(TSErrors.ConstructorHasTypeParameters, { at: typeParameters }); } const { declare = false, kind } = method; if (declare && (kind === "get" || kind === "set")) { this.raise(TSErrors.DeclareAccessor, { at: method, kind }); } if (typeParameters) method.typeParameters = typeParameters; super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); } pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); if (typeParameters) method.typeParameters = typeParameters; super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); } declareClassPrivateMethodInScope(node, kind) { if (node.type === "TSDeclareMethod") return; if (node.type === "MethodDefinition" && !node.value.body) return; super.declareClassPrivateMethodInScope(node, kind); } parseClassSuper(node) { super.parseClassSuper(node); if (node.superClass && (this.match(47) || this.match(51))) { node.superTypeParameters = this.tsParseTypeArgumentsInExpression(); } if (this.eatContextual(111)) { node.implements = this.tsParseHeritageClause("implements"); } } parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); if (typeParameters) prop.typeParameters = typeParameters; return super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); } parseFunctionParams(node, isConstructor) { const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); if (typeParameters) node.typeParameters = typeParameters; super.parseFunctionParams(node, isConstructor); } parseVarId(decl, kind) { super.parseVarId(decl, kind); if (decl.id.type === "Identifier" && !this.hasPrecedingLineBreak() && this.eat(35)) { decl.definite = true; } const type = this.tsTryParseTypeAnnotation(); if (type) { decl.id.typeAnnotation = type; this.resetEndLocation(decl.id); } } parseAsyncArrowFromCallExpression(node, call) { if (this.match(14)) { node.returnType = this.tsParseTypeAnnotation(); } return super.parseAsyncArrowFromCallExpression(node, call); } parseMaybeAssign(refExpressionErrors, afterLeftParse) { var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2; let state; let jsx; let typeCast; if (this.hasPlugin("jsx") && (this.match(140) || this.match(47))) { state = this.state.clone(); jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); if (!jsx.error) return jsx.node; const { context } = this.state; const currentContext = context[context.length - 1]; if (currentContext === types.j_oTag || currentContext === types.j_expr) { context.pop(); } } if (!((_jsx = jsx) != null && _jsx.error) && !this.match(47)) { return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); } if (!state || state === this.state) state = this.state.clone(); let typeParameters; const arrow = this.tryParse(abort => { var _expr$extra, _typeParameters; typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier); const expr = super.parseMaybeAssign(refExpressionErrors, afterLeftParse); if (expr.type !== "ArrowFunctionExpression" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) { abort(); } if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) { this.resetStartLocationFromNode(expr, typeParameters); } expr.typeParameters = typeParameters; return expr; }, state); if (!arrow.error && !arrow.aborted) { if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); return arrow.node; } if (!jsx) { assert(!this.hasPlugin("jsx")); typeCast = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); if (!typeCast.error) return typeCast.node; } if ((_jsx2 = jsx) != null && _jsx2.node) { this.state = jsx.failState; return jsx.node; } if (arrow.node) { this.state = arrow.failState; if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); return arrow.node; } if ((_typeCast = typeCast) != null && _typeCast.node) { this.state = typeCast.failState; return typeCast.node; } throw ((_jsx3 = jsx) == null ? void 0 : _jsx3.error) || arrow.error || ((_typeCast2 = typeCast) == null ? void 0 : _typeCast2.error); } reportReservedArrowTypeParam(node) { var _node$extra; if (node.params.length === 1 && !node.params[0].constraint && !((_node$extra = node.extra) != null && _node$extra.trailingComma) && this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) { this.raise(TSErrors.ReservedArrowTypeParam, { at: node }); } } parseMaybeUnary(refExpressionErrors, sawUnary) { if (!this.hasPlugin("jsx") && this.match(47)) { return this.tsParseTypeAssertion(); } return super.parseMaybeUnary(refExpressionErrors, sawUnary); } parseArrow(node) { if (this.match(14)) { const result = this.tryParse(abort => { const returnType = this.tsParseTypeOrTypePredicateAnnotation(14); if (this.canInsertSemicolon() || !this.match(19)) abort(); return returnType; }); if (result.aborted) return; if (!result.thrown) { if (result.error) this.state = result.failState; node.returnType = result.node; } } return super.parseArrow(node); } parseAssignableListItemTypes(param, flags) { if (!(flags & 2)) return param; if (this.eat(17)) { param.optional = true; } const type = this.tsTryParseTypeAnnotation(); if (type) param.typeAnnotation = type; this.resetEndLocation(param); return param; } isAssignable(node, isBinding) { switch (node.type) { case "TSTypeCastExpression": return this.isAssignable(node.expression, isBinding); case "TSParameterProperty": return true; default: return super.isAssignable(node, isBinding); } } toAssignable(node, isLHS = false) { switch (node.type) { case "ParenthesizedExpression": this.toAssignableParenthesizedExpression(node, isLHS); break; case "TSAsExpression": case "TSSatisfiesExpression": case "TSNonNullExpression": case "TSTypeAssertion": if (isLHS) { this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter, { at: node }); } else { this.raise(TSErrors.UnexpectedTypeCastInParameter, { at: node }); } this.toAssignable(node.expression, isLHS); break; case "AssignmentExpression": if (!isLHS && node.left.type === "TSTypeCastExpression") { node.left = this.typeCastToParameter(node.left); } default: super.toAssignable(node, isLHS); } } toAssignableParenthesizedExpression(node, isLHS) { switch (node.expression.type) { case "TSAsExpression": case "TSSatisfiesExpression": case "TSNonNullExpression": case "TSTypeAssertion": case "ParenthesizedExpression": this.toAssignable(node.expression, isLHS); break; default: super.toAssignable(node, isLHS); } } checkToRestConversion(node, allowPattern) { switch (node.type) { case "TSAsExpression": case "TSSatisfiesExpression": case "TSTypeAssertion": case "TSNonNullExpression": this.checkToRestConversion(node.expression, false); break; default: super.checkToRestConversion(node, allowPattern); } } isValidLVal(type, isUnparenthesizedInAssign, binding) { return getOwn({ TSTypeCastExpression: true, TSParameterProperty: "parameter", TSNonNullExpression: "expression", TSAsExpression: (binding !== BIND_NONE || !isUnparenthesizedInAssign) && ["expression", true], TSSatisfiesExpression: (binding !== BIND_NONE || !isUnparenthesizedInAssign) && ["expression", true], TSTypeAssertion: (binding !== BIND_NONE || !isUnparenthesizedInAssign) && ["expression", true] }, type) || super.isValidLVal(type, isUnparenthesizedInAssign, binding); } parseBindingAtom() { if (this.state.type === 78) { return this.parseIdentifier(true); } return super.parseBindingAtom(); } parseMaybeDecoratorArguments(expr) { if (this.match(47) || this.match(51)) { const typeArguments = this.tsParseTypeArgumentsInExpression(); if (this.match(10)) { const call = super.parseMaybeDecoratorArguments(expr); call.typeParameters = typeArguments; return call; } this.unexpected(null, 10); } return super.parseMaybeDecoratorArguments(expr); } checkCommaAfterRest(close) { if (this.state.isAmbientContext && this.match(12) && this.lookaheadCharCode() === close) { this.next(); return false; } return super.checkCommaAfterRest(close); } isClassMethod() { return this.match(47) || super.isClassMethod(); } isClassProperty() { return this.match(35) || this.match(14) || super.isClassProperty(); } parseMaybeDefault(startLoc, left) { const node = super.parseMaybeDefault(startLoc, left); if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { this.raise(TSErrors.TypeAnnotationAfterAssign, { at: node.typeAnnotation }); } return node; } getTokenFromCode(code) { if (this.state.inType) { if (code === 62) { this.finishOp(48, 1); return; } if (code === 60) { this.finishOp(47, 1); return; } } super.getTokenFromCode(code); } reScan_lt_gt() { const { type } = this.state; if (type === 47) { this.state.pos -= 1; this.readToken_lt(); } else if (type === 48) { this.state.pos -= 1; this.readToken_gt(); } } reScan_lt() { const { type } = this.state; if (type === 51) { this.state.pos -= 2; this.finishOp(47, 1); return 47; } return type; } toAssignableList(exprList, trailingCommaLoc, isLHS) { for (let i = 0; i < exprList.length; i++) { const expr = exprList[i]; if ((expr == null ? void 0 : expr.type) === "TSTypeCastExpression") { exprList[i] = this.typeCastToParameter(expr); } } super.toAssignableList(exprList, trailingCommaLoc, isLHS); } typeCastToParameter(node) { node.expression.typeAnnotation = node.typeAnnotation; this.resetEndLocation(node.expression, node.typeAnnotation.loc.end); return node.expression; } shouldParseArrow(params) { if (this.match(14)) { return params.every(expr => this.isAssignable(expr, true)); } return super.shouldParseArrow(params); } shouldParseAsyncArrow() { return this.match(14) || super.shouldParseAsyncArrow(); } canHaveLeadingDecorator() { return super.canHaveLeadingDecorator() || this.isAbstractClass(); } jsxParseOpeningElementAfterName(node) { if (this.match(47) || this.match(51)) { const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArgumentsInExpression()); if (typeArguments) node.typeParameters = typeArguments; } return super.jsxParseOpeningElementAfterName(node); } getGetterSetterExpectedParamCount(method) { const baseCount = super.getGetterSetterExpectedParamCount(method); const params = this.getObjectOrClassMethodParams(method); const firstParam = params[0]; const hasContextParam = firstParam && this.isThisParam(firstParam); return hasContextParam ? baseCount + 1 : baseCount; } parseCatchClauseParam() { const param = super.parseCatchClauseParam(); const type = this.tsTryParseTypeAnnotation(); if (type) { param.typeAnnotation = type; this.resetEndLocation(param); } return param; } tsInAmbientContext(cb) { const oldIsAmbientContext = this.state.isAmbientContext; this.state.isAmbientContext = true; try { return cb(); } finally { this.state.isAmbientContext = oldIsAmbientContext; } } parseClass(node, isStatement, optionalId) { const oldInAbstractClass = this.state.inAbstractClass; this.state.inAbstractClass = !!node.abstract; try { return super.parseClass(node, isStatement, optionalId); } finally { this.state.inAbstractClass = oldInAbstractClass; } } tsParseAbstractDeclaration(node, decorators) { if (this.match(80)) { node.abstract = true; return this.maybeTakeDecorators(decorators, this.parseClass(node, true, false)); } else if (this.isContextual(127)) { if (!this.hasFollowingLineBreak()) { node.abstract = true; this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, { at: node }); return this.tsParseInterfaceDeclaration(node); } } else { this.unexpected(null, 80); } } parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) { const method = super.parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); if (method.abstract) { const hasBody = this.hasPlugin("estree") ? !!method.value.body : !!method.body; if (hasBody) { const { key } = method; this.raise(TSErrors.AbstractMethodHasImplementation, { at: method, methodName: key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(key.start, key.end)}]` }); } } return method; } tsParseTypeParameterName() { const typeName = this.parseIdentifier(); return typeName.name; } shouldParseAsAmbientContext() { return !!this.getPluginOption("typescript", "dts"); } parse() { if (this.shouldParseAsAmbientContext()) { this.state.isAmbientContext = true; } return super.parse(); } getExpression() { if (this.shouldParseAsAmbientContext()) { this.state.isAmbientContext = true; } return super.getExpression(); } parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) { if (!isString && isMaybeTypeOnly) { this.parseTypeOnlyImportExportSpecifier(node, false, isInTypeExport); return this.finishNode(node, "ExportSpecifier"); } node.exportKind = "value"; return super.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly); } parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { if (!importedIsString && isMaybeTypeOnly) { this.parseTypeOnlyImportExportSpecifier(specifier, true, isInTypeOnlyImport); return this.finishNode(specifier, "ImportSpecifier"); } specifier.importKind = "value"; return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, isInTypeOnlyImport ? BIND_TS_TYPE_IMPORT : BIND_FLAGS_TS_IMPORT); } parseTypeOnlyImportExportSpecifier(node, isImport, isInTypeOnlyImportExport) { const leftOfAsKey = isImport ? "imported" : "local"; const rightOfAsKey = isImport ? "local" : "exported"; let leftOfAs = node[leftOfAsKey]; let rightOfAs; let hasTypeSpecifier = false; let canParseAsKeyword = true; const loc = leftOfAs.loc.start; if (this.isContextual(93)) { const firstAs = this.parseIdentifier(); if (this.isContextual(93)) { const secondAs = this.parseIdentifier(); if (tokenIsKeywordOrIdentifier(this.state.type)) { hasTypeSpecifier = true; leftOfAs = firstAs; rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName(); canParseAsKeyword = false; } else { rightOfAs = secondAs; canParseAsKeyword = false; } } else if (tokenIsKeywordOrIdentifier(this.state.type)) { canParseAsKeyword = false; rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName(); } else { hasTypeSpecifier = true; leftOfAs = firstAs; } } else if (tokenIsKeywordOrIdentifier(this.state.type)) { hasTypeSpecifier = true; if (isImport) { leftOfAs = this.parseIdentifier(true); if (!this.isContextual(93)) { this.checkReservedWord(leftOfAs.name, leftOfAs.loc.start, true, true); } } else { leftOfAs = this.parseModuleExportName(); } } if (hasTypeSpecifier && isInTypeOnlyImportExport) { this.raise(isImport ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports, { at: loc }); } node[leftOfAsKey] = leftOfAs; node[rightOfAsKey] = rightOfAs; const kindKey = isImport ? "importKind" : "exportKind"; node[kindKey] = hasTypeSpecifier ? "type" : "value"; if (canParseAsKeyword && this.eatContextual(93)) { node[rightOfAsKey] = isImport ? this.parseIdentifier() : this.parseModuleExportName(); } if (!node[rightOfAsKey]) { node[rightOfAsKey] = cloneIdentifier(node[leftOfAsKey]); } if (isImport) { this.checkIdentifier(node[rightOfAsKey], hasTypeSpecifier ? BIND_TS_TYPE_IMPORT : BIND_FLAGS_TS_IMPORT); } } }; function isPossiblyLiteralEnum(expression) { if (expression.type !== "MemberExpression") return false; const { computed, property } = expression; if (computed && property.type !== "StringLiteral" && (property.type !== "TemplateLiteral" || property.expressions.length > 0)) { return false; } return isUncomputedMemberExpressionChain(expression.object); } function isValidAmbientConstInitializer(expression, estree) { var _expression$extra; const { type } = expression; if ((_expression$extra = expression.extra) != null && _expression$extra.parenthesized) { return false; } if (estree) { if (type === "Literal") { const { value } = expression; if (typeof value === "string" || typeof value === "boolean") { return true; } } } else { if (type === "StringLiteral" || type === "BooleanLiteral") { return true; } } if (isNumber(expression, estree) || isNegativeNumber(expression, estree)) { return true; } if (type === "TemplateLiteral" && expression.expressions.length === 0) { return true; } if (isPossiblyLiteralEnum(expression)) { return true; } return false; } function isNumber(expression, estree) { if (estree) { return expression.type === "Literal" && (typeof expression.value === "number" || "bigint" in expression); } return expression.type === "NumericLiteral" || expression.type === "BigIntLiteral"; } function isNegativeNumber(expression, estree) { if (expression.type === "UnaryExpression") { const { operator, argument } = expression; if (operator === "-" && isNumber(argument, estree)) { return true; } } return false; } function isUncomputedMemberExpressionChain(expression) { if (expression.type === "Identifier") return true; if (expression.type !== "MemberExpression" || expression.computed) { return false; } return isUncomputedMemberExpressionChain(expression.object); } const PlaceholderErrors = ParseErrorEnum`placeholders`({ ClassNameIsRequired: "A class name is required.", UnexpectedSpace: "Unexpected space in placeholder." }); var placeholders = superClass => class PlaceholdersParserMixin extends superClass { parsePlaceholder(expectedNode) { if (this.match(142)) { const node = this.startNode(); this.next(); this.assertNoSpace(); node.name = super.parseIdentifier(true); this.assertNoSpace(); this.expect(142); return this.finishPlaceholder(node, expectedNode); } } finishPlaceholder(node, expectedNode) { const isFinished = !!(node.expectedNode && node.type === "Placeholder"); node.expectedNode = expectedNode; return isFinished ? node : this.finishNode(node, "Placeholder"); } getTokenFromCode(code) { if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) { this.finishOp(142, 2); } else { super.getTokenFromCode(code); } } parseExprAtom(refExpressionErrors) { return this.parsePlaceholder("Expression") || super.parseExprAtom(refExpressionErrors); } parseIdentifier(liberal) { return this.parsePlaceholder("Identifier") || super.parseIdentifier(liberal); } checkReservedWord(word, startLoc, checkKeywords, isBinding) { if (word !== undefined) { super.checkReservedWord(word, startLoc, checkKeywords, isBinding); } } parseBindingAtom() { return this.parsePlaceholder("Pattern") || super.parseBindingAtom(); } isValidLVal(type, isParenthesized, binding) { return type === "Placeholder" || super.isValidLVal(type, isParenthesized, binding); } toAssignable(node, isLHS) { if (node && node.type === "Placeholder" && node.expectedNode === "Expression") { node.expectedNode = "Pattern"; } else { super.toAssignable(node, isLHS); } } chStartsBindingIdentifier(ch, pos) { if (super.chStartsBindingIdentifier(ch, pos)) { return true; } const nextToken = this.lookahead(); if (nextToken.type === 142) { return true; } return false; } verifyBreakContinue(node, isBreak) { if (node.label && node.label.type === "Placeholder") return; super.verifyBreakContinue(node, isBreak); } parseExpressionStatement(node, expr) { if (expr.type !== "Placeholder" || expr.extra && expr.extra.parenthesized) { return super.parseExpressionStatement(node, expr); } if (this.match(14)) { const stmt = node; stmt.label = this.finishPlaceholder(expr, "Identifier"); this.next(); stmt.body = super.parseStatementOrSloppyAnnexBFunctionDeclaration(); return this.finishNode(stmt, "LabeledStatement"); } this.semicolon(); node.name = expr.name; return this.finishPlaceholder(node, "Statement"); } parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse) { return this.parsePlaceholder("BlockStatement") || super.parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse); } parseFunctionId(requireId) { return this.parsePlaceholder("Identifier") || super.parseFunctionId(requireId); } parseClass(node, isStatement, optionalId) { const type = isStatement ? "ClassDeclaration" : "ClassExpression"; this.next(); const oldStrict = this.state.strict; const placeholder = this.parsePlaceholder("Identifier"); if (placeholder) { if (this.match(81) || this.match(142) || this.match(5)) { node.id = placeholder; } else if (optionalId || !isStatement) { node.id = null; node.body = this.finishPlaceholder(placeholder, "ClassBody"); return this.finishNode(node, type); } else { throw this.raise(PlaceholderErrors.ClassNameIsRequired, { at: this.state.startLoc }); } } else { this.parseClassId(node, isStatement, optionalId); } super.parseClassSuper(node); node.body = this.parsePlaceholder("ClassBody") || super.parseClassBody(!!node.superClass, oldStrict); return this.finishNode(node, type); } parseExport(node, decorators) { const placeholder = this.parsePlaceholder("Identifier"); if (!placeholder) return super.parseExport(node, decorators); if (!this.isContextual(97) && !this.match(12)) { node.specifiers = []; node.source = null; node.declaration = this.finishPlaceholder(placeholder, "Declaration"); return this.finishNode(node, "ExportNamedDeclaration"); } this.expectPlugin("exportDefaultFrom"); const specifier = this.startNode(); specifier.exported = placeholder; node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; return super.parseExport(node, decorators); } isExportDefaultSpecifier() { if (this.match(65)) { const next = this.nextTokenStart(); if (this.isUnparsedContextual(next, "from")) { if (this.input.startsWith(tokenLabelName(142), this.nextTokenStartSince(next + 4))) { return true; } } } return super.isExportDefaultSpecifier(); } maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) { var _specifiers; if ((_specifiers = node.specifiers) != null && _specifiers.length) { return true; } return super.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier); } checkExport(node) { const { specifiers } = node; if (specifiers != null && specifiers.length) { node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder"); } super.checkExport(node); node.specifiers = specifiers; } parseImport(node) { const placeholder = this.parsePlaceholder("Identifier"); if (!placeholder) return super.parseImport(node); node.specifiers = []; if (!this.isContextual(97) && !this.match(12)) { node.source = this.finishPlaceholder(placeholder, "StringLiteral"); this.semicolon(); return this.finishNode(node, "ImportDeclaration"); } const specifier = this.startNodeAtNode(placeholder); specifier.local = placeholder; node.specifiers.push(this.finishNode(specifier, "ImportDefaultSpecifier")); if (this.eat(12)) { const hasStarImport = this.maybeParseStarImportSpecifier(node); if (!hasStarImport) this.parseNamedImportSpecifiers(node); } this.expectContextual(97); node.source = this.parseImportSource(); this.semicolon(); return this.finishNode(node, "ImportDeclaration"); } parseImportSource() { return this.parsePlaceholder("StringLiteral") || super.parseImportSource(); } assertNoSpace() { if (this.state.start > this.state.lastTokEndLoc.index) { this.raise(PlaceholderErrors.UnexpectedSpace, { at: this.state.lastTokEndLoc }); } } }; var v8intrinsic = superClass => class V8IntrinsicMixin extends superClass { parseV8Intrinsic() { if (this.match(54)) { const v8IntrinsicStartLoc = this.state.startLoc; const node = this.startNode(); this.next(); if (tokenIsIdentifier(this.state.type)) { const name = this.parseIdentifierName(); const identifier = this.createIdentifier(node, name); identifier.type = "V8IntrinsicIdentifier"; if (this.match(10)) { return identifier; } } this.unexpected(v8IntrinsicStartLoc); } } parseExprAtom(refExpressionErrors) { return this.parseV8Intrinsic() || super.parseExprAtom(refExpressionErrors); } }; function hasPlugin(plugins, expectedConfig) { const [expectedName, expectedOptions] = typeof expectedConfig === "string" ? [expectedConfig, {}] : expectedConfig; const expectedKeys = Object.keys(expectedOptions); const expectedOptionsIsEmpty = expectedKeys.length === 0; return plugins.some(p => { if (typeof p === "string") { return expectedOptionsIsEmpty && p === expectedName; } else { const [pluginName, pluginOptions] = p; if (pluginName !== expectedName) { return false; } for (const key of expectedKeys) { if (pluginOptions[key] !== expectedOptions[key]) { return false; } } return true; } }); } function getPluginOption(plugins, name, option) { const plugin = plugins.find(plugin => { if (Array.isArray(plugin)) { return plugin[0] === name; } else { return plugin === name; } }); if (plugin && Array.isArray(plugin) && plugin.length > 1) { return plugin[1][option]; } return null; } const PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack", "smart"]; const TOPIC_TOKENS = ["^^", "@@", "^", "%", "#"]; const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"]; function validatePlugins(plugins) { if (hasPlugin(plugins, "decorators")) { if (hasPlugin(plugins, "decorators-legacy")) { throw new Error("Cannot use the decorators and decorators-legacy plugin together"); } const decoratorsBeforeExport = getPluginOption(plugins, "decorators", "decoratorsBeforeExport"); if (decoratorsBeforeExport != null && typeof decoratorsBeforeExport !== "boolean") { throw new Error("'decoratorsBeforeExport' must be a boolean, if specified."); } const allowCallParenthesized = getPluginOption(plugins, "decorators", "allowCallParenthesized"); if (allowCallParenthesized != null && typeof allowCallParenthesized !== "boolean") { throw new Error("'allowCallParenthesized' must be a boolean."); } } if (hasPlugin(plugins, "flow") && hasPlugin(plugins, "typescript")) { throw new Error("Cannot combine flow and typescript plugins."); } if (hasPlugin(plugins, "placeholders") && hasPlugin(plugins, "v8intrinsic")) { throw new Error("Cannot combine placeholders and v8intrinsic plugins."); } if (hasPlugin(plugins, "pipelineOperator")) { const proposal = getPluginOption(plugins, "pipelineOperator", "proposal"); if (!PIPELINE_PROPOSALS.includes(proposal)) { const proposalList = PIPELINE_PROPOSALS.map(p => `"${p}"`).join(", "); throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${proposalList}.`); } const tupleSyntaxIsHash = hasPlugin(plugins, ["recordAndTuple", { syntaxType: "hash" }]); if (proposal === "hack") { if (hasPlugin(plugins, "placeholders")) { throw new Error("Cannot combine placeholders plugin and Hack-style pipes."); } if (hasPlugin(plugins, "v8intrinsic")) { throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes."); } const topicToken = getPluginOption(plugins, "pipelineOperator", "topicToken"); if (!TOPIC_TOKENS.includes(topicToken)) { const tokenList = TOPIC_TOKENS.map(t => `"${t}"`).join(", "); throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${tokenList}.`); } if (topicToken === "#" && tupleSyntaxIsHash) { throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "hack", topicToken: "#" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.'); } } else if (proposal === "smart" && tupleSyntaxIsHash) { throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "smart" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.'); } } if (hasPlugin(plugins, "moduleAttributes")) { { if (hasPlugin(plugins, "importAssertions") || hasPlugin(plugins, "importAttributes")) { throw new Error("Cannot combine importAssertions, importAttributes and moduleAttributes plugins."); } const moduleAttributesVersionPluginOption = getPluginOption(plugins, "moduleAttributes", "version"); if (moduleAttributesVersionPluginOption !== "may-2020") { throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'."); } } } if (hasPlugin(plugins, "importAssertions") && hasPlugin(plugins, "importAttributes")) { throw new Error("Cannot combine importAssertions and importAttributes plugins."); } if (hasPlugin(plugins, "recordAndTuple") && getPluginOption(plugins, "recordAndTuple", "syntaxType") != null && !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(getPluginOption(plugins, "recordAndTuple", "syntaxType"))) { throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", ")); } if (hasPlugin(plugins, "asyncDoExpressions") && !hasPlugin(plugins, "doExpressions")) { const error = new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins."); error.missingPlugins = "doExpressions"; throw error; } } const mixinPlugins = { estree, jsx, flow, typescript, v8intrinsic, placeholders }; const mixinPluginNames = Object.keys(mixinPlugins); const defaultOptions = { sourceType: "script", sourceFilename: undefined, startColumn: 0, startLine: 1, allowAwaitOutsideFunction: false, allowReturnOutsideFunction: false, allowNewTargetOutsideFunction: false, allowImportExportEverywhere: false, allowSuperOutsideMethod: false, allowUndeclaredExports: false, plugins: [], strictMode: null, ranges: false, tokens: false, createParenthesizedExpressions: false, errorRecovery: false, attachComment: true, annexB: true }; function getOptions(opts) { if (opts && opts.annexB != null && opts.annexB !== false) { throw new Error("The `annexB` option can only be set to `false`."); } const options = {}; for (const key of Object.keys(defaultOptions)) { options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key]; } return options; } class ExpressionParser extends LValParser { checkProto(prop, isRecord, protoRef, refExpressionErrors) { if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) { return; } const key = prop.key; const name = key.type === "Identifier" ? key.name : key.value; if (name === "__proto__") { if (isRecord) { this.raise(Errors.RecordNoProto, { at: key }); return; } if (protoRef.used) { if (refExpressionErrors) { if (refExpressionErrors.doubleProtoLoc === null) { refExpressionErrors.doubleProtoLoc = key.loc.start; } } else { this.raise(Errors.DuplicateProto, { at: key }); } } protoRef.used = true; } } shouldExitDescending(expr, potentialArrowAt) { return expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt; } getExpression() { this.enterInitialScopes(); this.nextToken(); const expr = this.parseExpression(); if (!this.match(137)) { this.unexpected(); } this.finalizeRemainingComments(); expr.comments = this.state.comments; expr.errors = this.state.errors; if (this.options.tokens) { expr.tokens = this.tokens; } return expr; } parseExpression(disallowIn, refExpressionErrors) { if (disallowIn) { return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors)); } return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors)); } parseExpressionBase(refExpressionErrors) { const startLoc = this.state.startLoc; const expr = this.parseMaybeAssign(refExpressionErrors); if (this.match(12)) { const node = this.startNodeAt(startLoc); node.expressions = [expr]; while (this.eat(12)) { node.expressions.push(this.parseMaybeAssign(refExpressionErrors)); } this.toReferencedList(node.expressions); return this.finishNode(node, "SequenceExpression"); } return expr; } parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse) { return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse)); } parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse) { return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse)); } setOptionalParametersError(refExpressionErrors, resultError) { var _resultError$loc; refExpressionErrors.optionalParametersLoc = (_resultError$loc = resultError == null ? void 0 : resultError.loc) != null ? _resultError$loc : this.state.startLoc; } parseMaybeAssign(refExpressionErrors, afterLeftParse) { const startLoc = this.state.startLoc; if (this.isContextual(106)) { if (this.prodParam.hasYield) { let left = this.parseYield(); if (afterLeftParse) { left = afterLeftParse.call(this, left, startLoc); } return left; } } let ownExpressionErrors; if (refExpressionErrors) { ownExpressionErrors = false; } else { refExpressionErrors = new ExpressionErrors(); ownExpressionErrors = true; } const { type } = this.state; if (type === 10 || tokenIsIdentifier(type)) { this.state.potentialArrowAt = this.state.start; } let left = this.parseMaybeConditional(refExpressionErrors); if (afterLeftParse) { left = afterLeftParse.call(this, left, startLoc); } if (tokenIsAssignment(this.state.type)) { const node = this.startNodeAt(startLoc); const operator = this.state.value; node.operator = operator; if (this.match(29)) { this.toAssignable(left, true); node.left = left; const startIndex = startLoc.index; if (refExpressionErrors.doubleProtoLoc != null && refExpressionErrors.doubleProtoLoc.index >= startIndex) { refExpressionErrors.doubleProtoLoc = null; } if (refExpressionErrors.shorthandAssignLoc != null && refExpressionErrors.shorthandAssignLoc.index >= startIndex) { refExpressionErrors.shorthandAssignLoc = null; } if (refExpressionErrors.privateKeyLoc != null && refExpressionErrors.privateKeyLoc.index >= startIndex) { this.checkDestructuringPrivate(refExpressionErrors); refExpressionErrors.privateKeyLoc = null; } } else { node.left = left; } this.next(); node.right = this.parseMaybeAssign(); this.checkLVal(left, { in: this.finishNode(node, "AssignmentExpression") }); return node; } else if (ownExpressionErrors) { this.checkExpressionErrors(refExpressionErrors, true); } return left; } parseMaybeConditional(refExpressionErrors) { const startLoc = this.state.startLoc; const potentialArrowAt = this.state.potentialArrowAt; const expr = this.parseExprOps(refExpressionErrors); if (this.shouldExitDescending(expr, potentialArrowAt)) { return expr; } return this.parseConditional(expr, startLoc, refExpressionErrors); } parseConditional(expr, startLoc, refExpressionErrors) { if (this.eat(17)) { const node = this.startNodeAt(startLoc); node.test = expr; node.consequent = this.parseMaybeAssignAllowIn(); this.expect(14); node.alternate = this.parseMaybeAssign(); return this.finishNode(node, "ConditionalExpression"); } return expr; } parseMaybeUnaryOrPrivate(refExpressionErrors) { return this.match(136) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors); } parseExprOps(refExpressionErrors) { const startLoc = this.state.startLoc; const potentialArrowAt = this.state.potentialArrowAt; const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors); if (this.shouldExitDescending(expr, potentialArrowAt)) { return expr; } return this.parseExprOp(expr, startLoc, -1); } parseExprOp(left, leftStartLoc, minPrec) { if (this.isPrivateName(left)) { const value = this.getPrivateNameSV(left); if (minPrec >= tokenOperatorPrecedence(58) || !this.prodParam.hasIn || !this.match(58)) { this.raise(Errors.PrivateInExpectedIn, { at: left, identifierName: value }); } this.classScope.usePrivateName(value, left.loc.start); } const op = this.state.type; if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(58))) { let prec = tokenOperatorPrecedence(op); if (prec > minPrec) { if (op === 39) { this.expectPlugin("pipelineOperator"); if (this.state.inFSharpPipelineDirectBody) { return left; } this.checkPipelineAtInfixOperator(left, leftStartLoc); } const node = this.startNodeAt(leftStartLoc); node.left = left; node.operator = this.state.value; const logical = op === 41 || op === 42; const coalesce = op === 40; if (coalesce) { prec = tokenOperatorPrecedence(42); } this.next(); if (op === 39 && this.hasPlugin(["pipelineOperator", { proposal: "minimal" }])) { if (this.state.type === 96 && this.prodParam.hasAwait) { throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody, { at: this.state.startLoc }); } } node.right = this.parseExprOpRightExpr(op, prec); const finishedNode = this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression"); const nextOp = this.state.type; if (coalesce && (nextOp === 41 || nextOp === 42) || logical && nextOp === 40) { throw this.raise(Errors.MixingCoalesceWithLogical, { at: this.state.startLoc }); } return this.parseExprOp(finishedNode, leftStartLoc, minPrec); } } return left; } parseExprOpRightExpr(op, prec) { const startLoc = this.state.startLoc; switch (op) { case 39: switch (this.getPluginOption("pipelineOperator", "proposal")) { case "hack": return this.withTopicBindingContext(() => { return this.parseHackPipeBody(); }); case "smart": return this.withTopicBindingContext(() => { if (this.prodParam.hasYield && this.isContextual(106)) { throw this.raise(Errors.PipeBodyIsTighter, { at: this.state.startLoc }); } return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startLoc); }); case "fsharp": return this.withSoloAwaitPermittingContext(() => { return this.parseFSharpPipelineBody(prec); }); } default: return this.parseExprOpBaseRightExpr(op, prec); } } parseExprOpBaseRightExpr(op, prec) { const startLoc = this.state.startLoc; return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, tokenIsRightAssociative(op) ? prec - 1 : prec); } parseHackPipeBody() { var _body$extra; const { startLoc } = this.state; const body = this.parseMaybeAssign(); const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has(body.type); if (requiredParentheses && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) { this.raise(Errors.PipeUnparenthesizedBody, { at: startLoc, type: body.type }); } if (!this.topicReferenceWasUsedInCurrentContext()) { this.raise(Errors.PipeTopicUnused, { at: startLoc }); } return body; } checkExponentialAfterUnary(node) { if (this.match(57)) { this.raise(Errors.UnexpectedTokenUnaryExponentiation, { at: node.argument }); } } parseMaybeUnary(refExpressionErrors, sawUnary) { const startLoc = this.state.startLoc; const isAwait = this.isContextual(96); if (isAwait && this.isAwaitAllowed()) { this.next(); const expr = this.parseAwait(startLoc); if (!sawUnary) this.checkExponentialAfterUnary(expr); return expr; } const update = this.match(34); const node = this.startNode(); if (tokenIsPrefix(this.state.type)) { node.operator = this.state.value; node.prefix = true; if (this.match(72)) { this.expectPlugin("throwExpressions"); } const isDelete = this.match(89); this.next(); node.argument = this.parseMaybeUnary(null, true); this.checkExpressionErrors(refExpressionErrors, true); if (this.state.strict && isDelete) { const arg = node.argument; if (arg.type === "Identifier") { this.raise(Errors.StrictDelete, { at: node }); } else if (this.hasPropertyAsPrivateName(arg)) { this.raise(Errors.DeletePrivateField, { at: node }); } } if (!update) { if (!sawUnary) { this.checkExponentialAfterUnary(node); } return this.finishNode(node, "UnaryExpression"); } } const expr = this.parseUpdate(node, update, refExpressionErrors); if (isAwait) { const { type } = this.state; const startsExpr = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54); if (startsExpr && !this.isAmbiguousAwait()) { this.raiseOverwrite(Errors.AwaitNotInAsyncContext, { at: startLoc }); return this.parseAwait(startLoc); } } return expr; } parseUpdate(node, update, refExpressionErrors) { if (update) { const updateExpressionNode = node; this.checkLVal(updateExpressionNode.argument, { in: this.finishNode(updateExpressionNode, "UpdateExpression") }); return node; } const startLoc = this.state.startLoc; let expr = this.parseExprSubscripts(refExpressionErrors); if (this.checkExpressionErrors(refExpressionErrors, false)) return expr; while (tokenIsPostfix(this.state.type) && !this.canInsertSemicolon()) { const node = this.startNodeAt(startLoc); node.operator = this.state.value; node.prefix = false; node.argument = expr; this.next(); this.checkLVal(expr, { in: expr = this.finishNode(node, "UpdateExpression") }); } return expr; } parseExprSubscripts(refExpressionErrors) { const startLoc = this.state.startLoc; const potentialArrowAt = this.state.potentialArrowAt; const expr = this.parseExprAtom(refExpressionErrors); if (this.shouldExitDescending(expr, potentialArrowAt)) { return expr; } return this.parseSubscripts(expr, startLoc); } parseSubscripts(base, startLoc, noCalls) { const state = { optionalChainMember: false, maybeAsyncArrow: this.atPossibleAsyncArrow(base), stop: false }; do { base = this.parseSubscript(base, startLoc, noCalls, state); state.maybeAsyncArrow = false; } while (!state.stop); return base; } parseSubscript(base, startLoc, noCalls, state) { const { type } = this.state; if (!noCalls && type === 15) { return this.parseBind(base, startLoc, noCalls, state); } else if (tokenIsTemplate(type)) { return this.parseTaggedTemplateExpression(base, startLoc, state); } let optional = false; if (type === 18) { if (noCalls) { this.raise(Errors.OptionalChainingNoNew, { at: this.state.startLoc }); if (this.lookaheadCharCode() === 40) { state.stop = true; return base; } } state.optionalChainMember = optional = true; this.next(); } if (!noCalls && this.match(10)) { return this.parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional); } else { const computed = this.eat(0); if (computed || optional || this.eat(16)) { return this.parseMember(base, startLoc, state, computed, optional); } else { state.stop = true; return base; } } } parseMember(base, startLoc, state, computed, optional) { const node = this.startNodeAt(startLoc); node.object = base; node.computed = computed; if (computed) { node.property = this.parseExpression(); this.expect(3); } else if (this.match(136)) { if (base.type === "Super") { this.raise(Errors.SuperPrivateField, { at: startLoc }); } this.classScope.usePrivateName(this.state.value, this.state.startLoc); node.property = this.parsePrivateName(); } else { node.property = this.parseIdentifier(true); } if (state.optionalChainMember) { node.optional = optional; return this.finishNode(node, "OptionalMemberExpression"); } else { return this.finishNode(node, "MemberExpression"); } } parseBind(base, startLoc, noCalls, state) { const node = this.startNodeAt(startLoc); node.object = base; this.next(); node.callee = this.parseNoCallExpr(); state.stop = true; return this.parseSubscripts(this.finishNode(node, "BindExpression"), startLoc, noCalls); } parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional) { const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; let refExpressionErrors = null; this.state.maybeInArrowParameters = true; this.next(); const node = this.startNodeAt(startLoc); node.callee = base; const { maybeAsyncArrow, optionalChainMember } = state; if (maybeAsyncArrow) { this.expressionScope.enter(newAsyncArrowScope()); refExpressionErrors = new ExpressionErrors(); } if (optionalChainMember) { node.optional = optional; } if (optional) { node.arguments = this.parseCallExpressionArguments(11); } else { node.arguments = this.parseCallExpressionArguments(11, base.type === "Import", base.type !== "Super", node, refExpressionErrors); } let finishedNode = this.finishCallExpression(node, optionalChainMember); if (maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) { state.stop = true; this.checkDestructuringPrivate(refExpressionErrors); this.expressionScope.validateAsPattern(); this.expressionScope.exit(); finishedNode = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startLoc), finishedNode); } else { if (maybeAsyncArrow) { this.checkExpressionErrors(refExpressionErrors, true); this.expressionScope.exit(); } this.toReferencedArguments(finishedNode); } this.state.maybeInArrowParameters = oldMaybeInArrowParameters; return finishedNode; } toReferencedArguments(node, isParenthesizedExpr) { this.toReferencedListDeep(node.arguments, isParenthesizedExpr); } parseTaggedTemplateExpression(base, startLoc, state) { const node = this.startNodeAt(startLoc); node.tag = base; node.quasi = this.parseTemplate(true); if (state.optionalChainMember) { this.raise(Errors.OptionalChainingNoTemplate, { at: startLoc }); } return this.finishNode(node, "TaggedTemplateExpression"); } atPossibleAsyncArrow(base) { return base.type === "Identifier" && base.name === "async" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && base.start === this.state.potentialArrowAt; } expectImportAttributesPlugin() { if (!this.hasPlugin("importAssertions")) { this.expectPlugin("importAttributes"); } } finishCallExpression(node, optional) { if (node.callee.type === "Import") { if (node.arguments.length === 2) { { if (!this.hasPlugin("moduleAttributes")) { this.expectImportAttributesPlugin(); } } } if (node.arguments.length === 0 || node.arguments.length > 2) { this.raise(Errors.ImportCallArity, { at: node, maxArgumentCount: this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions") || this.hasPlugin("moduleAttributes") ? 2 : 1 }); } else { for (const arg of node.arguments) { if (arg.type === "SpreadElement") { this.raise(Errors.ImportCallSpreadArgument, { at: arg }); } } } } return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression"); } parseCallExpressionArguments(close, dynamicImport, allowPlaceholder, nodeForExtra, refExpressionErrors) { const elts = []; let first = true; const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.inFSharpPipelineDirectBody = false; while (!this.eat(close)) { if (first) { first = false; } else { this.expect(12); if (this.match(close)) { if (dynamicImport && !this.hasPlugin("importAttributes") && !this.hasPlugin("importAssertions") && !this.hasPlugin("moduleAttributes")) { this.raise(Errors.ImportCallArgumentTrailingComma, { at: this.state.lastTokStartLoc }); } if (nodeForExtra) { this.addTrailingCommaExtraToNode(nodeForExtra); } this.next(); break; } } elts.push(this.parseExprListItem(false, refExpressionErrors, allowPlaceholder)); } this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; return elts; } shouldParseAsyncArrow() { return this.match(19) && !this.canInsertSemicolon(); } parseAsyncArrowFromCallExpression(node, call) { var _call$extra; this.resetPreviousNodeTrailingComments(call); this.expect(19); this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingCommaLoc); if (call.innerComments) { setInnerComments(node, call.innerComments); } if (call.callee.trailingComments) { setInnerComments(node, call.callee.trailingComments); } return node; } parseNoCallExpr() { const startLoc = this.state.startLoc; return this.parseSubscripts(this.parseExprAtom(), startLoc, true); } parseExprAtom(refExpressionErrors) { let node; let decorators = null; const { type } = this.state; switch (type) { case 79: return this.parseSuper(); case 83: node = this.startNode(); this.next(); if (this.match(16)) { return this.parseImportMetaProperty(node); } if (!this.match(10)) { this.raise(Errors.UnsupportedImport, { at: this.state.lastTokStartLoc }); } return this.finishNode(node, "Import"); case 78: node = this.startNode(); this.next(); return this.finishNode(node, "ThisExpression"); case 90: { return this.parseDo(this.startNode(), false); } case 56: case 31: { this.readRegexp(); return this.parseRegExpLiteral(this.state.value); } case 132: return this.parseNumericLiteral(this.state.value); case 133: return this.parseBigIntLiteral(this.state.value); case 134: return this.parseDecimalLiteral(this.state.value); case 131: return this.parseStringLiteral(this.state.value); case 84: return this.parseNullLiteral(); case 85: return this.parseBooleanLiteral(true); case 86: return this.parseBooleanLiteral(false); case 10: { const canBeArrow = this.state.potentialArrowAt === this.state.start; return this.parseParenAndDistinguishExpression(canBeArrow); } case 2: case 1: { return this.parseArrayLike(this.state.type === 2 ? 4 : 3, false, true); } case 0: { return this.parseArrayLike(3, true, false, refExpressionErrors); } case 6: case 7: { return this.parseObjectLike(this.state.type === 6 ? 9 : 8, false, true); } case 5: { return this.parseObjectLike(8, false, false, refExpressionErrors); } case 68: return this.parseFunctionOrFunctionSent(); case 26: decorators = this.parseDecorators(); case 80: return this.parseClass(this.maybeTakeDecorators(decorators, this.startNode()), false); case 77: return this.parseNewOrNewTarget(); case 25: case 24: return this.parseTemplate(false); case 15: { node = this.startNode(); this.next(); node.object = null; const callee = node.callee = this.parseNoCallExpr(); if (callee.type === "MemberExpression") { return this.finishNode(node, "BindExpression"); } else { throw this.raise(Errors.UnsupportedBind, { at: callee }); } } case 136: { this.raise(Errors.PrivateInExpectedIn, { at: this.state.startLoc, identifierName: this.state.value }); return this.parsePrivateName(); } case 33: { return this.parseTopicReferenceThenEqualsSign(54, "%"); } case 32: { return this.parseTopicReferenceThenEqualsSign(44, "^"); } case 37: case 38: { return this.parseTopicReference("hack"); } case 44: case 54: case 27: { const pipeProposal = this.getPluginOption("pipelineOperator", "proposal"); if (pipeProposal) { return this.parseTopicReference(pipeProposal); } this.unexpected(); break; } case 47: { const lookaheadCh = this.input.codePointAt(this.nextTokenStart()); if (isIdentifierStart(lookaheadCh) || lookaheadCh === 62) { this.expectOnePlugin(["jsx", "flow", "typescript"]); } else { this.unexpected(); } break; } default: if (tokenIsIdentifier(type)) { if (this.isContextual(125) && this.lookaheadInLineCharCode() === 123) { return this.parseModuleExpression(); } const canBeArrow = this.state.potentialArrowAt === this.state.start; const containsEsc = this.state.containsEsc; const id = this.parseIdentifier(); if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) { const { type } = this.state; if (type === 68) { this.resetPreviousNodeTrailingComments(id); this.next(); return this.parseAsyncFunctionExpression(this.startNodeAtNode(id)); } else if (tokenIsIdentifier(type)) { if (this.lookaheadCharCode() === 61) { return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id)); } else { return id; } } else if (type === 90) { this.resetPreviousNodeTrailingComments(id); return this.parseDo(this.startNodeAtNode(id), true); } } if (canBeArrow && this.match(19) && !this.canInsertSemicolon()) { this.next(); return this.parseArrowExpression(this.startNodeAtNode(id), [id], false); } return id; } else { this.unexpected(); } } } parseTopicReferenceThenEqualsSign(topicTokenType, topicTokenValue) { const pipeProposal = this.getPluginOption("pipelineOperator", "proposal"); if (pipeProposal) { this.state.type = topicTokenType; this.state.value = topicTokenValue; this.state.pos--; this.state.end--; this.state.endLoc = createPositionWithColumnOffset(this.state.endLoc, -1); return this.parseTopicReference(pipeProposal); } else { this.unexpected(); } } parseTopicReference(pipeProposal) { const node = this.startNode(); const startLoc = this.state.startLoc; const tokenType = this.state.type; this.next(); return this.finishTopicReference(node, startLoc, pipeProposal, tokenType); } finishTopicReference(node, startLoc, pipeProposal, tokenType) { if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) { const nodeType = pipeProposal === "smart" ? "PipelinePrimaryTopicReference" : "TopicReference"; if (!this.topicReferenceIsAllowedInCurrentContext()) { this.raise(pipeProposal === "smart" ? Errors.PrimaryTopicNotAllowed : Errors.PipeTopicUnbound, { at: startLoc }); } this.registerTopicReference(); return this.finishNode(node, nodeType); } else { throw this.raise(Errors.PipeTopicUnconfiguredToken, { at: startLoc, token: tokenLabelName(tokenType) }); } } testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType) { switch (pipeProposal) { case "hack": { return this.hasPlugin(["pipelineOperator", { topicToken: tokenLabelName(tokenType) }]); } case "smart": return tokenType === 27; default: throw this.raise(Errors.PipeTopicRequiresHackPipes, { at: startLoc }); } } parseAsyncArrowUnaryFunction(node) { this.prodParam.enter(functionFlags(true, this.prodParam.hasYield)); const params = [this.parseIdentifier()]; this.prodParam.exit(); if (this.hasPrecedingLineBreak()) { this.raise(Errors.LineTerminatorBeforeArrow, { at: this.state.curPosition() }); } this.expect(19); return this.parseArrowExpression(node, params, true); } parseDo(node, isAsync) { this.expectPlugin("doExpressions"); if (isAsync) { this.expectPlugin("asyncDoExpressions"); } node.async = isAsync; this.next(); const oldLabels = this.state.labels; this.state.labels = []; if (isAsync) { this.prodParam.enter(PARAM_AWAIT); node.body = this.parseBlock(); this.prodParam.exit(); } else { node.body = this.parseBlock(); } this.state.labels = oldLabels; return this.finishNode(node, "DoExpression"); } parseSuper() { const node = this.startNode(); this.next(); if (this.match(10) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) { this.raise(Errors.SuperNotAllowed, { at: node }); } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) { this.raise(Errors.UnexpectedSuper, { at: node }); } if (!this.match(10) && !this.match(0) && !this.match(16)) { this.raise(Errors.UnsupportedSuper, { at: node }); } return this.finishNode(node, "Super"); } parsePrivateName() { const node = this.startNode(); const id = this.startNodeAt(createPositionWithColumnOffset(this.state.startLoc, 1)); const name = this.state.value; this.next(); node.id = this.createIdentifier(id, name); return this.finishNode(node, "PrivateName"); } parseFunctionOrFunctionSent() { const node = this.startNode(); this.next(); if (this.prodParam.hasYield && this.match(16)) { const meta = this.createIdentifier(this.startNodeAtNode(node), "function"); this.next(); if (this.match(102)) { this.expectPlugin("functionSent"); } else if (!this.hasPlugin("functionSent")) { this.unexpected(); } return this.parseMetaProperty(node, meta, "sent"); } return this.parseFunction(node); } parseMetaProperty(node, meta, propertyName) { node.meta = meta; const containsEsc = this.state.containsEsc; node.property = this.parseIdentifier(true); if (node.property.name !== propertyName || containsEsc) { this.raise(Errors.UnsupportedMetaProperty, { at: node.property, target: meta.name, onlyValidPropertyName: propertyName }); } return this.finishNode(node, "MetaProperty"); } parseImportMetaProperty(node) { const id = this.createIdentifier(this.startNodeAtNode(node), "import"); this.next(); if (this.isContextual(100)) { if (!this.inModule) { this.raise(Errors.ImportMetaOutsideModule, { at: id }); } this.sawUnambiguousESM = true; } return this.parseMetaProperty(node, id, "meta"); } parseLiteralAtNode(value, type, node) { this.addExtra(node, "rawValue", value); this.addExtra(node, "raw", this.input.slice(node.start, this.state.end)); node.value = value; this.next(); return this.finishNode(node, type); } parseLiteral(value, type) { const node = this.startNode(); return this.parseLiteralAtNode(value, type, node); } parseStringLiteral(value) { return this.parseLiteral(value, "StringLiteral"); } parseNumericLiteral(value) { return this.parseLiteral(value, "NumericLiteral"); } parseBigIntLiteral(value) { return this.parseLiteral(value, "BigIntLiteral"); } parseDecimalLiteral(value) { return this.parseLiteral(value, "DecimalLiteral"); } parseRegExpLiteral(value) { const node = this.parseLiteral(value.value, "RegExpLiteral"); node.pattern = value.pattern; node.flags = value.flags; return node; } parseBooleanLiteral(value) { const node = this.startNode(); node.value = value; this.next(); return this.finishNode(node, "BooleanLiteral"); } parseNullLiteral() { const node = this.startNode(); this.next(); return this.finishNode(node, "NullLiteral"); } parseParenAndDistinguishExpression(canBeArrow) { const startLoc = this.state.startLoc; let val; this.next(); this.expressionScope.enter(newArrowHeadScope()); const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.maybeInArrowParameters = true; this.state.inFSharpPipelineDirectBody = false; const innerStartLoc = this.state.startLoc; const exprList = []; const refExpressionErrors = new ExpressionErrors(); let first = true; let spreadStartLoc; let optionalCommaStartLoc; while (!this.match(11)) { if (first) { first = false; } else { this.expect(12, refExpressionErrors.optionalParametersLoc === null ? null : refExpressionErrors.optionalParametersLoc); if (this.match(11)) { optionalCommaStartLoc = this.state.startLoc; break; } } if (this.match(21)) { const spreadNodeStartLoc = this.state.startLoc; spreadStartLoc = this.state.startLoc; exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartLoc)); if (!this.checkCommaAfterRest(41)) { break; } } else { exprList.push(this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem)); } } const innerEndLoc = this.state.lastTokEndLoc; this.expect(11); this.state.maybeInArrowParameters = oldMaybeInArrowParameters; this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; let arrowNode = this.startNodeAt(startLoc); if (canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) { this.checkDestructuringPrivate(refExpressionErrors); this.expressionScope.validateAsPattern(); this.expressionScope.exit(); this.parseArrowExpression(arrowNode, exprList, false); return arrowNode; } this.expressionScope.exit(); if (!exprList.length) { this.unexpected(this.state.lastTokStartLoc); } if (optionalCommaStartLoc) this.unexpected(optionalCommaStartLoc); if (spreadStartLoc) this.unexpected(spreadStartLoc); this.checkExpressionErrors(refExpressionErrors, true); this.toReferencedListDeep(exprList, true); if (exprList.length > 1) { val = this.startNodeAt(innerStartLoc); val.expressions = exprList; this.finishNode(val, "SequenceExpression"); this.resetEndLocation(val, innerEndLoc); } else { val = exprList[0]; } return this.wrapParenthesis(startLoc, val); } wrapParenthesis(startLoc, expression) { if (!this.options.createParenthesizedExpressions) { this.addExtra(expression, "parenthesized", true); this.addExtra(expression, "parenStart", startLoc.index); this.takeSurroundingComments(expression, startLoc.index, this.state.lastTokEndLoc.index); return expression; } const parenExpression = this.startNodeAt(startLoc); parenExpression.expression = expression; return this.finishNode(parenExpression, "ParenthesizedExpression"); } shouldParseArrow(params) { return !this.canInsertSemicolon(); } parseArrow(node) { if (this.eat(19)) { return node; } } parseParenItem(node, startLoc) { return node; } parseNewOrNewTarget() { const node = this.startNode(); this.next(); if (this.match(16)) { const meta = this.createIdentifier(this.startNodeAtNode(node), "new"); this.next(); const metaProp = this.parseMetaProperty(node, meta, "target"); if (!this.scope.inNonArrowFunction && !this.scope.inClass && !this.options.allowNewTargetOutsideFunction) { this.raise(Errors.UnexpectedNewTarget, { at: metaProp }); } return metaProp; } return this.parseNew(node); } parseNew(node) { this.parseNewCallee(node); if (this.eat(10)) { const args = this.parseExprList(11); this.toReferencedList(args); node.arguments = args; } else { node.arguments = []; } return this.finishNode(node, "NewExpression"); } parseNewCallee(node) { node.callee = this.parseNoCallExpr(); if (node.callee.type === "Import") { this.raise(Errors.ImportCallNotNewExpression, { at: node.callee }); } } parseTemplateElement(isTagged) { const { start, startLoc, end, value } = this.state; const elemStart = start + 1; const elem = this.startNodeAt(createPositionWithColumnOffset(startLoc, 1)); if (value === null) { if (!isTagged) { this.raise(Errors.InvalidEscapeSequenceTemplate, { at: createPositionWithColumnOffset(this.state.firstInvalidTemplateEscapePos, 1) }); } } const isTail = this.match(24); const endOffset = isTail ? -1 : -2; const elemEnd = end + endOffset; elem.value = { raw: this.input.slice(elemStart, elemEnd).replace(/\r\n?/g, "\n"), cooked: value === null ? null : value.slice(1, endOffset) }; elem.tail = isTail; this.next(); const finishedNode = this.finishNode(elem, "TemplateElement"); this.resetEndLocation(finishedNode, createPositionWithColumnOffset(this.state.lastTokEndLoc, endOffset)); return finishedNode; } parseTemplate(isTagged) { const node = this.startNode(); node.expressions = []; let curElt = this.parseTemplateElement(isTagged); node.quasis = [curElt]; while (!curElt.tail) { node.expressions.push(this.parseTemplateSubstitution()); this.readTemplateContinuation(); node.quasis.push(curElt = this.parseTemplateElement(isTagged)); } return this.finishNode(node, "TemplateLiteral"); } parseTemplateSubstitution() { return this.parseExpression(); } parseObjectLike(close, isPattern, isRecord, refExpressionErrors) { if (isRecord) { this.expectPlugin("recordAndTuple"); } const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.inFSharpPipelineDirectBody = false; const propHash = Object.create(null); let first = true; const node = this.startNode(); node.properties = []; this.next(); while (!this.match(close)) { if (first) { first = false; } else { this.expect(12); if (this.match(close)) { this.addTrailingCommaExtraToNode(node); break; } } let prop; if (isPattern) { prop = this.parseBindingProperty(); } else { prop = this.parsePropertyDefinition(refExpressionErrors); this.checkProto(prop, isRecord, propHash, refExpressionErrors); } if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") { this.raise(Errors.InvalidRecordProperty, { at: prop }); } if (prop.shorthand) { this.addExtra(prop, "shorthand", true); } node.properties.push(prop); } this.next(); this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; let type = "ObjectExpression"; if (isPattern) { type = "ObjectPattern"; } else if (isRecord) { type = "RecordExpression"; } return this.finishNode(node, type); } addTrailingCommaExtraToNode(node) { this.addExtra(node, "trailingComma", this.state.lastTokStart); this.addExtra(node, "trailingCommaLoc", this.state.lastTokStartLoc, false); } maybeAsyncOrAccessorProp(prop) { return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(0) || this.match(55)); } parsePropertyDefinition(refExpressionErrors) { let decorators = []; if (this.match(26)) { if (this.hasPlugin("decorators")) { this.raise(Errors.UnsupportedPropertyDecorator, { at: this.state.startLoc }); } while (this.match(26)) { decorators.push(this.parseDecorator()); } } const prop = this.startNode(); let isAsync = false; let isAccessor = false; let startLoc; if (this.match(21)) { if (decorators.length) this.unexpected(); return this.parseSpread(); } if (decorators.length) { prop.decorators = decorators; decorators = []; } prop.method = false; if (refExpressionErrors) { startLoc = this.state.startLoc; } let isGenerator = this.eat(55); this.parsePropertyNamePrefixOperator(prop); const containsEsc = this.state.containsEsc; const key = this.parsePropertyName(prop, refExpressionErrors); if (!isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) { const keyName = key.name; if (keyName === "async" && !this.hasPrecedingLineBreak()) { isAsync = true; this.resetPreviousNodeTrailingComments(key); isGenerator = this.eat(55); this.parsePropertyName(prop); } if (keyName === "get" || keyName === "set") { isAccessor = true; this.resetPreviousNodeTrailingComments(key); prop.kind = keyName; if (this.match(55)) { isGenerator = true; this.raise(Errors.AccessorIsGenerator, { at: this.state.curPosition(), kind: keyName }); this.next(); } this.parsePropertyName(prop); } } return this.parseObjPropValue(prop, startLoc, isGenerator, isAsync, false, isAccessor, refExpressionErrors); } getGetterSetterExpectedParamCount(method) { return method.kind === "get" ? 0 : 1; } getObjectOrClassMethodParams(method) { return method.params; } checkGetterSetterParams(method) { var _params; const paramCount = this.getGetterSetterExpectedParamCount(method); const params = this.getObjectOrClassMethodParams(method); if (params.length !== paramCount) { this.raise(method.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, { at: method }); } if (method.kind === "set" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === "RestElement") { this.raise(Errors.BadSetterRestParameter, { at: method }); } } parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { if (isAccessor) { const finishedProp = this.parseMethod(prop, isGenerator, false, false, false, "ObjectMethod"); this.checkGetterSetterParams(finishedProp); return finishedProp; } if (isAsync || isGenerator || this.match(10)) { if (isPattern) this.unexpected(); prop.kind = "method"; prop.method = true; return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod"); } } parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) { prop.shorthand = false; if (this.eat(14)) { prop.value = isPattern ? this.parseMaybeDefault(this.state.startLoc) : this.parseMaybeAssignAllowIn(refExpressionErrors); return this.finishNode(prop, "ObjectProperty"); } if (!prop.computed && prop.key.type === "Identifier") { this.checkReservedWord(prop.key.name, prop.key.loc.start, true, false); if (isPattern) { prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key)); } else if (this.match(29)) { const shorthandAssignLoc = this.state.startLoc; if (refExpressionErrors != null) { if (refExpressionErrors.shorthandAssignLoc === null) { refExpressionErrors.shorthandAssignLoc = shorthandAssignLoc; } } else { this.raise(Errors.InvalidCoverInitializedName, { at: shorthandAssignLoc }); } prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key)); } else { prop.value = cloneIdentifier(prop.key); } prop.shorthand = true; return this.finishNode(prop, "ObjectProperty"); } } parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) || this.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors); if (!node) this.unexpected(); return node; } parsePropertyName(prop, refExpressionErrors) { if (this.eat(0)) { prop.computed = true; prop.key = this.parseMaybeAssignAllowIn(); this.expect(3); } else { const { type, value } = this.state; let key; if (tokenIsKeywordOrIdentifier(type)) { key = this.parseIdentifier(true); } else { switch (type) { case 132: key = this.parseNumericLiteral(value); break; case 131: key = this.parseStringLiteral(value); break; case 133: key = this.parseBigIntLiteral(value); break; case 134: key = this.parseDecimalLiteral(value); break; case 136: { const privateKeyLoc = this.state.startLoc; if (refExpressionErrors != null) { if (refExpressionErrors.privateKeyLoc === null) { refExpressionErrors.privateKeyLoc = privateKeyLoc; } } else { this.raise(Errors.UnexpectedPrivateField, { at: privateKeyLoc }); } key = this.parsePrivateName(); break; } default: this.unexpected(); } } prop.key = key; if (type !== 136) { prop.computed = false; } } return prop.key; } initFunction(node, isAsync) { node.id = null; node.generator = false; node.async = isAsync; } parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { this.initFunction(node, isAsync); node.generator = isGenerator; this.scope.enter(SCOPE_FUNCTION | SCOPE_SUPER | (inClassScope ? SCOPE_CLASS : 0) | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); this.prodParam.enter(functionFlags(isAsync, node.generator)); this.parseFunctionParams(node, isConstructor); const finishedNode = this.parseFunctionBodyAndFinish(node, type, true); this.prodParam.exit(); this.scope.exit(); return finishedNode; } parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { if (isTuple) { this.expectPlugin("recordAndTuple"); } const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.inFSharpPipelineDirectBody = false; const node = this.startNode(); this.next(); node.elements = this.parseExprList(close, !isTuple, refExpressionErrors, node); this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; return this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression"); } parseArrowExpression(node, params, isAsync, trailingCommaLoc) { this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW); let flags = functionFlags(isAsync, false); if (!this.match(5) && this.prodParam.hasIn) { flags |= PARAM_IN; } this.prodParam.enter(flags); this.initFunction(node, isAsync); const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; if (params) { this.state.maybeInArrowParameters = true; this.setArrowFunctionParameters(node, params, trailingCommaLoc); } this.state.maybeInArrowParameters = false; this.parseFunctionBody(node, true); this.prodParam.exit(); this.scope.exit(); this.state.maybeInArrowParameters = oldMaybeInArrowParameters; return this.finishNode(node, "ArrowFunctionExpression"); } setArrowFunctionParameters(node, params, trailingCommaLoc) { this.toAssignableList(params, trailingCommaLoc, false); node.params = params; } parseFunctionBodyAndFinish(node, type, isMethod = false) { this.parseFunctionBody(node, false, isMethod); return this.finishNode(node, type); } parseFunctionBody(node, allowExpression, isMethod = false) { const isExpression = allowExpression && !this.match(5); this.expressionScope.enter(newExpressionScope()); if (isExpression) { node.body = this.parseMaybeAssign(); this.checkParams(node, false, allowExpression, false); } else { const oldStrict = this.state.strict; const oldLabels = this.state.labels; this.state.labels = []; this.prodParam.enter(this.prodParam.currentFlags() | PARAM_RETURN); node.body = this.parseBlock(true, false, hasStrictModeDirective => { const nonSimple = !this.isSimpleParamList(node.params); if (hasStrictModeDirective && nonSimple) { this.raise(Errors.IllegalLanguageModeDirective, { at: (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.loc.end : node }); } const strictModeChanged = !oldStrict && this.state.strict; this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged); if (this.state.strict && node.id) { this.checkIdentifier(node.id, BIND_OUTSIDE, strictModeChanged); } }); this.prodParam.exit(); this.state.labels = oldLabels; } this.expressionScope.exit(); } isSimpleParameter(node) { return node.type === "Identifier"; } isSimpleParamList(params) { for (let i = 0, len = params.length; i < len; i++) { if (!this.isSimpleParameter(params[i])) return false; } return true; } checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { const checkClashes = !allowDuplicates && new Set(); const formalParameters = { type: "FormalParameters" }; for (const param of node.params) { this.checkLVal(param, { in: formalParameters, binding: BIND_VAR, checkClashes, strictModeChanged }); } } parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) { const elts = []; let first = true; while (!this.eat(close)) { if (first) { first = false; } else { this.expect(12); if (this.match(close)) { if (nodeForExtra) { this.addTrailingCommaExtraToNode(nodeForExtra); } this.next(); break; } } elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors)); } return elts; } parseExprListItem(allowEmpty, refExpressionErrors, allowPlaceholder) { let elt; if (this.match(12)) { if (!allowEmpty) { this.raise(Errors.UnexpectedToken, { at: this.state.curPosition(), unexpected: "," }); } elt = null; } else if (this.match(21)) { const spreadNodeStartLoc = this.state.startLoc; elt = this.parseParenItem(this.parseSpread(refExpressionErrors), spreadNodeStartLoc); } else if (this.match(17)) { this.expectPlugin("partialApplication"); if (!allowPlaceholder) { this.raise(Errors.UnexpectedArgumentPlaceholder, { at: this.state.startLoc }); } const node = this.startNode(); this.next(); elt = this.finishNode(node, "ArgumentPlaceholder"); } else { elt = this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem); } return elt; } parseIdentifier(liberal) { const node = this.startNode(); const name = this.parseIdentifierName(liberal); return this.createIdentifier(node, name); } createIdentifier(node, name) { node.name = name; node.loc.identifierName = name; return this.finishNode(node, "Identifier"); } parseIdentifierName(liberal) { let name; const { startLoc, type } = this.state; if (tokenIsKeywordOrIdentifier(type)) { name = this.state.value; } else { this.unexpected(); } const tokenIsKeyword = tokenKeywordOrIdentifierIsKeyword(type); if (liberal) { if (tokenIsKeyword) { this.replaceToken(130); } } else { this.checkReservedWord(name, startLoc, tokenIsKeyword, false); } this.next(); return name; } checkReservedWord(word, startLoc, checkKeywords, isBinding) { if (word.length > 10) { return; } if (!canBeReservedWord(word)) { return; } if (checkKeywords && isKeyword(word)) { this.raise(Errors.UnexpectedKeyword, { at: startLoc, keyword: word }); return; } const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord; if (reservedTest(word, this.inModule)) { this.raise(Errors.UnexpectedReservedWord, { at: startLoc, reservedWord: word }); return; } else if (word === "yield") { if (this.prodParam.hasYield) { this.raise(Errors.YieldBindingIdentifier, { at: startLoc }); return; } } else if (word === "await") { if (this.prodParam.hasAwait) { this.raise(Errors.AwaitBindingIdentifier, { at: startLoc }); return; } if (this.scope.inStaticBlock) { this.raise(Errors.AwaitBindingIdentifierInStaticBlock, { at: startLoc }); return; } this.expressionScope.recordAsyncArrowParametersError({ at: startLoc }); } else if (word === "arguments") { if (this.scope.inClassAndNotInNonArrowFunction) { this.raise(Errors.ArgumentsInClass, { at: startLoc }); return; } } } isAwaitAllowed() { if (this.prodParam.hasAwait) return true; if (this.options.allowAwaitOutsideFunction && !this.scope.inFunction) { return true; } return false; } parseAwait(startLoc) { const node = this.startNodeAt(startLoc); this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, { at: node }); if (this.eat(55)) { this.raise(Errors.ObsoleteAwaitStar, { at: node }); } if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) { if (this.isAmbiguousAwait()) { this.ambiguousScriptDifferentAst = true; } else { this.sawUnambiguousESM = true; } } if (!this.state.soloAwait) { node.argument = this.parseMaybeUnary(null, true); } return this.finishNode(node, "AwaitExpression"); } isAmbiguousAwait() { if (this.hasPrecedingLineBreak()) return true; const { type } = this.state; return type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 101 && !this.state.containsEsc || type === 135 || type === 56 || this.hasPlugin("v8intrinsic") && type === 54; } parseYield() { const node = this.startNode(); this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, { at: node }); this.next(); let delegating = false; let argument = null; if (!this.hasPrecedingLineBreak()) { delegating = this.eat(55); switch (this.state.type) { case 13: case 137: case 8: case 11: case 3: case 9: case 14: case 12: if (!delegating) break; default: argument = this.parseMaybeAssign(); } } node.delegate = delegating; node.argument = argument; return this.finishNode(node, "YieldExpression"); } checkPipelineAtInfixOperator(left, leftStartLoc) { if (this.hasPlugin(["pipelineOperator", { proposal: "smart" }])) { if (left.type === "SequenceExpression") { this.raise(Errors.PipelineHeadSequenceExpression, { at: leftStartLoc }); } } } parseSmartPipelineBodyInStyle(childExpr, startLoc) { if (this.isSimpleReference(childExpr)) { const bodyNode = this.startNodeAt(startLoc); bodyNode.callee = childExpr; return this.finishNode(bodyNode, "PipelineBareFunction"); } else { const bodyNode = this.startNodeAt(startLoc); this.checkSmartPipeTopicBodyEarlyErrors(startLoc); bodyNode.expression = childExpr; return this.finishNode(bodyNode, "PipelineTopicExpression"); } } isSimpleReference(expression) { switch (expression.type) { case "MemberExpression": return !expression.computed && this.isSimpleReference(expression.object); case "Identifier": return true; default: return false; } } checkSmartPipeTopicBodyEarlyErrors(startLoc) { if (this.match(19)) { throw this.raise(Errors.PipelineBodyNoArrow, { at: this.state.startLoc }); } if (!this.topicReferenceWasUsedInCurrentContext()) { this.raise(Errors.PipelineTopicUnused, { at: startLoc }); } } withTopicBindingContext(callback) { const outerContextTopicState = this.state.topicContext; this.state.topicContext = { maxNumOfResolvableTopics: 1, maxTopicIndex: null }; try { return callback(); } finally { this.state.topicContext = outerContextTopicState; } } withSmartMixTopicForbiddingContext(callback) { if (this.hasPlugin(["pipelineOperator", { proposal: "smart" }])) { const outerContextTopicState = this.state.topicContext; this.state.topicContext = { maxNumOfResolvableTopics: 0, maxTopicIndex: null }; try { return callback(); } finally { this.state.topicContext = outerContextTopicState; } } else { return callback(); } } withSoloAwaitPermittingContext(callback) { const outerContextSoloAwaitState = this.state.soloAwait; this.state.soloAwait = true; try { return callback(); } finally { this.state.soloAwait = outerContextSoloAwaitState; } } allowInAnd(callback) { const flags = this.prodParam.currentFlags(); const prodParamToSet = PARAM_IN & ~flags; if (prodParamToSet) { this.prodParam.enter(flags | PARAM_IN); try { return callback(); } finally { this.prodParam.exit(); } } return callback(); } disallowInAnd(callback) { const flags = this.prodParam.currentFlags(); const prodParamToClear = PARAM_IN & flags; if (prodParamToClear) { this.prodParam.enter(flags & ~PARAM_IN); try { return callback(); } finally { this.prodParam.exit(); } } return callback(); } registerTopicReference() { this.state.topicContext.maxTopicIndex = 0; } topicReferenceIsAllowedInCurrentContext() { return this.state.topicContext.maxNumOfResolvableTopics >= 1; } topicReferenceWasUsedInCurrentContext() { return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0; } parseFSharpPipelineBody(prec) { const startLoc = this.state.startLoc; this.state.potentialArrowAt = this.state.start; const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.inFSharpPipelineDirectBody = true; const ret = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, prec); this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; return ret; } parseModuleExpression() { this.expectPlugin("moduleBlocks"); const node = this.startNode(); this.next(); if (!this.match(5)) { this.unexpected(null, 5); } const program = this.startNodeAt(this.state.endLoc); this.next(); const revertScopes = this.initializeScopes(true); this.enterInitialScopes(); try { node.body = this.parseProgram(program, 8, "module"); } finally { revertScopes(); } return this.finishNode(node, "ModuleExpression"); } parsePropertyNamePrefixOperator(prop) {} } const loopLabel = { kind: "loop" }, switchLabel = { kind: "switch" }; const loneSurrogate = /[\uD800-\uDFFF]/u; const keywordRelationalOperator = /in(?:stanceof)?/y; function babel7CompatTokens(tokens, input) { for (let i = 0; i < tokens.length; i++) { const token = tokens[i]; const { type } = token; if (typeof type === "number") { { if (type === 136) { const { loc, start, value, end } = token; const hashEndPos = start + 1; const hashEndLoc = createPositionWithColumnOffset(loc.start, 1); tokens.splice(i, 1, new Token({ type: getExportedToken(27), value: "#", start: start, end: hashEndPos, startLoc: loc.start, endLoc: hashEndLoc }), new Token({ type: getExportedToken(130), value: value, start: hashEndPos, end: end, startLoc: hashEndLoc, endLoc: loc.end })); i++; continue; } if (tokenIsTemplate(type)) { const { loc, start, value, end } = token; const backquoteEnd = start + 1; const backquoteEndLoc = createPositionWithColumnOffset(loc.start, 1); let startToken; if (input.charCodeAt(start) === 96) { startToken = new Token({ type: getExportedToken(22), value: "`", start: start, end: backquoteEnd, startLoc: loc.start, endLoc: backquoteEndLoc }); } else { startToken = new Token({ type: getExportedToken(8), value: "}", start: start, end: backquoteEnd, startLoc: loc.start, endLoc: backquoteEndLoc }); } let templateValue, templateElementEnd, templateElementEndLoc, endToken; if (type === 24) { templateElementEnd = end - 1; templateElementEndLoc = createPositionWithColumnOffset(loc.end, -1); templateValue = value === null ? null : value.slice(1, -1); endToken = new Token({ type: getExportedToken(22), value: "`", start: templateElementEnd, end: end, startLoc: templateElementEndLoc, endLoc: loc.end }); } else { templateElementEnd = end - 2; templateElementEndLoc = createPositionWithColumnOffset(loc.end, -2); templateValue = value === null ? null : value.slice(1, -2); endToken = new Token({ type: getExportedToken(23), value: "${", start: templateElementEnd, end: end, startLoc: templateElementEndLoc, endLoc: loc.end }); } tokens.splice(i, 1, startToken, new Token({ type: getExportedToken(20), value: templateValue, start: backquoteEnd, end: templateElementEnd, startLoc: backquoteEndLoc, endLoc: templateElementEndLoc }), endToken); i += 2; continue; } } token.type = getExportedToken(type); } } return tokens; } class StatementParser extends ExpressionParser { parseTopLevel(file, program) { file.program = this.parseProgram(program); file.comments = this.state.comments; if (this.options.tokens) { file.tokens = babel7CompatTokens(this.tokens, this.input); } return this.finishNode(file, "File"); } parseProgram(program, end = 137, sourceType = this.options.sourceType) { program.sourceType = sourceType; program.interpreter = this.parseInterpreterDirective(); this.parseBlockBody(program, true, true, end); if (this.inModule && !this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) { for (const [localName, at] of Array.from(this.scope.undefinedExports)) { this.raise(Errors.ModuleExportUndefined, { at, localName }); } } let finishedProgram; if (end === 137) { finishedProgram = this.finishNode(program, "Program"); } else { finishedProgram = this.finishNodeAt(program, "Program", createPositionWithColumnOffset(this.state.startLoc, -1)); } return finishedProgram; } stmtToDirective(stmt) { const directive = stmt; directive.type = "Directive"; directive.value = directive.expression; delete directive.expression; const directiveLiteral = directive.value; const expressionValue = directiveLiteral.value; const raw = this.input.slice(directiveLiteral.start, directiveLiteral.end); const val = directiveLiteral.value = raw.slice(1, -1); this.addExtra(directiveLiteral, "raw", raw); this.addExtra(directiveLiteral, "rawValue", val); this.addExtra(directiveLiteral, "expressionValue", expressionValue); directiveLiteral.type = "DirectiveLiteral"; return directive; } parseInterpreterDirective() { if (!this.match(28)) { return null; } const node = this.startNode(); node.value = this.state.value; this.next(); return this.finishNode(node, "InterpreterDirective"); } isLet() { if (!this.isContextual(99)) { return false; } return this.hasFollowingBindingAtom(); } chStartsBindingIdentifier(ch, pos) { if (isIdentifierStart(ch)) { keywordRelationalOperator.lastIndex = pos; if (keywordRelationalOperator.test(this.input)) { const endCh = this.codePointAtPos(keywordRelationalOperator.lastIndex); if (!isIdentifierChar(endCh) && endCh !== 92) { return false; } } return true; } else if (ch === 92) { return true; } else { return false; } } chStartsBindingPattern(ch) { return ch === 91 || ch === 123; } hasFollowingBindingAtom() { const next = this.nextTokenStart(); const nextCh = this.codePointAtPos(next); return this.chStartsBindingPattern(nextCh) || this.chStartsBindingIdentifier(nextCh, next); } hasInLineFollowingBindingIdentifier() { const next = this.nextTokenInLineStart(); const nextCh = this.codePointAtPos(next); return this.chStartsBindingIdentifier(nextCh, next); } startsUsingForOf() { const { type, containsEsc } = this.lookahead(); if (type === 101 && !containsEsc) { return false; } else if (tokenIsIdentifier(type) && !this.hasFollowingLineBreak()) { this.expectPlugin("explicitResourceManagement"); return true; } } startsAwaitUsing() { let next = this.nextTokenInLineStart(); if (this.isUnparsedContextual(next, "using")) { next = this.nextTokenInLineStartSince(next + 5); const nextCh = this.codePointAtPos(next); if (this.chStartsBindingIdentifier(nextCh, next)) { this.expectPlugin("explicitResourceManagement"); return true; } } return false; } parseModuleItem() { return this.parseStatementLike(1 | 2 | 4 | 8); } parseStatementListItem() { return this.parseStatementLike(2 | 4 | (!this.options.annexB || this.state.strict ? 0 : 8)); } parseStatementOrSloppyAnnexBFunctionDeclaration(allowLabeledFunction = false) { let flags = 0; if (this.options.annexB && !this.state.strict) { flags |= 4; if (allowLabeledFunction) { flags |= 8; } } return this.parseStatementLike(flags); } parseStatement() { return this.parseStatementLike(0); } parseStatementLike(flags) { let decorators = null; if (this.match(26)) { decorators = this.parseDecorators(true); } return this.parseStatementContent(flags, decorators); } parseStatementContent(flags, decorators) { const starttype = this.state.type; const node = this.startNode(); const allowDeclaration = !!(flags & 2); const allowFunctionDeclaration = !!(flags & 4); const topLevel = flags & 1; switch (starttype) { case 60: return this.parseBreakContinueStatement(node, true); case 63: return this.parseBreakContinueStatement(node, false); case 64: return this.parseDebuggerStatement(node); case 90: return this.parseDoWhileStatement(node); case 91: return this.parseForStatement(node); case 68: if (this.lookaheadCharCode() === 46) break; if (!allowFunctionDeclaration) { this.raise(this.state.strict ? Errors.StrictFunction : this.options.annexB ? Errors.SloppyFunctionAnnexB : Errors.SloppyFunction, { at: this.state.startLoc }); } return this.parseFunctionStatement(node, false, !allowDeclaration && allowFunctionDeclaration); case 80: if (!allowDeclaration) this.unexpected(); return this.parseClass(this.maybeTakeDecorators(decorators, node), true); case 69: return this.parseIfStatement(node); case 70: return this.parseReturnStatement(node); case 71: return this.parseSwitchStatement(node); case 72: return this.parseThrowStatement(node); case 73: return this.parseTryStatement(node); case 96: if (!this.state.containsEsc && this.startsAwaitUsing()) { if (!this.isAwaitAllowed()) { this.raise(Errors.AwaitUsingNotInAsyncContext, { at: node }); } else if (!allowDeclaration) { this.raise(Errors.UnexpectedLexicalDeclaration, { at: node }); } this.next(); return this.parseVarStatement(node, "await using"); } break; case 105: if (this.state.containsEsc || !this.hasInLineFollowingBindingIdentifier()) { break; } this.expectPlugin("explicitResourceManagement"); if (!this.scope.inModule && this.scope.inTopLevel) { this.raise(Errors.UnexpectedUsingDeclaration, { at: this.state.startLoc }); } else if (!allowDeclaration) { this.raise(Errors.UnexpectedLexicalDeclaration, { at: this.state.startLoc }); } return this.parseVarStatement(node, "using"); case 99: { if (this.state.containsEsc) { break; } const next = this.nextTokenStart(); const nextCh = this.codePointAtPos(next); if (nextCh !== 91) { if (!allowDeclaration && this.hasFollowingLineBreak()) break; if (!this.chStartsBindingIdentifier(nextCh, next) && nextCh !== 123) { break; } } } case 75: { if (!allowDeclaration) { this.raise(Errors.UnexpectedLexicalDeclaration, { at: this.state.startLoc }); } } case 74: { const kind = this.state.value; return this.parseVarStatement(node, kind); } case 92: return this.parseWhileStatement(node); case 76: return this.parseWithStatement(node); case 5: return this.parseBlock(); case 13: return this.parseEmptyStatement(node); case 83: { const nextTokenCharCode = this.lookaheadCharCode(); if (nextTokenCharCode === 40 || nextTokenCharCode === 46) { break; } } case 82: { if (!this.options.allowImportExportEverywhere && !topLevel) { this.raise(Errors.UnexpectedImportExport, { at: this.state.startLoc }); } this.next(); let result; if (starttype === 83) { result = this.parseImport(node); if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) { this.sawUnambiguousESM = true; } } else { result = this.parseExport(node, decorators); if (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") { this.sawUnambiguousESM = true; } } this.assertModuleNodeAllowed(result); return result; } default: { if (this.isAsyncFunction()) { if (!allowDeclaration) { this.raise(Errors.AsyncFunctionInSingleStatementContext, { at: this.state.startLoc }); } this.next(); return this.parseFunctionStatement(node, true, !allowDeclaration && allowFunctionDeclaration); } } } const maybeName = this.state.value; const expr = this.parseExpression(); if (tokenIsIdentifier(starttype) && expr.type === "Identifier" && this.eat(14)) { return this.parseLabeledStatement(node, maybeName, expr, flags); } else { return this.parseExpressionStatement(node, expr, decorators); } } assertModuleNodeAllowed(node) { if (!this.options.allowImportExportEverywhere && !this.inModule) { this.raise(Errors.ImportOutsideModule, { at: node }); } } decoratorsEnabledBeforeExport() { if (this.hasPlugin("decorators-legacy")) return true; return this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") !== false; } maybeTakeDecorators(maybeDecorators, classNode, exportNode) { if (maybeDecorators) { if (classNode.decorators && classNode.decorators.length > 0) { if (typeof this.getPluginOption("decorators", "decoratorsBeforeExport") !== "boolean") { this.raise(Errors.DecoratorsBeforeAfterExport, { at: classNode.decorators[0] }); } classNode.decorators.unshift(...maybeDecorators); } else { classNode.decorators = maybeDecorators; } this.resetStartLocationFromNode(classNode, maybeDecorators[0]); if (exportNode) this.resetStartLocationFromNode(exportNode, classNode); } return classNode; } canHaveLeadingDecorator() { return this.match(80); } parseDecorators(allowExport) { const decorators = []; do { decorators.push(this.parseDecorator()); } while (this.match(26)); if (this.match(82)) { if (!allowExport) { this.unexpected(); } if (!this.decoratorsEnabledBeforeExport()) { this.raise(Errors.DecoratorExportClass, { at: this.state.startLoc }); } } else if (!this.canHaveLeadingDecorator()) { throw this.raise(Errors.UnexpectedLeadingDecorator, { at: this.state.startLoc }); } return decorators; } parseDecorator() { this.expectOnePlugin(["decorators", "decorators-legacy"]); const node = this.startNode(); this.next(); if (this.hasPlugin("decorators")) { const startLoc = this.state.startLoc; let expr; if (this.match(10)) { const startLoc = this.state.startLoc; this.next(); expr = this.parseExpression(); this.expect(11); expr = this.wrapParenthesis(startLoc, expr); const paramsStartLoc = this.state.startLoc; node.expression = this.parseMaybeDecoratorArguments(expr); if (this.getPluginOption("decorators", "allowCallParenthesized") === false && node.expression !== expr) { this.raise(Errors.DecoratorArgumentsOutsideParentheses, { at: paramsStartLoc }); } } else { expr = this.parseIdentifier(false); while (this.eat(16)) { const node = this.startNodeAt(startLoc); node.object = expr; if (this.match(136)) { this.classScope.usePrivateName(this.state.value, this.state.startLoc); node.property = this.parsePrivateName(); } else { node.property = this.parseIdentifier(true); } node.computed = false; expr = this.finishNode(node, "MemberExpression"); } node.expression = this.parseMaybeDecoratorArguments(expr); } } else { node.expression = this.parseExprSubscripts(); } return this.finishNode(node, "Decorator"); } parseMaybeDecoratorArguments(expr) { if (this.eat(10)) { const node = this.startNodeAtNode(expr); node.callee = expr; node.arguments = this.parseCallExpressionArguments(11, false); this.toReferencedList(node.arguments); return this.finishNode(node, "CallExpression"); } return expr; } parseBreakContinueStatement(node, isBreak) { this.next(); if (this.isLineTerminator()) { node.label = null; } else { node.label = this.parseIdentifier(); this.semicolon(); } this.verifyBreakContinue(node, isBreak); return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); } verifyBreakContinue(node, isBreak) { let i; for (i = 0; i < this.state.labels.length; ++i) { const lab = this.state.labels[i]; if (node.label == null || lab.name === node.label.name) { if (lab.kind != null && (isBreak || lab.kind === "loop")) break; if (node.label && isBreak) break; } } if (i === this.state.labels.length) { const type = isBreak ? "BreakStatement" : "ContinueStatement"; this.raise(Errors.IllegalBreakContinue, { at: node, type }); } } parseDebuggerStatement(node) { this.next(); this.semicolon(); return this.finishNode(node, "DebuggerStatement"); } parseHeaderExpression() { this.expect(10); const val = this.parseExpression(); this.expect(11); return val; } parseDoWhileStatement(node) { this.next(); this.state.labels.push(loopLabel); node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); this.state.labels.pop(); this.expect(92); node.test = this.parseHeaderExpression(); this.eat(13); return this.finishNode(node, "DoWhileStatement"); } parseForStatement(node) { this.next(); this.state.labels.push(loopLabel); let awaitAt = null; if (this.isAwaitAllowed() && this.eatContextual(96)) { awaitAt = this.state.lastTokStartLoc; } this.scope.enter(SCOPE_OTHER); this.expect(10); if (this.match(13)) { if (awaitAt !== null) { this.unexpected(awaitAt); } return this.parseFor(node, null); } const startsWithLet = this.isContextual(99); { const startsWithAwaitUsing = this.isContextual(96) && this.startsAwaitUsing(); const starsWithUsingDeclaration = startsWithAwaitUsing || this.isContextual(105) && this.startsUsingForOf(); const isLetOrUsing = startsWithLet && this.hasFollowingBindingAtom() || starsWithUsingDeclaration; if (this.match(74) || this.match(75) || isLetOrUsing) { const initNode = this.startNode(); let kind; if (startsWithAwaitUsing) { kind = "await using"; if (!this.isAwaitAllowed()) { this.raise(Errors.AwaitUsingNotInAsyncContext, { at: this.state.startLoc }); } this.next(); } else { kind = this.state.value; } this.next(); this.parseVar(initNode, true, kind); const init = this.finishNode(initNode, "VariableDeclaration"); const isForIn = this.match(58); if (isForIn && starsWithUsingDeclaration) { this.raise(Errors.ForInUsing, { at: init }); } if ((isForIn || this.isContextual(101)) && init.declarations.length === 1) { return this.parseForIn(node, init, awaitAt); } if (awaitAt !== null) { this.unexpected(awaitAt); } return this.parseFor(node, init); } } const startsWithAsync = this.isContextual(95); const refExpressionErrors = new ExpressionErrors(); const init = this.parseExpression(true, refExpressionErrors); const isForOf = this.isContextual(101); if (isForOf) { if (startsWithLet) { this.raise(Errors.ForOfLet, { at: init }); } if (awaitAt === null && startsWithAsync && init.type === "Identifier") { this.raise(Errors.ForOfAsync, { at: init }); } } if (isForOf || this.match(58)) { this.checkDestructuringPrivate(refExpressionErrors); this.toAssignable(init, true); const type = isForOf ? "ForOfStatement" : "ForInStatement"; this.checkLVal(init, { in: { type } }); return this.parseForIn(node, init, awaitAt); } else { this.checkExpressionErrors(refExpressionErrors, true); } if (awaitAt !== null) { this.unexpected(awaitAt); } return this.parseFor(node, init); } parseFunctionStatement(node, isAsync, isHangingDeclaration) { this.next(); return this.parseFunction(node, 1 | (isHangingDeclaration ? 2 : 0) | (isAsync ? 8 : 0)); } parseIfStatement(node) { this.next(); node.test = this.parseHeaderExpression(); node.consequent = this.parseStatementOrSloppyAnnexBFunctionDeclaration(); node.alternate = this.eat(66) ? this.parseStatementOrSloppyAnnexBFunctionDeclaration() : null; return this.finishNode(node, "IfStatement"); } parseReturnStatement(node) { if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) { this.raise(Errors.IllegalReturn, { at: this.state.startLoc }); } this.next(); if (this.isLineTerminator()) { node.argument = null; } else { node.argument = this.parseExpression(); this.semicolon(); } return this.finishNode(node, "ReturnStatement"); } parseSwitchStatement(node) { this.next(); node.discriminant = this.parseHeaderExpression(); const cases = node.cases = []; this.expect(5); this.state.labels.push(switchLabel); this.scope.enter(SCOPE_OTHER); let cur; for (let sawDefault; !this.match(8);) { if (this.match(61) || this.match(65)) { const isCase = this.match(61); if (cur) this.finishNode(cur, "SwitchCase"); cases.push(cur = this.startNode()); cur.consequent = []; this.next(); if (isCase) { cur.test = this.parseExpression(); } else { if (sawDefault) { this.raise(Errors.MultipleDefaultsInSwitch, { at: this.state.lastTokStartLoc }); } sawDefault = true; cur.test = null; } this.expect(14); } else { if (cur) { cur.consequent.push(this.parseStatementListItem()); } else { this.unexpected(); } } } this.scope.exit(); if (cur) this.finishNode(cur, "SwitchCase"); this.next(); this.state.labels.pop(); return this.finishNode(node, "SwitchStatement"); } parseThrowStatement(node) { this.next(); if (this.hasPrecedingLineBreak()) { this.raise(Errors.NewlineAfterThrow, { at: this.state.lastTokEndLoc }); } node.argument = this.parseExpression(); this.semicolon(); return this.finishNode(node, "ThrowStatement"); } parseCatchClauseParam() { const param = this.parseBindingAtom(); this.scope.enter(this.options.annexB && param.type === "Identifier" ? SCOPE_SIMPLE_CATCH : 0); this.checkLVal(param, { in: { type: "CatchClause" }, binding: BIND_CATCH_PARAM }); return param; } parseTryStatement(node) { this.next(); node.block = this.parseBlock(); node.handler = null; if (this.match(62)) { const clause = this.startNode(); this.next(); if (this.match(10)) { this.expect(10); clause.param = this.parseCatchClauseParam(); this.expect(11); } else { clause.param = null; this.scope.enter(SCOPE_OTHER); } clause.body = this.withSmartMixTopicForbiddingContext(() => this.parseBlock(false, false)); this.scope.exit(); node.handler = this.finishNode(clause, "CatchClause"); } node.finalizer = this.eat(67) ? this.parseBlock() : null; if (!node.handler && !node.finalizer) { this.raise(Errors.NoCatchOrFinally, { at: node }); } return this.finishNode(node, "TryStatement"); } parseVarStatement(node, kind, allowMissingInitializer = false) { this.next(); this.parseVar(node, false, kind, allowMissingInitializer); this.semicolon(); return this.finishNode(node, "VariableDeclaration"); } parseWhileStatement(node) { this.next(); node.test = this.parseHeaderExpression(); this.state.labels.push(loopLabel); node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); this.state.labels.pop(); return this.finishNode(node, "WhileStatement"); } parseWithStatement(node) { if (this.state.strict) { this.raise(Errors.StrictWith, { at: this.state.startLoc }); } this.next(); node.object = this.parseHeaderExpression(); node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); return this.finishNode(node, "WithStatement"); } parseEmptyStatement(node) { this.next(); return this.finishNode(node, "EmptyStatement"); } parseLabeledStatement(node, maybeName, expr, flags) { for (const label of this.state.labels) { if (label.name === maybeName) { this.raise(Errors.LabelRedeclaration, { at: expr, labelName: maybeName }); } } const kind = tokenIsLoop(this.state.type) ? "loop" : this.match(71) ? "switch" : null; for (let i = this.state.labels.length - 1; i >= 0; i--) { const label = this.state.labels[i]; if (label.statementStart === node.start) { label.statementStart = this.state.start; label.kind = kind; } else { break; } } this.state.labels.push({ name: maybeName, kind: kind, statementStart: this.state.start }); node.body = flags & 8 ? this.parseStatementOrSloppyAnnexBFunctionDeclaration(true) : this.parseStatement(); this.state.labels.pop(); node.label = expr; return this.finishNode(node, "LabeledStatement"); } parseExpressionStatement(node, expr, decorators) { node.expression = expr; this.semicolon(); return this.finishNode(node, "ExpressionStatement"); } parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) { const node = this.startNode(); if (allowDirectives) { this.state.strictErrors.clear(); } this.expect(5); if (createNewLexicalScope) { this.scope.enter(SCOPE_OTHER); } this.parseBlockBody(node, allowDirectives, false, 8, afterBlockParse); if (createNewLexicalScope) { this.scope.exit(); } return this.finishNode(node, "BlockStatement"); } isValidDirective(stmt) { return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized; } parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) { const body = node.body = []; const directives = node.directives = []; this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse); } parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) { const oldStrict = this.state.strict; let hasStrictModeDirective = false; let parsedNonDirective = false; while (!this.match(end)) { const stmt = topLevel ? this.parseModuleItem() : this.parseStatementListItem(); if (directives && !parsedNonDirective) { if (this.isValidDirective(stmt)) { const directive = this.stmtToDirective(stmt); directives.push(directive); if (!hasStrictModeDirective && directive.value.value === "use strict") { hasStrictModeDirective = true; this.setStrict(true); } continue; } parsedNonDirective = true; this.state.strictErrors.clear(); } body.push(stmt); } if (afterBlockParse) { afterBlockParse.call(this, hasStrictModeDirective); } if (!oldStrict) { this.setStrict(false); } this.next(); } parseFor(node, init) { node.init = init; this.semicolon(false); node.test = this.match(13) ? null : this.parseExpression(); this.semicolon(false); node.update = this.match(11) ? null : this.parseExpression(); this.expect(11); node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); this.scope.exit(); this.state.labels.pop(); return this.finishNode(node, "ForStatement"); } parseForIn(node, init, awaitAt) { const isForIn = this.match(58); this.next(); if (isForIn) { if (awaitAt !== null) this.unexpected(awaitAt); } else { node.await = awaitAt !== null; } if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || !this.options.annexB || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) { this.raise(Errors.ForInOfLoopInitializer, { at: init, type: isForIn ? "ForInStatement" : "ForOfStatement" }); } if (init.type === "AssignmentPattern") { this.raise(Errors.InvalidLhs, { at: init, ancestor: { type: "ForStatement" } }); } node.left = init; node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn(); this.expect(11); node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); this.scope.exit(); this.state.labels.pop(); return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement"); } parseVar(node, isFor, kind, allowMissingInitializer = false) { const declarations = node.declarations = []; node.kind = kind; for (;;) { const decl = this.startNode(); this.parseVarId(decl, kind); decl.init = !this.eat(29) ? null : isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn(); if (decl.init === null && !allowMissingInitializer) { if (decl.id.type !== "Identifier" && !(isFor && (this.match(58) || this.isContextual(101)))) { this.raise(Errors.DeclarationMissingInitializer, { at: this.state.lastTokEndLoc, kind: "destructuring" }); } else if (kind === "const" && !(this.match(58) || this.isContextual(101))) { this.raise(Errors.DeclarationMissingInitializer, { at: this.state.lastTokEndLoc, kind: "const" }); } } declarations.push(this.finishNode(decl, "VariableDeclarator")); if (!this.eat(12)) break; } return node; } parseVarId(decl, kind) { const id = this.parseBindingAtom(); this.checkLVal(id, { in: { type: "VariableDeclarator" }, binding: kind === "var" ? BIND_VAR : BIND_LEXICAL }); decl.id = id; } parseAsyncFunctionExpression(node) { return this.parseFunction(node, 8); } parseFunction(node, flags = 0) { const hangingDeclaration = flags & 2; const isDeclaration = !!(flags & 1); const requireId = isDeclaration && !(flags & 4); const isAsync = !!(flags & 8); this.initFunction(node, isAsync); if (this.match(55)) { if (hangingDeclaration) { this.raise(Errors.GeneratorInSingleStatementContext, { at: this.state.startLoc }); } this.next(); node.generator = true; } if (isDeclaration) { node.id = this.parseFunctionId(requireId); } const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; this.state.maybeInArrowParameters = false; this.scope.enter(SCOPE_FUNCTION); this.prodParam.enter(functionFlags(isAsync, node.generator)); if (!isDeclaration) { node.id = this.parseFunctionId(); } this.parseFunctionParams(node, false); this.withSmartMixTopicForbiddingContext(() => { this.parseFunctionBodyAndFinish(node, isDeclaration ? "FunctionDeclaration" : "FunctionExpression"); }); this.prodParam.exit(); this.scope.exit(); if (isDeclaration && !hangingDeclaration) { this.registerFunctionStatementId(node); } this.state.maybeInArrowParameters = oldMaybeInArrowParameters; return node; } parseFunctionId(requireId) { return requireId || tokenIsIdentifier(this.state.type) ? this.parseIdentifier() : null; } parseFunctionParams(node, isConstructor) { this.expect(10); this.expressionScope.enter(newParameterDeclarationScope()); node.params = this.parseBindingList(11, 41, 2 | (isConstructor ? 4 : 0)); this.expressionScope.exit(); } registerFunctionStatementId(node) { if (!node.id) return; this.scope.declareName(node.id.name, !this.options.annexB || this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION, node.id.loc.start); } parseClass(node, isStatement, optionalId) { this.next(); const oldStrict = this.state.strict; this.state.strict = true; this.parseClassId(node, isStatement, optionalId); this.parseClassSuper(node); node.body = this.parseClassBody(!!node.superClass, oldStrict); return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); } isClassProperty() { return this.match(29) || this.match(13) || this.match(8); } isClassMethod() { return this.match(10); } isNonstaticConstructor(method) { return !method.computed && !method.static && (method.key.name === "constructor" || method.key.value === "constructor"); } parseClassBody(hadSuperClass, oldStrict) { this.classScope.enter(); const state = { hadConstructor: false, hadSuperClass }; let decorators = []; const classBody = this.startNode(); classBody.body = []; this.expect(5); this.withSmartMixTopicForbiddingContext(() => { while (!this.match(8)) { if (this.eat(13)) { if (decorators.length > 0) { throw this.raise(Errors.DecoratorSemicolon, { at: this.state.lastTokEndLoc }); } continue; } if (this.match(26)) { decorators.push(this.parseDecorator()); continue; } const member = this.startNode(); if (decorators.length) { member.decorators = decorators; this.resetStartLocationFromNode(member, decorators[0]); decorators = []; } this.parseClassMember(classBody, member, state); if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) { this.raise(Errors.DecoratorConstructor, { at: member }); } } }); this.state.strict = oldStrict; this.next(); if (decorators.length) { throw this.raise(Errors.TrailingDecorator, { at: this.state.startLoc }); } this.classScope.exit(); return this.finishNode(classBody, "ClassBody"); } parseClassMemberFromModifier(classBody, member) { const key = this.parseIdentifier(true); if (this.isClassMethod()) { const method = member; method.kind = "method"; method.computed = false; method.key = key; method.static = false; this.pushClassMethod(classBody, method, false, false, false, false); return true; } else if (this.isClassProperty()) { const prop = member; prop.computed = false; prop.key = key; prop.static = false; classBody.body.push(this.parseClassProperty(prop)); return true; } this.resetPreviousNodeTrailingComments(key); return false; } parseClassMember(classBody, member, state) { const isStatic = this.isContextual(104); if (isStatic) { if (this.parseClassMemberFromModifier(classBody, member)) { return; } if (this.eat(5)) { this.parseClassStaticBlock(classBody, member); return; } } this.parseClassMemberWithIsStatic(classBody, member, state, isStatic); } parseClassMemberWithIsStatic(classBody, member, state, isStatic) { const publicMethod = member; const privateMethod = member; const publicProp = member; const privateProp = member; const accessorProp = member; const method = publicMethod; const publicMember = publicMethod; member.static = isStatic; this.parsePropertyNamePrefixOperator(member); if (this.eat(55)) { method.kind = "method"; const isPrivateName = this.match(136); this.parseClassElementName(method); if (isPrivateName) { this.pushClassPrivateMethod(classBody, privateMethod, true, false); return; } if (this.isNonstaticConstructor(publicMethod)) { this.raise(Errors.ConstructorIsGenerator, { at: publicMethod.key }); } this.pushClassMethod(classBody, publicMethod, true, false, false, false); return; } const isContextual = tokenIsIdentifier(this.state.type) && !this.state.containsEsc; const isPrivate = this.match(136); const key = this.parseClassElementName(member); const maybeQuestionTokenStartLoc = this.state.startLoc; this.parsePostMemberNameModifiers(publicMember); if (this.isClassMethod()) { method.kind = "method"; if (isPrivate) { this.pushClassPrivateMethod(classBody, privateMethod, false, false); return; } const isConstructor = this.isNonstaticConstructor(publicMethod); let allowsDirectSuper = false; if (isConstructor) { publicMethod.kind = "constructor"; if (state.hadConstructor && !this.hasPlugin("typescript")) { this.raise(Errors.DuplicateConstructor, { at: key }); } if (isConstructor && this.hasPlugin("typescript") && member.override) { this.raise(Errors.OverrideOnConstructor, { at: key }); } state.hadConstructor = true; allowsDirectSuper = state.hadSuperClass; } this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper); } else if (this.isClassProperty()) { if (isPrivate) { this.pushClassPrivateProperty(classBody, privateProp); } else { this.pushClassProperty(classBody, publicProp); } } else if (isContextual && key.name === "async" && !this.isLineTerminator()) { this.resetPreviousNodeTrailingComments(key); const isGenerator = this.eat(55); if (publicMember.optional) { this.unexpected(maybeQuestionTokenStartLoc); } method.kind = "method"; const isPrivate = this.match(136); this.parseClassElementName(method); this.parsePostMemberNameModifiers(publicMember); if (isPrivate) { this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true); } else { if (this.isNonstaticConstructor(publicMethod)) { this.raise(Errors.ConstructorIsAsync, { at: publicMethod.key }); } this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false); } } else if (isContextual && (key.name === "get" || key.name === "set") && !(this.match(55) && this.isLineTerminator())) { this.resetPreviousNodeTrailingComments(key); method.kind = key.name; const isPrivate = this.match(136); this.parseClassElementName(publicMethod); if (isPrivate) { this.pushClassPrivateMethod(classBody, privateMethod, false, false); } else { if (this.isNonstaticConstructor(publicMethod)) { this.raise(Errors.ConstructorIsAccessor, { at: publicMethod.key }); } this.pushClassMethod(classBody, publicMethod, false, false, false, false); } this.checkGetterSetterParams(publicMethod); } else if (isContextual && key.name === "accessor" && !this.isLineTerminator()) { this.expectPlugin("decoratorAutoAccessors"); this.resetPreviousNodeTrailingComments(key); const isPrivate = this.match(136); this.parseClassElementName(publicProp); this.pushClassAccessorProperty(classBody, accessorProp, isPrivate); } else if (this.isLineTerminator()) { if (isPrivate) { this.pushClassPrivateProperty(classBody, privateProp); } else { this.pushClassProperty(classBody, publicProp); } } else { this.unexpected(); } } parseClassElementName(member) { const { type, value } = this.state; if ((type === 130 || type === 131) && member.static && value === "prototype") { this.raise(Errors.StaticPrototype, { at: this.state.startLoc }); } if (type === 136) { if (value === "constructor") { this.raise(Errors.ConstructorClassPrivateField, { at: this.state.startLoc }); } const key = this.parsePrivateName(); member.key = key; return key; } return this.parsePropertyName(member); } parseClassStaticBlock(classBody, member) { var _member$decorators; this.scope.enter(SCOPE_CLASS | SCOPE_STATIC_BLOCK | SCOPE_SUPER); const oldLabels = this.state.labels; this.state.labels = []; this.prodParam.enter(PARAM); const body = member.body = []; this.parseBlockOrModuleBlockBody(body, undefined, false, 8); this.prodParam.exit(); this.scope.exit(); this.state.labels = oldLabels; classBody.body.push(this.finishNode(member, "StaticBlock")); if ((_member$decorators = member.decorators) != null && _member$decorators.length) { this.raise(Errors.DecoratorStaticBlock, { at: member }); } } pushClassProperty(classBody, prop) { if (!prop.computed && (prop.key.name === "constructor" || prop.key.value === "constructor")) { this.raise(Errors.ConstructorClassField, { at: prop.key }); } classBody.body.push(this.parseClassProperty(prop)); } pushClassPrivateProperty(classBody, prop) { const node = this.parseClassPrivateProperty(prop); classBody.body.push(node); this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.loc.start); } pushClassAccessorProperty(classBody, prop, isPrivate) { if (!isPrivate && !prop.computed) { const key = prop.key; if (key.name === "constructor" || key.value === "constructor") { this.raise(Errors.ConstructorClassField, { at: key }); } } const node = this.parseClassAccessorProperty(prop); classBody.body.push(node); if (isPrivate) { this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.loc.start); } } pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true)); } pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true); classBody.body.push(node); const kind = node.kind === "get" ? node.static ? CLASS_ELEMENT_STATIC_GETTER : CLASS_ELEMENT_INSTANCE_GETTER : node.kind === "set" ? node.static ? CLASS_ELEMENT_STATIC_SETTER : CLASS_ELEMENT_INSTANCE_SETTER : CLASS_ELEMENT_OTHER; this.declareClassPrivateMethodInScope(node, kind); } declareClassPrivateMethodInScope(node, kind) { this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.loc.start); } parsePostMemberNameModifiers(methodOrProp) {} parseClassPrivateProperty(node) { this.parseInitializer(node); this.semicolon(); return this.finishNode(node, "ClassPrivateProperty"); } parseClassProperty(node) { this.parseInitializer(node); this.semicolon(); return this.finishNode(node, "ClassProperty"); } parseClassAccessorProperty(node) { this.parseInitializer(node); this.semicolon(); return this.finishNode(node, "ClassAccessorProperty"); } parseInitializer(node) { this.scope.enter(SCOPE_CLASS | SCOPE_SUPER); this.expressionScope.enter(newExpressionScope()); this.prodParam.enter(PARAM); node.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null; this.expressionScope.exit(); this.prodParam.exit(); this.scope.exit(); } parseClassId(node, isStatement, optionalId, bindingType = BIND_CLASS) { if (tokenIsIdentifier(this.state.type)) { node.id = this.parseIdentifier(); if (isStatement) { this.declareNameFromIdentifier(node.id, bindingType); } } else { if (optionalId || !isStatement) { node.id = null; } else { throw this.raise(Errors.MissingClassName, { at: this.state.startLoc }); } } } parseClassSuper(node) { node.superClass = this.eat(81) ? this.parseExprSubscripts() : null; } parseExport(node, decorators) { const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, true); const hasDefault = this.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier); const parseAfterDefault = !hasDefault || this.eat(12); const hasStar = parseAfterDefault && this.eatExportStar(node); const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node); const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(12)); const isFromRequired = hasDefault || hasStar; if (hasStar && !hasNamespace) { if (hasDefault) this.unexpected(); if (decorators) { throw this.raise(Errors.UnsupportedDecoratorExport, { at: node }); } this.parseExportFrom(node, true); return this.finishNode(node, "ExportAllDeclaration"); } const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node); if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers) { this.unexpected(null, 5); } if (hasNamespace && parseAfterNamespace) { this.unexpected(null, 97); } let hasDeclaration; if (isFromRequired || hasSpecifiers) { hasDeclaration = false; if (decorators) { throw this.raise(Errors.UnsupportedDecoratorExport, { at: node }); } this.parseExportFrom(node, isFromRequired); } else { hasDeclaration = this.maybeParseExportDeclaration(node); } if (isFromRequired || hasSpecifiers || hasDeclaration) { var _node2$declaration; const node2 = node; this.checkExport(node2, true, false, !!node2.source); if (((_node2$declaration = node2.declaration) == null ? void 0 : _node2$declaration.type) === "ClassDeclaration") { this.maybeTakeDecorators(decorators, node2.declaration, node2); } else if (decorators) { throw this.raise(Errors.UnsupportedDecoratorExport, { at: node }); } return this.finishNode(node2, "ExportNamedDeclaration"); } if (this.eat(65)) { const node2 = node; const decl = this.parseExportDefaultExpression(); node2.declaration = decl; if (decl.type === "ClassDeclaration") { this.maybeTakeDecorators(decorators, decl, node2); } else if (decorators) { throw this.raise(Errors.UnsupportedDecoratorExport, { at: node }); } this.checkExport(node2, true, true); return this.finishNode(node2, "ExportDefaultDeclaration"); } this.unexpected(null, 5); } eatExportStar(node) { return this.eat(55); } maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) { if (maybeDefaultIdentifier || this.isExportDefaultSpecifier()) { this.expectPlugin("exportDefaultFrom", maybeDefaultIdentifier == null ? void 0 : maybeDefaultIdentifier.loc.start); const id = maybeDefaultIdentifier || this.parseIdentifier(true); const specifier = this.startNodeAtNode(id); specifier.exported = id; node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; return true; } return false; } maybeParseExportNamespaceSpecifier(node) { if (this.isContextual(93)) { if (!node.specifiers) node.specifiers = []; const specifier = this.startNodeAt(this.state.lastTokStartLoc); this.next(); specifier.exported = this.parseModuleExportName(); node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier")); return true; } return false; } maybeParseExportNamedSpecifiers(node) { if (this.match(5)) { if (!node.specifiers) node.specifiers = []; const isTypeExport = node.exportKind === "type"; node.specifiers.push(...this.parseExportSpecifiers(isTypeExport)); node.source = null; node.declaration = null; if (this.hasPlugin("importAssertions")) { node.assertions = []; } return true; } return false; } maybeParseExportDeclaration(node) { if (this.shouldParseExportDeclaration()) { node.specifiers = []; node.source = null; if (this.hasPlugin("importAssertions")) { node.assertions = []; } node.declaration = this.parseExportDeclaration(node); return true; } return false; } isAsyncFunction() { if (!this.isContextual(95)) return false; const next = this.nextTokenInLineStart(); return this.isUnparsedContextual(next, "function"); } parseExportDefaultExpression() { const expr = this.startNode(); if (this.match(68)) { this.next(); return this.parseFunction(expr, 1 | 4); } else if (this.isAsyncFunction()) { this.next(); this.next(); return this.parseFunction(expr, 1 | 4 | 8); } if (this.match(80)) { return this.parseClass(expr, true, true); } if (this.match(26)) { if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") === true) { this.raise(Errors.DecoratorBeforeExport, { at: this.state.startLoc }); } return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true); } if (this.match(75) || this.match(74) || this.isLet()) { throw this.raise(Errors.UnsupportedDefaultExport, { at: this.state.startLoc }); } const res = this.parseMaybeAssignAllowIn(); this.semicolon(); return res; } parseExportDeclaration(node) { if (this.match(80)) { const node = this.parseClass(this.startNode(), true, false); return node; } return this.parseStatementListItem(); } isExportDefaultSpecifier() { const { type } = this.state; if (tokenIsIdentifier(type)) { if (type === 95 && !this.state.containsEsc || type === 99) { return false; } if ((type === 128 || type === 127) && !this.state.containsEsc) { const { type: nextType } = this.lookahead(); if (tokenIsIdentifier(nextType) && nextType !== 97 || nextType === 5) { this.expectOnePlugin(["flow", "typescript"]); return false; } } } else if (!this.match(65)) { return false; } const next = this.nextTokenStart(); const hasFrom = this.isUnparsedContextual(next, "from"); if (this.input.charCodeAt(next) === 44 || tokenIsIdentifier(this.state.type) && hasFrom) { return true; } if (this.match(65) && hasFrom) { const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4)); return nextAfterFrom === 34 || nextAfterFrom === 39; } return false; } parseExportFrom(node, expect) { if (this.eatContextual(97)) { node.source = this.parseImportSource(); this.checkExport(node); this.maybeParseImportAttributes(node); this.checkJSONModuleImport(node); } else if (expect) { this.unexpected(); } this.semicolon(); } shouldParseExportDeclaration() { const { type } = this.state; if (type === 26) { this.expectOnePlugin(["decorators", "decorators-legacy"]); if (this.hasPlugin("decorators")) { if (this.getPluginOption("decorators", "decoratorsBeforeExport") === true) { this.raise(Errors.DecoratorBeforeExport, { at: this.state.startLoc }); } return true; } } return type === 74 || type === 75 || type === 68 || type === 80 || this.isLet() || this.isAsyncFunction(); } checkExport(node, checkNames, isDefault, isFrom) { if (checkNames) { if (isDefault) { this.checkDuplicateExports(node, "default"); if (this.hasPlugin("exportDefaultFrom")) { var _declaration$extra; const declaration = node.declaration; if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) { this.raise(Errors.ExportDefaultFromAsIdentifier, { at: declaration }); } } } else if (node.specifiers && node.specifiers.length) { for (const specifier of node.specifiers) { const { exported } = specifier; const exportName = exported.type === "Identifier" ? exported.name : exported.value; this.checkDuplicateExports(specifier, exportName); if (!isFrom && specifier.local) { const { local } = specifier; if (local.type !== "Identifier") { this.raise(Errors.ExportBindingIsString, { at: specifier, localName: local.value, exportName }); } else { this.checkReservedWord(local.name, local.loc.start, true, false); this.scope.checkLocalExport(local); } } } } else if (node.declaration) { if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") { const id = node.declaration.id; if (!id) throw new Error("Assertion failure"); this.checkDuplicateExports(node, id.name); } else if (node.declaration.type === "VariableDeclaration") { for (const declaration of node.declaration.declarations) { this.checkDeclaration(declaration.id); } } } } } checkDeclaration(node) { if (node.type === "Identifier") { this.checkDuplicateExports(node, node.name); } else if (node.type === "ObjectPattern") { for (const prop of node.properties) { this.checkDeclaration(prop); } } else if (node.type === "ArrayPattern") { for (const elem of node.elements) { if (elem) { this.checkDeclaration(elem); } } } else if (node.type === "ObjectProperty") { this.checkDeclaration(node.value); } else if (node.type === "RestElement") { this.checkDeclaration(node.argument); } else if (node.type === "AssignmentPattern") { this.checkDeclaration(node.left); } } checkDuplicateExports(node, exportName) { if (this.exportedIdentifiers.has(exportName)) { if (exportName === "default") { this.raise(Errors.DuplicateDefaultExport, { at: node }); } else { this.raise(Errors.DuplicateExport, { at: node, exportName }); } } this.exportedIdentifiers.add(exportName); } parseExportSpecifiers(isInTypeExport) { const nodes = []; let first = true; this.expect(5); while (!this.eat(8)) { if (first) { first = false; } else { this.expect(12); if (this.eat(8)) break; } const isMaybeTypeOnly = this.isContextual(128); const isString = this.match(131); const node = this.startNode(); node.local = this.parseModuleExportName(); nodes.push(this.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly)); } return nodes; } parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) { if (this.eatContextual(93)) { node.exported = this.parseModuleExportName(); } else if (isString) { node.exported = cloneStringLiteral(node.local); } else if (!node.exported) { node.exported = cloneIdentifier(node.local); } return this.finishNode(node, "ExportSpecifier"); } parseModuleExportName() { if (this.match(131)) { const result = this.parseStringLiteral(this.state.value); const surrogate = result.value.match(loneSurrogate); if (surrogate) { this.raise(Errors.ModuleExportNameHasLoneSurrogate, { at: result, surrogateCharCode: surrogate[0].charCodeAt(0) }); } return result; } return this.parseIdentifier(true); } isJSONModuleImport(node) { if (node.assertions != null) { return node.assertions.some(({ key, value }) => { return value.value === "json" && (key.type === "Identifier" ? key.name === "type" : key.value === "type"); }); } return false; } checkImportReflection(node) { if (node.module) { var _node$assertions; if (node.specifiers.length !== 1 || node.specifiers[0].type !== "ImportDefaultSpecifier") { this.raise(Errors.ImportReflectionNotBinding, { at: node.specifiers[0].loc.start }); } if (((_node$assertions = node.assertions) == null ? void 0 : _node$assertions.length) > 0) { this.raise(Errors.ImportReflectionHasAssertion, { at: node.specifiers[0].loc.start }); } } } checkJSONModuleImport(node) { if (this.isJSONModuleImport(node) && node.type !== "ExportAllDeclaration") { const { specifiers } = node; if (specifiers != null) { const nonDefaultNamedSpecifier = specifiers.find(specifier => { let imported; if (specifier.type === "ExportSpecifier") { imported = specifier.local; } else if (specifier.type === "ImportSpecifier") { imported = specifier.imported; } if (imported !== undefined) { return imported.type === "Identifier" ? imported.name !== "default" : imported.value !== "default"; } }); if (nonDefaultNamedSpecifier !== undefined) { this.raise(Errors.ImportJSONBindingNotDefault, { at: nonDefaultNamedSpecifier.loc.start }); } } } } isPotentialImportPhase(isExport) { return !isExport && this.isContextual(125); } applyImportPhase(node, isExport, phase, loc) { if (isExport) { return; } if (phase === "module") { this.expectPlugin("importReflection", loc); node.module = true; } else if (this.hasPlugin("importReflection")) { node.module = false; } } parseMaybeImportPhase(node, isExport) { if (!this.isPotentialImportPhase(isExport)) { this.applyImportPhase(node, isExport, null); return null; } const phaseIdentifier = this.parseIdentifier(true); const { type } = this.state; const isImportPhase = tokenIsKeywordOrIdentifier(type) ? type !== 97 || this.lookaheadCharCode() === 102 : type !== 12; if (isImportPhase) { this.resetPreviousIdentifierLeadingComments(phaseIdentifier); this.applyImportPhase(node, isExport, phaseIdentifier.name, phaseIdentifier.loc.start); return null; } else { this.applyImportPhase(node, isExport, null); return phaseIdentifier; } } isPrecedingIdImportPhase(phase) { const { type } = this.state; return tokenIsIdentifier(type) ? type !== 97 || this.lookaheadCharCode() === 102 : type !== 12; } parseImport(node) { if (this.match(131)) { return this.parseImportSourceAndAttributes(node); } return this.parseImportSpecifiersAndAfter(node, this.parseMaybeImportPhase(node, false)); } parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier) { node.specifiers = []; const hasDefault = this.maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier); const parseNext = !hasDefault || this.eat(12); const hasStar = parseNext && this.maybeParseStarImportSpecifier(node); if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node); this.expectContextual(97); return this.parseImportSourceAndAttributes(node); } parseImportSourceAndAttributes(node) { var _node$specifiers; (_node$specifiers = node.specifiers) != null ? _node$specifiers : node.specifiers = []; node.source = this.parseImportSource(); this.maybeParseImportAttributes(node); this.checkImportReflection(node); this.checkJSONModuleImport(node); this.semicolon(); return this.finishNode(node, "ImportDeclaration"); } parseImportSource() { if (!this.match(131)) this.unexpected(); return this.parseExprAtom(); } parseImportSpecifierLocal(node, specifier, type) { specifier.local = this.parseIdentifier(); node.specifiers.push(this.finishImportSpecifier(specifier, type)); } finishImportSpecifier(specifier, type, bindingType = BIND_LEXICAL) { this.checkLVal(specifier.local, { in: { type }, binding: bindingType }); return this.finishNode(specifier, type); } parseImportAttributes() { this.expect(5); const attrs = []; const attrNames = new Set(); do { if (this.match(8)) { break; } const node = this.startNode(); const keyName = this.state.value; if (attrNames.has(keyName)) { this.raise(Errors.ModuleAttributesWithDuplicateKeys, { at: this.state.startLoc, key: keyName }); } attrNames.add(keyName); if (this.match(131)) { node.key = this.parseStringLiteral(keyName); } else { node.key = this.parseIdentifier(true); } this.expect(14); if (!this.match(131)) { throw this.raise(Errors.ModuleAttributeInvalidValue, { at: this.state.startLoc }); } node.value = this.parseStringLiteral(this.state.value); attrs.push(this.finishNode(node, "ImportAttribute")); } while (this.eat(12)); this.expect(8); return attrs; } parseModuleAttributes() { const attrs = []; const attributes = new Set(); do { const node = this.startNode(); node.key = this.parseIdentifier(true); if (node.key.name !== "type") { this.raise(Errors.ModuleAttributeDifferentFromType, { at: node.key }); } if (attributes.has(node.key.name)) { this.raise(Errors.ModuleAttributesWithDuplicateKeys, { at: node.key, key: node.key.name }); } attributes.add(node.key.name); this.expect(14); if (!this.match(131)) { throw this.raise(Errors.ModuleAttributeInvalidValue, { at: this.state.startLoc }); } node.value = this.parseStringLiteral(this.state.value); attrs.push(this.finishNode(node, "ImportAttribute")); } while (this.eat(12)); return attrs; } maybeParseImportAttributes(node) { let attributes; let useWith = false; if (this.match(76)) { if (this.hasPrecedingLineBreak() && this.lookaheadCharCode() === 40) { return; } this.next(); { if (this.hasPlugin("moduleAttributes")) { attributes = this.parseModuleAttributes(); } else { this.expectImportAttributesPlugin(); attributes = this.parseImportAttributes(); } } useWith = true; } else if (this.isContextual(94) && !this.hasPrecedingLineBreak()) { if (this.hasPlugin("importAttributes")) { if (this.getPluginOption("importAttributes", "deprecatedAssertSyntax") !== true) { this.raise(Errors.ImportAttributesUseAssert, { at: this.state.startLoc }); } this.addExtra(node, "deprecatedAssertSyntax", true); } else { this.expectOnePlugin(["importAttributes", "importAssertions"]); } this.next(); attributes = this.parseImportAttributes(); } else if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) { attributes = []; } else { if (this.hasPlugin("moduleAttributes")) { attributes = []; } else return; } if (!useWith && this.hasPlugin("importAssertions")) { node.assertions = attributes; } else { node.attributes = attributes; } } maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier) { if (maybeDefaultIdentifier) { const specifier = this.startNodeAtNode(maybeDefaultIdentifier); specifier.local = maybeDefaultIdentifier; node.specifiers.push(this.finishImportSpecifier(specifier, "ImportDefaultSpecifier")); return true; } else if (tokenIsKeywordOrIdentifier(this.state.type)) { this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier"); return true; } return false; } maybeParseStarImportSpecifier(node) { if (this.match(55)) { const specifier = this.startNode(); this.next(); this.expectContextual(93); this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier"); return true; } return false; } parseNamedImportSpecifiers(node) { let first = true; this.expect(5); while (!this.eat(8)) { if (first) { first = false; } else { if (this.eat(14)) { throw this.raise(Errors.DestructureNamedImport, { at: this.state.startLoc }); } this.expect(12); if (this.eat(8)) break; } const specifier = this.startNode(); const importedIsString = this.match(131); const isMaybeTypeOnly = this.isContextual(128); specifier.imported = this.parseModuleExportName(); const importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node.importKind === "type" || node.importKind === "typeof", isMaybeTypeOnly, undefined); node.specifiers.push(importSpecifier); } } parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { if (this.eatContextual(93)) { specifier.local = this.parseIdentifier(); } else { const { imported } = specifier; if (importedIsString) { throw this.raise(Errors.ImportBindingIsString, { at: specifier, importName: imported.value }); } this.checkReservedWord(imported.name, specifier.loc.start, true, true); if (!specifier.local) { specifier.local = cloneIdentifier(imported); } } return this.finishImportSpecifier(specifier, "ImportSpecifier", bindingType); } isThisParam(param) { return param.type === "Identifier" && param.name === "this"; } } class Parser extends StatementParser { constructor(options, input) { options = getOptions(options); super(options, input); this.options = options; this.initializeScopes(); this.plugins = pluginsMap(this.options.plugins); this.filename = options.sourceFilename; } getScopeHandler() { return ScopeHandler; } parse() { this.enterInitialScopes(); const file = this.startNode(); const program = this.startNode(); this.nextToken(); file.errors = null; this.parseTopLevel(file, program); file.errors = this.state.errors; return file; } } function pluginsMap(plugins) { const pluginMap = new Map(); for (const plugin of plugins) { const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}]; if (!pluginMap.has(name)) pluginMap.set(name, options || {}); } return pluginMap; } function parse(input, options) { var _options; if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") { options = Object.assign({}, options); try { options.sourceType = "module"; const parser = getParser(options, input); const ast = parser.parse(); if (parser.sawUnambiguousESM) { return ast; } if (parser.ambiguousScriptDifferentAst) { try { options.sourceType = "script"; return getParser(options, input).parse(); } catch (_unused) {} } else { ast.program.sourceType = "script"; } return ast; } catch (moduleError) { try { options.sourceType = "script"; return getParser(options, input).parse(); } catch (_unused2) {} throw moduleError; } } else { return getParser(options, input).parse(); } } function parseExpression(input, options) { const parser = getParser(options, input); if (parser.options.strictMode) { parser.state.strict = true; } return parser.getExpression(); } function generateExportedTokenTypes(internalTokenTypes) { const tokenTypes = {}; for (const typeName of Object.keys(internalTokenTypes)) { tokenTypes[typeName] = getExportedToken(internalTokenTypes[typeName]); } return tokenTypes; } const tokTypes = generateExportedTokenTypes(tt); function getParser(options, input) { let cls = Parser; if (options != null && options.plugins) { validatePlugins(options.plugins); cls = getParserClass(options.plugins); } return new cls(options, input); } const parserClassCache = {}; function getParserClass(pluginsFromOptions) { const pluginList = mixinPluginNames.filter(name => hasPlugin(pluginsFromOptions, name)); const key = pluginList.join("/"); let cls = parserClassCache[key]; if (!cls) { cls = Parser; for (const plugin of pluginList) { cls = mixinPlugins[plugin](cls); } parserClassCache[key] = cls; } return cls; } exports.parse = parse; exports.parseExpression = parseExpression; exports.tokTypes = tokTypes; //# sourceMappingURL=index.js.map lib/index.js.map 0000644 00005125066 15120211212 0007535 0 ustar 00 {"version":3,"file":"index.js","sources":["../src/util/location.ts","../src/parse-error/credentials.ts","../src/parse-error/module-errors.ts","../src/parse-error/to-node-description.ts","../src/parse-error/standard-errors.ts","../src/parse-error/strict-mode-errors.ts","../src/parse-error/pipeline-operator-errors.ts","../src/parse-error.ts","../src/plugins/estree.ts","../src/tokenizer/context.ts","../src/tokenizer/types.ts","../../babel-helper-validator-identifier/src/identifier.ts","../../babel-helper-validator-identifier/src/keyword.ts","../src/util/identifier.ts","../src/util/scopeflags.ts","../src/util/scope.ts","../src/plugins/flow/scope.ts","../src/parser/base.ts","../src/parser/comments.ts","../src/util/whitespace.ts","../src/tokenizer/state.ts","../../babel-helper-string-parser/src/index.ts","../src/tokenizer/index.ts","../src/util/class-scope.ts","../src/util/expression-scope.ts","../src/util/production-parameter.ts","../src/parser/util.ts","../src/parser/node.ts","../src/plugins/flow/index.ts","../src/plugins/jsx/xhtml.ts","../src/plugins/jsx/index.ts","../src/plugins/typescript/scope.ts","../src/parser/lval.ts","../src/plugins/typescript/index.ts","../src/plugins/placeholders.ts","../src/plugins/v8intrinsic.ts","../src/plugin-utils.ts","../src/options.ts","../src/parser/expression.ts","../src/parser/statement.ts","../src/parser/index.ts","../src/index.ts"],"sourcesContent":["export type Pos = {\n start: number;\n};\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nexport class Position {\n line: number;\n column: number;\n index: number;\n\n constructor(line: number, col: number, index: number) {\n this.line = line;\n this.column = col;\n this.index = index;\n }\n}\n\nexport class SourceLocation {\n start: Position;\n end: Position;\n filename: string;\n identifierName: string | undefined | null;\n\n constructor(start: Position, end?: Position) {\n this.start = start;\n // (may start as null, but initialized later)\n this.end = end;\n }\n}\n\n/**\n * creates a new position with a non-zero column offset from the given position.\n * This function should be only be used when we create AST node out of the token\n * boundaries, such as TemplateElement ends before tt.templateNonTail. This\n * function does not skip whitespaces.\n */\nexport function createPositionWithColumnOffset(\n position: Position,\n columnOffset: number,\n) {\n const { line, column, index } = position;\n return new Position(line, column + columnOffset, index + columnOffset);\n}\n","export const enum ParseErrorCode {\n SyntaxError = \"BABEL_PARSER_SYNTAX_ERROR\",\n SourceTypeModuleError = \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\",\n}\n\nexport type SyntaxPlugin =\n | \"flow\"\n | \"typescript\"\n | \"jsx\"\n | \"pipelineOperator\"\n | \"placeholders\";\n\nexport type ToMessage<ErrorDetails> = (self: ErrorDetails) => string;\n\nexport type ParseErrorCredentials<ErrorDetails> = {\n code: ParseErrorCode;\n reasonCode: string;\n syntaxPlugin?: SyntaxPlugin;\n toMessage: ToMessage<ErrorDetails>;\n};\n\nconst reflect = (keys: string[], last = keys.length - 1) => ({\n get(this: unknown): unknown {\n return keys.reduce(\n (object, key) =>\n // @ts-expect-error key should index object\n object[key],\n this,\n );\n },\n set(this: unknown, value: unknown) {\n keys.reduce(\n // @ts-expect-error key should index item\n (item, key, i) => (i === last ? (item[key] = value) : item[key]),\n this,\n );\n },\n});\n\nconst instantiate = <T>(\n constructor: new () => T,\n properties: any,\n descriptors: any,\n) =>\n Object.keys(descriptors)\n .map(key => [key, descriptors[key]])\n .filter(([, descriptor]) => !!descriptor)\n .map(([key, descriptor]) => [\n key,\n typeof descriptor === \"function\"\n ? { value: descriptor, enumerable: false }\n : typeof descriptor.reflect === \"string\"\n ? { ...descriptor, ...reflect(descriptor.reflect.split(\".\")) }\n : descriptor,\n ])\n .reduce(\n (instance, [key, descriptor]) =>\n Object.defineProperty(instance, key, {\n configurable: true,\n ...descriptor,\n }),\n Object.assign(new constructor(), properties),\n );\n\nexport { instantiate };\n","import { ParseErrorCode } from \"../parse-error\";\n\nexport default {\n ImportMetaOutsideModule: {\n message: `import.meta may appear only with 'sourceType: \"module\"'`,\n code: ParseErrorCode.SourceTypeModuleError,\n },\n ImportOutsideModule: {\n message: `'import' and 'export' may appear only with 'sourceType: \"module\"'`,\n code: ParseErrorCode.SourceTypeModuleError,\n },\n};\n","const NodeDescriptions = {\n ArrayPattern: \"array destructuring pattern\",\n AssignmentExpression: \"assignment expression\",\n AssignmentPattern: \"assignment expression\",\n ArrowFunctionExpression: \"arrow function expression\",\n ConditionalExpression: \"conditional expression\",\n CatchClause: \"catch clause\",\n ForOfStatement: \"for-of statement\",\n ForInStatement: \"for-in statement\",\n ForStatement: \"for-loop\",\n FormalParameters: \"function parameter list\",\n Identifier: \"identifier\",\n ImportSpecifier: \"import specifier\",\n ImportDefaultSpecifier: \"import default specifier\",\n ImportNamespaceSpecifier: \"import namespace specifier\",\n ObjectPattern: \"object destructuring pattern\",\n ParenthesizedExpression: \"parenthesized expression\",\n RestElement: \"rest element\",\n UpdateExpression: {\n true: \"prefix operation\",\n false: \"postfix operation\",\n },\n VariableDeclarator: \"variable declaration\",\n YieldExpression: \"yield expression\",\n};\n\ntype NodeTypesWithDescriptions = keyof Omit<\n typeof NodeDescriptions,\n \"UpdateExpression\"\n>;\n\ntype NodeWithDescription =\n | {\n type: \"UpdateExpression\";\n prefix: boolean;\n }\n | {\n type: NodeTypesWithDescriptions;\n };\n\n// @ts-expect-error prefix is specified only when type is UpdateExpression\n// eslint-disable-next-line no-confusing-arrow\nconst toNodeDescription = ({ type, prefix }: NodeWithDescription) =>\n type === \"UpdateExpression\"\n ? NodeDescriptions.UpdateExpression[String(prefix) as \"true\" | \"false\"]\n : NodeDescriptions[type];\n\nexport default toNodeDescription;\n","import toNodeDescription from \"./to-node-description\";\n\nexport type LValAncestor =\n | { type: \"UpdateExpression\"; prefix: boolean }\n | {\n type:\n | \"ArrayPattern\"\n | \"AssignmentExpression\"\n | \"CatchClause\"\n | \"ForOfStatement\"\n | \"FormalParameters\"\n | \"ForInStatement\"\n | \"ForStatement\"\n | \"ImportSpecifier\"\n | \"ImportNamespaceSpecifier\"\n | \"ImportDefaultSpecifier\"\n | \"ParenthesizedExpression\"\n | \"ObjectPattern\"\n | \"RestElement\"\n | \"VariableDeclarator\";\n };\n\nexport default {\n AccessorIsGenerator: ({ kind }: { kind: \"get\" | \"set\" }) =>\n `A ${kind}ter cannot be a generator.`,\n ArgumentsInClass:\n \"'arguments' is only allowed in functions and class methods.\",\n AsyncFunctionInSingleStatementContext:\n \"Async functions can only be declared at the top level or inside a block.\",\n AwaitBindingIdentifier:\n \"Can not use 'await' as identifier inside an async function.\",\n AwaitBindingIdentifierInStaticBlock:\n \"Can not use 'await' as identifier inside a static block.\",\n AwaitExpressionFormalParameter:\n \"'await' is not allowed in async function parameters.\",\n AwaitUsingNotInAsyncContext:\n \"'await using' is only allowed within async functions and at the top levels of modules.\",\n AwaitNotInAsyncContext:\n \"'await' is only allowed within async functions and at the top levels of modules.\",\n AwaitNotInAsyncFunction: \"'await' is only allowed within async functions.\",\n BadGetterArity: \"A 'get' accessor must not have any formal parameters.\",\n BadSetterArity: \"A 'set' accessor must have exactly one formal parameter.\",\n BadSetterRestParameter:\n \"A 'set' accessor function argument must not be a rest parameter.\",\n ConstructorClassField: \"Classes may not have a field named 'constructor'.\",\n ConstructorClassPrivateField:\n \"Classes may not have a private field named '#constructor'.\",\n ConstructorIsAccessor: \"Class constructor may not be an accessor.\",\n ConstructorIsAsync: \"Constructor can't be an async function.\",\n ConstructorIsGenerator: \"Constructor can't be a generator.\",\n DeclarationMissingInitializer: ({\n kind,\n }: {\n kind: \"const\" | \"destructuring\";\n }) => `Missing initializer in ${kind} declaration.`,\n DecoratorArgumentsOutsideParentheses:\n \"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.\",\n DecoratorBeforeExport:\n \"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.\",\n DecoratorsBeforeAfterExport:\n \"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.\",\n DecoratorConstructor:\n \"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?\",\n DecoratorExportClass:\n \"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.\",\n DecoratorSemicolon: \"Decorators must not be followed by a semicolon.\",\n DecoratorStaticBlock: \"Decorators can't be used with a static block.\",\n DeletePrivateField: \"Deleting a private field is not allowed.\",\n DestructureNamedImport:\n \"ES2015 named imports do not destructure. Use another statement for destructuring after the import.\",\n DuplicateConstructor: \"Duplicate constructor in the same class.\",\n DuplicateDefaultExport: \"Only one default export allowed per module.\",\n DuplicateExport: ({ exportName }: { exportName: string }) =>\n `\\`${exportName}\\` has already been exported. Exported identifiers must be unique.`,\n DuplicateProto: \"Redefinition of __proto__ property.\",\n DuplicateRegExpFlags: \"Duplicate regular expression flag.\",\n ElementAfterRest: \"Rest element must be last element.\",\n EscapedCharNotAnIdentifier: \"Invalid Unicode escape.\",\n ExportBindingIsString: ({\n localName,\n exportName,\n }: {\n localName: string;\n exportName: string;\n }) =>\n `A string literal cannot be used as an exported binding without \\`from\\`.\\n- Did you mean \\`export { '${localName}' as '${exportName}' } from 'some-module'\\`?`,\n ExportDefaultFromAsIdentifier:\n \"'from' is not allowed as an identifier after 'export default'.\",\n\n ForInOfLoopInitializer: ({\n type,\n }: {\n type: \"ForInStatement\" | \"ForOfStatement\";\n }) =>\n `'${\n type === \"ForInStatement\" ? \"for-in\" : \"for-of\"\n }' loop variable declaration may not have an initializer.`,\n ForInUsing: \"For-in loop may not start with 'using' declaration.\",\n\n ForOfAsync: \"The left-hand side of a for-of loop may not be 'async'.\",\n ForOfLet: \"The left-hand side of a for-of loop may not start with 'let'.\",\n GeneratorInSingleStatementContext:\n \"Generators can only be declared at the top level or inside a block.\",\n\n IllegalBreakContinue: ({\n type,\n }: {\n type: \"BreakStatement\" | \"ContinueStatement\";\n }) => `Unsyntactic ${type === \"BreakStatement\" ? \"break\" : \"continue\"}.`,\n\n IllegalLanguageModeDirective:\n \"Illegal 'use strict' directive in function with non-simple parameter list.\",\n IllegalReturn: \"'return' outside of function.\",\n ImportAttributesUseAssert:\n \"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.\",\n ImportBindingIsString: ({ importName }: { importName: string }) =>\n `A string literal cannot be used as an imported binding.\\n- Did you mean \\`import { \"${importName}\" as foo }\\`?`,\n ImportCallArgumentTrailingComma:\n \"Trailing comma is disallowed inside import(...) arguments.\",\n ImportCallArity: ({ maxArgumentCount }: { maxArgumentCount: 1 | 2 }) =>\n `\\`import()\\` requires exactly ${\n maxArgumentCount === 1 ? \"one argument\" : \"one or two arguments\"\n }.`,\n ImportCallNotNewExpression: \"Cannot use new with import(...).\",\n ImportCallSpreadArgument: \"`...` is not allowed in `import()`.\",\n ImportJSONBindingNotDefault:\n \"A JSON module can only be imported with `default`.\",\n ImportReflectionHasAssertion: \"`import module x` cannot have assertions.\",\n ImportReflectionNotBinding:\n 'Only `import module x from \"./module\"` is valid.',\n IncompatibleRegExpUVFlags:\n \"The 'u' and 'v' regular expression flags cannot be enabled at the same time.\",\n InvalidBigIntLiteral: \"Invalid BigIntLiteral.\",\n InvalidCodePoint: \"Code point out of bounds.\",\n InvalidCoverInitializedName: \"Invalid shorthand property initializer.\",\n InvalidDecimal: \"Invalid decimal.\",\n InvalidDigit: ({ radix }: { radix: number }) =>\n `Expected number in radix ${radix}.`,\n InvalidEscapeSequence: \"Bad character escape sequence.\",\n InvalidEscapeSequenceTemplate: \"Invalid escape sequence in template.\",\n InvalidEscapedReservedWord: ({ reservedWord }: { reservedWord: string }) =>\n `Escape sequence in keyword ${reservedWord}.`,\n InvalidIdentifier: ({ identifierName }: { identifierName: string }) =>\n `Invalid identifier ${identifierName}.`,\n InvalidLhs: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n InvalidLhsBinding: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n InvalidNumber: \"Invalid number.\",\n InvalidOrMissingExponent:\n \"Floating-point numbers require a valid exponent after the 'e'.\",\n InvalidOrUnexpectedToken: ({ unexpected }: { unexpected: string }) =>\n `Unexpected character '${unexpected}'.`,\n InvalidParenthesizedAssignment: \"Invalid parenthesized assignment pattern.\",\n InvalidPrivateFieldResolution: ({\n identifierName,\n }: {\n identifierName: string;\n }) => `Private name #${identifierName} is not defined.`,\n InvalidPropertyBindingPattern: \"Binding member expression.\",\n InvalidRecordProperty:\n \"Only properties and spread elements are allowed in record definitions.\",\n InvalidRestAssignmentPattern: \"Invalid rest operator's argument.\",\n LabelRedeclaration: ({ labelName }: { labelName: string }) =>\n `Label '${labelName}' is already declared.`,\n LetInLexicalBinding:\n \"'let' is not allowed to be used as a name in 'let' or 'const' declarations.\",\n LineTerminatorBeforeArrow: \"No line break is allowed before '=>'.\",\n MalformedRegExpFlags: \"Invalid regular expression flag.\",\n MissingClassName: \"A class name is required.\",\n MissingEqInAssignment:\n \"Only '=' operator can be used for specifying default value.\",\n MissingSemicolon: \"Missing semicolon.\",\n MissingPlugin: ({ missingPlugin }: { missingPlugin: [string] }) =>\n `This experimental syntax requires enabling the parser plugin: ${missingPlugin\n .map(name => JSON.stringify(name))\n .join(\", \")}.`,\n // FIXME: Would be nice to make this \"missingPlugins\" instead.\n // Also, seems like we can drop the \"(s)\" from the message and just make it \"s\".\n MissingOneOfPlugins: ({ missingPlugin }: { missingPlugin: string[] }) =>\n `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin\n .map(name => JSON.stringify(name))\n .join(\", \")}.`,\n MissingUnicodeEscape: \"Expecting Unicode escape sequence \\\\uXXXX.\",\n MixingCoalesceWithLogical:\n \"Nullish coalescing operator(??) requires parens when mixing with logical operators.\",\n ModuleAttributeDifferentFromType:\n \"The only accepted module attribute is `type`.\",\n ModuleAttributeInvalidValue:\n \"Only string literals are allowed as module attribute values.\",\n ModuleAttributesWithDuplicateKeys: ({ key }: { key: string }) =>\n `Duplicate key \"${key}\" is not allowed in module attributes.`,\n ModuleExportNameHasLoneSurrogate: ({\n surrogateCharCode,\n }: {\n surrogateCharCode: number;\n }) =>\n `An export name cannot include a lone surrogate, found '\\\\u${surrogateCharCode.toString(\n 16,\n )}'.`,\n ModuleExportUndefined: ({ localName }: { localName: string }) =>\n `Export '${localName}' is not defined.`,\n MultipleDefaultsInSwitch: \"Multiple default clauses.\",\n NewlineAfterThrow: \"Illegal newline after throw.\",\n NoCatchOrFinally: \"Missing catch or finally clause.\",\n NumberIdentifier: \"Identifier directly after number.\",\n NumericSeparatorInEscapeSequence:\n \"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.\",\n ObsoleteAwaitStar:\n \"'await*' has been removed from the async functions proposal. Use Promise.all() instead.\",\n OptionalChainingNoNew:\n \"Constructors in/after an Optional Chain are not allowed.\",\n OptionalChainingNoTemplate:\n \"Tagged Template Literals are not allowed in optionalChain.\",\n OverrideOnConstructor:\n \"'override' modifier cannot appear on a constructor declaration.\",\n ParamDupe: \"Argument name clash.\",\n PatternHasAccessor: \"Object pattern can't contain getter or setter.\",\n PatternHasMethod: \"Object pattern can't contain methods.\",\n PrivateInExpectedIn: ({ identifierName }: { identifierName: string }) =>\n `Private names are only allowed in property accesses (\\`obj.#${identifierName}\\`) or in \\`in\\` expressions (\\`#${identifierName} in obj\\`).`,\n PrivateNameRedeclaration: ({ identifierName }: { identifierName: string }) =>\n `Duplicate private name #${identifierName}.`,\n RecordExpressionBarIncorrectEndSyntaxType:\n \"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionBarIncorrectStartSyntaxType:\n \"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionHashIncorrectStartSyntaxType:\n \"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n RecordNoProto: \"'__proto__' is not allowed in Record expressions.\",\n RestTrailingComma: \"Unexpected trailing comma after rest element.\",\n SloppyFunction:\n \"In non-strict mode code, functions can only be declared at top level or inside a block.\",\n SloppyFunctionAnnexB:\n \"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.\",\n StaticPrototype: \"Classes may not have static property named prototype.\",\n SuperNotAllowed:\n \"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?\",\n SuperPrivateField: \"Private fields can't be accessed on super.\",\n TrailingDecorator: \"Decorators must be attached to a class element.\",\n TupleExpressionBarIncorrectEndSyntaxType:\n \"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionBarIncorrectStartSyntaxType:\n \"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionHashIncorrectStartSyntaxType:\n \"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n UnexpectedArgumentPlaceholder: \"Unexpected argument placeholder.\",\n UnexpectedAwaitAfterPipelineBody:\n 'Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal.',\n UnexpectedDigitAfterHash: \"Unexpected digit after hash token.\",\n UnexpectedImportExport:\n \"'import' and 'export' may only appear at the top level.\",\n UnexpectedKeyword: ({ keyword }: { keyword: string }) =>\n `Unexpected keyword '${keyword}'.`,\n UnexpectedLeadingDecorator:\n \"Leading decorators must be attached to a class declaration.\",\n UnexpectedLexicalDeclaration:\n \"Lexical declaration cannot appear in a single-statement context.\",\n UnexpectedNewTarget:\n \"`new.target` can only be used in functions or class properties.\",\n UnexpectedNumericSeparator:\n \"A numeric separator is only allowed between two digits.\",\n UnexpectedPrivateField: \"Unexpected private name.\",\n UnexpectedReservedWord: ({ reservedWord }: { reservedWord: string }) =>\n `Unexpected reserved word '${reservedWord}'.`,\n UnexpectedSuper: \"'super' is only allowed in object methods and classes.\",\n UnexpectedToken: ({\n expected,\n unexpected,\n }: {\n expected?: string | null;\n unexpected?: string | null;\n }) =>\n `Unexpected token${unexpected ? ` '${unexpected}'.` : \"\"}${\n expected ? `, expected \"${expected}\"` : \"\"\n }`,\n UnexpectedTokenUnaryExponentiation:\n \"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.\",\n UnexpectedUsingDeclaration:\n \"Using declaration cannot appear in the top level when source type is `script`.\",\n UnsupportedBind: \"Binding should be performed on object property.\",\n UnsupportedDecoratorExport:\n \"A decorated export must export a class declaration.\",\n UnsupportedDefaultExport:\n \"Only expressions, functions or classes are allowed as the `default` export.\",\n UnsupportedImport:\n \"`import` can only be used in `import()` or `import.meta`.\",\n UnsupportedMetaProperty: ({\n target,\n onlyValidPropertyName,\n }: {\n target: string;\n onlyValidPropertyName: string;\n }) =>\n `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`,\n UnsupportedParameterDecorator:\n \"Decorators cannot be used to decorate parameters.\",\n UnsupportedPropertyDecorator:\n \"Decorators cannot be used to decorate object literal properties.\",\n UnsupportedSuper:\n \"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).\",\n UnterminatedComment: \"Unterminated comment.\",\n UnterminatedRegExp: \"Unterminated regular expression.\",\n UnterminatedString: \"Unterminated string constant.\",\n UnterminatedTemplate: \"Unterminated template.\",\n UsingDeclarationHasBindingPattern:\n \"Using declaration cannot have destructuring patterns.\",\n VarRedeclaration: ({ identifierName }: { identifierName: string }) =>\n `Identifier '${identifierName}' has already been declared.`,\n YieldBindingIdentifier:\n \"Can not use 'yield' as identifier inside a generator.\",\n YieldInParameter: \"Yield expression is not allowed in formal parameters.\",\n ZeroDigitNumericSeparator:\n \"Numeric separator can not be used after leading 0.\",\n};\n","export default {\n StrictDelete: \"Deleting local variable in strict mode.\",\n\n // `referenceName` is the StringValue[1] of an IdentifierReference[2], which\n // is represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-IdentifierReference\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArguments: ({ referenceName }: { referenceName: string }) =>\n `Assigning to '${referenceName}' in strict mode.`,\n\n // `bindingName` is the StringValue[1] of a BindingIdentifier[2], which is\n // represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-BindingIdentifier\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArgumentsBinding: ({ bindingName }: { bindingName: string }) =>\n `Binding '${bindingName}' in strict mode.`,\n\n StrictFunction:\n \"In strict mode code, functions can only be declared at top level or inside a block.\",\n\n StrictNumericEscape: \"The only valid numeric escape in strict mode is '\\\\0'.\",\n\n StrictOctalLiteral: \"Legacy octal literals are not allowed in strict mode.\",\n\n StrictWith: \"'with' in strict mode.\",\n};\n","import toNodeDescription from \"./to-node-description\";\n\nexport const UnparenthesizedPipeBodyDescriptions = new Set([\n \"ArrowFunctionExpression\",\n \"AssignmentExpression\",\n \"ConditionalExpression\",\n \"YieldExpression\",\n] as const);\n\ntype GetSetMemberType<T extends Set<any>> = T extends Set<infer M>\n ? M\n : unknown;\n\ntype UnparenthesizedPipeBodyTypes = GetSetMemberType<\n typeof UnparenthesizedPipeBodyDescriptions\n>;\n\nexport default {\n // This error is only used by the smart-mix proposal\n PipeBodyIsTighter:\n \"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.\",\n PipeTopicRequiresHackPipes:\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n PipeTopicUnbound:\n \"Topic reference is unbound; it must be inside a pipe body.\",\n PipeTopicUnconfiguredToken: ({ token }: { token: string }) =>\n `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { \"proposal\": \"hack\", \"topicToken\": \"${token}\" }.`,\n PipeTopicUnused:\n \"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.\",\n PipeUnparenthesizedBody: ({ type }: { type: UnparenthesizedPipeBodyTypes }) =>\n `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({\n type,\n })}; please wrap it in parentheses.`,\n\n // Messages whose codes start with “Pipeline” or “PrimaryTopic”\n // are retained for backwards compatibility\n // with the deprecated smart-mix pipe operator proposal plugin.\n // They are subject to removal in a future major version.\n PipelineBodyNoArrow:\n 'Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized.',\n PipelineBodySequenceExpression:\n \"Pipeline body may not be a comma-separated sequence expression.\",\n PipelineHeadSequenceExpression:\n \"Pipeline head should not be a comma-separated sequence expression.\",\n PipelineTopicUnused:\n \"Pipeline is in topic style but does not use topic reference.\",\n PrimaryTopicNotAllowed:\n \"Topic reference was used in a lexical context without topic binding.\",\n PrimaryTopicRequiresSmartPipeline:\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n};\n","import { Position } from \"./util/location\";\nimport {\n instantiate,\n ParseErrorCode,\n type ParseErrorCredentials,\n type ToMessage,\n type SyntaxPlugin,\n} from \"./parse-error/credentials\";\nimport type { Undone } from \"./parser/node\";\nimport type { Node } from \"./types\";\n\n// Babel uses \"normal\" SyntaxErrors for it's errors, but adds some extra\n// functionality. This functionality is defined in the\n// `ParseErrorSpecification` interface below. We may choose to change to someday\n// give our errors their own full-blown class, but until then this allow us to\n// keep all the desirable properties of SyntaxErrors (like their name in stack\n// traces, etc.), and also allows us to punt on any publicly facing\n// class-hierarchy decisions until Babel 8.\ninterface ParseErrorSpecification<ErrorDetails> {\n // Look, these *could* be readonly, but then Flow complains when we initially\n // set them. We could do a whole dance and make a special interface that's not\n // readonly for when we create the error, then cast it to the readonly\n // interface for public use, but the previous implementation didn't have them\n // as readonly, so let's just not worry about it for now.\n code: ParseErrorCode;\n reasonCode: string;\n syntaxPlugin?: SyntaxPlugin;\n missingPlugin?: string | string[];\n loc: Position;\n details: ErrorDetails;\n\n // We should consider removing this as it now just contains the same\n // information as `loc.index`.\n // pos: number;\n}\n\nexport type ParseError<ErrorDetails> = SyntaxError &\n ParseErrorSpecification<ErrorDetails>;\n\n// By `ParseErrorConstructor`, we mean something like the new-less style\n// `ErrorConstructor`[1], since `ParseError`'s are not themselves actually\n// separate classes from `SyntaxError`'s.\n//\n// 1. https://github.com/microsoft/TypeScript/blob/v4.5.5/lib/lib.es5.d.ts#L1027\nexport type ParseErrorConstructor<ErrorDetails> = (a: {\n loc: Position;\n details: ErrorDetails;\n}) => ParseError<ErrorDetails>;\n\nfunction toParseErrorConstructor<ErrorDetails extends object>({\n toMessage,\n ...properties\n}: ParseErrorCredentials<ErrorDetails>): ParseErrorConstructor<ErrorDetails> {\n type ConstructorArgument = {\n loc: Position;\n details: ErrorDetails;\n };\n\n return function constructor({ loc, details }: ConstructorArgument) {\n return instantiate(\n SyntaxError,\n { ...properties, loc },\n {\n clone(\n overrides: {\n loc?: Position;\n details?: ErrorDetails;\n } = {},\n ) {\n const loc = (overrides.loc || {}) as Partial<Position>;\n return constructor({\n loc: new Position(\n \"line\" in loc ? loc.line : this.loc.line,\n \"column\" in loc ? loc.column : this.loc.column,\n \"index\" in loc ? loc.index : this.loc.index,\n ),\n details: { ...this.details, ...overrides.details },\n });\n },\n details: { value: details, enumerable: false },\n message: {\n get(this: ConstructorArgument): string {\n return `${toMessage(this.details)} (${this.loc.line}:${\n this.loc.column\n })`;\n },\n set(value: string) {\n Object.defineProperty(this, \"message\", { value });\n },\n },\n pos: { reflect: \"loc.index\", enumerable: true },\n missingPlugin: \"missingPlugin\" in details && {\n reflect: \"details.missingPlugin\",\n enumerable: true,\n },\n },\n ) as ParseError<ErrorDetails>;\n };\n}\n\ntype ParseErrorTemplate =\n | string\n | ToMessage<any>\n | { message: string | ToMessage<any> };\n\ntype ParseErrorTemplates = { [reasonCode: string]: ParseErrorTemplate };\n\n// This is the templated form of `ParseErrorEnum`.\n//\n// Note: We could factor out the return type calculation into something like\n// `ParseErrorConstructor<T extends ParseErrorTemplates>`, and then we could\n// reuse it in the non-templated form of `ParseErrorEnum`, but TypeScript\n// doesn't seem to drill down that far when showing you the computed type of\n// an object in an editor, so we'll leave it inlined for now.\nexport function ParseErrorEnum(a: TemplateStringsArray): <\n T extends ParseErrorTemplates,\n>(\n parseErrorTemplates: T,\n) => {\n [K in keyof T]: ParseErrorConstructor<\n T[K] extends { message: string | ToMessage<any> }\n ? T[K][\"message\"] extends ToMessage<any>\n ? Parameters<T[K][\"message\"]>[0]\n : {}\n : T[K] extends ToMessage<any>\n ? Parameters<T[K]>[0]\n : {}\n >;\n};\n\nexport function ParseErrorEnum<T extends ParseErrorTemplates>(\n parseErrorTemplates: T,\n syntaxPlugin?: SyntaxPlugin,\n): {\n [K in keyof T]: ParseErrorConstructor<\n T[K] extends { message: string | ToMessage<any> }\n ? T[K][\"message\"] extends ToMessage<any>\n ? Parameters<T[K][\"message\"]>[0]\n : {}\n : T[K] extends ToMessage<any>\n ? Parameters<T[K]>[0]\n : {}\n >;\n};\n\n// You call `ParseErrorEnum` with a mapping from `ReasonCode`'s to either:\n//\n// 1. a static error message,\n// 2. `toMessage` functions that define additional necessary `details` needed by\n// the `ParseError`, or\n// 3. Objects that contain a `message` of one of the above and overridden `code`\n// and/or `reasonCode`:\n//\n// ParseErrorEnum `optionalSyntaxPlugin` ({\n// ErrorWithStaticMessage: \"message\",\n// ErrorWithDynamicMessage: ({ type } : { type: string }) => `${type}`),\n// ErrorWithOverriddenCodeAndOrReasonCode: {\n// message: ({ type }: { type: string }) => `${type}`),\n// code: ParseErrorCode.SourceTypeModuleError,\n// ...(BABEL_8_BREAKING ? { } : { reasonCode: \"CustomErrorReasonCode\" })\n// }\n// });\n//\nexport function ParseErrorEnum(\n argument: TemplateStringsArray | ParseErrorTemplates,\n syntaxPlugin?: SyntaxPlugin,\n) {\n // If the first parameter is an array, that means we were called with a tagged\n // template literal. Extract the syntaxPlugin from this, and call again in\n // the \"normalized\" form.\n if (Array.isArray(argument)) {\n return (parseErrorTemplates: ParseErrorTemplates) =>\n ParseErrorEnum(parseErrorTemplates, argument[0]);\n }\n\n const ParseErrorConstructors = {} as Record<\n string,\n ParseErrorConstructor<unknown>\n >;\n\n for (const reasonCode of Object.keys(argument)) {\n const template = (argument as ParseErrorTemplates)[reasonCode];\n const { message, ...rest } =\n typeof template === \"string\"\n ? { message: () => template }\n : typeof template === \"function\"\n ? { message: template }\n : template;\n const toMessage = typeof message === \"string\" ? () => message : message;\n\n ParseErrorConstructors[reasonCode] = toParseErrorConstructor({\n code: ParseErrorCode.SyntaxError,\n reasonCode,\n toMessage,\n ...(syntaxPlugin ? { syntaxPlugin } : {}),\n ...rest,\n });\n }\n\n return ParseErrorConstructors;\n}\n\nexport type RaiseProperties<ErrorDetails> = {\n at: Position | Undone<Node>;\n} & ErrorDetails;\n\nimport ModuleErrors from \"./parse-error/module-errors\";\nimport StandardErrors from \"./parse-error/standard-errors\";\nimport StrictModeErrors from \"./parse-error/strict-mode-errors\";\nimport PipelineOperatorErrors from \"./parse-error/pipeline-operator-errors\";\n\nexport const Errors = {\n ...ParseErrorEnum(ModuleErrors),\n ...ParseErrorEnum(StandardErrors),\n ...ParseErrorEnum(StrictModeErrors),\n ...ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors),\n};\n\nexport type { LValAncestor } from \"./parse-error/standard-errors\";\n\nexport * from \"./parse-error/credentials\";\n","import type { TokenType } from \"../tokenizer/types\";\nimport type Parser from \"../parser\";\nimport type { ExpressionErrors } from \"../parser/util\";\nimport type * as N from \"../types\";\nimport type { Node as NodeType, NodeBase, File } from \"../types\";\nimport type { Position } from \"../util/location\";\nimport { Errors } from \"../parse-error\";\nimport type { Undone } from \"../parser/node\";\nimport type { BindingTypes } from \"../util/scopeflags\";\n\nconst { defineProperty } = Object;\nconst toUnenumerable = (object: any, key: string) =>\n defineProperty(object, key, { enumerable: false, value: object[key] });\n\nfunction toESTreeLocation(node: any) {\n node.loc.start && toUnenumerable(node.loc.start, \"index\");\n node.loc.end && toUnenumerable(node.loc.end, \"index\");\n\n return node;\n}\n\nexport default (superClass: typeof Parser) =>\n class ESTreeParserMixin extends superClass implements Parser {\n parse(): File {\n const file = toESTreeLocation(super.parse());\n\n if (this.options.tokens) {\n file.tokens = file.tokens.map(toESTreeLocation);\n }\n\n return file;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseRegExpLiteral({ pattern, flags }): N.EstreeRegExpLiteral {\n let regex: RegExp | null = null;\n try {\n regex = new RegExp(pattern, flags);\n } catch (e) {\n // In environments that don't support these flags value will\n // be null as the regex can't be represented natively.\n }\n const node = this.estreeParseLiteral<N.EstreeRegExpLiteral>(regex);\n node.regex = { pattern, flags };\n\n return node;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseBigIntLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/es2020.md#bigintliteral\n let bigInt: BigInt | null;\n try {\n bigInt = BigInt(value);\n } catch {\n bigInt = null;\n }\n const node = this.estreeParseLiteral<N.EstreeBigIntLiteral>(bigInt);\n node.bigint = String(node.value || value);\n\n return node;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseDecimalLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/experimental/decimal.md\n // todo: use BigDecimal when node supports it.\n const decimal: null = null;\n const node = this.estreeParseLiteral(decimal);\n node.decimal = String(node.value || value);\n\n return node;\n }\n\n estreeParseLiteral<T extends N.Node>(value: any) {\n // @ts-expect-error ESTree plugin changes node types\n return this.parseLiteral<T>(value, \"Literal\");\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseStringLiteral(value: any): N.Node {\n return this.estreeParseLiteral(value);\n }\n\n parseNumericLiteral(value: any): any {\n return this.estreeParseLiteral(value);\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseNullLiteral(): N.Node {\n return this.estreeParseLiteral(null);\n }\n\n parseBooleanLiteral(value: boolean): N.BooleanLiteral {\n return this.estreeParseLiteral(value);\n }\n\n // Cast a Directive to an ExpressionStatement. Mutates the input Directive.\n directiveToStmt(directive: N.Directive): N.ExpressionStatement {\n const expression = directive.value as any as N.EstreeLiteral;\n delete directive.value;\n\n expression.type = \"Literal\";\n // @ts-expect-error N.EstreeLiteral.raw is not defined.\n expression.raw = expression.extra.raw;\n expression.value = expression.extra.expressionValue;\n\n const stmt = directive as any as N.ExpressionStatement;\n stmt.type = \"ExpressionStatement\";\n stmt.expression = expression;\n // @ts-expect-error N.ExpressionStatement.directive is not defined\n stmt.directive = expression.extra.rawValue;\n\n delete expression.extra;\n\n return stmt;\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n initFunction(node: N.BodilessFunctionOrMethodBase, isAsync: boolean): void {\n super.initFunction(node, isAsync);\n node.expression = false;\n }\n\n checkDeclaration(node: N.Pattern | N.ObjectProperty): void {\n if (node != null && this.isObjectProperty(node)) {\n // @ts-expect-error plugin typings\n this.checkDeclaration((node as unknown as N.EstreeProperty).value);\n } else {\n super.checkDeclaration(node);\n }\n }\n\n getObjectOrClassMethodParams(method: N.ObjectMethod | N.ClassMethod) {\n return (method as any as N.EstreeProperty | N.EstreeMethodDefinition)\n .value.params;\n }\n\n isValidDirective(stmt: N.Statement): boolean {\n return (\n stmt.type === \"ExpressionStatement\" &&\n stmt.expression.type === \"Literal\" &&\n typeof stmt.expression.value === \"string\" &&\n !stmt.expression.extra?.parenthesized\n );\n }\n\n parseBlockBody(\n node: N.BlockStatementLike,\n allowDirectives: boolean | undefined | null,\n topLevel: boolean,\n end: TokenType,\n afterBlockParse?: (hasStrictModeDirective: boolean) => void,\n ): void {\n super.parseBlockBody(\n node,\n allowDirectives,\n topLevel,\n end,\n afterBlockParse,\n );\n\n const directiveStatements = node.directives.map(d =>\n this.directiveToStmt(d),\n );\n // @ts-expect-error estree plugin typings\n node.body = directiveStatements.concat(node.body);\n delete node.directives;\n }\n\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n this.parseMethod(\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n \"ClassMethod\",\n true,\n );\n if (method.typeParameters) {\n // @ts-expect-error mutate AST types\n method.value.typeParameters = method.typeParameters;\n delete method.typeParameters;\n }\n classBody.body.push(method);\n }\n\n parsePrivateName(): any {\n const node = super.parsePrivateName();\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return node;\n }\n }\n return this.convertPrivateNameToPrivateIdentifier(node);\n }\n\n convertPrivateNameToPrivateIdentifier(\n node: N.PrivateName,\n ): N.EstreePrivateIdentifier {\n const name = super.getPrivateNameSV(node);\n node = node as any;\n delete node.id;\n // @ts-expect-error mutate AST types\n node.name = name;\n // @ts-expect-error mutate AST types\n node.type = \"PrivateIdentifier\";\n return node as unknown as N.EstreePrivateIdentifier;\n }\n\n isPrivateName(node: N.Node): boolean {\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.isPrivateName(node);\n }\n }\n return node.type === \"PrivateIdentifier\";\n }\n\n getPrivateNameSV(node: N.Node): string {\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.getPrivateNameSV(node);\n }\n }\n return node.name;\n }\n\n // @ts-expect-error plugin may override interfaces\n parseLiteral<T extends N.Literal>(value: any, type: T[\"type\"]): T {\n const node = super.parseLiteral<T>(value, type);\n // @ts-expect-error mutating AST types\n node.raw = node.extra.raw;\n delete node.extra;\n\n return node;\n }\n\n parseFunctionBody(\n node: N.Function,\n allowExpression?: boolean | null,\n isMethod: boolean = false,\n ): void {\n super.parseFunctionBody(node, allowExpression, isMethod);\n node.expression = node.body.type !== \"BlockStatement\";\n }\n\n // @ts-expect-error plugin may override interfaces\n parseMethod<\n T extends N.ClassPrivateMethod | N.ObjectMethod | N.ClassMethod,\n >(\n node: Undone<T>,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowDirectSuper: boolean,\n type: T[\"type\"],\n inClassScope: boolean = false,\n ): N.EstreeMethodDefinition {\n let funcNode = this.startNode<N.MethodLike>();\n funcNode.kind = node.kind; // provide kind, so super method correctly sets state\n funcNode = super.parseMethod(\n // @ts-expect-error todo(flow->ts)\n funcNode,\n isGenerator,\n isAsync,\n isConstructor,\n allowDirectSuper,\n type,\n inClassScope,\n );\n // @ts-expect-error mutate AST types\n funcNode.type = \"FunctionExpression\";\n delete funcNode.kind;\n // @ts-expect-error mutate AST types\n node.value = funcNode;\n if (type === \"ClassPrivateMethod\") {\n node.computed = false;\n }\n return this.finishNode(\n // @ts-expect-error cast methods to estree types\n node as Undone<N.EstreeMethodDefinition>,\n \"MethodDefinition\",\n );\n }\n\n parseClassProperty(...args: [N.ClassProperty]): any {\n const propertyNode = super.parseClassProperty(...args) as any;\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return propertyNode as N.EstreePropertyDefinition;\n }\n }\n propertyNode.type = \"PropertyDefinition\";\n return propertyNode as N.EstreePropertyDefinition;\n }\n\n parseClassPrivateProperty(...args: [N.ClassPrivateProperty]): any {\n const propertyNode = super.parseClassPrivateProperty(...args) as any;\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return propertyNode as N.EstreePropertyDefinition;\n }\n }\n propertyNode.type = \"PropertyDefinition\";\n propertyNode.computed = false;\n return propertyNode as N.EstreePropertyDefinition;\n }\n\n parseObjectMethod(\n prop: N.ObjectMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n ): N.ObjectMethod | undefined | null {\n const node: N.EstreeProperty = super.parseObjectMethod(\n prop,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n ) as any;\n\n if (node) {\n node.type = \"Property\";\n if ((node as any as N.ClassMethod).kind === \"method\") {\n node.kind = \"init\";\n }\n node.shorthand = false;\n }\n\n return node as any;\n }\n\n parseObjectProperty(\n prop: N.ObjectProperty,\n startLoc: Position | undefined | null,\n isPattern: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ObjectProperty | undefined | null {\n const node: N.EstreeProperty = super.parseObjectProperty(\n prop,\n startLoc,\n isPattern,\n refExpressionErrors,\n ) as any;\n\n if (node) {\n node.kind = \"init\";\n node.type = \"Property\";\n }\n\n return node as any;\n }\n\n isValidLVal(\n type: string,\n isUnparenthesizedInAssign: boolean,\n binding: BindingTypes,\n ) {\n return type === \"Property\"\n ? \"value\"\n : super.isValidLVal(type, isUnparenthesizedInAssign, binding);\n }\n\n isAssignable(node: N.Node, isBinding?: boolean): boolean {\n if (node != null && this.isObjectProperty(node)) {\n return this.isAssignable(node.value, isBinding);\n }\n return super.isAssignable(node, isBinding);\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): void {\n if (node != null && this.isObjectProperty(node)) {\n const { key, value } = node;\n if (this.isPrivateName(key)) {\n this.classScope.usePrivateName(\n this.getPrivateNameSV(key),\n key.loc.start,\n );\n }\n this.toAssignable(value, isLHS);\n } else {\n super.toAssignable(node, isLHS);\n }\n }\n\n toAssignableObjectExpressionProp(\n prop: N.Node,\n isLast: boolean,\n isLHS: boolean,\n ) {\n if (prop.kind === \"get\" || prop.kind === \"set\") {\n this.raise(Errors.PatternHasAccessor, { at: prop.key });\n } else if (prop.method) {\n this.raise(Errors.PatternHasMethod, { at: prop.key });\n } else {\n super.toAssignableObjectExpressionProp(prop, isLast, isLHS);\n }\n }\n\n finishCallExpression<T extends N.CallExpression | N.OptionalCallExpression>(\n unfinished: Undone<T>,\n optional: boolean,\n ): T {\n const node = super.finishCallExpression(unfinished, optional);\n\n if (node.callee.type === \"Import\") {\n (node as N.Node as N.EstreeImportExpression).type = \"ImportExpression\";\n (node as N.Node as N.EstreeImportExpression).source = node.arguments[0];\n if (\n this.hasPlugin(\"importAttributes\") ||\n this.hasPlugin(\"importAssertions\")\n ) {\n (node as N.Node as N.EstreeImportExpression).attributes =\n node.arguments[1] ?? null;\n }\n // arguments isn't optional in the type definition\n delete node.arguments;\n // callee isn't optional in the type definition\n delete node.callee;\n }\n\n return node;\n }\n\n toReferencedArguments(\n node:\n | N.CallExpression\n | N.OptionalCallExpression\n | N.EstreeImportExpression,\n /* isParenthesizedExpr?: boolean, */\n ) {\n // ImportExpressions do not have an arguments array.\n if (node.type === \"ImportExpression\") {\n return;\n }\n\n super.toReferencedArguments(node);\n }\n\n parseExport(\n unfinished: Undone<N.AnyExport>,\n decorators: N.Decorator[] | null,\n ) {\n const exportStartLoc = this.state.lastTokStartLoc;\n const node = super.parseExport(unfinished, decorators);\n\n switch (node.type) {\n case \"ExportAllDeclaration\":\n // @ts-expect-error mutating AST types\n node.exported = null;\n break;\n\n case \"ExportNamedDeclaration\":\n if (\n node.specifiers.length === 1 &&\n // @ts-expect-error mutating AST types\n node.specifiers[0].type === \"ExportNamespaceSpecifier\"\n ) {\n // @ts-expect-error mutating AST types\n node.type = \"ExportAllDeclaration\";\n // @ts-expect-error mutating AST types\n node.exported = node.specifiers[0].exported;\n delete node.specifiers;\n }\n\n // fallthrough\n case \"ExportDefaultDeclaration\":\n {\n const { declaration } = node;\n if (\n declaration?.type === \"ClassDeclaration\" &&\n declaration.decorators?.length > 0 &&\n // decorator comes before export\n declaration.start === node.start\n ) {\n this.resetStartLocation(\n node,\n // For compatibility with ESLint's keyword-spacing rule, which assumes that an\n // export declaration must start with export.\n // https://github.com/babel/babel/issues/15085\n // Here we reset export declaration's start to be the start of the export token\n exportStartLoc,\n );\n }\n }\n\n break;\n }\n\n return node;\n }\n\n parseSubscript(\n base: N.Expression,\n startLoc: Position,\n noCalls: boolean | undefined | null,\n state: N.ParseSubscriptState,\n ) {\n const node = super.parseSubscript(base, startLoc, noCalls, state);\n\n if (state.optionalChainMember) {\n // https://github.com/estree/estree/blob/master/es2020.md#chainexpression\n if (\n node.type === \"OptionalMemberExpression\" ||\n node.type === \"OptionalCallExpression\"\n ) {\n node.type = node.type.substring(8); // strip Optional prefix\n }\n if (state.stop) {\n const chain = this.startNodeAtNode(node);\n chain.expression = node;\n return this.finishNode(chain, \"ChainExpression\");\n }\n } else if (\n node.type === \"MemberExpression\" ||\n node.type === \"CallExpression\"\n ) {\n node.optional = false;\n }\n\n return node;\n }\n\n hasPropertyAsPrivateName(node: N.Node): boolean {\n if (node.type === \"ChainExpression\") {\n node = node.expression;\n }\n return super.hasPropertyAsPrivateName(node);\n }\n\n // @ts-expect-error override interfaces\n isObjectProperty(node: N.Node): boolean {\n return node.type === \"Property\" && node.kind === \"init\" && !node.method;\n }\n\n isObjectMethod(node: N.Node): boolean {\n return node.method || node.kind === \"get\" || node.kind === \"set\";\n }\n\n finishNodeAt<T extends NodeType>(\n node: Undone<T>,\n type: T[\"type\"],\n endLoc: Position,\n ): T {\n return toESTreeLocation(super.finishNodeAt(node, type, endLoc));\n }\n\n resetStartLocation(node: N.Node, startLoc: Position) {\n super.resetStartLocation(node, startLoc);\n toESTreeLocation(node);\n }\n\n resetEndLocation(\n node: NodeBase,\n endLoc: Position = this.state.lastTokEndLoc,\n ): void {\n super.resetEndLocation(node, endLoc);\n toESTreeLocation(node);\n }\n };\n","// The token context is used in JSX plugin to track\n// jsx tag / jsx text / normal JavaScript expression\n\nexport class TokContext {\n constructor(token: string, preserveSpace?: boolean) {\n this.token = token;\n this.preserveSpace = !!preserveSpace;\n }\n\n token: string;\n preserveSpace: boolean;\n}\n\nconst types: {\n [key: string]: TokContext;\n} = {\n brace: new TokContext(\"{\"), // normal JavaScript expression\n j_oTag: new TokContext(\"<tag\"), // JSX opening tag\n j_cTag: new TokContext(\"</tag\"), // JSX closing tag\n j_expr: new TokContext(\"<tag>...</tag>\", true), // JSX expressions\n};\n\nif (!process.env.BABEL_8_BREAKING) {\n types.template = new TokContext(\"`\", true);\n}\n\nexport { types };\n","import { types as tc, type TokContext } from \"./context\";\n// ## Token types\n\n// The assignment of fine-grained, information-carrying type objects\n// allows the tokenizer to store the information it has about a\n// token in a way that is very cheap for the parser to look up.\n\n// All token type variables start with an underscore, to make them\n// easy to recognize.\n\n// The `beforeExpr` property is used to disambiguate between 1) binary\n// expression (<) and JSX Tag start (<name>); 2) object literal and JSX\n// texts. It is set on the `updateContext` function in the JSX plugin.\n\n// The `startsExpr` property is used to determine whether an expression\n// may be the “argument” subexpression of a `yield` expression or\n// `yield` statement. It is set on all token types that may be at the\n// start of a subexpression.\n\n// `isLoop` marks a keyword as starting a loop, which is important\n// to know when parsing a label, in order to allow or disallow\n// continue jumps to that label.\n\nconst beforeExpr = true;\nconst startsExpr = true;\nconst isLoop = true;\nconst isAssign = true;\nconst prefix = true;\nconst postfix = true;\n\ntype TokenOptions = {\n keyword?: string;\n beforeExpr?: boolean;\n startsExpr?: boolean;\n rightAssociative?: boolean;\n isLoop?: boolean;\n isAssign?: boolean;\n prefix?: boolean;\n postfix?: boolean;\n binop?: number | null;\n};\n\n// Internally the tokenizer stores token as a number\nexport type TokenType = number;\n\n// The `ExportedTokenType` is exported via `tokTypes` and accessible\n// when `tokens: true` is enabled. Unlike internal token type, it provides\n// metadata of the tokens.\nexport class ExportedTokenType {\n label: string;\n keyword: string | undefined | null;\n beforeExpr: boolean;\n startsExpr: boolean;\n rightAssociative: boolean;\n isLoop: boolean;\n isAssign: boolean;\n prefix: boolean;\n postfix: boolean;\n binop: number | undefined | null;\n // todo(Babel 8): remove updateContext from exposed token layout\n declare updateContext:\n | ((context: Array<TokContext>) => void)\n | undefined\n | null;\n\n constructor(label: string, conf: TokenOptions = {}) {\n this.label = label;\n this.keyword = conf.keyword;\n this.beforeExpr = !!conf.beforeExpr;\n this.startsExpr = !!conf.startsExpr;\n this.rightAssociative = !!conf.rightAssociative;\n this.isLoop = !!conf.isLoop;\n this.isAssign = !!conf.isAssign;\n this.prefix = !!conf.prefix;\n this.postfix = !!conf.postfix;\n this.binop = conf.binop != null ? conf.binop : null;\n if (!process.env.BABEL_8_BREAKING) {\n this.updateContext = null;\n }\n }\n}\n\n// A map from keyword/keyword-like string value to the token type\nexport const keywords = new Map<string, TokenType>();\n\nfunction createKeyword(name: string, options: TokenOptions = {}): TokenType {\n options.keyword = name;\n const token = createToken(name, options);\n keywords.set(name, token);\n return token;\n}\n\nfunction createBinop(name: string, binop: number) {\n return createToken(name, { beforeExpr, binop });\n}\n\nlet tokenTypeCounter = -1;\nexport const tokenTypes: ExportedTokenType[] = [];\nconst tokenLabels: string[] = [];\nconst tokenBinops: number[] = [];\nconst tokenBeforeExprs: boolean[] = [];\nconst tokenStartsExprs: boolean[] = [];\nconst tokenPrefixes: boolean[] = [];\n\nfunction createToken(name: string, options: TokenOptions = {}): TokenType {\n ++tokenTypeCounter;\n tokenLabels.push(name);\n tokenBinops.push(options.binop ?? -1);\n tokenBeforeExprs.push(options.beforeExpr ?? false);\n tokenStartsExprs.push(options.startsExpr ?? false);\n tokenPrefixes.push(options.prefix ?? false);\n tokenTypes.push(new ExportedTokenType(name, options));\n\n return tokenTypeCounter;\n}\n\nfunction createKeywordLike(\n name: string,\n options: TokenOptions = {},\n): TokenType {\n ++tokenTypeCounter;\n keywords.set(name, tokenTypeCounter);\n tokenLabels.push(name);\n tokenBinops.push(options.binop ?? -1);\n tokenBeforeExprs.push(options.beforeExpr ?? false);\n tokenStartsExprs.push(options.startsExpr ?? false);\n tokenPrefixes.push(options.prefix ?? false);\n // In the exported token type, we set the label as \"name\" for backward compatibility with Babel 7\n tokenTypes.push(new ExportedTokenType(\"name\", options));\n\n return tokenTypeCounter;\n}\n\n// For performance the token type helpers depend on the following declarations order.\n// When adding new token types, please also check if the token helpers need update.\n\nexport type InternalTokenTypes = typeof tt;\n\nexport const tt = {\n // Punctuation token types.\n bracketL: createToken(\"[\", { beforeExpr, startsExpr }),\n bracketHashL: createToken(\"#[\", { beforeExpr, startsExpr }),\n bracketBarL: createToken(\"[|\", { beforeExpr, startsExpr }),\n bracketR: createToken(\"]\"),\n bracketBarR: createToken(\"|]\"),\n braceL: createToken(\"{\", { beforeExpr, startsExpr }),\n braceBarL: createToken(\"{|\", { beforeExpr, startsExpr }),\n braceHashL: createToken(\"#{\", { beforeExpr, startsExpr }),\n braceR: createToken(\"}\"),\n braceBarR: createToken(\"|}\"),\n parenL: createToken(\"(\", { beforeExpr, startsExpr }),\n parenR: createToken(\")\"),\n comma: createToken(\",\", { beforeExpr }),\n semi: createToken(\";\", { beforeExpr }),\n colon: createToken(\":\", { beforeExpr }),\n doubleColon: createToken(\"::\", { beforeExpr }),\n dot: createToken(\".\"),\n question: createToken(\"?\", { beforeExpr }),\n questionDot: createToken(\"?.\"),\n arrow: createToken(\"=>\", { beforeExpr }),\n template: createToken(\"template\"),\n ellipsis: createToken(\"...\", { beforeExpr }),\n backQuote: createToken(\"`\", { startsExpr }),\n dollarBraceL: createToken(\"${\", { beforeExpr, startsExpr }),\n // start: isTemplate\n templateTail: createToken(\"...`\", { startsExpr }),\n templateNonTail: createToken(\"...${\", { beforeExpr, startsExpr }),\n // end: isTemplate\n at: createToken(\"@\"),\n hash: createToken(\"#\", { startsExpr }),\n\n // Special hashbang token.\n interpreterDirective: createToken(\"#!...\"),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n // start: isAssign\n eq: createToken(\"=\", { beforeExpr, isAssign }),\n assign: createToken(\"_=\", { beforeExpr, isAssign }),\n slashAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n // These are only needed to support % and ^ as a Hack-pipe topic token.\n // When the proposal settles on a token, the others can be merged with\n // tt.assign.\n xorAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n moduloAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n // end: isAssign\n\n incDec: createToken(\"++/--\", { prefix, postfix, startsExpr }),\n bang: createToken(\"!\", { beforeExpr, prefix, startsExpr }),\n tilde: createToken(\"~\", { beforeExpr, prefix, startsExpr }),\n\n // More possible topic tokens.\n // When the proposal settles on a token, at least one of these may be removed.\n doubleCaret: createToken(\"^^\", { startsExpr }),\n doubleAt: createToken(\"@@\", { startsExpr }),\n\n // start: isBinop\n pipeline: createBinop(\"|>\", 0),\n nullishCoalescing: createBinop(\"??\", 1),\n logicalOR: createBinop(\"||\", 1),\n logicalAND: createBinop(\"&&\", 2),\n bitwiseOR: createBinop(\"|\", 3),\n bitwiseXOR: createBinop(\"^\", 4),\n bitwiseAND: createBinop(\"&\", 5),\n equality: createBinop(\"==/!=/===/!==\", 6),\n lt: createBinop(\"</>/<=/>=\", 7),\n gt: createBinop(\"</>/<=/>=\", 7),\n relational: createBinop(\"</>/<=/>=\", 7),\n bitShift: createBinop(\"<</>>/>>>\", 8),\n bitShiftL: createBinop(\"<</>>/>>>\", 8),\n bitShiftR: createBinop(\"<</>>/>>>\", 8),\n plusMin: createToken(\"+/-\", { beforeExpr, binop: 9, prefix, startsExpr }),\n // startsExpr: required by v8intrinsic plugin\n modulo: createToken(\"%\", { binop: 10, startsExpr }),\n // unset `beforeExpr` as it can be `function *`\n star: createToken(\"*\", { binop: 10 }),\n slash: createBinop(\"/\", 10),\n exponent: createToken(\"**\", {\n beforeExpr,\n binop: 11,\n rightAssociative: true,\n }),\n\n // Keywords\n // Don't forget to update packages/babel-helper-validator-identifier/src/keyword.js\n // when new keywords are added\n // start: isLiteralPropertyName\n // start: isKeyword\n _in: createKeyword(\"in\", { beforeExpr, binop: 7 }),\n _instanceof: createKeyword(\"instanceof\", { beforeExpr, binop: 7 }),\n // end: isBinop\n _break: createKeyword(\"break\"),\n _case: createKeyword(\"case\", { beforeExpr }),\n _catch: createKeyword(\"catch\"),\n _continue: createKeyword(\"continue\"),\n _debugger: createKeyword(\"debugger\"),\n _default: createKeyword(\"default\", { beforeExpr }),\n _else: createKeyword(\"else\", { beforeExpr }),\n _finally: createKeyword(\"finally\"),\n _function: createKeyword(\"function\", { startsExpr }),\n _if: createKeyword(\"if\"),\n _return: createKeyword(\"return\", { beforeExpr }),\n _switch: createKeyword(\"switch\"),\n _throw: createKeyword(\"throw\", { beforeExpr, prefix, startsExpr }),\n _try: createKeyword(\"try\"),\n _var: createKeyword(\"var\"),\n _const: createKeyword(\"const\"),\n _with: createKeyword(\"with\"),\n _new: createKeyword(\"new\", { beforeExpr, startsExpr }),\n _this: createKeyword(\"this\", { startsExpr }),\n _super: createKeyword(\"super\", { startsExpr }),\n _class: createKeyword(\"class\", { startsExpr }),\n _extends: createKeyword(\"extends\", { beforeExpr }),\n _export: createKeyword(\"export\"),\n _import: createKeyword(\"import\", { startsExpr }),\n _null: createKeyword(\"null\", { startsExpr }),\n _true: createKeyword(\"true\", { startsExpr }),\n _false: createKeyword(\"false\", { startsExpr }),\n _typeof: createKeyword(\"typeof\", { beforeExpr, prefix, startsExpr }),\n _void: createKeyword(\"void\", { beforeExpr, prefix, startsExpr }),\n _delete: createKeyword(\"delete\", { beforeExpr, prefix, startsExpr }),\n // start: isLoop\n _do: createKeyword(\"do\", { isLoop, beforeExpr }),\n _for: createKeyword(\"for\", { isLoop }),\n _while: createKeyword(\"while\", { isLoop }),\n // end: isLoop\n // end: isKeyword\n\n // Primary literals\n // start: isIdentifier\n _as: createKeywordLike(\"as\", { startsExpr }),\n _assert: createKeywordLike(\"assert\", { startsExpr }),\n _async: createKeywordLike(\"async\", { startsExpr }),\n _await: createKeywordLike(\"await\", { startsExpr }),\n _from: createKeywordLike(\"from\", { startsExpr }),\n _get: createKeywordLike(\"get\", { startsExpr }),\n _let: createKeywordLike(\"let\", { startsExpr }),\n _meta: createKeywordLike(\"meta\", { startsExpr }),\n _of: createKeywordLike(\"of\", { startsExpr }),\n _sent: createKeywordLike(\"sent\", { startsExpr }),\n _set: createKeywordLike(\"set\", { startsExpr }),\n _static: createKeywordLike(\"static\", { startsExpr }),\n _using: createKeywordLike(\"using\", { startsExpr }),\n _yield: createKeywordLike(\"yield\", { startsExpr }),\n\n // Flow and TypeScript Keywordlike\n _asserts: createKeywordLike(\"asserts\", { startsExpr }),\n _checks: createKeywordLike(\"checks\", { startsExpr }),\n _exports: createKeywordLike(\"exports\", { startsExpr }),\n _global: createKeywordLike(\"global\", { startsExpr }),\n _implements: createKeywordLike(\"implements\", { startsExpr }),\n _intrinsic: createKeywordLike(\"intrinsic\", { startsExpr }),\n _infer: createKeywordLike(\"infer\", { startsExpr }),\n _is: createKeywordLike(\"is\", { startsExpr }),\n _mixins: createKeywordLike(\"mixins\", { startsExpr }),\n _proto: createKeywordLike(\"proto\", { startsExpr }),\n _require: createKeywordLike(\"require\", { startsExpr }),\n _satisfies: createKeywordLike(\"satisfies\", { startsExpr }),\n // start: isTSTypeOperator\n _keyof: createKeywordLike(\"keyof\", { startsExpr }),\n _readonly: createKeywordLike(\"readonly\", { startsExpr }),\n _unique: createKeywordLike(\"unique\", { startsExpr }),\n // end: isTSTypeOperator\n // start: isTSDeclarationStart\n _abstract: createKeywordLike(\"abstract\", { startsExpr }),\n _declare: createKeywordLike(\"declare\", { startsExpr }),\n _enum: createKeywordLike(\"enum\", { startsExpr }),\n _module: createKeywordLike(\"module\", { startsExpr }),\n _namespace: createKeywordLike(\"namespace\", { startsExpr }),\n // start: isFlowInterfaceOrTypeOrOpaque\n _interface: createKeywordLike(\"interface\", { startsExpr }),\n _type: createKeywordLike(\"type\", { startsExpr }),\n // end: isTSDeclarationStart\n _opaque: createKeywordLike(\"opaque\", { startsExpr }),\n // end: isFlowInterfaceOrTypeOrOpaque\n name: createToken(\"name\", { startsExpr }),\n // end: isIdentifier\n\n string: createToken(\"string\", { startsExpr }),\n num: createToken(\"num\", { startsExpr }),\n bigint: createToken(\"bigint\", { startsExpr }),\n decimal: createToken(\"decimal\", { startsExpr }),\n // end: isLiteralPropertyName\n regexp: createToken(\"regexp\", { startsExpr }),\n privateName: createToken(\"#name\", { startsExpr }),\n eof: createToken(\"eof\"),\n\n // jsx plugin\n jsxName: createToken(\"jsxName\"),\n jsxText: createToken(\"jsxText\", { beforeExpr: true }),\n jsxTagStart: createToken(\"jsxTagStart\", { startsExpr: true }),\n jsxTagEnd: createToken(\"jsxTagEnd\"),\n\n // placeholder plugin\n placeholder: createToken(\"%%\", { startsExpr: true }),\n} as const;\n\nexport function tokenIsIdentifier(token: TokenType): boolean {\n return token >= tt._as && token <= tt.name;\n}\n\nexport function tokenKeywordOrIdentifierIsKeyword(token: TokenType): boolean {\n // we can remove the token >= tt._in check when we\n // know a token is either keyword or identifier\n return token <= tt._while;\n}\n\nexport function tokenIsKeywordOrIdentifier(token: TokenType): boolean {\n return token >= tt._in && token <= tt.name;\n}\n\nexport function tokenIsLiteralPropertyName(token: TokenType): boolean {\n return token >= tt._in && token <= tt.decimal;\n}\n\nexport function tokenComesBeforeExpression(token: TokenType): boolean {\n return tokenBeforeExprs[token];\n}\n\nexport function tokenCanStartExpression(token: TokenType): boolean {\n return tokenStartsExprs[token];\n}\n\nexport function tokenIsAssignment(token: TokenType): boolean {\n return token >= tt.eq && token <= tt.moduloAssign;\n}\n\nexport function tokenIsFlowInterfaceOrTypeOrOpaque(token: TokenType): boolean {\n return token >= tt._interface && token <= tt._opaque;\n}\n\nexport function tokenIsLoop(token: TokenType): boolean {\n return token >= tt._do && token <= tt._while;\n}\n\nexport function tokenIsKeyword(token: TokenType): boolean {\n return token >= tt._in && token <= tt._while;\n}\n\nexport function tokenIsOperator(token: TokenType): boolean {\n return token >= tt.pipeline && token <= tt._instanceof;\n}\n\nexport function tokenIsPostfix(token: TokenType): boolean {\n return token === tt.incDec;\n}\n\nexport function tokenIsPrefix(token: TokenType): boolean {\n return tokenPrefixes[token];\n}\n\nexport function tokenIsTSTypeOperator(token: TokenType): boolean {\n return token >= tt._keyof && token <= tt._unique;\n}\n\nexport function tokenIsTSDeclarationStart(token: TokenType): boolean {\n return token >= tt._abstract && token <= tt._type;\n}\n\nexport function tokenLabelName(token: TokenType): string {\n return tokenLabels[token];\n}\n\nexport function tokenOperatorPrecedence(token: TokenType): number {\n return tokenBinops[token];\n}\n\nexport function tokenIsBinaryOperator(token: TokenType): boolean {\n return tokenBinops[token] !== -1;\n}\n\nexport function tokenIsRightAssociative(token: TokenType): boolean {\n return token === tt.exponent;\n}\n\nexport function tokenIsTemplate(token: TokenType): boolean {\n return token >= tt.templateTail && token <= tt.templateNonTail;\n}\n\nexport function getExportedToken(token: TokenType): ExportedTokenType {\n return tokenTypes[token];\n}\n\nexport function isTokenType(obj: any): boolean {\n return typeof obj === \"number\";\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n tokenTypes[tt.braceR].updateContext = context => {\n context.pop();\n };\n\n tokenTypes[tt.braceL].updateContext =\n tokenTypes[tt.braceHashL].updateContext =\n tokenTypes[tt.dollarBraceL].updateContext =\n context => {\n context.push(tc.brace);\n };\n\n tokenTypes[tt.backQuote].updateContext = context => {\n if (context[context.length - 1] === tc.template) {\n context.pop();\n } else {\n context.push(tc.template);\n }\n };\n\n tokenTypes[tt.jsxTagStart].updateContext = context => {\n context.push(tc.j_expr, tc.j_oTag);\n };\n}\n","import * as charCodes from \"charcodes\";\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point between 0x80 and 0xffff.\n// Generated by `scripts/generate-identifier-regex.js`.\n\n/* prettier-ignore */\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088e\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\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u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7ca\\ua7d0\\ua7d1\\ua7d3\\ua7d5-\\ua7d9\\ua7f2-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n/* prettier-ignore */\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0898-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u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\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1ace\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\n\nconst nonASCIIidentifierStart = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + \"]\",\n);\nconst nonASCIIidentifier = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\",\n);\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\n// These are a run-length and offset-encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by `scripts/generate-identifier-regex.js`.\n/* prettier-ignore */\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191];\n/* prettier-ignore */\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code: number, set: readonly number[]): boolean {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code: number): boolean {\n if (code < charCodes.uppercaseA) return code === charCodes.dollarSign;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return (\n code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n );\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code: number): boolean {\n if (code < charCodes.digit0) return code === charCodes.dollarSign;\n if (code < charCodes.colon) return true;\n if (code < charCodes.uppercaseA) return false;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return (\n isInAstralSet(code, astralIdentifierStartCodes) ||\n isInAstralSet(code, astralIdentifierCodes)\n );\n}\n\n// Test whether a given string is a valid identifier name\n\nexport function isIdentifierName(name: string): boolean {\n let isFirst = true;\n for (let i = 0; i < name.length; i++) {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `name` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = name.charCodeAt(i);\n if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {\n const trail = name.charCodeAt(++i);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n if (isFirst) {\n isFirst = false;\n if (!isIdentifierStart(cp)) {\n return false;\n }\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n return !isFirst;\n}\n","const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n","/* eslint max-len: 0 */\n\nimport * as charCodes from \"charcodes\";\nimport { isIdentifierStart } from \"@babel/helper-validator-identifier\";\n\nexport {\n isIdentifierStart,\n isIdentifierChar,\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"@babel/helper-validator-identifier\";\n\nexport const keywordRelationalOperator = /^in(stanceof)?$/;\n\n// Test whether a current state character code and next character code is @\n\nexport function isIteratorStart(\n current: number,\n next: number,\n next2: number,\n): boolean {\n return (\n current === charCodes.atSign &&\n next === charCodes.atSign &&\n isIdentifierStart(next2)\n );\n}\n\n// This is the comprehensive set of JavaScript reserved words\n// If a word is in this set, it could be a reserved word,\n// depending on sourceType/strictMode/binding info. In other words\n// if a word is not in this set, it is not a reserved word under\n// any circumstance.\nconst reservedWordLikeSet = new Set([\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n // strict\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n // strictBind\n \"eval\",\n \"arguments\",\n // reservedWorkLike\n \"enum\",\n \"await\",\n]);\n\nexport function canBeReservedWord(word: string): boolean {\n return reservedWordLikeSet.has(word);\n}\n","// Each scope gets a bitset that may contain these flags\n// prettier-ignore\nexport const SCOPE_OTHER = 0b000000000,\n SCOPE_PROGRAM = 0b000000001,\n SCOPE_FUNCTION = 0b000000010,\n SCOPE_ARROW = 0b000000100,\n SCOPE_SIMPLE_CATCH = 0b000001000,\n SCOPE_SUPER = 0b000010000,\n SCOPE_DIRECT_SUPER = 0b000100000,\n SCOPE_CLASS = 0b001000000,\n SCOPE_STATIC_BLOCK = 0b010000000,\n SCOPE_TS_MODULE = 0b100000000,\n SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_STATIC_BLOCK | SCOPE_TS_MODULE;\n\nexport type ScopeFlags =\n | typeof SCOPE_OTHER\n | typeof SCOPE_PROGRAM\n | typeof SCOPE_FUNCTION\n | typeof SCOPE_VAR\n | typeof SCOPE_ARROW\n | typeof SCOPE_SIMPLE_CATCH\n | typeof SCOPE_SUPER\n | typeof SCOPE_DIRECT_SUPER\n | typeof SCOPE_CLASS\n | typeof SCOPE_STATIC_BLOCK;\n\n// These flags are meant to be _only_ used inside the Scope class (or subclasses).\n// prettier-ignore\nexport const BIND_KIND_VALUE = 0b0000000_0000_01,\n BIND_KIND_TYPE = 0b0000000_0000_10,\n // Used in checkLVal and declareName to determine the type of a binding\n BIND_SCOPE_VAR = 0b0000000_0001_00, // Var-style binding\n BIND_SCOPE_LEXICAL = 0b0000000_0010_00, // Let- or const-style binding\n BIND_SCOPE_FUNCTION = 0b0000000_0100_00, // Function declaration\n BIND_SCOPE_OUTSIDE = 0b0000000_1000_00, // Special case for function names as\n // bound inside the function\n // Misc flags\n BIND_FLAGS_NONE = 0b00000001_0000_00,\n BIND_FLAGS_CLASS = 0b00000010_0000_00,\n BIND_FLAGS_TS_ENUM = 0b00000100_0000_00,\n BIND_FLAGS_TS_CONST_ENUM = 0b00001000_0000_00,\n BIND_FLAGS_TS_EXPORT_ONLY = 0b00010000_0000_00,\n BIND_FLAGS_FLOW_DECLARE_FN = 0b00100000_0000_00,\n BIND_FLAGS_TS_IMPORT = 0b01000000_0000_00,\n // Whether \"let\" should be allowed in bound names in sloppy mode\n BIND_FLAGS_NO_LET_IN_LEXICAL = 0b10000000_0000_00;\n\n// These flags are meant to be _only_ used by Scope consumers\n// prettier-ignore\n/* = is value? | is type? | scope | misc flags */\nexport const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS|BIND_FLAGS_NO_LET_IN_LEXICAL,\n BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | BIND_FLAGS_NO_LET_IN_LEXICAL,\n BIND_CATCH_PARAM = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0 ,\n BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0 ,\n BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0 ,\n BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS ,\n BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0 ,\n BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM|BIND_FLAGS_NO_LET_IN_LEXICAL,\n BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,\n // These bindings don't introduce anything in the scope. They are used for assignments and\n // function expressions IDs.\n BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE ,\n BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE ,\n\n BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM ,\n BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,\n BIND_TS_TYPE_IMPORT= 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_TS_IMPORT ,\n\n BIND_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN;\n\nexport type BindingTypes =\n | typeof BIND_NONE\n | typeof BIND_OUTSIDE\n | typeof BIND_VAR\n | typeof BIND_LEXICAL\n | typeof BIND_CLASS\n | typeof BIND_FUNCTION\n | typeof BIND_TS_INTERFACE\n | typeof BIND_TS_TYPE\n | typeof BIND_TS_ENUM\n | typeof BIND_TS_AMBIENT\n | typeof BIND_TS_NAMESPACE;\n\n// prettier-ignore\nexport const CLASS_ELEMENT_FLAG_STATIC = 0b1_00,\n CLASS_ELEMENT_KIND_GETTER = 0b0_10,\n CLASS_ELEMENT_KIND_SETTER = 0b0_01,\n CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER;\n\n// prettier-ignore\nexport const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER,\n CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER,\n CLASS_ELEMENT_OTHER = 0;\n\nexport type ClassElementTypes =\n | typeof CLASS_ELEMENT_STATIC_GETTER\n | typeof CLASS_ELEMENT_STATIC_SETTER\n | typeof CLASS_ELEMENT_INSTANCE_GETTER\n | typeof CLASS_ELEMENT_INSTANCE_SETTER\n | typeof CLASS_ELEMENT_OTHER;\n","import {\n SCOPE_ARROW,\n SCOPE_DIRECT_SUPER,\n SCOPE_FUNCTION,\n SCOPE_SIMPLE_CATCH,\n SCOPE_SUPER,\n SCOPE_PROGRAM,\n SCOPE_VAR,\n SCOPE_CLASS,\n SCOPE_STATIC_BLOCK,\n BIND_SCOPE_FUNCTION,\n BIND_SCOPE_VAR,\n BIND_SCOPE_LEXICAL,\n BIND_KIND_VALUE,\n type ScopeFlags,\n type BindingTypes,\n} from \"./scopeflags\";\nimport type { Position } from \"./location\";\nimport type * as N from \"../types\";\nimport { Errors } from \"../parse-error\";\nimport type Tokenizer from \"../tokenizer\";\n\n// Start an AST node, attaching a start offset.\nexport class Scope {\n declare flags: ScopeFlags;\n // A set of var-declared names in the current lexical scope\n var: Set<string> = new Set();\n // A set of lexically-declared names in the current lexical scope\n lexical: Set<string> = new Set();\n // A set of lexically-declared FunctionDeclaration names in the current lexical scope\n functions: Set<string> = new Set();\n\n constructor(flags: ScopeFlags) {\n this.flags = flags;\n }\n}\n\n// The functions in this module keep track of declared variables in the\n// current scope in order to detect duplicate variable names.\nexport default class ScopeHandler<IScope extends Scope = Scope> {\n parser: Tokenizer;\n scopeStack: Array<IScope> = [];\n inModule: boolean;\n undefinedExports: Map<string, Position> = new Map();\n\n constructor(parser: Tokenizer, inModule: boolean) {\n this.parser = parser;\n this.inModule = inModule;\n }\n\n get inTopLevel() {\n return (this.currentScope().flags & SCOPE_PROGRAM) > 0;\n }\n get inFunction() {\n return (this.currentVarScopeFlags() & SCOPE_FUNCTION) > 0;\n }\n get allowSuper() {\n return (this.currentThisScopeFlags() & SCOPE_SUPER) > 0;\n }\n get allowDirectSuper() {\n return (this.currentThisScopeFlags() & SCOPE_DIRECT_SUPER) > 0;\n }\n get inClass() {\n return (this.currentThisScopeFlags() & SCOPE_CLASS) > 0;\n }\n get inClassAndNotInNonArrowFunction() {\n const flags = this.currentThisScopeFlags();\n return (flags & SCOPE_CLASS) > 0 && (flags & SCOPE_FUNCTION) === 0;\n }\n get inStaticBlock() {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (flags & SCOPE_STATIC_BLOCK) {\n return true;\n }\n if (flags & (SCOPE_VAR | SCOPE_CLASS)) {\n // function body, module body, class property initializers\n return false;\n }\n }\n }\n get inNonArrowFunction() {\n return (this.currentThisScopeFlags() & SCOPE_FUNCTION) > 0;\n }\n get treatFunctionsAsVar() {\n return this.treatFunctionsAsVarInScope(this.currentScope());\n }\n\n createScope(flags: ScopeFlags): Scope {\n return new Scope(flags);\n }\n\n enter(flags: ScopeFlags) {\n /*:: +createScope: (flags: ScopeFlags) => IScope; */\n // @ts-expect-error This method will be overwritten by subclasses\n this.scopeStack.push(this.createScope(flags));\n }\n\n exit(): ScopeFlags {\n const scope = this.scopeStack.pop();\n return scope.flags;\n }\n\n // The spec says:\n // > At the top level of a function, or script, function declarations are\n // > treated like var declarations rather than like lexical declarations.\n treatFunctionsAsVarInScope(scope: IScope): boolean {\n return !!(\n scope.flags & (SCOPE_FUNCTION | SCOPE_STATIC_BLOCK) ||\n (!this.parser.inModule && scope.flags & SCOPE_PROGRAM)\n );\n }\n\n declareName(name: string, bindingType: BindingTypes, loc: Position) {\n let scope = this.currentScope();\n if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n\n if (bindingType & BIND_SCOPE_FUNCTION) {\n scope.functions.add(name);\n } else {\n scope.lexical.add(name);\n }\n\n if (bindingType & BIND_SCOPE_LEXICAL) {\n this.maybeExportDefined(scope, name);\n }\n } else if (bindingType & BIND_SCOPE_VAR) {\n for (let i = this.scopeStack.length - 1; i >= 0; --i) {\n scope = this.scopeStack[i];\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n scope.var.add(name);\n this.maybeExportDefined(scope, name);\n\n if (scope.flags & SCOPE_VAR) break;\n }\n }\n if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n maybeExportDefined(scope: IScope, name: string) {\n if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n checkRedeclarationInScope(\n scope: IScope,\n name: string,\n bindingType: BindingTypes,\n loc: Position,\n ) {\n if (this.isRedeclaredInScope(scope, name, bindingType)) {\n this.parser.raise(Errors.VarRedeclaration, {\n at: loc,\n identifierName: name,\n });\n }\n }\n\n isRedeclaredInScope(\n scope: IScope,\n name: string,\n bindingType: BindingTypes,\n ): boolean {\n if (!(bindingType & BIND_KIND_VALUE)) return false;\n\n if (bindingType & BIND_SCOPE_LEXICAL) {\n return (\n scope.lexical.has(name) ||\n scope.functions.has(name) ||\n scope.var.has(name)\n );\n }\n\n if (bindingType & BIND_SCOPE_FUNCTION) {\n return (\n scope.lexical.has(name) ||\n (!this.treatFunctionsAsVarInScope(scope) && scope.var.has(name))\n );\n }\n\n return (\n (scope.lexical.has(name) &&\n // Annex B.3.4\n // https://tc39.es/ecma262/#sec-variablestatements-in-catch-blocks\n !(\n scope.flags & SCOPE_SIMPLE_CATCH &&\n scope.lexical.values().next().value === name\n )) ||\n (!this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name))\n );\n }\n\n checkLocalExport(id: N.Identifier) {\n const { name } = id;\n const topLevelScope = this.scopeStack[0];\n if (\n !topLevelScope.lexical.has(name) &&\n !topLevelScope.var.has(name) &&\n // In strict mode, scope.functions will always be empty.\n // Modules are strict by default, but the `scriptMode` option\n // can overwrite this behavior.\n !topLevelScope.functions.has(name)\n ) {\n this.undefinedExports.set(name, id.loc.start);\n }\n }\n\n currentScope(): IScope {\n return this.scopeStack[this.scopeStack.length - 1];\n }\n\n currentVarScopeFlags(): ScopeFlags {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (flags & SCOPE_VAR) {\n return flags;\n }\n }\n }\n\n // Could be useful for `arguments`, `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\n currentThisScopeFlags(): ScopeFlags {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (flags & (SCOPE_VAR | SCOPE_CLASS) && !(flags & SCOPE_ARROW)) {\n return flags;\n }\n }\n }\n}\n","import type { Position } from \"../../util/location\";\nimport ScopeHandler, { Scope } from \"../../util/scope\";\nimport {\n BIND_FLAGS_FLOW_DECLARE_FN,\n type ScopeFlags,\n type BindingTypes,\n} from \"../../util/scopeflags\";\nimport type * as N from \"../../types\";\n\n// Reference implementation: https://github.com/facebook/flow/blob/23aeb2a2ef6eb4241ce178fde5d8f17c5f747fb5/src/typing/env.ml#L536-L584\nclass FlowScope extends Scope {\n // declare function foo(): type;\n declareFunctions: Set<string> = new Set();\n}\n\nexport default class FlowScopeHandler extends ScopeHandler<FlowScope> {\n createScope(flags: ScopeFlags): FlowScope {\n return new FlowScope(flags);\n }\n\n declareName(name: string, bindingType: BindingTypes, loc: Position) {\n const scope = this.currentScope();\n if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n this.maybeExportDefined(scope, name);\n scope.declareFunctions.add(name);\n return;\n }\n\n super.declareName(name, bindingType, loc);\n }\n\n isRedeclaredInScope(\n scope: FlowScope,\n name: string,\n bindingType: BindingTypes,\n ): boolean {\n if (super.isRedeclaredInScope(scope, name, bindingType)) return true;\n\n if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {\n return (\n !scope.declareFunctions.has(name) &&\n (scope.lexical.has(name) || scope.functions.has(name))\n );\n }\n\n return false;\n }\n\n checkLocalExport(id: N.Identifier) {\n if (!this.scopeStack[0].declareFunctions.has(id.name)) {\n super.checkLocalExport(id);\n }\n }\n}\n","import type { Options } from \"../options\";\nimport type State from \"../tokenizer/state\";\nimport type { PluginsMap } from \"./index\";\nimport type ScopeHandler from \"../util/scope\";\nimport type ExpressionScopeHandler from \"../util/expression-scope\";\nimport type ClassScopeHandler from \"../util/class-scope\";\nimport type ProductionParameterHandler from \"../util/production-parameter\";\nimport type {\n ParserPluginWithOptions,\n PluginConfig,\n PluginOptions,\n} from \"../typings\";\n\nexport default class BaseParser {\n // Properties set by constructor in index.js\n declare options: Options;\n declare inModule: boolean;\n declare scope: ScopeHandler<any>;\n declare classScope: ClassScopeHandler;\n declare prodParam: ProductionParameterHandler;\n declare expressionScope: ExpressionScopeHandler;\n declare plugins: PluginsMap;\n declare filename: string | undefined | null;\n // Names of exports store. `default` is stored as a name for both\n // `export default foo;` and `export { foo as default };`.\n declare exportedIdentifiers: Set<string>;\n sawUnambiguousESM: boolean = false;\n ambiguousScriptDifferentAst: boolean = false;\n\n // Initialized by Tokenizer\n declare state: State;\n // input and length are not in state as they are constant and we do\n // not want to ever copy them, which happens if state gets cloned\n declare input: string;\n declare length: number;\n\n // This method accepts either a string (plugin name) or an array pair\n // (plugin name and options object). If an options object is given,\n // then each value is non-recursively checked for identity with that\n // plugin’s actual option value.\n hasPlugin(pluginConfig: PluginConfig): boolean {\n if (typeof pluginConfig === \"string\") {\n return this.plugins.has(pluginConfig);\n } else {\n const [pluginName, pluginOptions] = pluginConfig;\n if (!this.hasPlugin(pluginName)) {\n return false;\n }\n const actualOptions = this.plugins.get(pluginName);\n for (const key of Object.keys(\n pluginOptions,\n ) as (keyof typeof pluginOptions)[]) {\n if (actualOptions?.[key] !== pluginOptions[key]) {\n return false;\n }\n }\n return true;\n }\n }\n\n getPluginOption<\n PluginName extends ParserPluginWithOptions[0],\n OptionName extends keyof PluginOptions<PluginName>,\n >(plugin: PluginName, name: OptionName) {\n return (this.plugins.get(plugin) as null | PluginOptions<PluginName>)?.[\n name\n ];\n }\n}\n","/*:: declare var invariant; */\n\nimport BaseParser from \"./base\";\nimport type { Comment, Node, Identifier } from \"../types\";\nimport * as charCodes from \"charcodes\";\nimport type { Undone } from \"./node\";\n\n/**\n * A whitespace token containing comments\n */\nexport type CommentWhitespace = {\n /**\n * the start of the whitespace token.\n */\n start: number;\n /**\n * the end of the whitespace token.\n */\n end: number;\n /**\n * the containing comments\n */\n comments: Array<Comment>;\n /**\n * the immediately preceding AST node of the whitespace token\n */\n leadingNode: Node | null;\n /**\n * the immediately following AST node of the whitespace token\n */\n trailingNode: Node | null;\n /**\n * the innermost AST node containing the whitespace with minimal size (|end - start|)\n */\n containingNode: Node | null;\n};\n\n/**\n * Merge comments with node's trailingComments or assign comments to be\n * trailingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nfunction setTrailingComments(node: Undone<Node>, comments: Array<Comment>) {\n if (node.trailingComments === undefined) {\n node.trailingComments = comments;\n } else {\n node.trailingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's leadingComments or assign comments to be\n * leadingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nfunction setLeadingComments(node: Undone<Node>, comments: Array<Comment>) {\n if (node.leadingComments === undefined) {\n node.leadingComments = comments;\n } else {\n node.leadingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's innerComments or assign comments to be\n * innerComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nexport function setInnerComments(\n node: Undone<Node>,\n comments?: Array<Comment>,\n) {\n if (node.innerComments === undefined) {\n node.innerComments = comments;\n } else {\n node.innerComments.unshift(...comments);\n }\n}\n\n/**\n * Given node and elements array, if elements has non-null element,\n * merge comments to its trailingComments, otherwise merge comments\n * to node's innerComments\n */\nfunction adjustInnerComments(\n node: Undone<Node>,\n elements: Array<Node>,\n commentWS: CommentWhitespace,\n) {\n let lastElement = null;\n let i = elements.length;\n while (lastElement === null && i > 0) {\n lastElement = elements[--i];\n }\n if (lastElement === null || lastElement.start > commentWS.start) {\n setInnerComments(node, commentWS.comments);\n } else {\n setTrailingComments(lastElement, commentWS.comments);\n }\n}\n\nexport default class CommentsParser extends BaseParser {\n addComment(comment: Comment): void {\n if (this.filename) comment.loc.filename = this.filename;\n this.state.comments.push(comment);\n }\n\n /**\n * Given a newly created AST node _n_, attach _n_ to a comment whitespace _w_ if applicable\n * {@see {@link CommentWhitespace}}\n */\n processComment(node: Node): void {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n const lastCommentWS = commentStack[i];\n\n if (lastCommentWS.start === node.end) {\n lastCommentWS.leadingNode = node;\n i--;\n }\n\n const { start: nodeStart } = node;\n // invariant: for all 0 <= j <= i, let c = commentStack[j], c must satisfy c.end < node.end\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n if (commentEnd > nodeStart) {\n // by definition of commentWhiteSpace, this implies commentWS.start > nodeStart\n // so node can be a containingNode candidate. At this time we can finalize the comment\n // whitespace, because\n // 1) its leadingNode or trailingNode, if exists, will not change\n // 2) its containingNode have been assigned and will not change because it is the\n // innermost minimal-sized AST node\n commentWS.containingNode = node;\n this.finalizeComment(commentWS);\n commentStack.splice(i, 1);\n } else {\n if (commentEnd === nodeStart) {\n commentWS.trailingNode = node;\n }\n // stop the loop when commentEnd <= nodeStart\n break;\n }\n }\n }\n\n /**\n * Assign the comments of comment whitespaces to related AST nodes.\n * Also adjust innerComments following trailing comma.\n */\n finalizeComment(commentWS: CommentWhitespace) {\n const { comments } = commentWS;\n if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {\n if (commentWS.leadingNode !== null) {\n setTrailingComments(commentWS.leadingNode, comments);\n }\n if (commentWS.trailingNode !== null) {\n setLeadingComments(commentWS.trailingNode, comments);\n }\n } else {\n /*:: invariant(commentWS.containingNode !== null) */\n const { containingNode: node, start: commentStart } = commentWS;\n if (this.input.charCodeAt(commentStart - 1) === charCodes.comma) {\n // If a commentWhitespace follows a comma and the containingNode allows\n // list structures with trailing comma, merge it to the trailingComment\n // of the last non-null list element\n switch (node.type) {\n case \"ObjectExpression\":\n case \"ObjectPattern\":\n case \"RecordExpression\":\n adjustInnerComments(node, node.properties, commentWS);\n break;\n case \"CallExpression\":\n case \"OptionalCallExpression\":\n adjustInnerComments(node, node.arguments, commentWS);\n break;\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n case \"ArrowFunctionExpression\":\n case \"ObjectMethod\":\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n adjustInnerComments(node, node.params, commentWS);\n break;\n case \"ArrayExpression\":\n case \"ArrayPattern\":\n case \"TupleExpression\":\n adjustInnerComments(node, node.elements, commentWS);\n break;\n case \"ExportNamedDeclaration\":\n case \"ImportDeclaration\":\n adjustInnerComments(node, node.specifiers, commentWS);\n break;\n default: {\n setInnerComments(node, comments);\n }\n }\n } else {\n setInnerComments(node, comments);\n }\n }\n }\n\n /**\n * Drains remaining commentStack and applies finalizeComment\n * to each comment whitespace. Used only in parseExpression\n * where the top level AST node is _not_ Program\n * {@see {@link CommentsParser#finalizeComment}}\n */\n finalizeRemainingComments() {\n const { commentStack } = this.state;\n for (let i = commentStack.length - 1; i >= 0; i--) {\n this.finalizeComment(commentStack[i]);\n }\n this.state.commentStack = [];\n }\n\n /* eslint-disable no-irregular-whitespace */\n /**\n * Reset previous node trailing comments. Used in object / class\n * property parsing. We parse `async`, `static`, `set` and `get`\n * as an identifier but may reinterpret it into an async/static/accessor\n * method later. In this case the identifier is not part of the AST and we\n * should sync the knowledge to commentStacks\n *\n * For example, when parsing\n * ```\n * async /* 1 */ function f() {}\n * ```\n * the comment whitespace `/* 1 */` has leading node Identifier(async). When\n * we see the function token, we create a Function node and mark `/* 1 */` as\n * inner comments. So `/* 1 */` should be detached from the Identifier node.\n *\n * @param node the last finished AST node _before_ current token\n */\n /* eslint-enable no-irregular-whitespace */\n resetPreviousNodeTrailingComments(node: Node) {\n const { commentStack } = this.state;\n const { length } = commentStack;\n if (length === 0) return;\n const commentWS = commentStack[length - 1];\n if (commentWS.leadingNode === node) {\n commentWS.leadingNode = null;\n }\n }\n\n /* eslint-disable no-irregular-whitespace */\n /**\n * Reset previous node leading comments, assuming that `node` is a\n * single-token node. Used in import phase modifiers parsing. We parse\n * `module` in `import module foo from ...` as an identifier but may\n * reinterpret it into a phase modifier later. In this case the identifier is\n * not part of the AST and we should sync the knowledge to commentStacks\n *\n * For example, when parsing\n * ```\n * import /* 1 */ module a from \"a\";\n * ```\n * the comment whitespace `/* 1 */` has trailing node Identifier(module). When\n * we see that `module` is not a default import binding, we mark `/* 1 */` as\n * inner comments of the ImportDeclaration. So `/* 1 */` should be detached from\n * the Identifier node.\n *\n * @param node the last finished AST node _before_ current token\n */\n /* eslint-enable no-irregular-whitespace */\n resetPreviousIdentifierLeadingComments(node: Identifier) {\n const { commentStack } = this.state;\n const { length } = commentStack;\n if (length === 0) return;\n\n if (commentStack[length - 1].trailingNode === node) {\n commentStack[length - 1].trailingNode = null;\n } else if (length >= 2 && commentStack[length - 2].trailingNode === node) {\n commentStack[length - 2].trailingNode = null;\n }\n }\n\n /**\n * Attach a node to the comment whitespaces right before/after\n * the given range.\n *\n * This is used to properly attach comments around parenthesized\n * expressions as leading/trailing comments of the inner expression.\n */\n takeSurroundingComments(node: Node, start: number, end: number) {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n const commentStart = commentWS.start;\n\n if (commentStart === end) {\n commentWS.leadingNode = node;\n } else if (commentEnd === start) {\n commentWS.trailingNode = node;\n } else if (commentEnd < start) {\n break;\n }\n }\n }\n}\n","import * as charCodes from \"charcodes\";\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\nexport const lineBreak = /\\r\\n?|[\\n\\u2028\\u2029]/;\nexport const lineBreakG = new RegExp(lineBreak.source, \"g\");\n\n// https://tc39.github.io/ecma262/#sec-line-terminators\nexport function isNewLine(code: number): boolean {\n switch (code) {\n case charCodes.lineFeed:\n case charCodes.carriageReturn:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return true;\n\n default:\n return false;\n }\n}\n\nexport const skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n\nexport const skipWhiteSpaceInLine =\n /(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*/g;\n\n// Skip whitespace and single-line comments, including /* no newline here */.\n// After this RegExp matches, its lastIndex points to a line terminator, or\n// the start of multi-line comment (which is effectively a line terminator),\n// or the end of string.\nexport const skipWhiteSpaceToLineBreak = new RegExp(\n // Unfortunately JS doesn't support Perl's atomic /(?>pattern)/ or\n // possessive quantifiers, so we use a trick to prevent backtracking\n // when the look-ahead for line terminator fails.\n \"(?=(\" +\n // Capture the whitespace and comments that should be skipped inside\n // a look-ahead assertion, and then re-match the group as a unit.\n skipWhiteSpaceInLine.source +\n \"))\\\\1\" +\n // Look-ahead for either line terminator, start of multi-line comment,\n // or end of string.\n /(?=[\\n\\r\\u2028\\u2029]|\\/\\*(?!.*?\\*\\/)|$)/.source,\n \"y\", // sticky\n);\n\n// https://tc39.github.io/ecma262/#sec-white-space\nexport function isWhitespace(code: number): boolean {\n switch (code) {\n case 0x0009: // CHARACTER TABULATION\n case 0x000b: // LINE TABULATION\n case 0x000c: // FORM FEED\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.oghamSpaceMark:\n case 0x2000: // EN QUAD\n case 0x2001: // EM QUAD\n case 0x2002: // EN SPACE\n case 0x2003: // EM SPACE\n case 0x2004: // THREE-PER-EM SPACE\n case 0x2005: // FOUR-PER-EM SPACE\n case 0x2006: // SIX-PER-EM SPACE\n case 0x2007: // FIGURE SPACE\n case 0x2008: // PUNCTUATION SPACE\n case 0x2009: // THIN SPACE\n case 0x200a: // HAIR SPACE\n case 0x202f: // NARROW NO-BREAK SPACE\n case 0x205f: // MEDIUM MATHEMATICAL SPACE\n case 0x3000: // IDEOGRAPHIC SPACE\n case 0xfeff: // ZERO WIDTH NO-BREAK SPACE\n return true;\n\n default:\n return false;\n }\n}\n","import type { Options } from \"../options\";\nimport type * as N from \"../types\";\nimport type { CommentWhitespace } from \"../parser/comments\";\nimport { Position } from \"../util/location\";\n\nimport { types as ct, type TokContext } from \"./context\";\nimport { tt, type TokenType } from \"./types\";\nimport type { Errors } from \"../parse-error\";\nimport type { ParseError } from \"../parse-error\";\n\nexport type DeferredStrictError =\n | typeof Errors.StrictNumericEscape\n | typeof Errors.StrictOctalLiteral;\n\ntype TopicContextState = {\n // When a topic binding has been currently established,\n // then this is 1. Otherwise, it is 0. This is forwards compatible\n // with a future plugin for multiple lexical topics.\n maxNumOfResolvableTopics: number;\n // When a topic binding has been currently established, and if that binding\n // has been used as a topic reference `#`, then this is 0. Otherwise, it is\n // `null`. This is forwards compatible with a future plugin for multiple\n // lexical topics.\n maxTopicIndex: null | 0;\n};\n\nexport default class State {\n strict: boolean;\n curLine: number;\n lineStart: number;\n\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n startLoc: Position;\n endLoc: Position;\n\n init({ strictMode, sourceType, startLine, startColumn }: Options): void {\n this.strict =\n strictMode === false\n ? false\n : strictMode === true\n ? true\n : sourceType === \"module\";\n\n this.curLine = startLine;\n this.lineStart = -startColumn;\n this.startLoc = this.endLoc = new Position(startLine, startColumn, 0);\n }\n\n errors: ParseError<any>[] = [];\n\n // Used to signify the start of a potential arrow function\n potentialArrowAt: number = -1;\n\n // Used to signify the start of an expression which looks like a\n // typed arrow function, but it isn't\n // e.g. a ? (b) : c => d\n // ^\n noArrowAt: number[] = [];\n\n // Used to signify the start of an expression whose params, if it looks like\n // an arrow function, shouldn't be converted to assignable nodes.\n // This is used to defer the validation of typed arrow functions inside\n // conditional expressions.\n // e.g. a ? (b) : c => d\n // ^\n noArrowParamsConversionAt: number[] = [];\n\n // Flags to track\n maybeInArrowParameters: boolean = false;\n inType: boolean = false;\n noAnonFunctionType: boolean = false;\n hasFlowComment: boolean = false;\n isAmbientContext: boolean = false;\n inAbstractClass: boolean = false;\n inDisallowConditionalTypesContext: boolean = false;\n\n // For the Hack-style pipelines plugin\n topicContext: TopicContextState = {\n maxNumOfResolvableTopics: 0,\n maxTopicIndex: null,\n };\n\n // For the F#-style pipelines plugin\n soloAwait: boolean = false;\n inFSharpPipelineDirectBody: boolean = false;\n\n // Labels in scope.\n labels: Array<{\n kind: \"loop\" | \"switch\" | undefined | null;\n name?: string | null;\n statementStart?: number;\n }> = [];\n\n // Comment store for Program.comments\n comments: Array<N.Comment> = [];\n\n // Comment attachment store\n commentStack: Array<CommentWhitespace> = [];\n\n // The current position of the tokenizer in the input.\n pos: number = 0;\n\n // Properties of the current token:\n // Its type\n type: TokenType = tt.eof;\n\n // For tokens that include more information than their type, the value\n value: any = null;\n\n // Its start and end offset\n start: number = 0;\n end: number = 0;\n\n // Position information for the previous token\n // this is initialized when generating the second token.\n lastTokEndLoc: Position = null;\n // this is initialized when generating the second token.\n lastTokStartLoc: Position = null;\n lastTokStart: number = 0;\n\n // The context stack is used to track whether the apostrophe \"`\" starts\n // or ends a string template\n context: Array<TokContext> = [ct.brace];\n // Used to track whether a JSX element is allowed to form\n canStartJSXElement: boolean = true;\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n containsEsc: boolean = false;\n\n // Used to track invalid escape sequences in template literals,\n // that must be reported if the template is not tagged.\n firstInvalidTemplateEscapePos: null | Position = null;\n\n // This property is used to track the following errors\n // - StrictNumericEscape\n // - StrictOctalLiteral\n //\n // in a literal that occurs prior to/immediately after a \"use strict\" directive.\n\n // todo(JLHwung): set strictErrors to null and avoid recording string errors\n // after a non-directive is parsed\n strictErrors: Map<number, [DeferredStrictError, Position]> = new Map();\n\n // Tokens length in token store\n tokensLength: number = 0;\n\n curPosition(): Position {\n return new Position(this.curLine, this.pos - this.lineStart, this.pos);\n }\n\n clone(skipArrays?: boolean): State {\n const state = new State();\n const keys = Object.keys(this) as (keyof State)[];\n for (let i = 0, length = keys.length; i < length; i++) {\n const key = keys[i];\n let val = this[key];\n\n if (!skipArrays && Array.isArray(val)) {\n val = val.slice();\n }\n\n // @ts-expect-error val must conform to S[key]\n state[key] = val;\n }\n\n return state;\n }\n}\n\nexport type LookaheadState = {\n pos: number;\n value: any;\n type: TokenType;\n start: number;\n end: number;\n context: TokContext[];\n startLoc: Position;\n lastTokEndLoc: Position;\n curLine: number;\n lineStart: number;\n curPosition: () => Position;\n /* Used only in readToken_mult_modulo */\n inType: boolean;\n // These boolean properties are not initialized in createLookaheadState()\n // instead they will only be set by the tokenizer\n containsEsc?: boolean;\n};\n","import * as charCodes from \"charcodes\";\n\n// The following character codes are forbidden from being\n// an immediate sibling of NumericLiteralSeparator _\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: new Set<number>([\n charCodes.dot,\n charCodes.uppercaseB,\n charCodes.uppercaseE,\n charCodes.uppercaseO,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseB,\n charCodes.lowercaseE,\n charCodes.lowercaseO,\n ]),\n hex: new Set<number>([\n charCodes.dot,\n charCodes.uppercaseX,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseX,\n ]),\n};\n\nconst isAllowedNumericSeparatorSibling = {\n // 0 - 1\n bin: (ch: number) => ch === charCodes.digit0 || ch === charCodes.digit1,\n\n // 0 - 7\n oct: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit7,\n\n // 0 - 9\n dec: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit9,\n\n // 0 - 9, A - F, a - f,\n hex: (ch: number) =>\n (ch >= charCodes.digit0 && ch <= charCodes.digit9) ||\n (ch >= charCodes.uppercaseA && ch <= charCodes.uppercaseF) ||\n (ch >= charCodes.lowercaseA && ch <= charCodes.lowercaseF),\n};\n\nexport type StringContentsErrorHandlers = EscapedCharErrorHandlers & {\n unterminated(\n initialPos: number,\n initialLineStart: number,\n initialCurLine: number,\n ): void;\n};\n\nexport function readStringContents(\n type: \"single\" | \"double\" | \"template\",\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n errors: StringContentsErrorHandlers,\n) {\n const initialPos = pos;\n const initialLineStart = lineStart;\n const initialCurLine = curLine;\n\n let out = \"\";\n let firstInvalidLoc = null;\n let chunkStart = pos;\n const { length } = input;\n for (;;) {\n if (pos >= length) {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n out += input.slice(chunkStart, pos);\n break;\n }\n const ch = input.charCodeAt(pos);\n if (isStringEnd(type, ch, input, pos)) {\n out += input.slice(chunkStart, pos);\n break;\n }\n if (ch === charCodes.backslash) {\n out += input.slice(chunkStart, pos);\n const res = readEscapedChar(\n input,\n pos,\n lineStart,\n curLine,\n type === \"template\",\n errors,\n );\n if (res.ch === null && !firstInvalidLoc) {\n firstInvalidLoc = { pos, lineStart, curLine };\n } else {\n out += res.ch;\n }\n ({ pos, lineStart, curLine } = res);\n chunkStart = pos;\n } else if (\n ch === charCodes.lineSeparator ||\n ch === charCodes.paragraphSeparator\n ) {\n ++pos;\n ++curLine;\n lineStart = pos;\n } else if (ch === charCodes.lineFeed || ch === charCodes.carriageReturn) {\n if (type === \"template\") {\n out += input.slice(chunkStart, pos) + \"\\n\";\n ++pos;\n if (\n ch === charCodes.carriageReturn &&\n input.charCodeAt(pos) === charCodes.lineFeed\n ) {\n ++pos;\n }\n ++curLine;\n chunkStart = lineStart = pos;\n } else {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n }\n } else {\n ++pos;\n }\n }\n return process.env.BABEL_8_BREAKING\n ? { pos, str: out, firstInvalidLoc, lineStart, curLine }\n : {\n pos,\n str: out,\n firstInvalidLoc,\n lineStart,\n curLine,\n containsInvalid: !!firstInvalidLoc,\n };\n}\n\nfunction isStringEnd(\n type: \"single\" | \"double\" | \"template\",\n ch: number,\n input: string,\n pos: number,\n) {\n if (type === \"template\") {\n return (\n ch === charCodes.graveAccent ||\n (ch === charCodes.dollarSign &&\n input.charCodeAt(pos + 1) === charCodes.leftCurlyBrace)\n );\n }\n return (\n ch === (type === \"double\" ? charCodes.quotationMark : charCodes.apostrophe)\n );\n}\n\ntype EscapedCharErrorHandlers = HexCharErrorHandlers &\n CodePointErrorHandlers & {\n strictNumericEscape(pos: number, lineStart: number, curLine: number): void;\n };\n\nfunction readEscapedChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n inTemplate: boolean,\n errors: EscapedCharErrorHandlers,\n) {\n const throwOnInvalid = !inTemplate;\n pos++; // skip '\\'\n\n const res = (ch: string | null) => ({ pos, ch, lineStart, curLine });\n\n const ch = input.charCodeAt(pos++);\n switch (ch) {\n case charCodes.lowercaseN:\n return res(\"\\n\");\n case charCodes.lowercaseR:\n return res(\"\\r\");\n case charCodes.lowercaseX: {\n let code;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 2,\n false,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCharCode(code));\n }\n case charCodes.lowercaseU: {\n let code;\n ({ code, pos } = readCodePoint(\n input,\n pos,\n lineStart,\n curLine,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCodePoint(code));\n }\n case charCodes.lowercaseT:\n return res(\"\\t\");\n case charCodes.lowercaseB:\n return res(\"\\b\");\n case charCodes.lowercaseV:\n return res(\"\\u000b\");\n case charCodes.lowercaseF:\n return res(\"\\f\");\n case charCodes.carriageReturn:\n if (input.charCodeAt(pos) === charCodes.lineFeed) {\n ++pos;\n }\n // fall through\n case charCodes.lineFeed:\n lineStart = pos;\n ++curLine;\n // fall through\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return res(\"\");\n case charCodes.digit8:\n case charCodes.digit9:\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(pos - 1, lineStart, curLine);\n }\n // fall through\n default:\n if (ch >= charCodes.digit0 && ch <= charCodes.digit7) {\n const startPos = pos - 1;\n const match = input.slice(startPos, pos + 2).match(/^[0-7]+/)!;\n\n let octalStr = match[0];\n\n let octal = parseInt(octalStr, 8);\n if (octal > 255) {\n octalStr = octalStr.slice(0, -1);\n octal = parseInt(octalStr, 8);\n }\n pos += octalStr.length - 1;\n const next = input.charCodeAt(pos);\n if (\n octalStr !== \"0\" ||\n next === charCodes.digit8 ||\n next === charCodes.digit9\n ) {\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(startPos, lineStart, curLine);\n }\n }\n\n return res(String.fromCharCode(octal));\n }\n\n return res(String.fromCharCode(ch));\n }\n}\n\ntype HexCharErrorHandlers = IntErrorHandlers & {\n invalidEscapeSequence(pos: number, lineStart: number, curLine: number): void;\n};\n\n// Used to read character escape sequences ('\\x', '\\u').\nfunction readHexChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n len: number,\n forceLen: boolean,\n throwOnInvalid: boolean,\n errors: HexCharErrorHandlers,\n) {\n const initialPos = pos;\n let n;\n ({ n, pos } = readInt(\n input,\n pos,\n lineStart,\n curLine,\n 16,\n len,\n forceLen,\n false,\n errors,\n /* bailOnError */ !throwOnInvalid,\n ));\n if (n === null) {\n if (throwOnInvalid) {\n errors.invalidEscapeSequence(initialPos, lineStart, curLine);\n } else {\n pos = initialPos - 1;\n }\n }\n return { code: n, pos };\n}\n\nexport type IntErrorHandlers = {\n numericSeparatorInEscapeSequence(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n unexpectedNumericSeparator(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n // It can return \"true\" to indicate that the error was handled\n // and the int parsing should continue.\n invalidDigit(\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n ): boolean;\n};\n\nexport function readInt(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n len: number | undefined,\n forceLen: boolean,\n allowNumSeparator: boolean | \"bail\",\n errors: IntErrorHandlers,\n bailOnError: boolean,\n) {\n const start = pos;\n const forbiddenSiblings =\n radix === 16\n ? forbiddenNumericSeparatorSiblings.hex\n : forbiddenNumericSeparatorSiblings.decBinOct;\n const isAllowedSibling =\n radix === 16\n ? isAllowedNumericSeparatorSibling.hex\n : radix === 10\n ? isAllowedNumericSeparatorSibling.dec\n : radix === 8\n ? isAllowedNumericSeparatorSibling.oct\n : isAllowedNumericSeparatorSibling.bin;\n\n let invalid = false;\n let total = 0;\n\n for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {\n const code = input.charCodeAt(pos);\n let val;\n\n if (code === charCodes.underscore && allowNumSeparator !== \"bail\") {\n const prev = input.charCodeAt(pos - 1);\n const next = input.charCodeAt(pos + 1);\n\n if (!allowNumSeparator) {\n if (bailOnError) return { n: null, pos };\n errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);\n } else if (\n Number.isNaN(next) ||\n !isAllowedSibling(next) ||\n forbiddenSiblings.has(prev) ||\n forbiddenSiblings.has(next)\n ) {\n if (bailOnError) return { n: null, pos };\n errors.unexpectedNumericSeparator(pos, lineStart, curLine);\n }\n\n // Ignore this _ character\n ++pos;\n continue;\n }\n\n if (code >= charCodes.lowercaseA) {\n val = code - charCodes.lowercaseA + charCodes.lineFeed;\n } else if (code >= charCodes.uppercaseA) {\n val = code - charCodes.uppercaseA + charCodes.lineFeed;\n } else if (charCodes.isDigit(code)) {\n val = code - charCodes.digit0; // 0-9\n } else {\n val = Infinity;\n }\n if (val >= radix) {\n // If we found a digit which is too big, errors.invalidDigit can return true to avoid\n // breaking the loop (this is used for error recovery).\n if (val <= 9 && bailOnError) {\n return { n: null, pos };\n } else if (\n val <= 9 &&\n errors.invalidDigit(pos, lineStart, curLine, radix)\n ) {\n val = 0;\n } else if (forceLen) {\n val = 0;\n invalid = true;\n } else {\n break;\n }\n }\n ++pos;\n total = total * radix + val;\n }\n if (pos === start || (len != null && pos - start !== len) || invalid) {\n return { n: null, pos };\n }\n\n return { n: total, pos };\n}\n\nexport type CodePointErrorHandlers = HexCharErrorHandlers & {\n invalidCodePoint(pos: number, lineStart: number, curLine: number): void;\n};\n\nexport function readCodePoint(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n throwOnInvalid: boolean,\n errors: CodePointErrorHandlers,\n) {\n const ch = input.charCodeAt(pos);\n let code;\n\n if (ch === charCodes.leftCurlyBrace) {\n ++pos;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n input.indexOf(\"}\", pos) - pos,\n true,\n throwOnInvalid,\n errors,\n ));\n ++pos;\n if (code !== null && code > 0x10ffff) {\n if (throwOnInvalid) {\n errors.invalidCodePoint(pos, lineStart, curLine);\n } else {\n return { code: null, pos };\n }\n }\n } else {\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 4,\n false,\n throwOnInvalid,\n errors,\n ));\n }\n return { code, pos };\n}\n","/*:: declare var invariant; */\n\nimport type { Options } from \"../options\";\nimport {\n Position,\n SourceLocation,\n createPositionWithColumnOffset,\n} from \"../util/location\";\nimport CommentsParser, { type CommentWhitespace } from \"../parser/comments\";\nimport type * as N from \"../types\";\nimport * as charCodes from \"charcodes\";\nimport { isIdentifierStart, isIdentifierChar } from \"../util/identifier\";\nimport {\n tokenIsKeyword,\n tokenLabelName,\n tt,\n keywords as keywordTypes,\n type TokenType,\n} from \"./types\";\nimport type { TokContext } from \"./context\";\nimport {\n Errors,\n type ParseError,\n type ParseErrorConstructor,\n type RaiseProperties,\n} from \"../parse-error\";\nimport {\n lineBreakG,\n isNewLine,\n isWhitespace,\n skipWhiteSpace,\n skipWhiteSpaceInLine,\n} from \"../util/whitespace\";\nimport State from \"./state\";\nimport type { LookaheadState, DeferredStrictError } from \"./state\";\n\nimport {\n readInt,\n readCodePoint,\n readStringContents,\n type IntErrorHandlers,\n type CodePointErrorHandlers,\n type StringContentsErrorHandlers,\n} from \"@babel/helper-string-parser\";\n\nimport type { Plugin } from \"../typings\";\n\nfunction buildPosition(pos: number, lineStart: number, curLine: number) {\n return new Position(curLine, pos - lineStart, pos);\n}\n\nconst VALID_REGEX_FLAGS = new Set([\n charCodes.lowercaseG,\n charCodes.lowercaseM,\n charCodes.lowercaseS,\n charCodes.lowercaseI,\n charCodes.lowercaseY,\n charCodes.lowercaseU,\n charCodes.lowercaseD,\n charCodes.lowercaseV,\n]);\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nexport class Token {\n constructor(state: State) {\n this.type = state.type;\n this.value = state.value;\n this.start = state.start;\n this.end = state.end;\n this.loc = new SourceLocation(state.startLoc, state.endLoc);\n }\n\n declare type: TokenType;\n declare value: any;\n declare start: number;\n declare end: number;\n declare loc: SourceLocation;\n}\n\n// ## Tokenizer\n\nexport default abstract class Tokenizer extends CommentsParser {\n isLookahead: boolean;\n\n // Token store.\n tokens: Array<Token | N.Comment> = [];\n\n constructor(options: Options, input: string) {\n super();\n this.state = new State();\n this.state.init(options);\n this.input = input;\n this.length = input.length;\n this.isLookahead = false;\n }\n\n pushToken(token: Token | N.Comment) {\n // Pop out invalid tokens trapped by try-catch parsing.\n // Those parsing branches are mainly created by typescript and flow plugins.\n this.tokens.length = this.state.tokensLength;\n this.tokens.push(token);\n ++this.state.tokensLength;\n }\n\n // Move to the next token\n\n next(): void {\n this.checkKeywordEscapes();\n if (this.options.tokens) {\n this.pushToken(new Token(this.state));\n }\n\n this.state.lastTokStart = this.state.start;\n this.state.lastTokEndLoc = this.state.endLoc;\n this.state.lastTokStartLoc = this.state.startLoc;\n this.nextToken();\n }\n\n eat(type: TokenType): boolean {\n if (this.match(type)) {\n this.next();\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Whether current token matches given type\n */\n match(type: TokenType): boolean {\n return this.state.type === type;\n }\n\n /**\n * Create a LookaheadState from current parser state\n */\n createLookaheadState(state: State): LookaheadState {\n return {\n pos: state.pos,\n value: null,\n type: state.type,\n start: state.start,\n end: state.end,\n context: [this.curContext()],\n inType: state.inType,\n startLoc: state.startLoc,\n lastTokEndLoc: state.lastTokEndLoc,\n curLine: state.curLine,\n lineStart: state.lineStart,\n curPosition: state.curPosition,\n };\n }\n\n /**\n * lookahead peeks the next token, skipping changes to token context and\n * comment stack. For performance it returns a limited LookaheadState\n * instead of full parser state.\n *\n * The { column, line } Loc info is not included in lookahead since such usage\n * is rare. Although it may return other location properties e.g. `curLine` and\n * `lineStart`, these properties are not listed in the LookaheadState interface\n * and thus the returned value is _NOT_ reliable.\n *\n * The tokenizer should make best efforts to avoid using any parser state\n * other than those defined in LookaheadState\n */\n lookahead(): LookaheadState {\n const old = this.state;\n // @ts-expect-error For performance we use a simplified tokenizer state structure\n this.state = this.createLookaheadState(old);\n\n this.isLookahead = true;\n this.nextToken();\n this.isLookahead = false;\n\n const curr = this.state;\n this.state = old;\n return curr;\n }\n\n nextTokenStart(): number {\n return this.nextTokenStartSince(this.state.pos);\n }\n\n nextTokenStartSince(pos: number): number {\n skipWhiteSpace.lastIndex = pos;\n return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos;\n }\n\n lookaheadCharCode(): number {\n return this.input.charCodeAt(this.nextTokenStart());\n }\n\n /**\n * Similar to nextToken, but it will stop at line break when it is seen before the next token\n *\n * @returns {number} position of the next token start or line break, whichever is seen first.\n * @memberof Tokenizer\n */\n nextTokenInLineStart(): number {\n return this.nextTokenInLineStartSince(this.state.pos);\n }\n\n nextTokenInLineStartSince(pos: number): number {\n skipWhiteSpaceInLine.lastIndex = pos;\n return skipWhiteSpaceInLine.test(this.input)\n ? skipWhiteSpaceInLine.lastIndex\n : pos;\n }\n\n /**\n * Similar to lookaheadCharCode, but it will return the char code of line break if it is\n * seen before the next token\n *\n * @returns {number} char code of the next token start or line break, whichever is seen first.\n * @memberof Tokenizer\n */\n lookaheadInLineCharCode(): number {\n return this.input.charCodeAt(this.nextTokenInLineStart());\n }\n\n codePointAtPos(pos: number): number {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `input` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = this.input.charCodeAt(pos);\n if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) {\n const trail = this.input.charCodeAt(pos);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n return cp;\n }\n\n // Toggle strict mode. Re-reads the next number or string to please\n // pedantic tests (`\"use strict\"; 010;` should fail).\n\n setStrict(strict: boolean): void {\n this.state.strict = strict;\n if (strict) {\n // Throw an error for any string decimal escape found before/immediately\n // after a \"use strict\" directive. Strict mode will be set at parse\n // time for any literals that occur after the next node of the strict\n // directive.\n this.state.strictErrors.forEach(([toParseError, at]) =>\n this.raise(toParseError, { at }),\n );\n this.state.strictErrors.clear();\n }\n }\n\n curContext(): TokContext {\n return this.state.context[this.state.context.length - 1];\n }\n\n // Read a single token, updating the parser object's token-related properties.\n nextToken(): void {\n this.skipSpace();\n this.state.start = this.state.pos;\n if (!this.isLookahead) this.state.startLoc = this.state.curPosition();\n if (this.state.pos >= this.length) {\n this.finishToken(tt.eof);\n return;\n }\n\n this.getTokenFromCode(this.codePointAtPos(this.state.pos));\n }\n\n // Skips a block comment, whose end is marked by commentEnd.\n // *-/ is used by the Flow plugin, when parsing block comments nested\n // inside Flow comments.\n skipBlockComment(commentEnd: \"*/\" | \"*-/\"): N.CommentBlock | undefined {\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n const start = this.state.pos;\n const end = this.input.indexOf(commentEnd, start + 2);\n if (end === -1) {\n // We have to call this again here because startLoc may not be set...\n // This seems to be for performance reasons:\n // https://github.com/babel/babel/commit/acf2a10899f696a8aaf34df78bf9725b5ea7f2da\n throw this.raise(Errors.UnterminatedComment, {\n at: this.state.curPosition(),\n });\n }\n\n this.state.pos = end + commentEnd.length;\n lineBreakG.lastIndex = start + 2;\n while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) {\n ++this.state.curLine;\n this.state.lineStart = lineBreakG.lastIndex;\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n /*:: invariant(startLoc) */\n\n const comment: N.CommentBlock = {\n type: \"CommentBlock\",\n value: this.input.slice(start + 2, end),\n start,\n end: end + commentEnd.length,\n loc: new SourceLocation(startLoc, this.state.curPosition()),\n };\n if (this.options.tokens) this.pushToken(comment);\n return comment;\n }\n\n skipLineComment(startSkip: number): N.CommentLine | undefined {\n const start = this.state.pos;\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n let ch = this.input.charCodeAt((this.state.pos += startSkip));\n if (this.state.pos < this.length) {\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n /*:: invariant(startLoc) */\n\n const end = this.state.pos;\n const value = this.input.slice(start + startSkip, end);\n\n const comment: N.CommentLine = {\n type: \"CommentLine\",\n value,\n start,\n end,\n loc: new SourceLocation(startLoc, this.state.curPosition()),\n };\n if (this.options.tokens) this.pushToken(comment);\n return comment;\n }\n\n // Called at the start of the parse and after every token. Skips\n // whitespace and comments, and.\n\n skipSpace(): void {\n const spaceStart = this.state.pos;\n const comments = [];\n loop: while (this.state.pos < this.length) {\n const ch = this.input.charCodeAt(this.state.pos);\n switch (ch) {\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.tab:\n ++this.state.pos;\n break;\n case charCodes.carriageReturn:\n if (\n this.input.charCodeAt(this.state.pos + 1) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n }\n // fall through\n case charCodes.lineFeed:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n ++this.state.pos;\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n break;\n\n case charCodes.slash:\n switch (this.input.charCodeAt(this.state.pos + 1)) {\n case charCodes.asterisk: {\n const comment = this.skipBlockComment(\"*/\");\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n break;\n }\n\n case charCodes.slash: {\n const comment = this.skipLineComment(2);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n break;\n }\n\n default:\n break loop;\n }\n break;\n\n default:\n if (isWhitespace(ch)) {\n ++this.state.pos;\n } else if (\n ch === charCodes.dash &&\n !this.inModule &&\n this.options.annexB\n ) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.dash &&\n this.input.charCodeAt(pos + 2) === charCodes.greaterThan &&\n (spaceStart === 0 || this.state.lineStart > spaceStart)\n ) {\n // A `-->` line comment\n const comment = this.skipLineComment(3);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n } else {\n break loop;\n }\n } else if (\n ch === charCodes.lessThan &&\n !this.inModule &&\n this.options.annexB\n ) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.exclamationMark &&\n this.input.charCodeAt(pos + 2) === charCodes.dash &&\n this.input.charCodeAt(pos + 3) === charCodes.dash\n ) {\n // `<!--`, an XML-style comment that should be interpreted as a line comment\n const comment = this.skipLineComment(4);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n } else {\n break loop;\n }\n } else {\n break loop;\n }\n }\n }\n\n if (comments.length > 0) {\n const end = this.state.pos;\n const commentWhitespace: CommentWhitespace = {\n start: spaceStart,\n end,\n comments,\n leadingNode: null,\n trailingNode: null,\n containingNode: null,\n };\n this.state.commentStack.push(commentWhitespace);\n }\n }\n\n // Called at the end of every token. Sets `end`, `val`, and\n // maintains `context` and `canStartJSXElement`, and skips the space after\n // the token, so that the next one's `start` will point at the\n // right position.\n\n finishToken(type: TokenType, val?: any): void {\n this.state.end = this.state.pos;\n this.state.endLoc = this.state.curPosition();\n const prevType = this.state.type;\n this.state.type = type;\n this.state.value = val;\n\n if (!this.isLookahead) {\n this.updateContext(prevType);\n }\n }\n\n replaceToken(type: TokenType): void {\n this.state.type = type;\n // @ts-expect-error the prevType of updateContext is required\n // only when the new type is tt.slash/tt.jsxTagEnd\n this.updateContext();\n }\n\n // ### Token reading\n\n // This is the function that is called to fetch the next token. It\n // is somewhat obscure, because it works in character codes rather\n // than characters, and because operator parsing has been inlined\n // into it.\n //\n // All in the name of speed.\n\n // number sign is \"#\"\n readToken_numberSign(): void {\n if (this.state.pos === 0 && this.readToken_interpreter()) {\n return;\n }\n\n const nextPos = this.state.pos + 1;\n const next = this.codePointAtPos(nextPos);\n if (next >= charCodes.digit0 && next <= charCodes.digit9) {\n throw this.raise(Errors.UnexpectedDigitAfterHash, {\n at: this.state.curPosition(),\n });\n }\n\n if (\n next === charCodes.leftCurlyBrace ||\n (next === charCodes.leftSquareBracket && this.hasPlugin(\"recordAndTuple\"))\n ) {\n // When we see `#{`, it is likely to be a hash record.\n // However we don't yell at `#[` since users may intend to use \"computed private fields\",\n // which is not allowed in the spec. Throwing expecting recordAndTuple is\n // misleading\n this.expectPlugin(\"recordAndTuple\");\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") === \"bar\") {\n throw this.raise(\n next === charCodes.leftCurlyBrace\n ? Errors.RecordExpressionHashIncorrectStartSyntaxType\n : Errors.TupleExpressionHashIncorrectStartSyntaxType,\n { at: this.state.curPosition() },\n );\n }\n\n this.state.pos += 2;\n if (next === charCodes.leftCurlyBrace) {\n // #{\n this.finishToken(tt.braceHashL);\n } else {\n // #[\n this.finishToken(tt.bracketHashL);\n }\n } else if (isIdentifierStart(next)) {\n ++this.state.pos;\n this.finishToken(tt.privateName, this.readWord1(next));\n } else if (next === charCodes.backslash) {\n ++this.state.pos;\n this.finishToken(tt.privateName, this.readWord1());\n } else {\n this.finishOp(tt.hash, 1);\n }\n }\n\n readToken_dot(): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next >= charCodes.digit0 && next <= charCodes.digit9) {\n this.readNumber(true);\n return;\n }\n\n if (\n next === charCodes.dot &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.dot\n ) {\n this.state.pos += 3;\n this.finishToken(tt.ellipsis);\n } else {\n ++this.state.pos;\n this.finishToken(tt.dot);\n }\n }\n\n readToken_slash(): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.slashAssign, 2);\n } else {\n this.finishOp(tt.slash, 1);\n }\n }\n\n readToken_interpreter(): boolean {\n if (this.state.pos !== 0 || this.length < 2) return false;\n\n let ch = this.input.charCodeAt(this.state.pos + 1);\n if (ch !== charCodes.exclamationMark) return false;\n\n const start = this.state.pos;\n this.state.pos += 1;\n\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n\n const value = this.input.slice(start + 2, this.state.pos);\n\n this.finishToken(tt.interpreterDirective, value);\n\n return true;\n }\n\n readToken_mult_modulo(code: number): void {\n // '%' or '*'\n let type = code === charCodes.asterisk ? tt.star : tt.modulo;\n let width = 1;\n let next = this.input.charCodeAt(this.state.pos + 1);\n\n // Exponentiation operator '**'\n if (code === charCodes.asterisk && next === charCodes.asterisk) {\n width++;\n next = this.input.charCodeAt(this.state.pos + 2);\n type = tt.exponent;\n }\n\n // '%=' or '*='\n if (next === charCodes.equalsTo && !this.state.inType) {\n width++;\n // `tt.moduloAssign` is only needed to support % as a Hack-pipe topic token.\n // If the proposal ends up choosing a different token,\n // it can be merged with tt.assign.\n type = code === charCodes.percentSign ? tt.moduloAssign : tt.assign;\n }\n\n this.finishOp(type, width);\n }\n\n readToken_pipe_amp(code: number): void {\n // '||' '&&' '||=' '&&='\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next === code) {\n if (this.input.charCodeAt(this.state.pos + 2) === charCodes.equalsTo) {\n this.finishOp(tt.assign, 3);\n } else {\n this.finishOp(\n code === charCodes.verticalBar ? tt.logicalOR : tt.logicalAND,\n 2,\n );\n }\n return;\n }\n\n if (code === charCodes.verticalBar) {\n // '|>'\n if (next === charCodes.greaterThan) {\n this.finishOp(tt.pipeline, 2);\n return;\n }\n // '|}'\n if (\n this.hasPlugin(\"recordAndTuple\") &&\n next === charCodes.rightCurlyBrace\n ) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType, {\n at: this.state.curPosition(),\n });\n }\n this.state.pos += 2;\n this.finishToken(tt.braceBarR);\n return;\n }\n\n // '|]'\n if (\n this.hasPlugin(\"recordAndTuple\") &&\n next === charCodes.rightSquareBracket\n ) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, {\n at: this.state.curPosition(),\n });\n }\n this.state.pos += 2;\n this.finishToken(tt.bracketBarR);\n return;\n }\n }\n\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n return;\n }\n\n this.finishOp(\n code === charCodes.verticalBar ? tt.bitwiseOR : tt.bitwiseAND,\n 1,\n );\n }\n\n readToken_caret(): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n // '^='\n if (next === charCodes.equalsTo && !this.state.inType) {\n // `tt.xorAssign` is only needed to support ^ as a Hack-pipe topic token.\n // If the proposal ends up choosing a different token,\n // it can be merged with tt.assign.\n this.finishOp(tt.xorAssign, 2);\n }\n // '^^'\n else if (\n next === charCodes.caret &&\n // If the ^^ token is not enabled, we don't throw but parse two single ^s\n // because it could be a ^ hack token followed by a ^ binary operator.\n this.hasPlugin([\n \"pipelineOperator\",\n { proposal: \"hack\", topicToken: \"^^\" },\n ])\n ) {\n this.finishOp(tt.doubleCaret, 2);\n\n // `^^^` is forbidden and must be separated by a space.\n const lookaheadCh = this.input.codePointAt(this.state.pos);\n if (lookaheadCh === charCodes.caret) {\n this.unexpected();\n }\n }\n // '^'\n else {\n this.finishOp(tt.bitwiseXOR, 1);\n }\n }\n\n readToken_atSign(): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n // '@@'\n if (\n next === charCodes.atSign &&\n this.hasPlugin([\n \"pipelineOperator\",\n { proposal: \"hack\", topicToken: \"@@\" },\n ])\n ) {\n this.finishOp(tt.doubleAt, 2);\n }\n // '@'\n else {\n this.finishOp(tt.at, 1);\n }\n }\n\n readToken_plus_min(code: number): void {\n // '+-'\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next === code) {\n this.finishOp(tt.incDec, 2);\n return;\n }\n\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n } else {\n this.finishOp(tt.plusMin, 1);\n }\n }\n\n readToken_lt(): void {\n // '<'\n const { pos } = this.state;\n const next = this.input.charCodeAt(pos + 1);\n\n if (next === charCodes.lessThan) {\n if (this.input.charCodeAt(pos + 2) === charCodes.equalsTo) {\n this.finishOp(tt.assign, 3);\n return;\n }\n this.finishOp(tt.bitShiftL, 2);\n return;\n }\n\n if (next === charCodes.equalsTo) {\n // <=\n this.finishOp(tt.relational, 2);\n return;\n }\n\n this.finishOp(tt.lt, 1);\n }\n\n readToken_gt(): void {\n // '>'\n const { pos } = this.state;\n const next = this.input.charCodeAt(pos + 1);\n\n if (next === charCodes.greaterThan) {\n const size =\n this.input.charCodeAt(pos + 2) === charCodes.greaterThan ? 3 : 2;\n if (this.input.charCodeAt(pos + size) === charCodes.equalsTo) {\n this.finishOp(tt.assign, size + 1);\n return;\n }\n this.finishOp(tt.bitShiftR, size);\n return;\n }\n\n if (next === charCodes.equalsTo) {\n // <= | >=\n this.finishOp(tt.relational, 2);\n return;\n }\n\n this.finishOp(tt.gt, 1);\n }\n\n readToken_eq_excl(code: number): void {\n // '=!'\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next === charCodes.equalsTo) {\n this.finishOp(\n tt.equality,\n this.input.charCodeAt(this.state.pos + 2) === charCodes.equalsTo\n ? 3\n : 2,\n );\n return;\n }\n if (code === charCodes.equalsTo && next === charCodes.greaterThan) {\n // '=>'\n this.state.pos += 2;\n this.finishToken(tt.arrow);\n return;\n }\n this.finishOp(code === charCodes.equalsTo ? tt.eq : tt.bang, 1);\n }\n\n readToken_question(): void {\n // '?'\n const next = this.input.charCodeAt(this.state.pos + 1);\n const next2 = this.input.charCodeAt(this.state.pos + 2);\n if (next === charCodes.questionMark) {\n if (next2 === charCodes.equalsTo) {\n // '??='\n this.finishOp(tt.assign, 3);\n } else {\n // '??'\n this.finishOp(tt.nullishCoalescing, 2);\n }\n } else if (\n next === charCodes.dot &&\n !(next2 >= charCodes.digit0 && next2 <= charCodes.digit9)\n ) {\n // '.' not followed by a number\n this.state.pos += 2;\n this.finishToken(tt.questionDot);\n } else {\n ++this.state.pos;\n this.finishToken(tt.question);\n }\n }\n\n getTokenFromCode(code: number): void {\n switch (code) {\n // The interpretation of a dot depends on whether it is followed\n // by a digit or another two dots.\n\n case charCodes.dot:\n this.readToken_dot();\n return;\n // Punctuation tokens.\n case charCodes.leftParenthesis:\n ++this.state.pos;\n this.finishToken(tt.parenL);\n return;\n case charCodes.rightParenthesis:\n ++this.state.pos;\n this.finishToken(tt.parenR);\n return;\n case charCodes.semicolon:\n ++this.state.pos;\n this.finishToken(tt.semi);\n return;\n case charCodes.comma:\n ++this.state.pos;\n this.finishToken(tt.comma);\n return;\n case charCodes.leftSquareBracket:\n if (\n this.hasPlugin(\"recordAndTuple\") &&\n this.input.charCodeAt(this.state.pos + 1) === charCodes.verticalBar\n ) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(\n Errors.TupleExpressionBarIncorrectStartSyntaxType,\n { at: this.state.curPosition() },\n );\n }\n\n // [|\n this.state.pos += 2;\n this.finishToken(tt.bracketBarL);\n } else {\n ++this.state.pos;\n this.finishToken(tt.bracketL);\n }\n return;\n case charCodes.rightSquareBracket:\n ++this.state.pos;\n this.finishToken(tt.bracketR);\n return;\n case charCodes.leftCurlyBrace:\n if (\n this.hasPlugin(\"recordAndTuple\") &&\n this.input.charCodeAt(this.state.pos + 1) === charCodes.verticalBar\n ) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(\n Errors.RecordExpressionBarIncorrectStartSyntaxType,\n { at: this.state.curPosition() },\n );\n }\n\n // {|\n this.state.pos += 2;\n this.finishToken(tt.braceBarL);\n } else {\n ++this.state.pos;\n this.finishToken(tt.braceL);\n }\n return;\n case charCodes.rightCurlyBrace:\n ++this.state.pos;\n this.finishToken(tt.braceR);\n return;\n\n case charCodes.colon:\n if (\n this.hasPlugin(\"functionBind\") &&\n this.input.charCodeAt(this.state.pos + 1) === charCodes.colon\n ) {\n this.finishOp(tt.doubleColon, 2);\n } else {\n ++this.state.pos;\n this.finishToken(tt.colon);\n }\n return;\n\n case charCodes.questionMark:\n this.readToken_question();\n return;\n\n case charCodes.graveAccent:\n this.readTemplateToken();\n return;\n\n case charCodes.digit0: {\n const next = this.input.charCodeAt(this.state.pos + 1);\n // '0x', '0X' - hex number\n if (next === charCodes.lowercaseX || next === charCodes.uppercaseX) {\n this.readRadixNumber(16);\n return;\n }\n // '0o', '0O' - octal number\n if (next === charCodes.lowercaseO || next === charCodes.uppercaseO) {\n this.readRadixNumber(8);\n return;\n }\n // '0b', '0B' - binary number\n if (next === charCodes.lowercaseB || next === charCodes.uppercaseB) {\n this.readRadixNumber(2);\n return;\n }\n }\n // Anything else beginning with a digit is an integer, octal\n // number, or float. (fall through)\n case charCodes.digit1:\n case charCodes.digit2:\n case charCodes.digit3:\n case charCodes.digit4:\n case charCodes.digit5:\n case charCodes.digit6:\n case charCodes.digit7:\n case charCodes.digit8:\n case charCodes.digit9:\n this.readNumber(false);\n return;\n\n // Quotes produce strings.\n case charCodes.quotationMark:\n case charCodes.apostrophe:\n this.readString(code);\n return;\n\n // Operators are parsed inline in tiny state machines. '=' (charCodes.equalsTo) is\n // often referred to. `finishOp` simply skips the amount of\n // characters it is given as second argument, and returns a token\n // of the type given by its first argument.\n\n case charCodes.slash:\n this.readToken_slash();\n return;\n\n case charCodes.percentSign:\n case charCodes.asterisk:\n this.readToken_mult_modulo(code);\n return;\n\n case charCodes.verticalBar:\n case charCodes.ampersand:\n this.readToken_pipe_amp(code);\n return;\n\n case charCodes.caret:\n this.readToken_caret();\n return;\n\n case charCodes.plusSign:\n case charCodes.dash:\n this.readToken_plus_min(code);\n return;\n\n case charCodes.lessThan:\n this.readToken_lt();\n return;\n\n case charCodes.greaterThan:\n this.readToken_gt();\n return;\n\n case charCodes.equalsTo:\n case charCodes.exclamationMark:\n this.readToken_eq_excl(code);\n return;\n\n case charCodes.tilde:\n this.finishOp(tt.tilde, 1);\n return;\n\n case charCodes.atSign:\n this.readToken_atSign();\n return;\n\n case charCodes.numberSign:\n this.readToken_numberSign();\n return;\n\n case charCodes.backslash:\n this.readWord();\n return;\n\n default:\n if (isIdentifierStart(code)) {\n this.readWord(code);\n return;\n }\n }\n\n throw this.raise(Errors.InvalidOrUnexpectedToken, {\n at: this.state.curPosition(),\n unexpected: String.fromCodePoint(code),\n });\n }\n\n finishOp(type: TokenType, size: number): void {\n const str = this.input.slice(this.state.pos, this.state.pos + size);\n this.state.pos += size;\n this.finishToken(type, str);\n }\n\n readRegexp(): void {\n const startLoc = this.state.startLoc;\n const start = this.state.start + 1;\n let escaped, inClass;\n let { pos } = this.state;\n for (; ; ++pos) {\n if (pos >= this.length) {\n // FIXME: explain\n throw this.raise(Errors.UnterminatedRegExp, {\n at: createPositionWithColumnOffset(startLoc, 1),\n });\n }\n const ch = this.input.charCodeAt(pos);\n if (isNewLine(ch)) {\n throw this.raise(Errors.UnterminatedRegExp, {\n at: createPositionWithColumnOffset(startLoc, 1),\n });\n }\n if (escaped) {\n escaped = false;\n } else {\n if (ch === charCodes.leftSquareBracket) {\n inClass = true;\n } else if (ch === charCodes.rightSquareBracket && inClass) {\n inClass = false;\n } else if (ch === charCodes.slash && !inClass) {\n break;\n }\n escaped = ch === charCodes.backslash;\n }\n }\n const content = this.input.slice(start, pos);\n ++pos;\n\n let mods = \"\";\n\n const nextPos = () =>\n // (pos + 1) + 1 - start\n createPositionWithColumnOffset(startLoc, pos + 2 - start);\n\n while (pos < this.length) {\n const cp = this.codePointAtPos(pos);\n // It doesn't matter if cp > 0xffff, the loop will either throw or break because we check on cp\n const char = String.fromCharCode(cp);\n\n // @ts-expect-error VALID_REGEX_FLAGS.has should accept expanded type: number\n if (VALID_REGEX_FLAGS.has(cp)) {\n if (cp === charCodes.lowercaseV) {\n if (mods.includes(\"u\")) {\n this.raise(Errors.IncompatibleRegExpUVFlags, { at: nextPos() });\n }\n } else if (cp === charCodes.lowercaseU) {\n if (mods.includes(\"v\")) {\n this.raise(Errors.IncompatibleRegExpUVFlags, { at: nextPos() });\n }\n }\n if (mods.includes(char)) {\n this.raise(Errors.DuplicateRegExpFlags, { at: nextPos() });\n }\n } else if (isIdentifierChar(cp) || cp === charCodes.backslash) {\n this.raise(Errors.MalformedRegExpFlags, { at: nextPos() });\n } else {\n break;\n }\n\n ++pos;\n mods += char;\n }\n this.state.pos = pos;\n\n this.finishToken(tt.regexp, {\n pattern: content,\n flags: mods,\n });\n }\n\n // Read an integer in the given radix. Return null if zero digits\n // were read, the integer value otherwise. When `len` is given, this\n // will return `null` unless the integer has exactly `len` digits.\n // When `forceLen` is `true`, it means that we already know that in case\n // of a malformed number we have to skip `len` characters anyway, instead\n // of bailing out early. For example, in \"\\u{123Z}\" we want to read up to }\n // anyway, while in \"\\u00Z\" we will stop at Z instead of consuming four\n // characters (and thus the closing quote).\n\n readInt(\n radix: number,\n len?: number,\n forceLen: boolean = false,\n allowNumSeparator: boolean | \"bail\" = true,\n ): number | null {\n const { n, pos } = readInt(\n this.input,\n this.state.pos,\n this.state.lineStart,\n this.state.curLine,\n radix,\n len,\n forceLen,\n allowNumSeparator,\n this.errorHandlers_readInt,\n /* bailOnError */ false,\n );\n this.state.pos = pos;\n return n;\n }\n\n readRadixNumber(radix: number): void {\n const startLoc = this.state.curPosition();\n let isBigInt = false;\n\n this.state.pos += 2; // 0x\n const val = this.readInt(radix);\n if (val == null) {\n this.raise(Errors.InvalidDigit, {\n // Numeric literals can't have newlines, so this is safe to do.\n at: createPositionWithColumnOffset(startLoc, 2),\n radix,\n });\n }\n const next = this.input.charCodeAt(this.state.pos);\n\n if (next === charCodes.lowercaseN) {\n ++this.state.pos;\n isBigInt = true;\n } else if (next === charCodes.lowercaseM) {\n throw this.raise(Errors.InvalidDecimal, { at: startLoc });\n }\n\n if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {\n throw this.raise(Errors.NumberIdentifier, {\n at: this.state.curPosition(),\n });\n }\n\n if (isBigInt) {\n const str = this.input\n .slice(startLoc.index, this.state.pos)\n .replace(/[_n]/g, \"\");\n this.finishToken(tt.bigint, str);\n return;\n }\n\n this.finishToken(tt.num, val);\n }\n\n // Read an integer, octal integer, or floating-point number.\n\n readNumber(startsWithDot: boolean): void {\n const start = this.state.pos;\n const startLoc = this.state.curPosition();\n let isFloat = false;\n let isBigInt = false;\n let isDecimal = false;\n let hasExponent = false;\n let isOctal = false;\n\n if (!startsWithDot && this.readInt(10) === null) {\n this.raise(Errors.InvalidNumber, { at: this.state.curPosition() });\n }\n const hasLeadingZero =\n this.state.pos - start >= 2 &&\n this.input.charCodeAt(start) === charCodes.digit0;\n\n if (hasLeadingZero) {\n const integer = this.input.slice(start, this.state.pos);\n this.recordStrictModeErrors(Errors.StrictOctalLiteral, { at: startLoc });\n if (!this.state.strict) {\n // disallow numeric separators in non octal decimals and legacy octal likes\n const underscorePos = integer.indexOf(\"_\");\n if (underscorePos > 0) {\n // Numeric literals can't have newlines, so this is safe to do.\n this.raise(Errors.ZeroDigitNumericSeparator, {\n at: createPositionWithColumnOffset(startLoc, underscorePos),\n });\n }\n }\n isOctal = hasLeadingZero && !/[89]/.test(integer);\n }\n\n let next = this.input.charCodeAt(this.state.pos);\n if (next === charCodes.dot && !isOctal) {\n ++this.state.pos;\n this.readInt(10);\n isFloat = true;\n next = this.input.charCodeAt(this.state.pos);\n }\n\n if (\n (next === charCodes.uppercaseE || next === charCodes.lowercaseE) &&\n !isOctal\n ) {\n next = this.input.charCodeAt(++this.state.pos);\n if (next === charCodes.plusSign || next === charCodes.dash) {\n ++this.state.pos;\n }\n if (this.readInt(10) === null) {\n this.raise(Errors.InvalidOrMissingExponent, { at: startLoc });\n }\n isFloat = true;\n hasExponent = true;\n next = this.input.charCodeAt(this.state.pos);\n }\n\n if (next === charCodes.lowercaseN) {\n // disallow floats, legacy octal syntax and non octal decimals\n // new style octal (\"0o\") is handled in this.readRadixNumber\n if (isFloat || hasLeadingZero) {\n this.raise(Errors.InvalidBigIntLiteral, { at: startLoc });\n }\n ++this.state.pos;\n isBigInt = true;\n }\n\n if (next === charCodes.lowercaseM) {\n this.expectPlugin(\"decimal\", this.state.curPosition());\n if (hasExponent || hasLeadingZero) {\n this.raise(Errors.InvalidDecimal, { at: startLoc });\n }\n ++this.state.pos;\n isDecimal = true;\n }\n\n if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {\n throw this.raise(Errors.NumberIdentifier, {\n at: this.state.curPosition(),\n });\n }\n\n // remove \"_\" for numeric literal separator, and trailing `m` or `n`\n const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, \"\");\n\n if (isBigInt) {\n this.finishToken(tt.bigint, str);\n return;\n }\n\n if (isDecimal) {\n this.finishToken(tt.decimal, str);\n return;\n }\n\n const val = isOctal ? parseInt(str, 8) : parseFloat(str);\n this.finishToken(tt.num, val);\n }\n\n // Read a string value, interpreting backslash-escapes.\n\n readCodePoint(throwOnInvalid: boolean): number | null {\n const { code, pos } = readCodePoint(\n this.input,\n this.state.pos,\n this.state.lineStart,\n this.state.curLine,\n throwOnInvalid,\n this.errorHandlers_readCodePoint,\n );\n this.state.pos = pos;\n return code;\n }\n\n readString(quote: number): void {\n const { str, pos, curLine, lineStart } = readStringContents(\n quote === charCodes.quotationMark ? \"double\" : \"single\",\n this.input,\n this.state.pos + 1, // skip the quote\n this.state.lineStart,\n this.state.curLine,\n this.errorHandlers_readStringContents_string,\n );\n this.state.pos = pos + 1; // skip the quote\n this.state.lineStart = lineStart;\n this.state.curLine = curLine;\n this.finishToken(tt.string, str);\n }\n\n // Reads template continuation `}...`\n readTemplateContinuation(): void {\n if (!this.match(tt.braceR)) {\n this.unexpected(null, tt.braceR);\n }\n // rewind pos to `}`\n this.state.pos--;\n this.readTemplateToken();\n }\n\n // Reads template string tokens.\n readTemplateToken(): void {\n const opening = this.input[this.state.pos];\n const { str, firstInvalidLoc, pos, curLine, lineStart } =\n readStringContents(\n \"template\",\n this.input,\n this.state.pos + 1, // skip '`' or `}`\n this.state.lineStart,\n this.state.curLine,\n this.errorHandlers_readStringContents_template,\n );\n this.state.pos = pos + 1; // skip '`' or `$`\n this.state.lineStart = lineStart;\n this.state.curLine = curLine;\n\n if (firstInvalidLoc) {\n this.state.firstInvalidTemplateEscapePos = new Position(\n firstInvalidLoc.curLine,\n firstInvalidLoc.pos - firstInvalidLoc.lineStart,\n firstInvalidLoc.pos,\n );\n }\n\n if (this.input.codePointAt(pos) === charCodes.graveAccent) {\n this.finishToken(\n tt.templateTail,\n firstInvalidLoc ? null : opening + str + \"`\",\n );\n } else {\n this.state.pos++; // skip '{'\n this.finishToken(\n tt.templateNonTail,\n firstInvalidLoc ? null : opening + str + \"${\",\n );\n }\n }\n\n recordStrictModeErrors(\n toParseError: DeferredStrictError,\n { at }: { at: Position },\n ) {\n const index = at.index;\n\n if (this.state.strict && !this.state.strictErrors.has(index)) {\n this.raise(toParseError, { at });\n } else {\n this.state.strictErrors.set(index, [toParseError, at]);\n }\n }\n\n // Read an identifier, and return it as a string. Sets `this.state.containsEsc`\n // to whether the word contained a '\\u' escape.\n //\n // Incrementally adds only escaped chars, adding other chunks as-is\n // as a micro-optimization.\n //\n // When `firstCode` is given, it assumes it is always an identifier start and\n // will skip reading start position again\n\n readWord1(firstCode?: number): string {\n this.state.containsEsc = false;\n let word = \"\";\n const start = this.state.pos;\n let chunkStart = this.state.pos;\n if (firstCode !== undefined) {\n this.state.pos += firstCode <= 0xffff ? 1 : 2;\n }\n\n while (this.state.pos < this.length) {\n const ch = this.codePointAtPos(this.state.pos);\n if (isIdentifierChar(ch)) {\n this.state.pos += ch <= 0xffff ? 1 : 2;\n } else if (ch === charCodes.backslash) {\n this.state.containsEsc = true;\n\n word += this.input.slice(chunkStart, this.state.pos);\n const escStart = this.state.curPosition();\n const identifierCheck =\n this.state.pos === start ? isIdentifierStart : isIdentifierChar;\n\n if (this.input.charCodeAt(++this.state.pos) !== charCodes.lowercaseU) {\n this.raise(Errors.MissingUnicodeEscape, {\n at: this.state.curPosition(),\n });\n chunkStart = this.state.pos - 1;\n continue;\n }\n\n ++this.state.pos;\n const esc = this.readCodePoint(true);\n if (esc !== null) {\n if (!identifierCheck(esc)) {\n this.raise(Errors.EscapedCharNotAnIdentifier, { at: escStart });\n }\n\n word += String.fromCodePoint(esc);\n }\n chunkStart = this.state.pos;\n } else {\n break;\n }\n }\n return word + this.input.slice(chunkStart, this.state.pos);\n }\n\n // Read an identifier or keyword token. Will check for reserved\n // words when necessary.\n\n readWord(firstCode?: number): void {\n const word = this.readWord1(firstCode);\n const type = keywordTypes.get(word);\n if (type !== undefined) {\n // We don't use word as state.value here because word is a dynamic string\n // while token label is a shared constant string\n this.finishToken(type, tokenLabelName(type));\n } else {\n this.finishToken(tt.name, word);\n }\n }\n\n checkKeywordEscapes(): void {\n const { type } = this.state;\n if (tokenIsKeyword(type) && this.state.containsEsc) {\n this.raise(Errors.InvalidEscapedReservedWord, {\n at: this.state.startLoc,\n reservedWord: tokenLabelName(type),\n });\n }\n }\n\n /**\n * Raise a `ParseError` given the appropriate properties. If passed a\n * `Position` for the `at` property, raises the `ParseError` at that location.\n * Otherwise, if passed a `Node`, raises the `ParseError` at the start\n * location of that `Node`.\n *\n * If `errorRecovery` is `true`, the error is pushed to the errors array and\n * returned. If `errorRecovery` is `false`, the error is instead thrown.\n */\n raise<ErrorDetails>(\n toParseError: ParseErrorConstructor<ErrorDetails>,\n raiseProperties: RaiseProperties<ErrorDetails>,\n ): ParseError<ErrorDetails> {\n const { at, ...details } = raiseProperties;\n const loc = at instanceof Position ? at : at.loc.start;\n // @ts-expect-error: refine details typing\n const error = toParseError({ loc, details });\n\n if (!this.options.errorRecovery) throw error;\n if (!this.isLookahead) this.state.errors.push(error);\n\n return error;\n }\n\n /**\n * If `errorRecovery` is `false`, this method behaves identically to `raise`.\n * If `errorRecovery` is `true`, this method will first see if there is\n * already an error stored at the same `Position`, and replaces it with the\n * one generated here.\n */\n raiseOverwrite<ErrorDetails>(\n toParseError: ParseErrorConstructor<ErrorDetails>,\n raiseProperties: RaiseProperties<ErrorDetails>,\n ): ParseError<ErrorDetails> | never {\n const { at, ...details } = raiseProperties;\n const loc = at instanceof Position ? at : at.loc.start;\n const pos = loc.index;\n const errors = this.state.errors;\n\n for (let i = errors.length - 1; i >= 0; i--) {\n const error = errors[i];\n if (error.loc.index === pos) {\n // @ts-expect-error: refine details typing\n return (errors[i] = toParseError({ loc, details }));\n }\n if (error.loc.index < pos) break;\n }\n\n return this.raise(toParseError, raiseProperties);\n }\n\n // updateContext is used by the jsx plugin\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n updateContext(prevType: TokenType): void {}\n\n // Raise an unexpected token error. Can take the expected token type.\n unexpected(loc?: Position | null, type?: TokenType): void {\n throw this.raise(Errors.UnexpectedToken, {\n expected: type ? tokenLabelName(type) : null,\n at: loc != null ? loc : this.state.startLoc,\n });\n }\n\n expectPlugin(pluginName: Plugin, loc?: Position): true {\n if (this.hasPlugin(pluginName)) {\n return true;\n }\n\n throw this.raise(Errors.MissingPlugin, {\n at: loc != null ? loc : this.state.startLoc,\n missingPlugin: [pluginName],\n });\n }\n\n expectOnePlugin(pluginNames: Plugin[]): void {\n if (!pluginNames.some(name => this.hasPlugin(name))) {\n throw this.raise(Errors.MissingOneOfPlugins, {\n at: this.state.startLoc,\n missingPlugin: pluginNames,\n });\n }\n }\n\n errorBuilder(error: ParseErrorConstructor<{}>) {\n return (pos: number, lineStart: number, curLine: number) => {\n this.raise(error, {\n at: buildPosition(pos, lineStart, curLine),\n });\n };\n }\n\n errorHandlers_readInt: IntErrorHandlers = {\n invalidDigit: (pos, lineStart, curLine, radix) => {\n if (!this.options.errorRecovery) return false;\n\n this.raise(Errors.InvalidDigit, {\n at: buildPosition(pos, lineStart, curLine),\n radix,\n });\n // Continue parsing the number as if there was no invalid digit.\n return true;\n },\n numericSeparatorInEscapeSequence: this.errorBuilder(\n Errors.NumericSeparatorInEscapeSequence,\n ),\n unexpectedNumericSeparator: this.errorBuilder(\n Errors.UnexpectedNumericSeparator,\n ),\n };\n\n errorHandlers_readCodePoint: CodePointErrorHandlers = {\n ...this.errorHandlers_readInt,\n invalidEscapeSequence: this.errorBuilder(Errors.InvalidEscapeSequence),\n invalidCodePoint: this.errorBuilder(Errors.InvalidCodePoint),\n };\n\n errorHandlers_readStringContents_string: StringContentsErrorHandlers = {\n ...this.errorHandlers_readCodePoint,\n strictNumericEscape: (pos, lineStart, curLine) => {\n this.recordStrictModeErrors(Errors.StrictNumericEscape, {\n at: buildPosition(pos, lineStart, curLine),\n });\n },\n unterminated: (pos, lineStart, curLine) => {\n throw this.raise(Errors.UnterminatedString, {\n // Report the error at the string quote\n at: buildPosition(pos - 1, lineStart, curLine),\n });\n },\n };\n\n errorHandlers_readStringContents_template: StringContentsErrorHandlers = {\n ...this.errorHandlers_readCodePoint,\n strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape),\n unterminated: (pos, lineStart, curLine) => {\n throw this.raise(Errors.UnterminatedTemplate, {\n at: buildPosition(pos, lineStart, curLine),\n });\n },\n };\n}\n","import {\n CLASS_ELEMENT_KIND_ACCESSOR,\n CLASS_ELEMENT_FLAG_STATIC,\n type ClassElementTypes,\n} from \"./scopeflags\";\nimport type { Position } from \"./location\";\nimport { Errors } from \"../parse-error\";\nimport type Tokenizer from \"../tokenizer\";\n\nexport class ClassScope {\n // A list of private named declared in the current class\n privateNames: Set<string> = new Set();\n\n // A list of private getters of setters without their counterpart\n loneAccessors: Map<string, ClassElementTypes> = new Map();\n\n // A list of private names used before being defined, mapping to\n // their position.\n undefinedPrivateNames: Map<string, Position> = new Map();\n}\n\nexport default class ClassScopeHandler {\n parser: Tokenizer;\n stack: Array<ClassScope> = [];\n undefinedPrivateNames: Map<string, Position> = new Map();\n\n constructor(parser: Tokenizer) {\n this.parser = parser;\n }\n\n current(): ClassScope {\n return this.stack[this.stack.length - 1];\n }\n\n enter() {\n this.stack.push(new ClassScope());\n }\n\n exit() {\n const oldClassScope = this.stack.pop();\n\n // Migrate the usage of not yet defined private names to the outer\n // class scope, or raise an error if we reached the top-level scope.\n\n const current = this.current();\n\n // Array.from is needed because this is compiled to an array-like for loop\n for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) {\n if (current) {\n if (!current.undefinedPrivateNames.has(name)) {\n current.undefinedPrivateNames.set(name, loc);\n }\n } else {\n this.parser.raise(Errors.InvalidPrivateFieldResolution, {\n at: loc,\n identifierName: name,\n });\n }\n }\n }\n\n declarePrivateName(\n name: string,\n elementType: ClassElementTypes,\n loc: Position,\n ) {\n const { privateNames, loneAccessors, undefinedPrivateNames } =\n this.current();\n let redefined = privateNames.has(name);\n\n if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) {\n const accessor = redefined && loneAccessors.get(name);\n if (accessor) {\n const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC;\n const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC;\n\n const oldKind = accessor & CLASS_ELEMENT_KIND_ACCESSOR;\n const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR;\n\n // The private name can be duplicated only if it is used by\n // two accessors with different kind (get and set), and if\n // they have the same placement (static or not).\n redefined = oldKind === newKind || oldStatic !== newStatic;\n\n if (!redefined) loneAccessors.delete(name);\n } else if (!redefined) {\n loneAccessors.set(name, elementType);\n }\n }\n\n if (redefined) {\n this.parser.raise(Errors.PrivateNameRedeclaration, {\n at: loc,\n identifierName: name,\n });\n }\n\n privateNames.add(name);\n undefinedPrivateNames.delete(name);\n }\n\n usePrivateName(name: string, loc: Position) {\n let classScope;\n for (classScope of this.stack) {\n if (classScope.privateNames.has(name)) return;\n }\n\n if (classScope) {\n classScope.undefinedPrivateNames.set(name, loc);\n } else {\n // top-level\n this.parser.raise(Errors.InvalidPrivateFieldResolution, {\n at: loc,\n identifierName: name,\n });\n }\n }\n}\n","import { Errors, type ParseErrorConstructor } from \"../parse-error\";\nimport type { Position } from \"./location\";\nimport type { Node } from \"../types\";\nimport type Tokenizer from \"../tokenizer\";\n\n/**\n * @module util/expression-scope\n\nExpressionScope is used to track declaration errors in these ambiguous patterns:\n\n- CoverParenthesizedExpressionAndArrowParameterList\n e.g. we don't know if `({ x })` is an parenthesized expression or an\n arrow function parameters until we see an `=>` after `)`.\n\n- CoverCallExpressionAndAsyncArrowHead\n e.g. we don't know if `async({ x })` is a call expression or an async arrow\n function parameters until we see an `=>` after `)`\n\nThe following declaration errors (@see parser-errors/standard) will be recorded in\nsome expression scopes and thrown later when we know what the ambiguous pattern is\n\n- AwaitBindingIdentifier\n- AwaitExpressionFormalParameter\n- YieldInParameter\n- InvalidParenthesizedAssignment when parenthesized is an identifier\n\nThere are four different expression scope\n- Expression\n A general scope that represents program / function body / static block. No errors\n will be recorded nor thrown in this scope.\n\n- MaybeArrowParameterDeclaration\n A scope that represents ambiguous arrow head e.g. `(x)`. Errors will be recorded\n alongside parent scopes and thrown when `ExpressionScopeHandler#validateAsPattern`\n is called.\n\n- MaybeAsyncArrowParameterDeclaration\n A scope that represents ambiguous async arrow head e.g. `async(x)`. Errors will\n be recorded alongside parent scopes and thrown when\n `ExpressionScopeHandler#validateAsPattern` is called.\n\n- ParameterDeclaration\n A scope that represents unambiguous function parameters `function(x)`. Errors\n recorded in this scope will be thrown immediately. No errors will be recorded in\n this scope.\n\n// @see {@link https://docs.google.com/document/d/1FAvEp9EUK-G8kHfDIEo_385Hs2SUBCYbJ5H-NnLvq8M|V8 Expression Scope design docs}\n */\n\nconst kExpression = 0,\n kMaybeArrowParameterDeclaration = 1,\n kMaybeAsyncArrowParameterDeclaration = 2,\n kParameterDeclaration = 3;\n\ntype ExpressionScopeType = 0 | 1 | 2 | 3;\n\nclass ExpressionScope {\n type: ExpressionScopeType;\n\n constructor(type: ExpressionScopeType = kExpression) {\n this.type = type;\n }\n\n canBeArrowParameterDeclaration(): this is ArrowHeadParsingScope {\n return (\n this.type === kMaybeAsyncArrowParameterDeclaration ||\n this.type === kMaybeArrowParameterDeclaration\n );\n }\n\n isCertainlyParameterDeclaration() {\n return this.type === kParameterDeclaration;\n }\n}\n\ntype ArrowHeadParsingParameterInitializerError =\n | typeof Errors.AwaitExpressionFormalParameter\n | typeof Errors.YieldInParameter;\ntype ArrowHeadParsingDeclarationError =\n | ArrowHeadParsingParameterInitializerError\n | typeof Errors.InvalidParenthesizedAssignment\n | typeof Errors.AwaitBindingIdentifier;\n\nclass ArrowHeadParsingScope extends ExpressionScope {\n declarationErrors: Map<number, [ParseErrorConstructor<{}>, Position]> =\n new Map();\n constructor(type: 1 | 2) {\n super(type);\n }\n recordDeclarationError(\n ParsingErrorClass: ParseErrorConstructor<{}>,\n {\n at,\n }: {\n at: Position;\n },\n ) {\n const index = at.index;\n\n this.declarationErrors.set(index, [ParsingErrorClass, at]);\n }\n clearDeclarationError(index: number) {\n this.declarationErrors.delete(index);\n }\n iterateErrors(\n iterator: (a: [ArrowHeadParsingDeclarationError, Position]) => void,\n ) {\n this.declarationErrors.forEach(iterator);\n }\n}\n\nexport default class ExpressionScopeHandler {\n parser: Tokenizer;\n stack: Array<ExpressionScope> = [new ExpressionScope()];\n\n constructor(parser: Tokenizer) {\n this.parser = parser;\n }\n enter(scope: ExpressionScope) {\n this.stack.push(scope);\n }\n\n exit() {\n this.stack.pop();\n }\n\n /**\n * Record likely parameter initializer errors\n *\n * When current scope is a ParameterDeclaration, the error will be thrown immediately,\n * otherwise it will be recorded to any ancestry MaybeArrowParameterDeclaration and\n * MaybeAsyncArrowParameterDeclaration scope until an Expression scope is seen.\n */\n recordParameterInitializerError(\n toParseError: ArrowHeadParsingParameterInitializerError,\n {\n at: node,\n }: {\n at: Node;\n },\n ): void {\n const origin = { at: node.loc.start };\n const { stack } = this;\n let i = stack.length - 1;\n let scope: ExpressionScope = stack[i];\n while (!scope.isCertainlyParameterDeclaration()) {\n if (scope.canBeArrowParameterDeclaration()) {\n scope.recordDeclarationError(toParseError, origin);\n } else {\n /*:: invariant(scope.type == kExpression) */\n // Type-Expression is the boundary where initializer error can populate to\n return;\n }\n scope = stack[--i];\n }\n this.parser.raise(toParseError, origin);\n }\n\n /**\n * Record errors that must be thrown if the current pattern ends up being an arrow\n * function parameter. This is used to record parenthesized identifiers, and to record\n * \"a as T\" and \"<T> a\" type assertions when parsing typescript.\n *\n * A parenthesized identifier (or type assertion) in LHS can be ambiguous because the assignment\n * can be transformed to an assignable later, but not vice versa:\n * For example, in `([(a) = []] = []) => {}`, we think `(a) = []` is an LHS in `[(a) = []]`,\n * an LHS within `[(a) = []] = []`. However the LHS chain is then transformed by toAssignable,\n * and we should throw assignment `(a)`, which is only valid in LHS. Hence we record the\n * location of parenthesized `(a)` to current scope if it is one of MaybeArrowParameterDeclaration\n * and MaybeAsyncArrowParameterDeclaration\n *\n * Unlike `recordParameterInitializerError`, we don't record to ancestry scope because we\n * validate arrow head parsing scope before exit, and then the LHS will be unambiguous:\n * For example, in `( x = ( [(a) = []] = [] ) ) => {}`, we should not record `(a)` in `( x = ... ) =>`\n * arrow scope because when we finish parsing `( [(a) = []] = [] )`, it is an unambiguous assignment\n * expression and can not be cast to pattern\n */\n recordArrowParameterBindingError(\n error: ParseErrorConstructor<{}>,\n {\n at: node,\n }: {\n at: Node;\n },\n ): void {\n const { stack } = this;\n const scope: ExpressionScope = stack[stack.length - 1];\n const origin = { at: node.loc.start };\n if (scope.isCertainlyParameterDeclaration()) {\n this.parser.raise(error, origin);\n } else if (scope.canBeArrowParameterDeclaration()) {\n scope.recordDeclarationError(error, origin);\n } else {\n return;\n }\n }\n\n /**\n * Record likely async arrow parameter errors\n *\n * Errors will be recorded to any ancestry MaybeAsyncArrowParameterDeclaration\n * scope until an Expression scope is seen.\n */\n recordAsyncArrowParametersError({ at }: { at: Position }): void {\n const { stack } = this;\n let i = stack.length - 1;\n let scope: ExpressionScope = stack[i];\n while (scope.canBeArrowParameterDeclaration()) {\n if (scope.type === kMaybeAsyncArrowParameterDeclaration) {\n scope.recordDeclarationError(Errors.AwaitBindingIdentifier, { at });\n }\n scope = stack[--i];\n }\n }\n\n validateAsPattern(): void {\n const { stack } = this;\n const currentScope = stack[stack.length - 1];\n if (!currentScope.canBeArrowParameterDeclaration()) return;\n currentScope.iterateErrors(([toParseError, loc]) => {\n this.parser.raise(toParseError, { at: loc });\n // iterate from parent scope\n let i = stack.length - 2;\n let scope = stack[i];\n while (scope.canBeArrowParameterDeclaration()) {\n scope.clearDeclarationError(loc.index);\n scope = stack[--i];\n }\n });\n }\n}\n\nexport function newParameterDeclarationScope() {\n return new ExpressionScope(kParameterDeclaration);\n}\n\nexport function newArrowHeadScope() {\n return new ArrowHeadParsingScope(kMaybeArrowParameterDeclaration);\n}\n\nexport function newAsyncArrowScope() {\n return new ArrowHeadParsingScope(kMaybeAsyncArrowParameterDeclaration);\n}\n\nexport function newExpressionScope() {\n return new ExpressionScope();\n}\n","export const // Initial Parameter flags\n PARAM = 0b0000,\n // track [Yield] production parameter\n PARAM_YIELD = 0b0001,\n // track [Await] production parameter\n PARAM_AWAIT = 0b0010,\n // track [Return] production parameter\n PARAM_RETURN = 0b0100,\n PARAM_IN = 0b1000; // track [In] production parameter\n\n// ProductionParameterHandler is a stack fashioned production parameter tracker\n// https://tc39.es/ecma262/#sec-grammar-notation\n// The tracked parameters are defined above.\n//\n// Whenever [+Await]/[+Yield] appears in the right-hand sides of a production,\n// we must enter a new tracking stack. For example when parsing\n//\n// AsyncFunctionDeclaration [Yield, Await]:\n// async [no LineTerminator here] function BindingIdentifier[?Yield, ?Await]\n// ( FormalParameters[~Yield, +Await] ) { AsyncFunctionBody }\n//\n// we must follow such process:\n//\n// 1. parse async keyword\n// 2. parse function keyword\n// 3. parse bindingIdentifier <= inherit current parameters: [?Await]\n// 4. enter new stack with (PARAM_AWAIT)\n// 5. parse formal parameters <= must have [Await] parameter [+Await]\n// 6. parse function body\n// 7. exit current stack\n\nexport type ParamKind = number;\n\n// todo(flow->ts) - check if more granular type can be used,\n// type below is not good because things like PARAM_AWAIT|PARAM_YIELD are not included\n// export type ParamKind =\n// | typeof PARAM\n// | typeof PARAM_AWAIT\n// | typeof PARAM_IN\n// | typeof PARAM_RETURN\n// | typeof PARAM_YIELD;\n\nexport default class ProductionParameterHandler {\n stacks: Array<number> = [];\n enter(flags: number) {\n this.stacks.push(flags);\n }\n\n exit() {\n this.stacks.pop();\n }\n\n currentFlags(): number {\n return this.stacks[this.stacks.length - 1];\n }\n\n get hasAwait(): boolean {\n return (this.currentFlags() & PARAM_AWAIT) > 0;\n }\n\n get hasYield(): boolean {\n return (this.currentFlags() & PARAM_YIELD) > 0;\n }\n\n get hasReturn(): boolean {\n return (this.currentFlags() & PARAM_RETURN) > 0;\n }\n\n get hasIn(): boolean {\n return (this.currentFlags() & PARAM_IN) > 0;\n }\n}\n\nexport function functionFlags(\n isAsync: boolean,\n isGenerator: boolean,\n): ParamKind {\n return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0);\n}\n","import type { Position } from \"../util/location\";\nimport {\n tokenIsLiteralPropertyName,\n tt,\n type TokenType,\n} from \"../tokenizer/types\";\nimport Tokenizer from \"../tokenizer\";\nimport type State from \"../tokenizer/state\";\nimport type { EstreePropertyDefinition, Node, ObjectProperty } from \"../types\";\nimport { lineBreak, skipWhiteSpaceToLineBreak } from \"../util/whitespace\";\nimport { isIdentifierChar } from \"../util/identifier\";\nimport ClassScopeHandler from \"../util/class-scope\";\nimport ExpressionScopeHandler from \"../util/expression-scope\";\nimport { SCOPE_PROGRAM } from \"../util/scopeflags\";\nimport ProductionParameterHandler, {\n PARAM_AWAIT,\n PARAM,\n} from \"../util/production-parameter\";\nimport {\n Errors,\n type ParseError,\n type ParseErrorConstructor,\n} from \"../parse-error\";\nimport type Parser from \".\";\n\nimport type ScopeHandler from \"../util/scope\";\n\ntype TryParse<Node, Error, Thrown, Aborted, FailState> = {\n node: Node;\n error: Error;\n thrown: Thrown;\n aborted: Aborted;\n failState: FailState;\n};\n\n// ## Parser utilities\n\nexport default abstract class UtilParser extends Tokenizer {\n // Forward-declaration: defined in parser/index.js\n abstract getScopeHandler(): { new (...args: any): ScopeHandler };\n\n addExtra(\n node: Partial<Node>,\n key: string,\n value: any,\n enumerable: boolean = true,\n ): void {\n if (!node) return;\n\n const extra = (node.extra = node.extra || {});\n if (enumerable) {\n extra[key] = value;\n } else {\n Object.defineProperty(extra, key, { enumerable, value });\n }\n }\n\n // Tests whether parsed token is a contextual keyword.\n\n isContextual(token: TokenType): boolean {\n return this.state.type === token && !this.state.containsEsc;\n }\n\n isUnparsedContextual(nameStart: number, name: string): boolean {\n const nameEnd = nameStart + name.length;\n if (this.input.slice(nameStart, nameEnd) === name) {\n const nextCh = this.input.charCodeAt(nameEnd);\n return !(\n isIdentifierChar(nextCh) ||\n // check if `nextCh is between 0xd800 - 0xdbff,\n // if `nextCh` is NaN, `NaN & 0xfc00` is 0, the function\n // returns true\n (nextCh & 0xfc00) === 0xd800\n );\n }\n return false;\n }\n\n isLookaheadContextual(name: string): boolean {\n const next = this.nextTokenStart();\n return this.isUnparsedContextual(next, name);\n }\n\n // Consumes contextual keyword if possible.\n\n eatContextual(token: TokenType): boolean {\n if (this.isContextual(token)) {\n this.next();\n return true;\n }\n return false;\n }\n\n // Asserts that following token is given contextual keyword.\n\n expectContextual(\n token: TokenType,\n toParseError?: ParseErrorConstructor<any>,\n ): void {\n if (!this.eatContextual(token)) {\n if (toParseError != null) {\n throw this.raise(toParseError, { at: this.state.startLoc });\n }\n this.unexpected(null, token);\n }\n }\n\n // Test whether a semicolon can be inserted at the current position.\n\n canInsertSemicolon(): boolean {\n return (\n this.match(tt.eof) ||\n this.match(tt.braceR) ||\n this.hasPrecedingLineBreak()\n );\n }\n\n hasPrecedingLineBreak(): boolean {\n return lineBreak.test(\n this.input.slice(this.state.lastTokEndLoc.index, this.state.start),\n );\n }\n\n hasFollowingLineBreak(): boolean {\n skipWhiteSpaceToLineBreak.lastIndex = this.state.end;\n return skipWhiteSpaceToLineBreak.test(this.input);\n }\n\n isLineTerminator(): boolean {\n return this.eat(tt.semi) || this.canInsertSemicolon();\n }\n\n // Consume a semicolon, or, failing that, see if we are allowed to\n // pretend that there is a semicolon at this position.\n\n semicolon(allowAsi: boolean = true): void {\n if (allowAsi ? this.isLineTerminator() : this.eat(tt.semi)) return;\n this.raise(Errors.MissingSemicolon, { at: this.state.lastTokEndLoc });\n }\n\n // Expect a token of a given type. If found, consume it, otherwise,\n // raise an unexpected token error at given pos.\n\n expect(type: TokenType, loc?: Position | null): void {\n this.eat(type) || this.unexpected(loc, type);\n }\n\n // tryParse will clone parser state.\n // It is expensive and should be used with cautions\n tryParse<T extends Node | ReadonlyArray<Node>>(\n fn: (abort: (node?: T) => never) => T,\n oldState: State = this.state.clone(),\n ):\n | TryParse<T, null, false, false, null>\n | TryParse<T | null, ParseError<any>, boolean, false, State>\n | TryParse<T | null, null, false, true, State> {\n const abortSignal: {\n node: T | null;\n } = { node: null };\n try {\n const node = fn((node = null) => {\n abortSignal.node = node;\n throw abortSignal;\n });\n if (this.state.errors.length > oldState.errors.length) {\n const failState = this.state;\n this.state = oldState;\n // tokensLength should be preserved during error recovery mode\n // since the parser does not halt and will instead parse the\n // remaining tokens\n this.state.tokensLength = failState.tokensLength;\n return {\n node,\n error: failState.errors[oldState.errors.length],\n thrown: false,\n aborted: false,\n failState,\n };\n }\n\n return {\n node,\n error: null,\n thrown: false,\n aborted: false,\n failState: null,\n };\n } catch (error) {\n const failState = this.state;\n this.state = oldState;\n if (error instanceof SyntaxError) {\n // @ts-expect-error casting general syntax error to parse error\n return { node: null, error, thrown: true, aborted: false, failState };\n }\n if (error === abortSignal) {\n return {\n node: abortSignal.node,\n error: null,\n thrown: false,\n aborted: true,\n failState,\n };\n }\n\n throw error;\n }\n }\n\n checkExpressionErrors(\n refExpressionErrors: ExpressionErrors | undefined | null,\n andThrow: boolean,\n ) {\n if (!refExpressionErrors) return false;\n const {\n shorthandAssignLoc,\n doubleProtoLoc,\n privateKeyLoc,\n optionalParametersLoc,\n } = refExpressionErrors;\n\n const hasErrors =\n !!shorthandAssignLoc ||\n !!doubleProtoLoc ||\n !!optionalParametersLoc ||\n !!privateKeyLoc;\n\n if (!andThrow) {\n return hasErrors;\n }\n\n if (shorthandAssignLoc != null) {\n this.raise(Errors.InvalidCoverInitializedName, {\n at: shorthandAssignLoc,\n });\n }\n\n if (doubleProtoLoc != null) {\n this.raise(Errors.DuplicateProto, { at: doubleProtoLoc });\n }\n\n if (privateKeyLoc != null) {\n this.raise(Errors.UnexpectedPrivateField, { at: privateKeyLoc });\n }\n\n if (optionalParametersLoc != null) {\n this.unexpected(optionalParametersLoc);\n }\n }\n\n /**\n * Test if current token is a literal property name\n * https://tc39.es/ecma262/#prod-LiteralPropertyName\n * LiteralPropertyName:\n * IdentifierName\n * StringLiteral\n * NumericLiteral\n * BigIntLiteral\n */\n isLiteralPropertyName(): boolean {\n return tokenIsLiteralPropertyName(this.state.type);\n }\n\n /**\n * Test if given node is a PrivateName\n * will be overridden in ESTree plugin\n */\n isPrivateName(node: Node): boolean {\n return node.type === \"PrivateName\";\n }\n\n /**\n * Return the string value of a given private name\n * WITHOUT `#`\n * @see {@link https://tc39.es/ecma262/#sec-static-semantics-stringvalue}\n */\n getPrivateNameSV(node: Node): string {\n return node.id.name;\n }\n\n /**\n * Return whether the given node is a member/optional chain that\n * contains a private name as its property\n * It is overridden in ESTree plugin\n */\n hasPropertyAsPrivateName(node: Node): boolean {\n return (\n (node.type === \"MemberExpression\" ||\n node.type === \"OptionalMemberExpression\") &&\n this.isPrivateName(node.property)\n );\n }\n\n isObjectProperty(\n node: Node,\n ): node is ObjectProperty | EstreePropertyDefinition {\n return node.type === \"ObjectProperty\";\n }\n\n isObjectMethod(node: Node): boolean {\n return node.type === \"ObjectMethod\";\n }\n\n initializeScopes(\n this: Parser,\n inModule: boolean = this.options.sourceType === \"module\",\n ): () => void {\n // Initialize state\n const oldLabels = this.state.labels;\n this.state.labels = [];\n\n const oldExportedIdentifiers = this.exportedIdentifiers;\n this.exportedIdentifiers = new Set();\n\n // initialize scopes\n const oldInModule = this.inModule;\n this.inModule = inModule;\n\n const oldScope = this.scope;\n const ScopeHandler = this.getScopeHandler();\n this.scope = new ScopeHandler(this, inModule);\n\n const oldProdParam = this.prodParam;\n this.prodParam = new ProductionParameterHandler();\n\n const oldClassScope = this.classScope;\n this.classScope = new ClassScopeHandler(this);\n\n const oldExpressionScope = this.expressionScope;\n this.expressionScope = new ExpressionScopeHandler(this);\n\n return () => {\n // Revert state\n this.state.labels = oldLabels;\n this.exportedIdentifiers = oldExportedIdentifiers;\n\n // Revert scopes\n this.inModule = oldInModule;\n this.scope = oldScope;\n this.prodParam = oldProdParam;\n this.classScope = oldClassScope;\n this.expressionScope = oldExpressionScope;\n };\n }\n\n enterInitialScopes() {\n let paramFlags = PARAM;\n if (this.inModule) {\n paramFlags |= PARAM_AWAIT;\n }\n this.scope.enter(SCOPE_PROGRAM);\n this.prodParam.enter(paramFlags);\n }\n\n checkDestructuringPrivate(refExpressionErrors: ExpressionErrors) {\n const { privateKeyLoc } = refExpressionErrors;\n if (privateKeyLoc !== null) {\n this.expectPlugin(\"destructuringPrivate\", privateKeyLoc);\n }\n }\n}\n\n/**\n * The ExpressionErrors is a context struct used to track ambiguous patterns\n * When we are sure the parsed pattern is a RHS, which means it is not a pattern,\n * we will throw on this position on invalid assign syntax, otherwise it will be reset to -1\n *\n * Types of ExpressionErrors:\n *\n * - **shorthandAssignLoc**: track initializer `=` position\n * - **doubleProtoLoc**: track the duplicate `__proto__` key position\n * - **privateKey**: track private key `#p` position\n * - **optionalParametersLoc**: track the optional parameter (`?`).\n * It's only used by typescript and flow plugins\n */\nexport class ExpressionErrors {\n shorthandAssignLoc: Position | undefined | null = null;\n doubleProtoLoc: Position | undefined | null = null;\n privateKeyLoc: Position | undefined | null = null;\n optionalParametersLoc: Position | undefined | null = null;\n}\n","import type Parser from \"./index\";\nimport UtilParser from \"./util\";\nimport { SourceLocation, type Position } from \"../util/location\";\nimport type { Comment, Node as NodeType, NodeBase } from \"../types\";\n\n// Start an AST node, attaching a start offset.\n\nclass Node implements NodeBase {\n constructor(parser: Parser, pos: number, loc: Position) {\n this.start = pos;\n this.end = 0;\n this.loc = new SourceLocation(loc);\n if (parser?.options.ranges) this.range = [pos, 0];\n if (parser?.filename) this.loc.filename = parser.filename;\n }\n\n type: string = \"\";\n declare start: number;\n declare end: number;\n declare loc: SourceLocation;\n declare range: [number, number];\n declare leadingComments: Array<Comment>;\n declare trailingComments: Array<Comment>;\n declare innerComments: Array<Comment>;\n declare extra: {\n [key: string]: any;\n };\n}\nconst NodePrototype = Node.prototype;\n\nif (!process.env.BABEL_8_BREAKING) {\n // @ts-expect-error __clone is not defined in Node prototype\n NodePrototype.__clone = function (): Node {\n const newNode = new Node(undefined, this.start, this.loc.start);\n const keys = Object.keys(this) as (keyof Node)[];\n for (let i = 0, length = keys.length; i < length; i++) {\n const key = keys[i];\n // Do not clone comments that are already attached to the node\n if (\n key !== \"leadingComments\" &&\n key !== \"trailingComments\" &&\n key !== \"innerComments\"\n ) {\n // @ts-expect-error cloning this to newNode\n newNode[key] = this[key];\n }\n }\n\n return newNode;\n };\n}\n\nfunction clonePlaceholder(node: any): any {\n return cloneIdentifier(node);\n}\n\nexport function cloneIdentifier(node: any): any {\n // We don't need to clone `typeAnnotations` and `optional`: because\n // cloneIdentifier is only used in object shorthand and named import/export.\n // Neither of them allow type annotations after the identifier or optional identifier\n const { type, start, end, loc, range, extra, name } = node;\n const cloned = Object.create(NodePrototype);\n cloned.type = type;\n cloned.start = start;\n cloned.end = end;\n cloned.loc = loc;\n cloned.range = range;\n cloned.extra = extra;\n cloned.name = name;\n if (type === \"Placeholder\") {\n cloned.expectedNode = node.expectedNode;\n }\n return cloned;\n}\n\nexport function cloneStringLiteral(node: any): any {\n const { type, start, end, loc, range, extra } = node;\n if (type === \"Placeholder\") {\n return clonePlaceholder(node);\n }\n const cloned = Object.create(NodePrototype);\n cloned.type = type;\n cloned.start = start;\n cloned.end = end;\n cloned.loc = loc;\n cloned.range = range;\n if (node.raw !== undefined) {\n // estree set node.raw instead of node.extra\n cloned.raw = node.raw;\n } else {\n cloned.extra = extra;\n }\n cloned.value = node.value;\n return cloned;\n}\n\nexport type Undone<T extends NodeType> = Omit<T, \"type\">;\n\nexport abstract class NodeUtils extends UtilParser {\n startNode<T extends NodeType>(): Undone<T> {\n // @ts-expect-error cast Node as Undone<T>\n return new Node(this, this.state.start, this.state.startLoc);\n }\n\n startNodeAt<T extends NodeType>(loc: Position): Undone<T> {\n // @ts-expect-error cast Node as Undone<T>\n return new Node(this, loc.index, loc);\n }\n\n /** Start a new node with a previous node's location. */\n startNodeAtNode<T extends NodeType>(type: Undone<NodeType>): Undone<T> {\n return this.startNodeAt(type.loc.start);\n }\n\n // Finish an AST node, adding `type` and `end` properties.\n\n finishNode<T extends NodeType>(node: Undone<T>, type: T[\"type\"]): T {\n return this.finishNodeAt(node, type, this.state.lastTokEndLoc);\n }\n\n // Finish node at given position\n\n finishNodeAt<T extends NodeType>(\n node: Omit<T, \"type\">,\n type: T[\"type\"],\n endLoc: Position,\n ): T {\n if (process.env.NODE_ENV !== \"production\" && node.end > 0) {\n throw new Error(\n \"Do not call finishNode*() twice on the same node.\" +\n \" Instead use resetEndLocation() or change type directly.\",\n );\n }\n // @ts-expect-error migrate to Babel types AST typings\n node.type = type;\n // @ts-expect-error migrate to Babel types AST typings\n node.end = endLoc.index;\n node.loc.end = endLoc;\n if (this.options.ranges) node.range[1] = endLoc.index;\n if (this.options.attachComment) this.processComment(node as T);\n return node as T;\n }\n\n resetStartLocation(node: NodeBase, startLoc: Position): void {\n node.start = startLoc.index;\n node.loc.start = startLoc;\n if (this.options.ranges) node.range[0] = startLoc.index;\n }\n\n resetEndLocation(\n node: NodeBase,\n endLoc: Position = this.state.lastTokEndLoc,\n ): void {\n node.end = endLoc.index;\n node.loc.end = endLoc;\n if (this.options.ranges) node.range[1] = endLoc.index;\n }\n\n /**\n * Reset the start location of node to the start location of locationNode\n */\n resetStartLocationFromNode(node: NodeBase, locationNode: NodeBase): void {\n this.resetStartLocation(node, locationNode.loc.start);\n }\n}\n","/*:: declare var invariant; */\n\nimport type Parser from \"../../parser\";\nimport {\n tokenIsIdentifier,\n tokenIsKeyword,\n tokenIsKeywordOrIdentifier,\n tokenIsLiteralPropertyName,\n tokenLabelName,\n tt,\n type TokenType,\n tokenIsFlowInterfaceOrTypeOrOpaque,\n} from \"../../tokenizer/types\";\nimport type * as N from \"../../types\";\nimport type { Position } from \"../../util/location\";\nimport { types as tc } from \"../../tokenizer/context\";\nimport * as charCodes from \"charcodes\";\nimport { isIteratorStart } from \"../../util/identifier\";\nimport FlowScopeHandler from \"./scope\";\nimport {\n BIND_LEXICAL,\n BIND_VAR,\n BIND_FUNCTION,\n BIND_FLOW_DECLARE_FN,\n SCOPE_ARROW,\n SCOPE_FUNCTION,\n SCOPE_OTHER,\n type BindingTypes,\n} from \"../../util/scopeflags\";\nimport type { ExpressionErrors } from \"../../parser/util\";\nimport type { ParseStatementFlag } from \"../../parser/statement\";\nimport { Errors, ParseErrorEnum } from \"../../parse-error\";\nimport { cloneIdentifier, type Undone } from \"../../parser/node\";\n\nconst reservedTypes = new Set([\n \"_\",\n \"any\",\n \"bool\",\n \"boolean\",\n \"empty\",\n \"extends\",\n \"false\",\n \"interface\",\n \"mixed\",\n \"null\",\n \"number\",\n \"static\",\n \"string\",\n \"true\",\n \"typeof\",\n \"void\",\n]);\n\n/* eslint sort-keys: \"error\" */\n// The Errors key follows https://github.com/facebook/flow/blob/master/src/parser/parse_error.ml unless it does not exist\nconst FlowErrors = ParseErrorEnum`flow`({\n AmbiguousConditionalArrow:\n \"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.\",\n AmbiguousDeclareModuleKind:\n \"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.\",\n // TODO: When we get proper string enums in typescript make this ReservedType.\n // Not really worth it to do the whole $Values dance with reservedTypes set.\n AssignReservedType: ({ reservedType }: { reservedType: string }) =>\n `Cannot overwrite reserved type ${reservedType}.`,\n DeclareClassElement:\n \"The `declare` modifier can only appear on class fields.\",\n DeclareClassFieldInitializer:\n \"Initializers are not allowed in fields with the `declare` modifier.\",\n DuplicateDeclareModuleExports:\n \"Duplicate `declare module.exports` statement.\",\n EnumBooleanMemberNotInitialized: ({\n memberName,\n enumName,\n }: {\n memberName: string;\n enumName: string;\n }) =>\n `Boolean enum members need to be initialized. Use either \\`${memberName} = true,\\` or \\`${memberName} = false,\\` in enum \\`${enumName}\\`.`,\n EnumDuplicateMemberName: ({\n memberName,\n enumName,\n }: {\n memberName: string;\n enumName: string;\n }) =>\n `Enum member names need to be unique, but the name \\`${memberName}\\` has already been used before in enum \\`${enumName}\\`.`,\n EnumInconsistentMemberValues: ({ enumName }: { enumName: string }) =>\n `Enum \\`${enumName}\\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,\n EnumInvalidExplicitType: ({\n invalidEnumType,\n enumName,\n }: {\n invalidEnumType: string;\n enumName: string;\n }) =>\n `Enum type \\`${invalidEnumType}\\` is not valid. Use one of \\`boolean\\`, \\`number\\`, \\`string\\`, or \\`symbol\\` in enum \\`${enumName}\\`.`,\n EnumInvalidExplicitTypeUnknownSupplied: ({\n enumName,\n }: {\n enumName: string;\n }) =>\n `Supplied enum type is not valid. Use one of \\`boolean\\`, \\`number\\`, \\`string\\`, or \\`symbol\\` in enum \\`${enumName}\\`.`,\n\n // TODO: When moving to typescript, we should either have each of the\n // following errors only accept the specific strings they want:\n //\n // ...PrimaryType: explicitType: \"string\" | \"number\" | \"boolean\"\n // ...SymbolType: explicitType: \"symbol\"\n // ...UnknownType: explicitType: null\n //\n // Or, alternatively, merge these three errors together into one\n // `EnumInvalidMemberInitializer` error that can accept `EnumExplicitType`\n // without alteration, and then just have its message change based on the\n // explicitType.\n EnumInvalidMemberInitializerPrimaryType: ({\n enumName,\n memberName,\n explicitType,\n }: {\n enumName: string;\n memberName: string;\n explicitType: EnumExplicitType;\n }) =>\n `Enum \\`${enumName}\\` has type \\`${explicitType}\\`, so the initializer of \\`${memberName}\\` needs to be a ${explicitType} literal.`,\n EnumInvalidMemberInitializerSymbolType: ({\n enumName,\n memberName,\n }: {\n enumName: string;\n memberName: string;\n explicitType: EnumExplicitType;\n }) =>\n `Symbol enum members cannot be initialized. Use \\`${memberName},\\` in enum \\`${enumName}\\`.`,\n EnumInvalidMemberInitializerUnknownType: ({\n enumName,\n memberName,\n }: {\n enumName: string;\n memberName: string;\n explicitType: EnumExplicitType;\n }) =>\n `The enum member initializer for \\`${memberName}\\` needs to be a literal (either a boolean, number, or string) in enum \\`${enumName}\\`.`,\n EnumInvalidMemberName: ({\n enumName,\n memberName,\n suggestion,\n }: {\n enumName: string;\n memberName: string;\n suggestion: string;\n }) =>\n `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \\`${memberName}\\`, consider using \\`${suggestion}\\`, in enum \\`${enumName}\\`.`,\n EnumNumberMemberNotInitialized: ({\n enumName,\n memberName,\n }: {\n enumName: string;\n memberName: string;\n }) =>\n `Number enum members need to be initialized, e.g. \\`${memberName} = 1\\` in enum \\`${enumName}\\`.`,\n EnumStringMemberInconsistentlyInitailized: ({\n enumName,\n }: {\n enumName: string;\n }) =>\n `String enum members need to consistently either all use initializers, or use no initializers, in enum \\`${enumName}\\`.`,\n GetterMayNotHaveThisParam: \"A getter cannot have a `this` parameter.\",\n ImportReflectionHasImportType:\n \"An `import module` declaration can not use `type` or `typeof` keyword.\",\n ImportTypeShorthandOnlyInPureImport:\n \"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.\",\n InexactInsideExact:\n \"Explicit inexact syntax cannot appear inside an explicit exact object type.\",\n InexactInsideNonObject:\n \"Explicit inexact syntax cannot appear in class or interface definitions.\",\n InexactVariance: \"Explicit inexact syntax cannot have variance.\",\n InvalidNonTypeImportInDeclareModule:\n \"Imports within a `declare module` body must always be `import type` or `import typeof`.\",\n MissingTypeParamDefault:\n \"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.\",\n NestedDeclareModule:\n \"`declare module` cannot be used inside another `declare module`.\",\n NestedFlowComment: \"Cannot have a flow comment inside another flow comment.\",\n PatternIsOptional: {\n message:\n \"A binding pattern parameter cannot be optional in an implementation signature.\",\n // For consistency in TypeScript and Flow error codes\n ...(!process.env.BABEL_8_BREAKING\n ? { reasonCode: \"OptionalBindingPattern\" }\n : {}),\n },\n SetterMayNotHaveThisParam: \"A setter cannot have a `this` parameter.\",\n SpreadVariance: \"Spread properties cannot have variance.\",\n ThisParamAnnotationRequired:\n \"A type annotation is required for the `this` parameter.\",\n ThisParamBannedInConstructor:\n \"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.\",\n ThisParamMayNotBeOptional: \"The `this` parameter cannot be optional.\",\n ThisParamMustBeFirst:\n \"The `this` parameter must be the first function parameter.\",\n ThisParamNoDefault: \"The `this` parameter may not have a default value.\",\n TypeBeforeInitializer:\n \"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.\",\n TypeCastInPattern:\n \"The type cast expression is expected to be wrapped with parenthesis.\",\n UnexpectedExplicitInexactInObject:\n \"Explicit inexact syntax must appear at the end of an inexact object.\",\n UnexpectedReservedType: ({ reservedType }: { reservedType: string }) =>\n `Unexpected reserved type ${reservedType}.`,\n UnexpectedReservedUnderscore:\n \"`_` is only allowed as a type argument to call or new.\",\n UnexpectedSpaceBetweenModuloChecks:\n \"Spaces between `%` and `checks` are not allowed here.\",\n UnexpectedSpreadType:\n \"Spread operator cannot appear in class or interface definitions.\",\n UnexpectedSubtractionOperand:\n 'Unexpected token, expected \"number\" or \"bigint\".',\n UnexpectedTokenAfterTypeParameter:\n \"Expected an arrow function after this type parameter declaration.\",\n UnexpectedTypeParameterBeforeAsyncArrowFunction:\n \"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.\",\n UnsupportedDeclareExportKind: ({\n unsupportedExportKind,\n suggestion,\n }: {\n unsupportedExportKind: string;\n suggestion: string;\n }) =>\n `\\`declare export ${unsupportedExportKind}\\` is not supported. Use \\`${suggestion}\\` instead.`,\n UnsupportedStatementInDeclareModule:\n \"Only declares and type imports are allowed inside declare module.\",\n UnterminatedFlowComment: \"Unterminated flow-comment.\",\n});\n/* eslint-disable sort-keys */\n\nfunction isEsModuleType(bodyElement: N.Node): boolean {\n return (\n bodyElement.type === \"DeclareExportAllDeclaration\" ||\n (bodyElement.type === \"DeclareExportDeclaration\" &&\n (!bodyElement.declaration ||\n (bodyElement.declaration.type !== \"TypeAlias\" &&\n bodyElement.declaration.type !== \"InterfaceDeclaration\")))\n );\n}\n\nfunction hasTypeImportKind(node: N.Node): boolean {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n}\n\nconst exportSuggestions = {\n const: \"declare export var\",\n let: \"declare export var\",\n type: \"export type\",\n interface: \"export interface\",\n};\n\n// Like Array#filter, but returns a tuple [ acceptedElements, discardedElements ]\nfunction partition<T>(\n list: T[],\n test: (c: T, b: number, a: T[]) => boolean | undefined | null,\n): [T[], T[]] {\n const list1: T[] = [];\n const list2: T[] = [];\n for (let i = 0; i < list.length; i++) {\n (test(list[i], i, list) ? list1 : list2).push(list[i]);\n }\n return [list1, list2];\n}\n\nconst FLOW_PRAGMA_REGEX = /\\*?\\s*@((?:no)?flow)\\b/;\n\n// Flow enums types\ntype EnumExplicitType = null | \"boolean\" | \"number\" | \"string\" | \"symbol\";\n\ntype EnumContext = {\n enumName: string;\n explicitType: EnumExplicitType;\n memberName: string;\n};\n\ntype EnumMemberInit =\n | {\n type: \"number\";\n loc: Position;\n value: N.Node;\n }\n | {\n type: \"string\";\n loc: Position;\n value: N.Node;\n }\n | {\n type: \"boolean\";\n loc: Position;\n value: N.Node;\n }\n | {\n type: \"invalid\";\n loc: Position;\n }\n | {\n type: \"none\";\n loc: Position;\n };\n\nexport default (superClass: typeof Parser) =>\n class FlowParserMixin extends superClass implements Parser {\n // The value of the @flow/@noflow pragma. Initially undefined, transitions\n // to \"@flow\" or \"@noflow\" if we see a pragma. Transitions to null if we are\n // past the initial comment.\n flowPragma: void | null | \"flow\" | \"noflow\" = undefined;\n\n getScopeHandler(): {\n new (...args: any): FlowScopeHandler;\n } {\n return FlowScopeHandler;\n }\n\n shouldParseTypes(): boolean {\n return this.getPluginOption(\"flow\", \"all\") || this.flowPragma === \"flow\";\n }\n\n shouldParseEnums(): boolean {\n return !!this.getPluginOption(\"flow\", \"enums\");\n }\n\n finishToken(type: TokenType, val: any): void {\n if (\n type !== tt.string &&\n type !== tt.semi &&\n type !== tt.interpreterDirective\n ) {\n if (this.flowPragma === undefined) {\n this.flowPragma = null;\n }\n }\n super.finishToken(type, val);\n }\n\n addComment(comment: N.Comment): void {\n if (this.flowPragma === undefined) {\n // Try to parse a flow pragma.\n const matches = FLOW_PRAGMA_REGEX.exec(comment.value);\n if (!matches) {\n // do nothing\n } else if (matches[1] === \"flow\") {\n this.flowPragma = \"flow\";\n } else if (matches[1] === \"noflow\") {\n this.flowPragma = \"noflow\";\n } else {\n throw new Error(\"Unexpected flow pragma\");\n }\n }\n super.addComment(comment);\n }\n\n flowParseTypeInitialiser(tok?: TokenType): N.FlowType {\n const oldInType = this.state.inType;\n this.state.inType = true;\n this.expect(tok || tt.colon);\n\n const type = this.flowParseType();\n this.state.inType = oldInType;\n return type;\n }\n\n flowParsePredicate(): N.FlowPredicate {\n const node = this.startNode();\n const moduloLoc = this.state.startLoc;\n this.next(); // eat `%`\n this.expectContextual(tt._checks);\n // Force '%' and 'checks' to be adjacent\n if (this.state.lastTokStart > moduloLoc.index + 1) {\n this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, {\n at: moduloLoc,\n });\n }\n if (this.eat(tt.parenL)) {\n node.value = super.parseExpression();\n this.expect(tt.parenR);\n return this.finishNode(node, \"DeclaredPredicate\");\n } else {\n return this.finishNode(node, \"InferredPredicate\");\n }\n }\n\n flowParseTypeAndPredicateInitialiser(): [\n N.FlowType | undefined | null,\n N.FlowPredicate | undefined | null,\n ] {\n const oldInType = this.state.inType;\n this.state.inType = true;\n this.expect(tt.colon);\n let type = null;\n let predicate = null;\n if (this.match(tt.modulo)) {\n this.state.inType = oldInType;\n predicate = this.flowParsePredicate();\n } else {\n type = this.flowParseType();\n this.state.inType = oldInType;\n if (this.match(tt.modulo)) {\n predicate = this.flowParsePredicate();\n }\n }\n return [type, predicate];\n }\n\n flowParseDeclareClass(\n node: Undone<N.FlowDeclareClass>,\n ): N.FlowDeclareClass {\n this.next();\n this.flowParseInterfaceish(node, /*isClass*/ true);\n return this.finishNode(node, \"DeclareClass\");\n }\n\n flowParseDeclareFunction(\n node: Undone<N.FlowDeclareFunction>,\n ): N.FlowDeclareFunction {\n this.next();\n\n const id = (node.id = this.parseIdentifier());\n\n const typeNode = this.startNode();\n const typeContainer = this.startNode<N.TypeAnnotation>();\n\n if (this.match(tt.lt)) {\n typeNode.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n typeNode.typeParameters = null;\n }\n\n this.expect(tt.parenL);\n const tmp = this.flowParseFunctionTypeParams();\n typeNode.params = tmp.params;\n typeNode.rest = tmp.rest;\n typeNode.this = tmp._this;\n this.expect(tt.parenR);\n\n [typeNode.returnType, node.predicate] =\n this.flowParseTypeAndPredicateInitialiser();\n\n typeContainer.typeAnnotation = this.finishNode(\n typeNode,\n \"FunctionTypeAnnotation\",\n );\n\n id.typeAnnotation = this.finishNode(typeContainer, \"TypeAnnotation\");\n\n this.resetEndLocation(id);\n this.semicolon();\n\n this.scope.declareName(\n node.id.name,\n BIND_FLOW_DECLARE_FN,\n node.id.loc.start,\n );\n\n return this.finishNode(node, \"DeclareFunction\");\n }\n\n flowParseDeclare(\n node: Undone<N.FlowDeclare>,\n insideModule?: boolean,\n ): N.FlowDeclare {\n if (this.match(tt._class)) {\n return this.flowParseDeclareClass(node);\n } else if (this.match(tt._function)) {\n return this.flowParseDeclareFunction(node);\n } else if (this.match(tt._var)) {\n return this.flowParseDeclareVariable(node);\n } else if (this.eatContextual(tt._module)) {\n if (this.match(tt.dot)) {\n return this.flowParseDeclareModuleExports(node);\n } else {\n if (insideModule) {\n this.raise(FlowErrors.NestedDeclareModule, {\n at: this.state.lastTokStartLoc,\n });\n }\n return this.flowParseDeclareModule(node);\n }\n } else if (this.isContextual(tt._type)) {\n return this.flowParseDeclareTypeAlias(node);\n } else if (this.isContextual(tt._opaque)) {\n return this.flowParseDeclareOpaqueType(node);\n } else if (this.isContextual(tt._interface)) {\n return this.flowParseDeclareInterface(node);\n } else if (this.match(tt._export)) {\n return this.flowParseDeclareExportDeclaration(node, insideModule);\n } else {\n this.unexpected();\n }\n }\n\n flowParseDeclareVariable(\n node: Undone<N.FlowDeclareVariable>,\n ): N.FlowDeclareVariable {\n this.next();\n node.id = this.flowParseTypeAnnotatableIdentifier(\n /*allowPrimitiveOverride*/ true,\n );\n this.scope.declareName(node.id.name, BIND_VAR, node.id.loc.start);\n this.semicolon();\n return this.finishNode(node, \"DeclareVariable\");\n }\n\n flowParseDeclareModule(\n node: Undone<N.FlowDeclareModule>,\n ): N.FlowDeclareModule {\n this.scope.enter(SCOPE_OTHER);\n\n if (this.match(tt.string)) {\n node.id = super.parseExprAtom();\n } else {\n node.id = this.parseIdentifier();\n }\n\n const bodyNode = (node.body = this.startNode());\n // @ts-expect-error refine typings\n const body = (bodyNode.body = []);\n this.expect(tt.braceL);\n while (!this.match(tt.braceR)) {\n let bodyNode = this.startNode<N.ImportDeclaration>();\n\n if (this.match(tt._import)) {\n this.next();\n if (!this.isContextual(tt._type) && !this.match(tt._typeof)) {\n this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, {\n at: this.state.lastTokStartLoc,\n });\n }\n super.parseImport(bodyNode);\n } else {\n this.expectContextual(\n tt._declare,\n FlowErrors.UnsupportedStatementInDeclareModule,\n );\n // @ts-expect-error refine typings\n bodyNode = this.flowParseDeclare(bodyNode, true);\n }\n\n body.push(bodyNode);\n }\n\n this.scope.exit();\n\n this.expect(tt.braceR);\n\n this.finishNode(bodyNode, \"BlockStatement\");\n\n let kind: \"CommonJS\" | \"ES\" | null = null;\n let hasModuleExport = false;\n body.forEach(bodyElement => {\n if (isEsModuleType(bodyElement)) {\n if (kind === \"CommonJS\") {\n this.raise(FlowErrors.AmbiguousDeclareModuleKind, {\n at: bodyElement,\n });\n }\n kind = \"ES\";\n } else if (bodyElement.type === \"DeclareModuleExports\") {\n if (hasModuleExport) {\n this.raise(FlowErrors.DuplicateDeclareModuleExports, {\n at: bodyElement,\n });\n }\n if (kind === \"ES\") {\n this.raise(FlowErrors.AmbiguousDeclareModuleKind, {\n at: bodyElement,\n });\n }\n kind = \"CommonJS\";\n hasModuleExport = true;\n }\n });\n\n node.kind = kind || \"CommonJS\";\n return this.finishNode(node, \"DeclareModule\");\n }\n\n flowParseDeclareExportDeclaration(\n node: Undone<N.FlowDeclareExportDeclaration>,\n insideModule?: boolean | null,\n ): N.FlowDeclareExportDeclaration {\n this.expect(tt._export);\n\n if (this.eat(tt._default)) {\n if (this.match(tt._function) || this.match(tt._class)) {\n // declare export default class ...\n // declare export default function ...\n node.declaration = this.flowParseDeclare(this.startNode());\n } else {\n // declare export default [type];\n node.declaration = this.flowParseType();\n this.semicolon();\n }\n node.default = true;\n\n return this.finishNode(node, \"DeclareExportDeclaration\");\n } else {\n if (\n this.match(tt._const) ||\n this.isLet() ||\n ((this.isContextual(tt._type) || this.isContextual(tt._interface)) &&\n !insideModule)\n ) {\n const label = this.state.value as\n | \"const\"\n | \"let\"\n | \"type\"\n | \"interface\";\n throw this.raise(FlowErrors.UnsupportedDeclareExportKind, {\n at: this.state.startLoc,\n unsupportedExportKind: label,\n suggestion: exportSuggestions[label],\n });\n }\n\n if (\n this.match(tt._var) || // declare export var ...\n this.match(tt._function) || // declare export function ...\n this.match(tt._class) || // declare export class ...\n this.isContextual(tt._opaque) // declare export opaque ..\n ) {\n node.declaration = this.flowParseDeclare(this.startNode());\n node.default = false;\n\n return this.finishNode(node, \"DeclareExportDeclaration\");\n } else if (\n this.match(tt.star) || // declare export * from ''\n this.match(tt.braceL) || // declare export {} ...\n this.isContextual(tt._interface) || // declare export interface ...\n this.isContextual(tt._type) || // declare export type ...\n this.isContextual(tt._opaque) // declare export opaque type ...\n ) {\n node = this.parseExport(\n node as Undone<N.ExportNamedDeclaration | N.ExportAllDeclaration>,\n /* decorators */ null,\n );\n if (node.type === \"ExportNamedDeclaration\") {\n node.type = \"ExportDeclaration\";\n node.default = false;\n delete node.exportKind;\n }\n\n node.type = \"Declare\" + node.type;\n\n return node as N.Node;\n }\n }\n\n this.unexpected();\n }\n\n flowParseDeclareModuleExports(\n node: Undone<N.FlowDeclareModuleExports>,\n ): N.FlowDeclareModuleExports {\n this.next();\n this.expectContextual(tt._exports);\n node.typeAnnotation = this.flowParseTypeAnnotation();\n this.semicolon();\n\n return this.finishNode(node, \"DeclareModuleExports\");\n }\n\n flowParseDeclareTypeAlias(\n node: Undone<N.FlowDeclareTypeAlias>,\n ): N.FlowDeclareTypeAlias {\n this.next();\n const finished = this.flowParseTypeAlias(node);\n // Don't do finishNode as we don't want to process comments twice\n finished.type = \"DeclareTypeAlias\";\n return finished;\n }\n\n flowParseDeclareOpaqueType(\n node: Undone<N.FlowDeclareOpaqueType>,\n ): N.FlowDeclareOpaqueType {\n this.next();\n const finished = this.flowParseOpaqueType(node, true);\n // Don't do finishNode as we don't want to process comments twice\n finished.type = \"DeclareOpaqueType\";\n return finished;\n }\n\n flowParseDeclareInterface(\n node: Undone<N.FlowDeclareInterface>,\n ): N.FlowDeclareInterface {\n this.next();\n this.flowParseInterfaceish(node, /* isClass */ false);\n return this.finishNode(node, \"DeclareInterface\");\n }\n\n // Interfaces\n\n flowParseInterfaceish(node: Undone<N.FlowDeclare>, isClass: boolean): void {\n node.id = this.flowParseRestrictedIdentifier(\n /* liberal */ !isClass,\n /* declaration */ true,\n );\n\n this.scope.declareName(\n node.id.name,\n isClass ? BIND_FUNCTION : BIND_LEXICAL,\n node.id.loc.start,\n );\n\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n node.extends = [];\n\n if (this.eat(tt._extends)) {\n do {\n node.extends.push(this.flowParseInterfaceExtends());\n } while (!isClass && this.eat(tt.comma));\n }\n\n if (isClass) {\n node.implements = [];\n node.mixins = [];\n\n if (this.eatContextual(tt._mixins)) {\n do {\n node.mixins.push(this.flowParseInterfaceExtends());\n } while (this.eat(tt.comma));\n }\n\n if (this.eatContextual(tt._implements)) {\n do {\n node.implements.push(this.flowParseInterfaceExtends());\n } while (this.eat(tt.comma));\n }\n }\n\n node.body = this.flowParseObjectType({\n allowStatic: isClass,\n allowExact: false,\n allowSpread: false,\n allowProto: isClass,\n allowInexact: false,\n });\n }\n\n flowParseInterfaceExtends(): N.FlowInterfaceExtends {\n const node = this.startNode();\n\n node.id = this.flowParseQualifiedTypeIdentifier();\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n } else {\n node.typeParameters = null;\n }\n\n return this.finishNode(node, \"InterfaceExtends\");\n }\n\n flowParseInterface(node: Undone<N.FlowInterface>): N.FlowInterface {\n this.flowParseInterfaceish(node, /* isClass */ false);\n return this.finishNode(node, \"InterfaceDeclaration\");\n }\n\n checkNotUnderscore(word: string) {\n if (word === \"_\") {\n this.raise(FlowErrors.UnexpectedReservedUnderscore, {\n at: this.state.startLoc,\n });\n }\n }\n\n checkReservedType(word: string, startLoc: Position, declaration?: boolean) {\n if (!reservedTypes.has(word)) return;\n\n this.raise(\n declaration\n ? FlowErrors.AssignReservedType\n : FlowErrors.UnexpectedReservedType,\n {\n at: startLoc,\n reservedType: word,\n },\n );\n }\n\n flowParseRestrictedIdentifier(\n liberal?: boolean,\n declaration?: boolean,\n ): N.Identifier {\n this.checkReservedType(\n this.state.value,\n this.state.startLoc,\n declaration,\n );\n return this.parseIdentifier(liberal);\n }\n\n // Type aliases\n\n flowParseTypeAlias(node: Undone<N.FlowTypeAlias>): N.FlowTypeAlias {\n node.id = this.flowParseRestrictedIdentifier(\n /* liberal */ false,\n /* declaration */ true,\n );\n this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start);\n\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n node.right = this.flowParseTypeInitialiser(tt.eq);\n this.semicolon();\n\n return this.finishNode(node, \"TypeAlias\");\n }\n\n flowParseOpaqueType(\n node: Undone<N.FlowOpaqueType>,\n declare: boolean,\n ): N.FlowOpaqueType {\n this.expectContextual(tt._type);\n node.id = this.flowParseRestrictedIdentifier(\n /* liberal */ true,\n /* declaration */ true,\n );\n this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start);\n\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n // Parse the supertype\n node.supertype = null;\n if (this.match(tt.colon)) {\n node.supertype = this.flowParseTypeInitialiser(tt.colon);\n }\n\n node.impltype = null;\n if (!declare) {\n node.impltype = this.flowParseTypeInitialiser(tt.eq);\n }\n this.semicolon();\n\n return this.finishNode(node, \"OpaqueType\");\n }\n\n // Type annotations\n\n flowParseTypeParameter(requireDefault: boolean = false): N.TypeParameter {\n const nodeStartLoc = this.state.startLoc;\n\n const node = this.startNode<N.TypeParameter>();\n\n const variance = this.flowParseVariance();\n\n const ident = this.flowParseTypeAnnotatableIdentifier();\n node.name = ident.name;\n // @ts-expect-error migrate to Babel types\n node.variance = variance;\n // @ts-expect-error migrate to Babel types\n node.bound = ident.typeAnnotation;\n\n if (this.match(tt.eq)) {\n this.eat(tt.eq);\n // @ts-expect-error migrate to Babel types\n node.default = this.flowParseType();\n } else {\n if (requireDefault) {\n this.raise(FlowErrors.MissingTypeParamDefault, { at: nodeStartLoc });\n }\n }\n\n return this.finishNode(node, \"TypeParameter\");\n }\n\n flowParseTypeParameterDeclaration(): N.TypeParameterDeclaration {\n const oldInType = this.state.inType;\n const node = this.startNode<N.TypeParameterDeclaration>();\n node.params = [];\n\n this.state.inType = true;\n\n // istanbul ignore else: this condition is already checked at all call sites\n if (this.match(tt.lt) || this.match(tt.jsxTagStart)) {\n this.next();\n } else {\n this.unexpected();\n }\n\n let defaultRequired = false;\n\n do {\n const typeParameter = this.flowParseTypeParameter(defaultRequired);\n\n node.params.push(typeParameter);\n\n if (typeParameter.default) {\n defaultRequired = true;\n }\n\n if (!this.match(tt.gt)) {\n this.expect(tt.comma);\n }\n } while (!this.match(tt.gt));\n this.expect(tt.gt);\n\n this.state.inType = oldInType;\n\n return this.finishNode(node, \"TypeParameterDeclaration\");\n }\n\n flowParseTypeParameterInstantiation(): N.TypeParameterInstantiation {\n const node = this.startNode<N.TypeParameterInstantiation>();\n const oldInType = this.state.inType;\n node.params = [];\n\n this.state.inType = true;\n\n this.expect(tt.lt);\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = false;\n while (!this.match(tt.gt)) {\n node.params.push(this.flowParseType());\n if (!this.match(tt.gt)) {\n this.expect(tt.comma);\n }\n }\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n this.expect(tt.gt);\n\n this.state.inType = oldInType;\n\n return this.finishNode(node, \"TypeParameterInstantiation\");\n }\n\n flowParseTypeParameterInstantiationCallOrNew(): N.TypeParameterInstantiation {\n const node = this.startNode<N.TypeParameterInstantiation>();\n const oldInType = this.state.inType;\n node.params = [];\n\n this.state.inType = true;\n\n this.expect(tt.lt);\n while (!this.match(tt.gt)) {\n node.params.push(this.flowParseTypeOrImplicitInstantiation());\n if (!this.match(tt.gt)) {\n this.expect(tt.comma);\n }\n }\n this.expect(tt.gt);\n\n this.state.inType = oldInType;\n\n return this.finishNode(node, \"TypeParameterInstantiation\");\n }\n\n flowParseInterfaceType(): N.FlowInterfaceType {\n const node = this.startNode<N.FlowInterfaceType>();\n this.expectContextual(tt._interface);\n\n node.extends = [];\n if (this.eat(tt._extends)) {\n do {\n node.extends.push(this.flowParseInterfaceExtends());\n } while (this.eat(tt.comma));\n }\n\n node.body = this.flowParseObjectType({\n allowStatic: false,\n allowExact: false,\n allowSpread: false,\n allowProto: false,\n allowInexact: false,\n });\n\n return this.finishNode(node, \"InterfaceTypeAnnotation\");\n }\n\n flowParseObjectPropertyKey(): N.Expression {\n return this.match(tt.num) || this.match(tt.string)\n ? super.parseExprAtom()\n : this.parseIdentifier(true);\n }\n\n flowParseObjectTypeIndexer(\n node: Undone<N.FlowObjectTypeIndexer>,\n isStatic: boolean,\n variance?: N.FlowVariance | null,\n ): N.FlowObjectTypeIndexer {\n node.static = isStatic;\n\n // Note: bracketL has already been consumed\n if (this.lookahead().type === tt.colon) {\n node.id = this.flowParseObjectPropertyKey();\n node.key = this.flowParseTypeInitialiser();\n } else {\n node.id = null;\n node.key = this.flowParseType();\n }\n this.expect(tt.bracketR);\n node.value = this.flowParseTypeInitialiser();\n node.variance = variance;\n\n return this.finishNode(node, \"ObjectTypeIndexer\");\n }\n\n flowParseObjectTypeInternalSlot(\n node: Undone<N.FlowObjectTypeInternalSlot>,\n isStatic: boolean,\n ): N.FlowObjectTypeInternalSlot {\n node.static = isStatic;\n // Note: both bracketL have already been consumed\n node.id = this.flowParseObjectPropertyKey();\n this.expect(tt.bracketR);\n this.expect(tt.bracketR);\n if (this.match(tt.lt) || this.match(tt.parenL)) {\n node.method = true;\n node.optional = false;\n node.value = this.flowParseObjectTypeMethodish(\n this.startNodeAt(node.loc.start),\n );\n } else {\n node.method = false;\n if (this.eat(tt.question)) {\n node.optional = true;\n }\n node.value = this.flowParseTypeInitialiser();\n }\n return this.finishNode(node, \"ObjectTypeInternalSlot\");\n }\n\n flowParseObjectTypeMethodish(\n node: Undone<N.FlowFunctionTypeAnnotation>,\n ): N.FlowFunctionTypeAnnotation {\n node.params = [];\n node.rest = null;\n node.typeParameters = null;\n node.this = null;\n\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n this.expect(tt.parenL);\n if (this.match(tt._this)) {\n node.this = this.flowParseFunctionTypeParam(/* first */ true);\n // match Flow parser behavior\n node.this.name = null;\n if (!this.match(tt.parenR)) {\n this.expect(tt.comma);\n }\n }\n while (!this.match(tt.parenR) && !this.match(tt.ellipsis)) {\n node.params.push(this.flowParseFunctionTypeParam(false));\n if (!this.match(tt.parenR)) {\n this.expect(tt.comma);\n }\n }\n\n if (this.eat(tt.ellipsis)) {\n node.rest = this.flowParseFunctionTypeParam(false);\n }\n this.expect(tt.parenR);\n node.returnType = this.flowParseTypeInitialiser();\n\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n\n flowParseObjectTypeCallProperty(\n node: Undone<N.FlowObjectTypeCallProperty>,\n isStatic: boolean,\n ): N.FlowObjectTypeCallProperty {\n const valueNode = this.startNode();\n node.static = isStatic;\n node.value = this.flowParseObjectTypeMethodish(valueNode);\n return this.finishNode(node, \"ObjectTypeCallProperty\");\n }\n\n flowParseObjectType({\n allowStatic,\n allowExact,\n allowSpread,\n allowProto,\n allowInexact,\n }: {\n allowStatic: boolean;\n allowExact: boolean;\n allowSpread: boolean;\n allowProto: boolean;\n allowInexact: boolean;\n }): N.FlowObjectTypeAnnotation {\n const oldInType = this.state.inType;\n this.state.inType = true;\n\n const nodeStart = this.startNode();\n\n nodeStart.callProperties = [];\n nodeStart.properties = [];\n nodeStart.indexers = [];\n nodeStart.internalSlots = [];\n\n let endDelim;\n let exact;\n let inexact = false;\n if (allowExact && this.match(tt.braceBarL)) {\n this.expect(tt.braceBarL);\n endDelim = tt.braceBarR;\n exact = true;\n } else {\n this.expect(tt.braceL);\n endDelim = tt.braceR;\n exact = false;\n }\n\n nodeStart.exact = exact;\n\n while (!this.match(endDelim)) {\n let isStatic = false;\n let protoStartLoc: Position | undefined | null = null;\n let inexactStartLoc: Position | undefined | null = null;\n const node = this.startNode();\n\n if (allowProto && this.isContextual(tt._proto)) {\n const lookahead = this.lookahead();\n\n if (lookahead.type !== tt.colon && lookahead.type !== tt.question) {\n this.next();\n protoStartLoc = this.state.startLoc;\n allowStatic = false;\n }\n }\n\n if (allowStatic && this.isContextual(tt._static)) {\n const lookahead = this.lookahead();\n\n // static is a valid identifier name\n if (lookahead.type !== tt.colon && lookahead.type !== tt.question) {\n this.next();\n isStatic = true;\n }\n }\n\n const variance = this.flowParseVariance();\n\n if (this.eat(tt.bracketL)) {\n if (protoStartLoc != null) {\n this.unexpected(protoStartLoc);\n }\n if (this.eat(tt.bracketL)) {\n if (variance) {\n this.unexpected(variance.loc.start);\n }\n nodeStart.internalSlots.push(\n this.flowParseObjectTypeInternalSlot(node, isStatic),\n );\n } else {\n nodeStart.indexers.push(\n this.flowParseObjectTypeIndexer(node, isStatic, variance),\n );\n }\n } else if (this.match(tt.parenL) || this.match(tt.lt)) {\n if (protoStartLoc != null) {\n this.unexpected(protoStartLoc);\n }\n if (variance) {\n this.unexpected(variance.loc.start);\n }\n nodeStart.callProperties.push(\n this.flowParseObjectTypeCallProperty(node, isStatic),\n );\n } else {\n let kind = \"init\";\n\n if (this.isContextual(tt._get) || this.isContextual(tt._set)) {\n const lookahead = this.lookahead();\n if (tokenIsLiteralPropertyName(lookahead.type)) {\n kind = this.state.value;\n this.next();\n }\n }\n\n const propOrInexact = this.flowParseObjectTypeProperty(\n node,\n isStatic,\n protoStartLoc,\n variance,\n kind,\n allowSpread,\n allowInexact ?? !exact,\n );\n\n if (propOrInexact === null) {\n inexact = true;\n inexactStartLoc = this.state.lastTokStartLoc;\n } else {\n nodeStart.properties.push(propOrInexact);\n }\n }\n\n this.flowObjectTypeSemicolon();\n\n if (\n inexactStartLoc &&\n !this.match(tt.braceR) &&\n !this.match(tt.braceBarR)\n ) {\n this.raise(FlowErrors.UnexpectedExplicitInexactInObject, {\n at: inexactStartLoc,\n });\n }\n }\n\n this.expect(endDelim);\n\n /* The inexact flag should only be added on ObjectTypeAnnotations that\n * are not the body of an interface, declare interface, or declare class.\n * Since spreads are only allowed in object types, checking that is\n * sufficient here.\n */\n if (allowSpread) {\n nodeStart.inexact = inexact;\n }\n\n const out = this.finishNode(nodeStart, \"ObjectTypeAnnotation\");\n\n this.state.inType = oldInType;\n\n return out;\n }\n\n flowParseObjectTypeProperty(\n node: Undone<N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty>,\n isStatic: boolean,\n protoStartLoc: Position | undefined | null,\n variance: N.FlowVariance | undefined | null,\n kind: string,\n allowSpread: boolean,\n allowInexact: boolean,\n ): N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty | null {\n if (this.eat(tt.ellipsis)) {\n const isInexactToken =\n this.match(tt.comma) ||\n this.match(tt.semi) ||\n this.match(tt.braceR) ||\n this.match(tt.braceBarR);\n\n if (isInexactToken) {\n if (!allowSpread) {\n this.raise(FlowErrors.InexactInsideNonObject, {\n at: this.state.lastTokStartLoc,\n });\n } else if (!allowInexact) {\n this.raise(FlowErrors.InexactInsideExact, {\n at: this.state.lastTokStartLoc,\n });\n }\n if (variance) {\n this.raise(FlowErrors.InexactVariance, { at: variance });\n }\n\n return null;\n }\n\n if (!allowSpread) {\n this.raise(FlowErrors.UnexpectedSpreadType, {\n at: this.state.lastTokStartLoc,\n });\n }\n if (protoStartLoc != null) {\n this.unexpected(protoStartLoc);\n }\n if (variance) {\n this.raise(FlowErrors.SpreadVariance, { at: variance });\n }\n\n node.argument = this.flowParseType();\n return this.finishNode(node, \"ObjectTypeSpreadProperty\");\n } else {\n node.key = this.flowParseObjectPropertyKey();\n node.static = isStatic;\n node.proto = protoStartLoc != null;\n node.kind = kind;\n\n let optional = false;\n if (this.match(tt.lt) || this.match(tt.parenL)) {\n // This is a method property\n node.method = true;\n\n if (protoStartLoc != null) {\n this.unexpected(protoStartLoc);\n }\n if (variance) {\n this.unexpected(variance.loc.start);\n }\n\n node.value = this.flowParseObjectTypeMethodish(\n this.startNodeAt(node.loc.start),\n );\n if (kind === \"get\" || kind === \"set\") {\n this.flowCheckGetterSetterParams(node);\n }\n /** Declared classes/interfaces do not allow spread */\n if (\n !allowSpread &&\n node.key.name === \"constructor\" &&\n node.value.this\n ) {\n this.raise(FlowErrors.ThisParamBannedInConstructor, {\n at: node.value.this,\n });\n }\n } else {\n if (kind !== \"init\") this.unexpected();\n\n node.method = false;\n\n if (this.eat(tt.question)) {\n optional = true;\n }\n node.value = this.flowParseTypeInitialiser();\n node.variance = variance;\n }\n\n node.optional = optional;\n\n return this.finishNode(node, \"ObjectTypeProperty\");\n }\n }\n\n // This is similar to checkGetterSetterParams, but as\n // @babel/parser uses non estree properties we cannot reuse it here\n flowCheckGetterSetterParams(\n property: Undone<\n N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty\n >,\n ): void {\n const paramCount = property.kind === \"get\" ? 0 : 1;\n const length =\n property.value.params.length + (property.value.rest ? 1 : 0);\n\n if (property.value.this) {\n this.raise(\n property.kind === \"get\"\n ? FlowErrors.GetterMayNotHaveThisParam\n : FlowErrors.SetterMayNotHaveThisParam,\n { at: property.value.this },\n );\n }\n\n if (length !== paramCount) {\n this.raise(\n property.kind === \"get\"\n ? Errors.BadGetterArity\n : Errors.BadSetterArity,\n { at: property },\n );\n }\n\n if (property.kind === \"set\" && property.value.rest) {\n this.raise(Errors.BadSetterRestParameter, { at: property });\n }\n }\n\n flowObjectTypeSemicolon(): void {\n if (\n !this.eat(tt.semi) &&\n !this.eat(tt.comma) &&\n !this.match(tt.braceR) &&\n !this.match(tt.braceBarR)\n ) {\n this.unexpected();\n }\n }\n\n flowParseQualifiedTypeIdentifier(\n startLoc?: Position,\n id?: N.Identifier,\n ): N.FlowQualifiedTypeIdentifier {\n startLoc ??= this.state.startLoc;\n let node: N.Identifier | N.FlowQualifiedTypeIdentifier =\n id || this.flowParseRestrictedIdentifier(true);\n\n while (this.eat(tt.dot)) {\n const node2 = this.startNodeAt<N.FlowQualifiedTypeIdentifier>(startLoc);\n node2.qualification = node;\n node2.id = this.flowParseRestrictedIdentifier(true);\n node = this.finishNode(node2, \"QualifiedTypeIdentifier\");\n }\n\n return node;\n }\n\n flowParseGenericType(\n startLoc: Position,\n id: N.Identifier,\n ): N.FlowGenericTypeAnnotation {\n const node = this.startNodeAt(startLoc);\n\n node.typeParameters = null;\n node.id = this.flowParseQualifiedTypeIdentifier(startLoc, id);\n\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n }\n\n return this.finishNode(node, \"GenericTypeAnnotation\");\n }\n\n flowParseTypeofType(): N.FlowTypeofTypeAnnotation {\n const node = this.startNode();\n this.expect(tt._typeof);\n node.argument = this.flowParsePrimaryType();\n return this.finishNode(node, \"TypeofTypeAnnotation\");\n }\n\n flowParseTupleType(): N.FlowTupleTypeAnnotation {\n const node = this.startNode();\n node.types = [];\n this.expect(tt.bracketL);\n // We allow trailing commas\n while (this.state.pos < this.length && !this.match(tt.bracketR)) {\n node.types.push(this.flowParseType());\n if (this.match(tt.bracketR)) break;\n this.expect(tt.comma);\n }\n this.expect(tt.bracketR);\n return this.finishNode(node, \"TupleTypeAnnotation\");\n }\n\n flowParseFunctionTypeParam(first: boolean): N.FlowFunctionTypeParam {\n let name = null;\n let optional = false;\n let typeAnnotation = null;\n const node = this.startNode<N.FlowFunctionTypeParam>();\n const lh = this.lookahead();\n const isThis = this.state.type === tt._this;\n\n if (lh.type === tt.colon || lh.type === tt.question) {\n if (isThis && !first) {\n this.raise(FlowErrors.ThisParamMustBeFirst, { at: node });\n }\n name = this.parseIdentifier(isThis);\n if (this.eat(tt.question)) {\n optional = true;\n if (isThis) {\n this.raise(FlowErrors.ThisParamMayNotBeOptional, { at: node });\n }\n }\n typeAnnotation = this.flowParseTypeInitialiser();\n } else {\n typeAnnotation = this.flowParseType();\n }\n node.name = name;\n node.optional = optional;\n node.typeAnnotation = typeAnnotation;\n return this.finishNode(node, \"FunctionTypeParam\");\n }\n\n reinterpretTypeAsFunctionTypeParam(\n type: N.FlowType,\n ): N.FlowFunctionTypeParam {\n const node = this.startNodeAt(type.loc.start);\n node.name = null;\n node.optional = false;\n node.typeAnnotation = type;\n return this.finishNode(node, \"FunctionTypeParam\");\n }\n\n flowParseFunctionTypeParams(params: N.FlowFunctionTypeParam[] = []): {\n params: N.FlowFunctionTypeParam[];\n rest: N.FlowFunctionTypeParam | undefined | null;\n _this: N.FlowFunctionTypeParam | undefined | null;\n } {\n let rest: N.FlowFunctionTypeParam | undefined | null = null;\n let _this: N.FlowFunctionTypeParam | undefined | null = null;\n if (this.match(tt._this)) {\n _this = this.flowParseFunctionTypeParam(/* first */ true);\n // match Flow parser behavior\n _this.name = null;\n if (!this.match(tt.parenR)) {\n this.expect(tt.comma);\n }\n }\n while (!this.match(tt.parenR) && !this.match(tt.ellipsis)) {\n params.push(this.flowParseFunctionTypeParam(false));\n if (!this.match(tt.parenR)) {\n this.expect(tt.comma);\n }\n }\n if (this.eat(tt.ellipsis)) {\n rest = this.flowParseFunctionTypeParam(false);\n }\n return { params, rest, _this };\n }\n\n flowIdentToTypeAnnotation(\n startLoc: Position,\n node: Undone<N.FlowTypeAnnotation>,\n id: N.Identifier,\n ): N.FlowTypeAnnotation {\n switch (id.name) {\n case \"any\":\n return this.finishNode(node, \"AnyTypeAnnotation\");\n\n case \"bool\":\n case \"boolean\":\n return this.finishNode(node, \"BooleanTypeAnnotation\");\n\n case \"mixed\":\n return this.finishNode(node, \"MixedTypeAnnotation\");\n\n case \"empty\":\n return this.finishNode(node, \"EmptyTypeAnnotation\");\n\n case \"number\":\n return this.finishNode(node, \"NumberTypeAnnotation\");\n\n case \"string\":\n return this.finishNode(node, \"StringTypeAnnotation\");\n\n case \"symbol\":\n return this.finishNode(node, \"SymbolTypeAnnotation\");\n\n default:\n this.checkNotUnderscore(id.name);\n return this.flowParseGenericType(startLoc, id);\n }\n }\n\n // The parsing of types roughly parallels the parsing of expressions, and\n // primary types are kind of like primary expressions...they're the\n // primitives with which other types are constructed.\n flowParsePrimaryType(): N.FlowTypeAnnotation {\n const startLoc = this.state.startLoc;\n const node = this.startNode();\n let tmp;\n let type;\n let isGroupedType = false;\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n\n switch (this.state.type) {\n case tt.braceL:\n return this.flowParseObjectType({\n allowStatic: false,\n allowExact: false,\n allowSpread: true,\n allowProto: false,\n allowInexact: true,\n });\n\n case tt.braceBarL:\n return this.flowParseObjectType({\n allowStatic: false,\n allowExact: true,\n allowSpread: true,\n allowProto: false,\n allowInexact: false,\n });\n\n case tt.bracketL:\n this.state.noAnonFunctionType = false;\n type = this.flowParseTupleType();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n return type;\n\n case tt.lt:\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n this.expect(tt.parenL);\n tmp = this.flowParseFunctionTypeParams();\n node.params = tmp.params;\n node.rest = tmp.rest;\n node.this = tmp._this;\n this.expect(tt.parenR);\n\n this.expect(tt.arrow);\n\n node.returnType = this.flowParseType();\n\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n\n case tt.parenL:\n this.next();\n\n // Check to see if this is actually a grouped type\n if (!this.match(tt.parenR) && !this.match(tt.ellipsis)) {\n if (tokenIsIdentifier(this.state.type) || this.match(tt._this)) {\n const token = this.lookahead().type;\n isGroupedType = token !== tt.question && token !== tt.colon;\n } else {\n isGroupedType = true;\n }\n }\n\n if (isGroupedType) {\n this.state.noAnonFunctionType = false;\n type = this.flowParseType();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n\n // A `,` or a `) =>` means this is an anonymous function type\n if (\n this.state.noAnonFunctionType ||\n !(\n this.match(tt.comma) ||\n (this.match(tt.parenR) && this.lookahead().type === tt.arrow)\n )\n ) {\n this.expect(tt.parenR);\n return type;\n } else {\n // Eat a comma if there is one\n this.eat(tt.comma);\n }\n }\n\n if (type) {\n tmp = this.flowParseFunctionTypeParams([\n this.reinterpretTypeAsFunctionTypeParam(type),\n ]);\n } else {\n tmp = this.flowParseFunctionTypeParams();\n }\n\n node.params = tmp.params;\n node.rest = tmp.rest;\n node.this = tmp._this;\n\n this.expect(tt.parenR);\n\n this.expect(tt.arrow);\n\n node.returnType = this.flowParseType();\n\n node.typeParameters = null;\n\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n\n case tt.string:\n return this.parseLiteral<N.StringLiteralTypeAnnotation>(\n this.state.value,\n \"StringLiteralTypeAnnotation\",\n );\n\n case tt._true:\n case tt._false:\n node.value = this.match(tt._true);\n this.next();\n return this.finishNode(\n node as Undone<N.BooleanLiteralTypeAnnotation>,\n \"BooleanLiteralTypeAnnotation\",\n );\n\n case tt.plusMin:\n if (this.state.value === \"-\") {\n this.next();\n if (this.match(tt.num)) {\n return this.parseLiteralAtNode<N.NumberLiteralTypeAnnotation>(\n -this.state.value,\n \"NumberLiteralTypeAnnotation\",\n node,\n );\n }\n\n if (this.match(tt.bigint)) {\n return this.parseLiteralAtNode<N.BigIntLiteralTypeAnnotation>(\n -this.state.value,\n \"BigIntLiteralTypeAnnotation\",\n node,\n );\n }\n\n throw this.raise(FlowErrors.UnexpectedSubtractionOperand, {\n at: this.state.startLoc,\n });\n }\n this.unexpected();\n return;\n case tt.num:\n return this.parseLiteral(\n this.state.value,\n \"NumberLiteralTypeAnnotation\",\n );\n\n case tt.bigint:\n return this.parseLiteral(\n this.state.value,\n \"BigIntLiteralTypeAnnotation\",\n );\n\n case tt._void:\n this.next();\n return this.finishNode(node, \"VoidTypeAnnotation\");\n\n case tt._null:\n this.next();\n return this.finishNode(node, \"NullLiteralTypeAnnotation\");\n\n case tt._this:\n this.next();\n return this.finishNode(node, \"ThisTypeAnnotation\");\n\n case tt.star:\n this.next();\n return this.finishNode(node, \"ExistsTypeAnnotation\");\n\n case tt._typeof:\n return this.flowParseTypeofType();\n\n default:\n if (tokenIsKeyword(this.state.type)) {\n const label = tokenLabelName(this.state.type);\n this.next();\n return super.createIdentifier(node as Undone<N.Identifier>, label);\n } else if (tokenIsIdentifier(this.state.type)) {\n if (this.isContextual(tt._interface)) {\n return this.flowParseInterfaceType();\n }\n\n return this.flowIdentToTypeAnnotation(\n startLoc,\n node,\n this.parseIdentifier(),\n );\n }\n }\n\n this.unexpected();\n }\n\n flowParsePostfixType(): N.FlowTypeAnnotation {\n const startLoc = this.state.startLoc;\n let type = this.flowParsePrimaryType();\n let seenOptionalIndexedAccess = false;\n while (\n (this.match(tt.bracketL) || this.match(tt.questionDot)) &&\n !this.canInsertSemicolon()\n ) {\n const node = this.startNodeAt(startLoc);\n const optional = this.eat(tt.questionDot);\n seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional;\n this.expect(tt.bracketL);\n if (!optional && this.match(tt.bracketR)) {\n node.elementType = type;\n this.next(); // eat `]`\n type = this.finishNode(node, \"ArrayTypeAnnotation\");\n } else {\n node.objectType = type;\n node.indexType = this.flowParseType();\n this.expect(tt.bracketR);\n if (seenOptionalIndexedAccess) {\n node.optional = optional;\n type = this.finishNode<N.FlowOptionalIndexedAccessType>(\n // @ts-expect-error todo(flow->ts)\n node,\n \"OptionalIndexedAccessType\",\n );\n } else {\n type = this.finishNode<N.FlowIndexedAccessType>(\n // @ts-expect-error todo(flow->ts)\n node,\n \"IndexedAccessType\",\n );\n }\n }\n }\n return type;\n }\n\n flowParsePrefixType(): N.FlowTypeAnnotation {\n const node = this.startNode();\n if (this.eat(tt.question)) {\n node.typeAnnotation = this.flowParsePrefixType();\n return this.finishNode(node, \"NullableTypeAnnotation\");\n } else {\n return this.flowParsePostfixType();\n }\n }\n\n flowParseAnonFunctionWithoutParens(): N.FlowTypeAnnotation {\n const param = this.flowParsePrefixType();\n if (!this.state.noAnonFunctionType && this.eat(tt.arrow)) {\n // TODO: This should be a type error. Passing in a SourceLocation, and it expects a Position.\n const node = this.startNodeAt(param.loc.start);\n node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];\n node.rest = null;\n node.this = null;\n node.returnType = this.flowParseType();\n node.typeParameters = null;\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n return param;\n }\n\n flowParseIntersectionType(): N.FlowTypeAnnotation {\n const node = this.startNode();\n this.eat(tt.bitwiseAND);\n const type = this.flowParseAnonFunctionWithoutParens();\n node.types = [type];\n while (this.eat(tt.bitwiseAND)) {\n node.types.push(this.flowParseAnonFunctionWithoutParens());\n }\n return node.types.length === 1\n ? type\n : this.finishNode(node, \"IntersectionTypeAnnotation\");\n }\n\n flowParseUnionType(): N.FlowTypeAnnotation {\n const node = this.startNode();\n this.eat(tt.bitwiseOR);\n const type = this.flowParseIntersectionType();\n node.types = [type];\n while (this.eat(tt.bitwiseOR)) {\n node.types.push(this.flowParseIntersectionType());\n }\n return node.types.length === 1\n ? type\n : this.finishNode(node, \"UnionTypeAnnotation\");\n }\n\n flowParseType(): N.FlowTypeAnnotation {\n const oldInType = this.state.inType;\n this.state.inType = true;\n const type = this.flowParseUnionType();\n this.state.inType = oldInType;\n return type;\n }\n\n flowParseTypeOrImplicitInstantiation(): N.FlowTypeAnnotation {\n if (this.state.type === tt.name && this.state.value === \"_\") {\n const startLoc = this.state.startLoc;\n const node = this.parseIdentifier();\n return this.flowParseGenericType(startLoc, node);\n } else {\n return this.flowParseType();\n }\n }\n\n flowParseTypeAnnotation(): N.FlowTypeAnnotation {\n const node = this.startNode<N.FlowTypeAnnotation>();\n node.typeAnnotation = this.flowParseTypeInitialiser();\n return this.finishNode(node, \"TypeAnnotation\");\n }\n\n flowParseTypeAnnotatableIdentifier(\n allowPrimitiveOverride?: boolean,\n ): N.Identifier {\n const ident = allowPrimitiveOverride\n ? this.parseIdentifier()\n : this.flowParseRestrictedIdentifier();\n if (this.match(tt.colon)) {\n // @ts-expect-error: refine typings\n ident.typeAnnotation = this.flowParseTypeAnnotation();\n this.resetEndLocation(ident);\n }\n return ident;\n }\n\n typeCastToParameter(node: N.Node): N.Node {\n node.expression.typeAnnotation = node.typeAnnotation;\n\n this.resetEndLocation(node.expression, node.typeAnnotation.loc.end);\n\n return node.expression;\n }\n\n flowParseVariance(): N.FlowVariance | undefined | null {\n let variance = null;\n if (this.match(tt.plusMin)) {\n variance = this.startNode<N.FlowVariance>();\n if (this.state.value === \"+\") {\n variance.kind = \"plus\";\n } else {\n variance.kind = \"minus\";\n }\n this.next();\n return this.finishNode(variance, \"Variance\");\n }\n return variance;\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n parseFunctionBody(\n node: N.Function,\n allowExpressionBody?: boolean | null,\n isMethod: boolean = false,\n ): void {\n if (allowExpressionBody) {\n this.forwardNoArrowParamsConversionAt(node, () =>\n super.parseFunctionBody(node, true, isMethod),\n );\n return;\n }\n\n super.parseFunctionBody(node, false, isMethod);\n }\n\n parseFunctionBodyAndFinish<\n T extends\n | N.Function\n | N.TSDeclareMethod\n | N.TSDeclareFunction\n | N.ClassPrivateMethod,\n >(node: Undone<T>, type: T[\"type\"], isMethod: boolean = false): T {\n if (this.match(tt.colon)) {\n const typeNode = this.startNode<N.TypeAnnotation>();\n\n [\n typeNode.typeAnnotation,\n // @ts-expect-error predicate may not exist\n node.predicate,\n ] = this.flowParseTypeAndPredicateInitialiser();\n\n node.returnType = typeNode.typeAnnotation\n ? this.finishNode(typeNode, \"TypeAnnotation\")\n : null;\n }\n\n return super.parseFunctionBodyAndFinish(node, type, isMethod);\n }\n\n // interfaces and enums\n parseStatementLike(flags: ParseStatementFlag): N.Statement {\n // strict mode handling of `interface` since it's a reserved word\n if (this.state.strict && this.isContextual(tt._interface)) {\n const lookahead = this.lookahead();\n if (tokenIsKeywordOrIdentifier(lookahead.type)) {\n const node = this.startNode<N.FlowInterface>();\n this.next();\n return this.flowParseInterface(node);\n }\n } else if (this.shouldParseEnums() && this.isContextual(tt._enum)) {\n const node = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(node);\n }\n const stmt = super.parseStatementLike(flags);\n // We will parse a flow pragma in any comment before the first statement.\n if (this.flowPragma === undefined && !this.isValidDirective(stmt)) {\n this.flowPragma = null;\n }\n return stmt;\n }\n\n // declares, interfaces and type aliases\n parseExpressionStatement(\n node: N.ExpressionStatement,\n expr: N.Expression,\n decorators: N.Decorator[] | null,\n ): N.ExpressionStatement {\n if (expr.type === \"Identifier\") {\n if (expr.name === \"declare\") {\n if (\n this.match(tt._class) ||\n tokenIsIdentifier(this.state.type) ||\n this.match(tt._function) ||\n this.match(tt._var) ||\n this.match(tt._export)\n ) {\n // @ts-expect-error: refine typings\n return this.flowParseDeclare(node);\n }\n } else if (tokenIsIdentifier(this.state.type)) {\n if (expr.name === \"interface\") {\n // @ts-expect-error: refine typings\n return this.flowParseInterface(node);\n } else if (expr.name === \"type\") {\n // @ts-expect-error: refine typings\n return this.flowParseTypeAlias(node);\n } else if (expr.name === \"opaque\") {\n // @ts-expect-error: refine typings\n return this.flowParseOpaqueType(node, false);\n }\n }\n }\n\n return super.parseExpressionStatement(node, expr, decorators);\n }\n\n // export type\n shouldParseExportDeclaration(): boolean {\n const { type } = this.state;\n if (\n tokenIsFlowInterfaceOrTypeOrOpaque(type) ||\n (this.shouldParseEnums() && type === tt._enum)\n ) {\n return !this.state.containsEsc;\n }\n return super.shouldParseExportDeclaration();\n }\n\n isExportDefaultSpecifier(): boolean {\n const { type } = this.state;\n if (\n tokenIsFlowInterfaceOrTypeOrOpaque(type) ||\n (this.shouldParseEnums() && type === tt._enum)\n ) {\n return this.state.containsEsc;\n }\n\n return super.isExportDefaultSpecifier();\n }\n\n parseExportDefaultExpression(): N.Expression | N.Declaration {\n if (this.shouldParseEnums() && this.isContextual(tt._enum)) {\n const node = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(node);\n }\n return super.parseExportDefaultExpression();\n }\n\n parseConditional(\n expr: N.Expression,\n\n startLoc: Position,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.Expression {\n if (!this.match(tt.question)) return expr;\n\n if (this.state.maybeInArrowParameters) {\n const nextCh = this.lookaheadCharCode();\n // These tokens cannot start an expression, so if one of them follows\n // ? then we are probably in an arrow function parameters list and we\n // don't parse the conditional expression.\n if (\n nextCh === charCodes.comma || // (a?, b) => c\n nextCh === charCodes.equalsTo || // (a? = b) => c\n nextCh === charCodes.colon || // (a?: b) => c\n nextCh === charCodes.rightParenthesis // (a?) => c\n ) {\n /*:: invariant(refExpressionErrors != null) */\n this.setOptionalParametersError(refExpressionErrors);\n return expr;\n }\n }\n\n this.expect(tt.question);\n const state = this.state.clone();\n const originalNoArrowAt = this.state.noArrowAt;\n const node = this.startNodeAt(startLoc);\n let { consequent, failed } = this.tryParseConditionalConsequent();\n let [valid, invalid] = this.getArrowLikeExpressions(consequent);\n\n if (failed || invalid.length > 0) {\n const noArrowAt = [...originalNoArrowAt];\n\n if (invalid.length > 0) {\n this.state = state;\n this.state.noArrowAt = noArrowAt;\n\n for (let i = 0; i < invalid.length; i++) {\n noArrowAt.push(invalid[i].start);\n }\n\n ({ consequent, failed } = this.tryParseConditionalConsequent());\n [valid, invalid] = this.getArrowLikeExpressions(consequent);\n }\n\n if (failed && valid.length > 1) {\n // if there are two or more possible correct ways of parsing, throw an\n // error.\n // e.g. Source: a ? (b): c => (d): e => f\n // Result 1: a ? b : (c => ((d): e => f))\n // Result 2: a ? ((b): c => d) : (e => f)\n this.raise(FlowErrors.AmbiguousConditionalArrow, {\n at: state.startLoc,\n });\n }\n\n if (failed && valid.length === 1) {\n this.state = state;\n noArrowAt.push(valid[0].start);\n this.state.noArrowAt = noArrowAt;\n ({ consequent, failed } = this.tryParseConditionalConsequent());\n }\n }\n\n this.getArrowLikeExpressions(consequent, true);\n\n this.state.noArrowAt = originalNoArrowAt;\n this.expect(tt.colon);\n\n node.test = expr;\n node.consequent = consequent;\n node.alternate = this.forwardNoArrowParamsConversionAt(node, () =>\n this.parseMaybeAssign(undefined, undefined),\n );\n\n return this.finishNode(node, \"ConditionalExpression\");\n }\n\n tryParseConditionalConsequent(): {\n consequent: N.Expression;\n failed: boolean;\n } {\n this.state.noArrowParamsConversionAt.push(this.state.start);\n\n const consequent = this.parseMaybeAssignAllowIn();\n const failed = !this.match(tt.colon);\n\n this.state.noArrowParamsConversionAt.pop();\n\n return { consequent, failed };\n }\n\n // Given an expression, walks through out its arrow functions whose body is\n // an expression and through out conditional expressions. It returns every\n // function which has been parsed with a return type but could have been\n // parenthesized expressions.\n // These functions are separated into two arrays: one containing the ones\n // whose parameters can be converted to assignable lists, one containing the\n // others.\n getArrowLikeExpressions(\n node: N.Expression,\n disallowInvalid?: boolean,\n ): [N.ArrowFunctionExpression[], N.ArrowFunctionExpression[]] {\n const stack = [node];\n const arrows: N.ArrowFunctionExpression[] = [];\n\n while (stack.length !== 0) {\n const node = stack.pop();\n if (node.type === \"ArrowFunctionExpression\") {\n if (node.typeParameters || !node.returnType) {\n // This is an arrow expression without ambiguity, so check its parameters\n // @ts-expect-error: refine typings\n this.finishArrowValidation(node);\n } else {\n // @ts-expect-error: refine typings\n arrows.push(node);\n }\n stack.push(node.body);\n } else if (node.type === \"ConditionalExpression\") {\n stack.push(node.consequent);\n stack.push(node.alternate);\n }\n }\n\n if (disallowInvalid) {\n arrows.forEach(node => this.finishArrowValidation(node));\n return [arrows, []];\n }\n\n return partition(arrows, node =>\n node.params.every(param => this.isAssignable(param, true)),\n );\n }\n\n finishArrowValidation(node: N.ArrowFunctionExpression) {\n this.toAssignableList(\n // node.params is Expression[] instead of $ReadOnlyArray<Pattern> because it\n // has not been converted yet.\n node.params as any as N.Expression[],\n node.extra?.trailingCommaLoc,\n /* isLHS */ false,\n );\n // Enter scope, as checkParams defines bindings\n this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);\n // Use super's method to force the parameters to be checked\n super.checkParams(node, false, true);\n this.scope.exit();\n }\n\n forwardNoArrowParamsConversionAt<T>(\n node: Undone<N.Node>,\n parse: () => T,\n ): T {\n let result: T;\n if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {\n this.state.noArrowParamsConversionAt.push(this.state.start);\n result = parse();\n this.state.noArrowParamsConversionAt.pop();\n } else {\n result = parse();\n }\n\n return result;\n }\n\n parseParenItem(\n node: N.Expression,\n\n startLoc: Position,\n ): N.Expression {\n node = super.parseParenItem(node, startLoc);\n if (this.eat(tt.question)) {\n node.optional = true;\n // Include questionmark in location of node\n // Don't use this.finishNode() as otherwise we might process comments twice and\n // include already consumed parens\n this.resetEndLocation(node);\n }\n\n if (this.match(tt.colon)) {\n const typeCastNode = this.startNodeAt(startLoc);\n typeCastNode.expression = node;\n typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();\n\n return this.finishNode(typeCastNode, \"TypeCastExpression\");\n }\n\n return node;\n }\n\n assertModuleNodeAllowed(node: N.Node) {\n if (\n (node.type === \"ImportDeclaration\" &&\n (node.importKind === \"type\" || node.importKind === \"typeof\")) ||\n (node.type === \"ExportNamedDeclaration\" &&\n node.exportKind === \"type\") ||\n (node.type === \"ExportAllDeclaration\" && node.exportKind === \"type\")\n ) {\n // Allow Flowtype imports and exports in all conditions because\n // Flow itself does not care about 'sourceType'.\n return;\n }\n\n super.assertModuleNodeAllowed(node);\n }\n\n parseExportDeclaration(\n node: N.ExportNamedDeclaration,\n ): N.Declaration | undefined | null {\n if (this.isContextual(tt._type)) {\n node.exportKind = \"type\";\n\n const declarationNode = this.startNode();\n this.next();\n\n if (this.match(tt.braceL)) {\n // export type { foo, bar };\n node.specifiers = this.parseExportSpecifiers(\n /* isInTypeExport */ true,\n );\n super.parseExportFrom(node);\n return null;\n } else {\n // export type Foo = Bar;\n // @ts-expect-error: refine typings\n return this.flowParseTypeAlias(declarationNode);\n }\n } else if (this.isContextual(tt._opaque)) {\n node.exportKind = \"type\";\n\n const declarationNode = this.startNode();\n this.next();\n // export opaque type Foo = Bar;\n // @ts-expect-error: refine typings\n return this.flowParseOpaqueType(declarationNode, false);\n } else if (this.isContextual(tt._interface)) {\n node.exportKind = \"type\";\n const declarationNode = this.startNode();\n this.next();\n // @ts-expect-error: refine typings\n return this.flowParseInterface(declarationNode);\n } else if (this.shouldParseEnums() && this.isContextual(tt._enum)) {\n node.exportKind = \"value\";\n const declarationNode = this.startNode();\n this.next();\n // @ts-expect-error: refine typings\n return this.flowParseEnumDeclaration(declarationNode);\n } else {\n return super.parseExportDeclaration(node);\n }\n }\n\n eatExportStar(node: N.Node): boolean {\n if (super.eatExportStar(node)) return true;\n\n if (this.isContextual(tt._type) && this.lookahead().type === tt.star) {\n node.exportKind = \"type\";\n this.next();\n this.next();\n return true;\n }\n\n return false;\n }\n\n maybeParseExportNamespaceSpecifier(node: N.Node): boolean {\n const { startLoc } = this.state;\n const hasNamespace = super.maybeParseExportNamespaceSpecifier(node);\n if (hasNamespace && node.exportKind === \"type\") {\n this.unexpected(startLoc);\n }\n return hasNamespace;\n }\n\n parseClassId(\n node: N.Class,\n isStatement: boolean,\n optionalId?: boolean | null,\n ) {\n super.parseClassId(node, isStatement, optionalId);\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n }\n\n parseClassMember(\n classBody: N.ClassBody,\n member: any,\n state: N.ParseClassMemberState,\n ): void {\n const { startLoc } = this.state;\n if (this.isContextual(tt._declare)) {\n if (super.parseClassMemberFromModifier(classBody, member)) {\n // 'declare' is a class element name\n return;\n }\n\n member.declare = true;\n }\n\n super.parseClassMember(classBody, member, state);\n\n if (member.declare) {\n if (\n member.type !== \"ClassProperty\" &&\n member.type !== \"ClassPrivateProperty\" &&\n member.type !== \"PropertyDefinition\" // Used by estree plugin\n ) {\n this.raise(FlowErrors.DeclareClassElement, { at: startLoc });\n } else if (member.value) {\n this.raise(FlowErrors.DeclareClassFieldInitializer, {\n at: member.value,\n });\n }\n }\n }\n\n isIterator(word: string): boolean {\n return word === \"iterator\" || word === \"asyncIterator\";\n }\n\n readIterator(): void {\n const word = super.readWord1();\n const fullWord = \"@@\" + word;\n\n // Allow @@iterator and @@asyncIterator as a identifier only inside type\n if (!this.isIterator(word) || !this.state.inType) {\n this.raise(Errors.InvalidIdentifier, {\n at: this.state.curPosition(),\n identifierName: fullWord,\n });\n }\n\n this.finishToken(tt.name, fullWord);\n }\n\n // ensure that inside flow types, we bypass the jsx parser plugin\n getTokenFromCode(code: number): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (code === charCodes.leftCurlyBrace && next === charCodes.verticalBar) {\n this.finishOp(tt.braceBarL, 2);\n } else if (\n this.state.inType &&\n (code === charCodes.greaterThan || code === charCodes.lessThan)\n ) {\n this.finishOp(code === charCodes.greaterThan ? tt.gt : tt.lt, 1);\n } else if (this.state.inType && code === charCodes.questionMark) {\n if (next === charCodes.dot) {\n this.finishOp(tt.questionDot, 2);\n } else {\n // allow double nullable types in Flow: ??string\n this.finishOp(tt.question, 1);\n }\n } else if (\n isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))\n ) {\n this.state.pos += 2; // eat \"@@\"\n this.readIterator();\n } else {\n super.getTokenFromCode(code);\n }\n }\n\n isAssignable(node: N.Node, isBinding?: boolean): boolean {\n if (node.type === \"TypeCastExpression\") {\n return this.isAssignable(node.expression, isBinding);\n } else {\n return super.isAssignable(node, isBinding);\n }\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): void {\n if (\n !isLHS &&\n node.type === \"AssignmentExpression\" &&\n node.left.type === \"TypeCastExpression\"\n ) {\n node.left = this.typeCastToParameter(node.left);\n }\n super.toAssignable(node, isLHS);\n }\n\n // turn type casts that we found in function parameter head into type annotated params\n toAssignableList(\n exprList: N.Expression[],\n trailingCommaLoc: Position | undefined | null,\n isLHS: boolean,\n ): void {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if (expr?.type === \"TypeCastExpression\") {\n exprList[i] = this.typeCastToParameter(expr);\n }\n }\n super.toAssignableList(exprList, trailingCommaLoc, isLHS);\n }\n\n // this is a list of nodes, from something like a call expression, we need to filter the\n // type casts that we've found that are illegal in this context\n toReferencedList(\n exprList: ReadonlyArray<N.Expression | undefined | null>,\n isParenthesizedExpr?: boolean,\n ): ReadonlyArray<N.Expression | undefined | null> {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if (\n expr &&\n expr.type === \"TypeCastExpression\" &&\n !expr.extra?.parenthesized &&\n (exprList.length > 1 || !isParenthesizedExpr)\n ) {\n this.raise(FlowErrors.TypeCastInPattern, {\n at: expr.typeAnnotation,\n });\n }\n }\n\n return exprList;\n }\n\n parseArrayLike(\n close: TokenType,\n canBePattern: boolean,\n isTuple: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ArrayExpression | N.TupleExpression {\n const node = super.parseArrayLike(\n close,\n canBePattern,\n isTuple,\n refExpressionErrors,\n );\n\n // This could be an array pattern:\n // ([a: string, b: string]) => {}\n // In this case, we don't have to call toReferencedList. We will\n // call it, if needed, when we are sure that it is a parenthesized\n // expression by calling toReferencedListDeep.\n if (canBePattern && !this.state.maybeInArrowParameters) {\n this.toReferencedList(node.elements);\n }\n\n return node;\n }\n\n isValidLVal(type: string, isParenthesized: boolean, binding: BindingTypes) {\n return (\n type === \"TypeCastExpression\" ||\n super.isValidLVal(type, isParenthesized, binding)\n );\n }\n\n // parse class property type annotations\n parseClassProperty(node: N.ClassProperty): N.ClassProperty {\n if (this.match(tt.colon)) {\n // @ts-expect-error refine typings\n node.typeAnnotation = this.flowParseTypeAnnotation();\n }\n return super.parseClassProperty(node);\n }\n\n parseClassPrivateProperty(\n node: N.ClassPrivateProperty,\n ): N.ClassPrivateProperty {\n if (this.match(tt.colon)) {\n // @ts-expect-error refine typings\n node.typeAnnotation = this.flowParseTypeAnnotation();\n }\n return super.parseClassPrivateProperty(node);\n }\n\n // determine whether or not we're currently in the position where a class method would appear\n isClassMethod(): boolean {\n return this.match(tt.lt) || super.isClassMethod();\n }\n\n // determine whether or not we're currently in the position where a class property would appear\n isClassProperty(): boolean {\n return this.match(tt.colon) || super.isClassProperty();\n }\n\n isNonstaticConstructor(method: N.ClassMethod | N.ClassProperty): boolean {\n return !this.match(tt.colon) && super.isNonstaticConstructor(method);\n }\n\n // parse type parameters for class methods\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n if ((method as any).variance) {\n this.unexpected((method as any).variance.loc.start);\n }\n delete (method as any).variance;\n if (this.match(tt.lt)) {\n method.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n super.pushClassMethod(\n classBody,\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n );\n\n if (method.params && isConstructor) {\n const params = method.params;\n if (params.length > 0 && this.isThisParam(params[0])) {\n this.raise(FlowErrors.ThisParamBannedInConstructor, { at: method });\n }\n // estree support\n } else if (\n // @ts-expect-error TS does not know about the face that estree can replace ClassMethod with MethodDefinition\n method.type === \"MethodDefinition\" &&\n isConstructor &&\n // @ts-expect-error estree\n method.value.params\n ) {\n // @ts-expect-error estree\n const params = method.value.params;\n if (params.length > 0 && this.isThisParam(params[0])) {\n this.raise(FlowErrors.ThisParamBannedInConstructor, { at: method });\n }\n }\n }\n\n pushClassPrivateMethod(\n classBody: N.ClassBody,\n method: N.ClassPrivateMethod,\n isGenerator: boolean,\n isAsync: boolean,\n ): void {\n if ((method as any).variance) {\n this.unexpected((method as any).variance.loc.start);\n }\n delete (method as any).variance;\n if (this.match(tt.lt)) {\n method.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);\n }\n\n // parse a the super class type parameters and implements\n parseClassSuper(node: N.Class): void {\n super.parseClassSuper(node);\n if (node.superClass && this.match(tt.lt)) {\n node.superTypeParameters = this.flowParseTypeParameterInstantiation();\n }\n if (this.isContextual(tt._implements)) {\n this.next();\n const implemented: N.FlowClassImplements[] = (node.implements = []);\n do {\n const node = this.startNode();\n node.id = this.flowParseRestrictedIdentifier(/*liberal*/ true);\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n } else {\n node.typeParameters = null;\n }\n implemented.push(this.finishNode(node, \"ClassImplements\"));\n } while (this.eat(tt.comma));\n }\n }\n\n checkGetterSetterParams(method: N.ObjectMethod | N.ClassMethod): void {\n super.checkGetterSetterParams(method);\n const params = this.getObjectOrClassMethodParams(method);\n if (params.length > 0) {\n const param = params[0];\n if (this.isThisParam(param) && method.kind === \"get\") {\n this.raise(FlowErrors.GetterMayNotHaveThisParam, { at: param });\n } else if (this.isThisParam(param)) {\n this.raise(FlowErrors.SetterMayNotHaveThisParam, { at: param });\n }\n }\n }\n\n parsePropertyNamePrefixOperator(\n node: N.ObjectOrClassMember | N.ClassMember,\n ): void {\n node.variance = this.flowParseVariance();\n }\n\n // parse type parameters for object method shorthand\n parseObjPropValue(\n prop: Undone<N.ObjectMethod | N.ObjectProperty>,\n startLoc: Position | undefined | null,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ObjectMethod | N.ObjectProperty {\n if ((prop as any).variance) {\n this.unexpected((prop as any).variance.loc.start);\n }\n delete (prop as any).variance;\n\n let typeParameters;\n\n // method shorthand\n if (this.match(tt.lt) && !isAccessor) {\n typeParameters = this.flowParseTypeParameterDeclaration();\n if (!this.match(tt.parenL)) this.unexpected();\n }\n\n const result = super.parseObjPropValue(\n prop,\n startLoc,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n refExpressionErrors,\n );\n\n // add typeParameters if we found them\n if (typeParameters) {\n (result.value || result).typeParameters = typeParameters;\n }\n return result;\n }\n\n parseAssignableListItemTypes(param: N.Pattern): N.Pattern {\n if (this.eat(tt.question)) {\n if (param.type !== \"Identifier\") {\n this.raise(FlowErrors.PatternIsOptional, { at: param });\n }\n if (this.isThisParam(param)) {\n this.raise(FlowErrors.ThisParamMayNotBeOptional, { at: param });\n }\n\n (param as any as N.Identifier).optional = true;\n }\n if (this.match(tt.colon)) {\n // @ts-expect-error: refine typings\n param.typeAnnotation = this.flowParseTypeAnnotation();\n } else if (this.isThisParam(param)) {\n this.raise(FlowErrors.ThisParamAnnotationRequired, { at: param });\n }\n\n if (this.match(tt.eq) && this.isThisParam(param)) {\n this.raise(FlowErrors.ThisParamNoDefault, { at: param });\n }\n\n this.resetEndLocation(param);\n return param;\n }\n\n parseMaybeDefault(\n startLoc?: Position | null,\n left?: N.Pattern | null,\n ): N.Pattern {\n const node = super.parseMaybeDefault(startLoc, left);\n\n if (\n node.type === \"AssignmentPattern\" &&\n node.typeAnnotation &&\n node.right.start < node.typeAnnotation.start\n ) {\n this.raise(FlowErrors.TypeBeforeInitializer, {\n at: node.typeAnnotation,\n });\n }\n\n return node;\n }\n\n checkImportReflection(node: Undone<N.ImportDeclaration>) {\n super.checkImportReflection(node);\n if (node.module && node.importKind !== \"value\") {\n this.raise(FlowErrors.ImportReflectionHasImportType, {\n at: node.specifiers[0].loc.start,\n });\n }\n }\n\n parseImportSpecifierLocal<\n T extends\n | N.ImportSpecifier\n | N.ImportDefaultSpecifier\n | N.ImportNamespaceSpecifier,\n >(node: N.ImportDeclaration, specifier: Undone<T>, type: T[\"type\"]): void {\n specifier.local = hasTypeImportKind(node)\n ? this.flowParseRestrictedIdentifier(\n /* liberal */ true,\n /* declaration */ true,\n )\n : this.parseIdentifier();\n\n node.specifiers.push(this.finishImportSpecifier(specifier, type));\n }\n\n isPotentialImportPhase(isExport: boolean): boolean {\n if (super.isPotentialImportPhase(isExport)) return true;\n if (this.isContextual(tt._type)) {\n if (!isExport) return true;\n const ch = this.lookaheadCharCode();\n return ch === charCodes.leftCurlyBrace || ch === charCodes.asterisk;\n }\n return !isExport && this.isContextual(tt._typeof);\n }\n\n applyImportPhase(\n node: Undone<N.ImportDeclaration | N.ExportNamedDeclaration>,\n isExport: boolean,\n phase: string | null,\n loc?: Position,\n ): void {\n super.applyImportPhase(node, isExport, phase, loc);\n if (isExport) {\n if (!phase && this.match(tt._default)) {\n // TODO: Align with our TS AST and always add .exportKind\n return;\n }\n (node as N.ExportNamedDeclaration).exportKind =\n phase === \"type\" ? phase : \"value\";\n } else {\n if (phase === \"type\" && this.match(tt.star)) this.unexpected();\n (node as N.ImportDeclaration).importKind =\n phase === \"type\" || phase === \"typeof\" ? phase : \"value\";\n }\n }\n\n // parse import-type/typeof shorthand\n parseImportSpecifier(\n specifier: any,\n importedIsString: boolean,\n isInTypeOnlyImport: boolean,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n isMaybeTypeOnly: boolean,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n bindingType: BindingTypes | undefined,\n ): N.ImportSpecifier {\n const firstIdent = specifier.imported;\n\n let specifierTypeKind = null;\n if (firstIdent.type === \"Identifier\") {\n if (firstIdent.name === \"type\") {\n specifierTypeKind = \"type\";\n } else if (firstIdent.name === \"typeof\") {\n specifierTypeKind = \"typeof\";\n }\n }\n\n let isBinding = false;\n if (this.isContextual(tt._as) && !this.isLookaheadContextual(\"as\")) {\n const as_ident = this.parseIdentifier(true);\n if (\n specifierTypeKind !== null &&\n !tokenIsKeywordOrIdentifier(this.state.type)\n ) {\n // `import {type as ,` or `import {type as }`\n specifier.imported = as_ident;\n specifier.importKind = specifierTypeKind;\n specifier.local = cloneIdentifier(as_ident);\n } else {\n // `import {type as foo`\n specifier.imported = firstIdent;\n specifier.importKind = null;\n specifier.local = this.parseIdentifier();\n }\n } else {\n if (\n specifierTypeKind !== null &&\n tokenIsKeywordOrIdentifier(this.state.type)\n ) {\n // `import {type foo`\n specifier.imported = this.parseIdentifier(true);\n specifier.importKind = specifierTypeKind;\n } else {\n if (importedIsString) {\n /*:: invariant(firstIdent instanceof N.StringLiteral) */\n throw this.raise(Errors.ImportBindingIsString, {\n at: specifier,\n importName: firstIdent.value,\n });\n }\n /*:: invariant(firstIdent instanceof N.Node) */\n specifier.imported = firstIdent;\n specifier.importKind = null;\n }\n\n if (this.eatContextual(tt._as)) {\n specifier.local = this.parseIdentifier();\n } else {\n isBinding = true;\n specifier.local = cloneIdentifier(specifier.imported);\n }\n }\n\n const specifierIsTypeImport = hasTypeImportKind(specifier);\n\n if (isInTypeOnlyImport && specifierIsTypeImport) {\n this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, {\n at: specifier,\n });\n }\n\n if (isInTypeOnlyImport || specifierIsTypeImport) {\n this.checkReservedType(\n specifier.local.name,\n specifier.local.loc.start,\n /* declaration */ true,\n );\n }\n\n if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) {\n this.checkReservedWord(\n specifier.local.name,\n specifier.loc.start,\n true,\n true,\n );\n }\n\n return this.finishImportSpecifier(specifier, \"ImportSpecifier\");\n }\n\n parseBindingAtom(): N.Pattern {\n switch (this.state.type) {\n case tt._this:\n // \"this\" may be the name of a parameter, so allow it.\n return this.parseIdentifier(/* liberal */ true);\n default:\n return super.parseBindingAtom();\n }\n }\n\n // parse function type parameters - function foo<T>() {}\n parseFunctionParams(\n node: Undone<N.Function>,\n isConstructor: boolean,\n ): void {\n // @ts-expect-error kind may not index node\n const kind = node.kind;\n if (kind !== \"get\" && kind !== \"set\" && this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n super.parseFunctionParams(node, isConstructor);\n }\n\n // parse flow type annotations on variable declarator heads - let foo: string = bar\n parseVarId(\n decl: N.VariableDeclarator,\n kind: \"var\" | \"let\" | \"const\",\n ): void {\n super.parseVarId(decl, kind);\n if (this.match(tt.colon)) {\n // @ts-expect-error: refine typings\n decl.id.typeAnnotation = this.flowParseTypeAnnotation();\n this.resetEndLocation(decl.id); // set end position to end of type\n }\n }\n\n // parse the return type of an async arrow function - let foo = (async (): number => {});\n parseAsyncArrowFromCallExpression(\n node: N.ArrowFunctionExpression,\n call: N.CallExpression,\n ): N.ArrowFunctionExpression {\n if (this.match(tt.colon)) {\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = true;\n // @ts-expect-error refine typings\n node.returnType = this.flowParseTypeAnnotation();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n }\n\n return super.parseAsyncArrowFromCallExpression(node, call);\n }\n\n // todo description\n shouldParseAsyncArrow(): boolean {\n return this.match(tt.colon) || super.shouldParseAsyncArrow();\n }\n\n // We need to support type parameter declarations for arrow functions. This\n // is tricky. There are three situations we need to handle\n //\n // 1. This is either JSX or an arrow function. We'll try JSX first. If that\n // fails, we'll try an arrow function. If that fails, we'll throw the JSX\n // error.\n // 2. This is an arrow function. We'll parse the type parameter declaration,\n // parse the rest, make sure the rest is an arrow function, and go from\n // there\n // 3. This is neither. Just call the super method\n parseMaybeAssign(\n refExpressionErrors?: ExpressionErrors | null,\n afterLeftParse?: Function,\n ): N.Expression {\n let state = null;\n\n let jsx;\n\n if (\n this.hasPlugin(\"jsx\") &&\n (this.match(tt.jsxTagStart) || this.match(tt.lt))\n ) {\n state = this.state.clone();\n\n jsx = this.tryParse(\n () => super.parseMaybeAssign(refExpressionErrors, afterLeftParse),\n state,\n );\n\n /*:: invariant(!jsx.aborted) */\n /*:: invariant(jsx.node != null) */\n if (!jsx.error) return jsx.node;\n\n // Remove `tc.j_expr` and `tc.j_oTag` from context added\n // by parsing `jsxTagStart` to stop the JSX plugin from\n // messing with the tokens\n const { context } = this.state;\n const currentContext = context[context.length - 1];\n if (currentContext === tc.j_oTag || currentContext === tc.j_expr) {\n context.pop();\n }\n }\n\n if (jsx?.error || this.match(tt.lt)) {\n state = state || this.state.clone();\n\n let typeParameters: N.TypeParameterDeclaration;\n\n const arrow = this.tryParse(abort => {\n typeParameters = this.flowParseTypeParameterDeclaration();\n\n const arrowExpression = this.forwardNoArrowParamsConversionAt(\n typeParameters,\n () => {\n const result = super.parseMaybeAssign(\n refExpressionErrors,\n afterLeftParse,\n );\n\n this.resetStartLocationFromNode(result, typeParameters);\n\n return result;\n },\n );\n\n // <T>(() => {});\n // <T>(() => {}: any);\n if (arrowExpression.extra?.parenthesized) abort();\n\n // The above can return a TypeCastExpression when the arrow\n // expression is not wrapped in parens. See also `this.parseParenItem`.\n // (<T>() => {}: any);\n const expr = this.maybeUnwrapTypeCastExpression(arrowExpression);\n\n if (expr.type !== \"ArrowFunctionExpression\") abort();\n\n expr.typeParameters = typeParameters;\n this.resetStartLocationFromNode(expr, typeParameters);\n\n return arrowExpression;\n }, state);\n\n let arrowExpression:\n | N.ArrowFunctionExpression\n | N.TypeCastExpression\n | undefined\n | null = null;\n\n if (\n arrow.node &&\n // @ts-expect-error: refine tryParse typings\n this.maybeUnwrapTypeCastExpression(arrow.node).type ===\n \"ArrowFunctionExpression\"\n ) {\n if (!arrow.error && !arrow.aborted) {\n // <T> async () => {}\n // @ts-expect-error: refine tryParse typings\n if (arrow.node.async) {\n /*:: invariant(typeParameters) */\n this.raise(\n FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction,\n { at: typeParameters },\n );\n }\n // @ts-expect-error: refine tryParse typings\n return arrow.node;\n }\n\n // @ts-expect-error: refine typings\n arrowExpression = arrow.node;\n }\n\n // If we are here, both JSX and Flow parsing attempts failed.\n // Give the precedence to the JSX error, except if JSX had an\n // unrecoverable error while Flow didn't.\n // If the error is recoverable, we can only re-report it if there is\n // a node we can return.\n\n if (jsx?.node) {\n /*:: invariant(jsx.failState) */\n this.state = jsx.failState;\n return jsx.node;\n }\n\n if (arrowExpression) {\n /*:: invariant(arrow.failState) */\n this.state = arrow.failState;\n return arrowExpression;\n }\n\n if (jsx?.thrown) throw jsx.error;\n if (arrow.thrown) throw arrow.error;\n\n /*:: invariant(typeParameters) */\n throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, {\n at: typeParameters,\n });\n }\n\n return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);\n }\n\n // handle return types for arrow functions\n parseArrow(\n node: Undone<N.ArrowFunctionExpression>,\n ): Undone<N.ArrowFunctionExpression> | undefined | null {\n if (this.match(tt.colon)) {\n // @ts-expect-error todo(flow->ts)\n const result = this.tryParse(() => {\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = true;\n\n const typeNode = this.startNode<N.TypeAnnotation>();\n\n [\n typeNode.typeAnnotation,\n // @ts-expect-error (destructuring not supported yet)\n node.predicate,\n ] = this.flowParseTypeAndPredicateInitialiser();\n\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n\n if (this.canInsertSemicolon()) this.unexpected();\n if (!this.match(tt.arrow)) this.unexpected();\n\n return typeNode;\n });\n\n if (result.thrown) return null;\n /*:: invariant(result.node) */\n\n if (result.error) this.state = result.failState;\n\n // assign after it is clear it is an arrow\n // @ts-expect-error todo(flow->ts)\n node.returnType = result.node.typeAnnotation\n ? this.finishNode(result.node, \"TypeAnnotation\")\n : null;\n }\n\n return super.parseArrow(node);\n }\n\n shouldParseArrow(params: Array<N.Node>): boolean {\n return this.match(tt.colon) || super.shouldParseArrow(params);\n }\n\n setArrowFunctionParameters(\n node: N.ArrowFunctionExpression,\n params: N.Pattern[],\n ): void {\n if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {\n node.params = params;\n } else {\n super.setArrowFunctionParameters(node, params);\n }\n }\n\n checkParams(\n node: N.Function,\n allowDuplicates: boolean,\n isArrowFunction?: boolean | null,\n strictModeChanged: boolean = true,\n ): void {\n if (\n isArrowFunction &&\n this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1\n ) {\n return;\n }\n\n // ensure the `this` param is first, if it exists\n for (let i = 0; i < node.params.length; i++) {\n if (this.isThisParam(node.params[i]) && i > 0) {\n this.raise(FlowErrors.ThisParamMustBeFirst, { at: node.params[i] });\n }\n }\n\n super.checkParams(\n node,\n allowDuplicates,\n isArrowFunction,\n strictModeChanged,\n );\n }\n\n parseParenAndDistinguishExpression(canBeArrow: boolean): N.Expression {\n return super.parseParenAndDistinguishExpression(\n canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1,\n );\n }\n\n parseSubscripts(\n base: N.Expression,\n\n startLoc: Position,\n noCalls?: boolean | null,\n ): N.Expression {\n if (\n base.type === \"Identifier\" &&\n base.name === \"async\" &&\n this.state.noArrowAt.indexOf(startLoc.index) !== -1\n ) {\n this.next();\n\n const node = this.startNodeAt(startLoc);\n node.callee = base;\n node.arguments = super.parseCallExpressionArguments(tt.parenR, false);\n base = this.finishNode(node, \"CallExpression\");\n } else if (\n base.type === \"Identifier\" &&\n base.name === \"async\" &&\n this.match(tt.lt)\n ) {\n const state = this.state.clone();\n const arrow = this.tryParse(\n abort => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(),\n state,\n );\n\n /*:: invariant(arrow.node != null) */\n // @ts-expect-error: refine tryParse typings\n if (!arrow.error && !arrow.aborted) return arrow.node;\n\n const result = this.tryParse(\n () => super.parseSubscripts(base, startLoc, noCalls),\n state,\n );\n\n if (result.node && !result.error) return result.node;\n\n if (arrow.node) {\n this.state = arrow.failState;\n // @ts-expect-error: refine tryParse typings\n return arrow.node;\n }\n\n if (result.node) {\n this.state = result.failState;\n return result.node;\n }\n\n throw arrow.error || result.error;\n }\n\n return super.parseSubscripts(base, startLoc, noCalls);\n }\n\n parseSubscript(\n base: N.Expression,\n\n startLoc: Position,\n noCalls: boolean | undefined | null,\n subscriptState: N.ParseSubscriptState,\n ): N.Expression {\n if (this.match(tt.questionDot) && this.isLookaheadToken_lt()) {\n subscriptState.optionalChainMember = true;\n if (noCalls) {\n subscriptState.stop = true;\n return base;\n }\n this.next();\n const node = this.startNodeAt<N.OptionalCallExpression>(startLoc);\n node.callee = base;\n node.typeArguments = this.flowParseTypeParameterInstantiation();\n this.expect(tt.parenL);\n node.arguments = this.parseCallExpressionArguments(tt.parenR, false);\n node.optional = true;\n return this.finishCallExpression(node, /* optional */ true);\n } else if (!noCalls && this.shouldParseTypes() && this.match(tt.lt)) {\n const node = this.startNodeAt<\n N.OptionalCallExpression | N.CallExpression\n >(startLoc);\n node.callee = base;\n\n const result = this.tryParse(() => {\n node.typeArguments =\n this.flowParseTypeParameterInstantiationCallOrNew();\n this.expect(tt.parenL);\n node.arguments = super.parseCallExpressionArguments(tt.parenR, false);\n if (subscriptState.optionalChainMember) {\n (node as Undone<N.OptionalCallExpression>).optional = false;\n }\n return this.finishCallExpression(\n node,\n subscriptState.optionalChainMember,\n );\n });\n\n if (result.node) {\n if (result.error) this.state = result.failState;\n return result.node;\n }\n }\n\n return super.parseSubscript(\n base,\n\n startLoc,\n noCalls,\n subscriptState,\n );\n }\n\n parseNewCallee(node: N.NewExpression): void {\n super.parseNewCallee(node);\n\n let targs = null;\n if (this.shouldParseTypes() && this.match(tt.lt)) {\n targs = this.tryParse(() =>\n this.flowParseTypeParameterInstantiationCallOrNew(),\n ).node;\n }\n node.typeArguments = targs;\n }\n\n parseAsyncArrowWithTypeParameters(\n startLoc: Position,\n ): N.ArrowFunctionExpression | undefined | null {\n const node = this.startNodeAt<N.ArrowFunctionExpression>(startLoc);\n this.parseFunctionParams(node, false);\n if (!this.parseArrow(node)) return;\n return super.parseArrowExpression(\n node,\n /* params */ undefined,\n /* isAsync */ true,\n );\n }\n\n readToken_mult_modulo(code: number): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (\n code === charCodes.asterisk &&\n next === charCodes.slash &&\n this.state.hasFlowComment\n ) {\n this.state.hasFlowComment = false;\n this.state.pos += 2;\n this.nextToken();\n return;\n }\n\n super.readToken_mult_modulo(code);\n }\n\n readToken_pipe_amp(code: number): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (\n code === charCodes.verticalBar &&\n next === charCodes.rightCurlyBrace\n ) {\n // '|}'\n this.finishOp(tt.braceBarR, 2);\n return;\n }\n\n super.readToken_pipe_amp(code);\n }\n\n parseTopLevel(file: N.File, program: N.Program): N.File {\n const fileNode = super.parseTopLevel(file, program);\n if (this.state.hasFlowComment) {\n this.raise(FlowErrors.UnterminatedFlowComment, {\n at: this.state.curPosition(),\n });\n }\n return fileNode;\n }\n\n skipBlockComment(): N.CommentBlock | undefined {\n if (this.hasPlugin(\"flowComments\") && this.skipFlowComment()) {\n if (this.state.hasFlowComment) {\n throw this.raise(FlowErrors.NestedFlowComment, {\n at: this.state.startLoc,\n });\n }\n this.hasFlowCommentCompletion();\n const commentSkip = this.skipFlowComment();\n if (commentSkip) {\n this.state.pos += commentSkip;\n this.state.hasFlowComment = true;\n }\n return;\n }\n\n return super.skipBlockComment(this.state.hasFlowComment ? \"*-/\" : \"*/\");\n }\n\n skipFlowComment(): number | false {\n const { pos } = this.state;\n let shiftToFirstNonWhiteSpace = 2;\n while (\n [charCodes.space, charCodes.tab].includes(\n // @ts-expect-error testing whether a number is included\n this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace),\n )\n ) {\n shiftToFirstNonWhiteSpace++;\n }\n\n const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos);\n const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1);\n\n if (ch2 === charCodes.colon && ch3 === charCodes.colon) {\n return shiftToFirstNonWhiteSpace + 2; // check for /*::\n }\n if (\n this.input.slice(\n shiftToFirstNonWhiteSpace + pos,\n shiftToFirstNonWhiteSpace + pos + 12,\n ) === \"flow-include\"\n ) {\n return shiftToFirstNonWhiteSpace + 12; // check for /*flow-include\n }\n if (ch2 === charCodes.colon && ch3 !== charCodes.colon) {\n return shiftToFirstNonWhiteSpace; // check for /*:, advance up to :\n }\n return false;\n }\n\n hasFlowCommentCompletion(): void {\n const end = this.input.indexOf(\"*/\", this.state.pos);\n if (end === -1) {\n throw this.raise(Errors.UnterminatedComment, {\n at: this.state.curPosition(),\n });\n }\n }\n\n // Flow enum parsing\n\n flowEnumErrorBooleanMemberNotInitialized(\n loc: Position,\n {\n enumName,\n memberName,\n }: {\n enumName: string;\n memberName: string;\n },\n ): void {\n this.raise(FlowErrors.EnumBooleanMemberNotInitialized, {\n at: loc,\n memberName,\n enumName,\n });\n }\n\n flowEnumErrorInvalidMemberInitializer(\n loc: Position,\n enumContext: EnumContext,\n ) {\n return this.raise(\n !enumContext.explicitType\n ? FlowErrors.EnumInvalidMemberInitializerUnknownType\n : enumContext.explicitType === \"symbol\"\n ? FlowErrors.EnumInvalidMemberInitializerSymbolType\n : FlowErrors.EnumInvalidMemberInitializerPrimaryType,\n {\n at: loc,\n ...enumContext,\n },\n );\n }\n\n flowEnumErrorNumberMemberNotInitialized(\n loc: Position,\n {\n enumName,\n memberName,\n }: {\n enumName: string;\n memberName: string;\n },\n ): void {\n this.raise(FlowErrors.EnumNumberMemberNotInitialized, {\n at: loc,\n enumName,\n memberName,\n });\n }\n\n flowEnumErrorStringMemberInconsistentlyInitailized(\n node: N.Node,\n {\n enumName,\n }: {\n enumName: string;\n },\n ): void {\n this.raise(FlowErrors.EnumStringMemberInconsistentlyInitailized, {\n at: node,\n enumName,\n });\n }\n\n flowEnumMemberInit(): EnumMemberInit {\n const startLoc = this.state.startLoc;\n const endOfInit = () => this.match(tt.comma) || this.match(tt.braceR);\n switch (this.state.type) {\n case tt.num: {\n const literal = this.parseNumericLiteral(this.state.value);\n if (endOfInit()) {\n return { type: \"number\", loc: literal.loc.start, value: literal };\n }\n return { type: \"invalid\", loc: startLoc };\n }\n case tt.string: {\n const literal = this.parseStringLiteral(this.state.value);\n if (endOfInit()) {\n return { type: \"string\", loc: literal.loc.start, value: literal };\n }\n return { type: \"invalid\", loc: startLoc };\n }\n case tt._true:\n case tt._false: {\n const literal = this.parseBooleanLiteral(this.match(tt._true));\n if (endOfInit()) {\n return {\n type: \"boolean\",\n loc: literal.loc.start,\n value: literal,\n };\n }\n return { type: \"invalid\", loc: startLoc };\n }\n default:\n return { type: \"invalid\", loc: startLoc };\n }\n }\n\n flowEnumMemberRaw(): {\n id: N.Node;\n init: EnumMemberInit;\n } {\n const loc = this.state.startLoc;\n const id = this.parseIdentifier(true);\n const init = this.eat(tt.eq)\n ? this.flowEnumMemberInit()\n : { type: \"none\" as const, loc };\n return { id, init };\n }\n\n flowEnumCheckExplicitTypeMismatch(\n loc: Position,\n context: EnumContext,\n expectedType: EnumExplicitType,\n ): void {\n const { explicitType } = context;\n if (explicitType === null) {\n return;\n }\n if (explicitType !== expectedType) {\n this.flowEnumErrorInvalidMemberInitializer(loc, context);\n }\n }\n\n flowEnumMembers({\n enumName,\n explicitType,\n }: {\n enumName: string;\n explicitType: EnumExplicitType;\n }): {\n members: {\n booleanMembers: Array<N.Node>;\n numberMembers: Array<N.Node>;\n stringMembers: Array<N.Node>;\n defaultedMembers: Array<N.Node>;\n };\n hasUnknownMembers: boolean;\n } {\n const seenNames = new Set();\n const members = {\n // @ts-expect-error: migrate to Babel types\n booleanMembers: [],\n // @ts-expect-error: migrate to Babel types\n numberMembers: [],\n // @ts-expect-error: migrate to Babel types\n stringMembers: [],\n // @ts-expect-error: migrate to Babel types\n defaultedMembers: [],\n };\n let hasUnknownMembers = false;\n while (!this.match(tt.braceR)) {\n if (this.eat(tt.ellipsis)) {\n hasUnknownMembers = true;\n break;\n }\n const memberNode = this.startNode();\n const { id, init } = this.flowEnumMemberRaw();\n const memberName = id.name;\n if (memberName === \"\") {\n continue;\n }\n if (/^[a-z]/.test(memberName)) {\n this.raise(FlowErrors.EnumInvalidMemberName, {\n at: id,\n memberName,\n suggestion: memberName[0].toUpperCase() + memberName.slice(1),\n enumName,\n });\n }\n if (seenNames.has(memberName)) {\n this.raise(FlowErrors.EnumDuplicateMemberName, {\n at: id,\n memberName,\n enumName,\n });\n }\n seenNames.add(memberName);\n const context = { enumName, explicitType, memberName };\n memberNode.id = id;\n switch (init.type) {\n case \"boolean\": {\n this.flowEnumCheckExplicitTypeMismatch(\n init.loc,\n context,\n \"boolean\",\n );\n memberNode.init = init.value;\n members.booleanMembers.push(\n this.finishNode(memberNode, \"EnumBooleanMember\"),\n );\n break;\n }\n case \"number\": {\n this.flowEnumCheckExplicitTypeMismatch(init.loc, context, \"number\");\n memberNode.init = init.value;\n members.numberMembers.push(\n this.finishNode(memberNode, \"EnumNumberMember\"),\n );\n break;\n }\n case \"string\": {\n this.flowEnumCheckExplicitTypeMismatch(init.loc, context, \"string\");\n memberNode.init = init.value;\n members.stringMembers.push(\n this.finishNode(memberNode, \"EnumStringMember\"),\n );\n break;\n }\n case \"invalid\": {\n throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context);\n }\n case \"none\": {\n switch (explicitType) {\n case \"boolean\":\n this.flowEnumErrorBooleanMemberNotInitialized(\n init.loc,\n context,\n );\n break;\n case \"number\":\n this.flowEnumErrorNumberMemberNotInitialized(init.loc, context);\n break;\n default:\n members.defaultedMembers.push(\n this.finishNode(memberNode, \"EnumDefaultedMember\"),\n );\n }\n }\n }\n\n if (!this.match(tt.braceR)) {\n this.expect(tt.comma);\n }\n }\n return { members, hasUnknownMembers };\n }\n\n flowEnumStringMembers(\n initializedMembers: Array<N.Node>,\n defaultedMembers: Array<N.Node>,\n {\n enumName,\n }: {\n enumName: string;\n },\n ): Array<N.Node> {\n if (initializedMembers.length === 0) {\n return defaultedMembers;\n } else if (defaultedMembers.length === 0) {\n return initializedMembers;\n } else if (defaultedMembers.length > initializedMembers.length) {\n for (const member of initializedMembers) {\n this.flowEnumErrorStringMemberInconsistentlyInitailized(member, {\n enumName,\n });\n }\n return defaultedMembers;\n } else {\n for (const member of defaultedMembers) {\n this.flowEnumErrorStringMemberInconsistentlyInitailized(member, {\n enumName,\n });\n }\n return initializedMembers;\n }\n }\n\n flowEnumParseExplicitType({\n enumName,\n }: {\n enumName: string;\n }): EnumExplicitType {\n if (!this.eatContextual(tt._of)) return null;\n\n if (!tokenIsIdentifier(this.state.type)) {\n throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, {\n at: this.state.startLoc,\n enumName,\n });\n }\n\n const { value } = this.state;\n this.next();\n\n if (\n value !== \"boolean\" &&\n value !== \"number\" &&\n value !== \"string\" &&\n value !== \"symbol\"\n ) {\n this.raise(FlowErrors.EnumInvalidExplicitType, {\n at: this.state.startLoc,\n enumName,\n invalidEnumType: value,\n });\n }\n\n return value;\n }\n\n flowEnumBody(node: Undone<N.Node>, id: N.Node): N.Node {\n const enumName = id.name;\n const nameLoc = id.loc.start;\n const explicitType = this.flowEnumParseExplicitType({ enumName });\n this.expect(tt.braceL);\n const { members, hasUnknownMembers } = this.flowEnumMembers({\n enumName,\n explicitType,\n });\n node.hasUnknownMembers = hasUnknownMembers;\n\n switch (explicitType) {\n case \"boolean\":\n node.explicitType = true;\n node.members = members.booleanMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumBooleanBody\");\n case \"number\":\n node.explicitType = true;\n node.members = members.numberMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumNumberBody\");\n case \"string\":\n node.explicitType = true;\n node.members = this.flowEnumStringMembers(\n members.stringMembers,\n members.defaultedMembers,\n { enumName },\n );\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n case \"symbol\":\n node.members = members.defaultedMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumSymbolBody\");\n default: {\n // `explicitType` is `null`\n const empty = () => {\n node.members = [];\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n };\n node.explicitType = false;\n\n const boolsLen = members.booleanMembers.length;\n const numsLen = members.numberMembers.length;\n const strsLen = members.stringMembers.length;\n const defaultedLen = members.defaultedMembers.length;\n\n if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {\n return empty();\n } else if (!boolsLen && !numsLen) {\n node.members = this.flowEnumStringMembers(\n members.stringMembers,\n members.defaultedMembers,\n { enumName },\n );\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {\n for (const member of members.defaultedMembers) {\n this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, {\n enumName,\n memberName: member.id.name,\n });\n }\n node.members = members.booleanMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumBooleanBody\");\n } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {\n for (const member of members.defaultedMembers) {\n this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, {\n enumName,\n memberName: member.id.name,\n });\n }\n node.members = members.numberMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumNumberBody\");\n } else {\n this.raise(FlowErrors.EnumInconsistentMemberValues, {\n at: nameLoc,\n enumName,\n });\n return empty();\n }\n }\n }\n }\n\n flowParseEnumDeclaration(node: Undone<N.Node>): N.Node {\n const id = this.parseIdentifier();\n node.id = id;\n node.body = this.flowEnumBody(this.startNode(), id);\n return this.finishNode(node, \"EnumDeclaration\");\n }\n\n // check if the next token is a tt.lt\n isLookaheadToken_lt(): boolean {\n const next = this.nextTokenStart();\n if (this.input.charCodeAt(next) === charCodes.lessThan) {\n const afterNext = this.input.charCodeAt(next + 1);\n return (\n afterNext !== charCodes.lessThan && afterNext !== charCodes.equalsTo\n );\n }\n return false;\n }\n\n maybeUnwrapTypeCastExpression(node: N.Node) {\n return node.type === \"TypeCastExpression\" ? node.expression : node;\n }\n };\n","const entities: {\n __proto__: null;\n [name: string]: string;\n} = {\n __proto__: null,\n quot: \"\\u0022\",\n amp: \"&\",\n apos: \"\\u0027\",\n lt: \"<\",\n gt: \">\",\n nbsp: \"\\u00A0\",\n iexcl: \"\\u00A1\",\n cent: \"\\u00A2\",\n pound: \"\\u00A3\",\n curren: \"\\u00A4\",\n yen: \"\\u00A5\",\n brvbar: \"\\u00A6\",\n sect: \"\\u00A7\",\n uml: \"\\u00A8\",\n copy: \"\\u00A9\",\n ordf: \"\\u00AA\",\n laquo: \"\\u00AB\",\n not: \"\\u00AC\",\n shy: \"\\u00AD\",\n reg: \"\\u00AE\",\n macr: \"\\u00AF\",\n deg: \"\\u00B0\",\n plusmn: \"\\u00B1\",\n sup2: \"\\u00B2\",\n sup3: \"\\u00B3\",\n acute: \"\\u00B4\",\n micro: \"\\u00B5\",\n para: \"\\u00B6\",\n middot: \"\\u00B7\",\n cedil: \"\\u00B8\",\n sup1: \"\\u00B9\",\n ordm: \"\\u00BA\",\n raquo: \"\\u00BB\",\n frac14: \"\\u00BC\",\n frac12: \"\\u00BD\",\n frac34: \"\\u00BE\",\n iquest: \"\\u00BF\",\n Agrave: \"\\u00C0\",\n Aacute: \"\\u00C1\",\n Acirc: \"\\u00C2\",\n Atilde: \"\\u00C3\",\n Auml: \"\\u00C4\",\n Aring: \"\\u00C5\",\n AElig: \"\\u00C6\",\n Ccedil: \"\\u00C7\",\n Egrave: \"\\u00C8\",\n Eacute: \"\\u00C9\",\n Ecirc: \"\\u00CA\",\n Euml: \"\\u00CB\",\n Igrave: \"\\u00CC\",\n Iacute: \"\\u00CD\",\n Icirc: \"\\u00CE\",\n Iuml: \"\\u00CF\",\n ETH: \"\\u00D0\",\n Ntilde: \"\\u00D1\",\n Ograve: \"\\u00D2\",\n Oacute: \"\\u00D3\",\n Ocirc: \"\\u00D4\",\n Otilde: \"\\u00D5\",\n Ouml: \"\\u00D6\",\n times: \"\\u00D7\",\n Oslash: \"\\u00D8\",\n Ugrave: \"\\u00D9\",\n Uacute: \"\\u00DA\",\n Ucirc: \"\\u00DB\",\n Uuml: \"\\u00DC\",\n Yacute: \"\\u00DD\",\n THORN: \"\\u00DE\",\n szlig: \"\\u00DF\",\n agrave: \"\\u00E0\",\n aacute: \"\\u00E1\",\n acirc: \"\\u00E2\",\n atilde: \"\\u00E3\",\n auml: \"\\u00E4\",\n aring: \"\\u00E5\",\n aelig: \"\\u00E6\",\n ccedil: \"\\u00E7\",\n egrave: \"\\u00E8\",\n eacute: \"\\u00E9\",\n ecirc: \"\\u00EA\",\n euml: \"\\u00EB\",\n igrave: \"\\u00EC\",\n iacute: \"\\u00ED\",\n icirc: \"\\u00EE\",\n iuml: \"\\u00EF\",\n eth: \"\\u00F0\",\n ntilde: \"\\u00F1\",\n ograve: \"\\u00F2\",\n oacute: \"\\u00F3\",\n ocirc: \"\\u00F4\",\n otilde: \"\\u00F5\",\n ouml: \"\\u00F6\",\n divide: \"\\u00F7\",\n oslash: \"\\u00F8\",\n ugrave: \"\\u00F9\",\n uacute: \"\\u00FA\",\n ucirc: \"\\u00FB\",\n uuml: \"\\u00FC\",\n yacute: \"\\u00FD\",\n thorn: \"\\u00FE\",\n yuml: \"\\u00FF\",\n OElig: \"\\u0152\",\n oelig: \"\\u0153\",\n Scaron: \"\\u0160\",\n scaron: \"\\u0161\",\n Yuml: \"\\u0178\",\n fnof: \"\\u0192\",\n circ: \"\\u02C6\",\n tilde: \"\\u02DC\",\n Alpha: \"\\u0391\",\n Beta: \"\\u0392\",\n Gamma: \"\\u0393\",\n Delta: \"\\u0394\",\n Epsilon: \"\\u0395\",\n Zeta: \"\\u0396\",\n Eta: \"\\u0397\",\n Theta: \"\\u0398\",\n Iota: \"\\u0399\",\n Kappa: \"\\u039A\",\n Lambda: \"\\u039B\",\n Mu: \"\\u039C\",\n Nu: \"\\u039D\",\n Xi: \"\\u039E\",\n Omicron: \"\\u039F\",\n Pi: \"\\u03A0\",\n Rho: \"\\u03A1\",\n Sigma: \"\\u03A3\",\n Tau: \"\\u03A4\",\n Upsilon: \"\\u03A5\",\n Phi: \"\\u03A6\",\n Chi: \"\\u03A7\",\n Psi: \"\\u03A8\",\n Omega: \"\\u03A9\",\n alpha: \"\\u03B1\",\n beta: \"\\u03B2\",\n gamma: \"\\u03B3\",\n delta: \"\\u03B4\",\n epsilon: \"\\u03B5\",\n zeta: \"\\u03B6\",\n eta: \"\\u03B7\",\n theta: \"\\u03B8\",\n iota: \"\\u03B9\",\n kappa: \"\\u03BA\",\n lambda: \"\\u03BB\",\n mu: \"\\u03BC\",\n nu: \"\\u03BD\",\n xi: \"\\u03BE\",\n omicron: \"\\u03BF\",\n pi: \"\\u03C0\",\n rho: \"\\u03C1\",\n sigmaf: \"\\u03C2\",\n sigma: \"\\u03C3\",\n tau: \"\\u03C4\",\n upsilon: \"\\u03C5\",\n phi: \"\\u03C6\",\n chi: \"\\u03C7\",\n psi: \"\\u03C8\",\n omega: \"\\u03C9\",\n thetasym: \"\\u03D1\",\n upsih: \"\\u03D2\",\n piv: \"\\u03D6\",\n ensp: \"\\u2002\",\n emsp: \"\\u2003\",\n thinsp: \"\\u2009\",\n zwnj: \"\\u200C\",\n zwj: \"\\u200D\",\n lrm: \"\\u200E\",\n rlm: \"\\u200F\",\n ndash: \"\\u2013\",\n mdash: \"\\u2014\",\n lsquo: \"\\u2018\",\n rsquo: \"\\u2019\",\n sbquo: \"\\u201A\",\n ldquo: \"\\u201C\",\n rdquo: \"\\u201D\",\n bdquo: \"\\u201E\",\n dagger: \"\\u2020\",\n Dagger: \"\\u2021\",\n bull: \"\\u2022\",\n hellip: \"\\u2026\",\n permil: \"\\u2030\",\n prime: \"\\u2032\",\n Prime: \"\\u2033\",\n lsaquo: \"\\u2039\",\n rsaquo: \"\\u203A\",\n oline: \"\\u203E\",\n frasl: \"\\u2044\",\n euro: \"\\u20AC\",\n image: \"\\u2111\",\n weierp: \"\\u2118\",\n real: \"\\u211C\",\n trade: \"\\u2122\",\n alefsym: \"\\u2135\",\n larr: \"\\u2190\",\n uarr: \"\\u2191\",\n rarr: \"\\u2192\",\n darr: \"\\u2193\",\n harr: \"\\u2194\",\n crarr: \"\\u21B5\",\n lArr: \"\\u21D0\",\n uArr: \"\\u21D1\",\n rArr: \"\\u21D2\",\n dArr: \"\\u21D3\",\n hArr: \"\\u21D4\",\n forall: \"\\u2200\",\n part: \"\\u2202\",\n exist: \"\\u2203\",\n empty: \"\\u2205\",\n nabla: \"\\u2207\",\n isin: \"\\u2208\",\n notin: \"\\u2209\",\n ni: \"\\u220B\",\n prod: \"\\u220F\",\n sum: \"\\u2211\",\n minus: \"\\u2212\",\n lowast: \"\\u2217\",\n radic: \"\\u221A\",\n prop: \"\\u221D\",\n infin: \"\\u221E\",\n ang: \"\\u2220\",\n and: \"\\u2227\",\n or: \"\\u2228\",\n cap: \"\\u2229\",\n cup: \"\\u222A\",\n int: \"\\u222B\",\n there4: \"\\u2234\",\n sim: \"\\u223C\",\n cong: \"\\u2245\",\n asymp: \"\\u2248\",\n ne: \"\\u2260\",\n equiv: \"\\u2261\",\n le: \"\\u2264\",\n ge: \"\\u2265\",\n sub: \"\\u2282\",\n sup: \"\\u2283\",\n nsub: \"\\u2284\",\n sube: \"\\u2286\",\n supe: \"\\u2287\",\n oplus: \"\\u2295\",\n otimes: \"\\u2297\",\n perp: \"\\u22A5\",\n sdot: \"\\u22C5\",\n lceil: \"\\u2308\",\n rceil: \"\\u2309\",\n lfloor: \"\\u230A\",\n rfloor: \"\\u230B\",\n lang: \"\\u2329\",\n rang: \"\\u232A\",\n loz: \"\\u25CA\",\n spades: \"\\u2660\",\n clubs: \"\\u2663\",\n hearts: \"\\u2665\",\n diams: \"\\u2666\",\n} as const;\nexport default entities;\n","import * as charCodes from \"charcodes\";\n\nimport XHTMLEntities from \"./xhtml\";\nimport type Parser from \"../../parser\";\nimport type { ExpressionErrors } from \"../../parser/util\";\nimport {\n tokenComesBeforeExpression,\n tokenIsKeyword,\n tokenLabelName,\n type TokenType,\n tt,\n} from \"../../tokenizer/types\";\nimport type { TokContext } from \"../../tokenizer/context\";\nimport { types as tc } from \"../../tokenizer/context\";\nimport type * as N from \"../../types\";\nimport { isIdentifierChar, isIdentifierStart } from \"../../util/identifier\";\nimport type { Position } from \"../../util/location\";\nimport { isNewLine } from \"../../util/whitespace\";\nimport { Errors, ParseErrorEnum } from \"../../parse-error\";\nimport type { Undone } from \"../../parser/node\";\n\n/* eslint sort-keys: \"error\" */\nconst JsxErrors = ParseErrorEnum`jsx`({\n AttributeIsEmpty:\n \"JSX attributes must only be assigned a non-empty expression.\",\n MissingClosingTagElement: ({ openingTagName }: { openingTagName: string }) =>\n `Expected corresponding JSX closing tag for <${openingTagName}>.`,\n MissingClosingTagFragment: \"Expected corresponding JSX closing tag for <>.\",\n UnexpectedSequenceExpression:\n \"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?\",\n // FIXME: Unify with Errors.UnexpectedToken\n UnexpectedToken: ({\n unexpected,\n HTMLEntity,\n }: {\n unexpected: string;\n HTMLEntity: string;\n }) =>\n `Unexpected token \\`${unexpected}\\`. Did you mean \\`${HTMLEntity}\\` or \\`{'${unexpected}'}\\`?`,\n UnsupportedJsxValue:\n \"JSX value should be either an expression or a quoted JSX text.\",\n UnterminatedJsxContent: \"Unterminated JSX contents.\",\n UnwrappedAdjacentJSXElements:\n \"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?\",\n});\n\n/* eslint-disable sort-keys */\n\nfunction isFragment(object?: N.JSXElement | null): boolean {\n return object\n ? object.type === \"JSXOpeningFragment\" ||\n object.type === \"JSXClosingFragment\"\n : false;\n}\n\n// Transforms JSX element name to string.\n\nfunction getQualifiedJSXName(\n object: N.JSXIdentifier | N.JSXNamespacedName | N.JSXMemberExpression,\n): string {\n if (object.type === \"JSXIdentifier\") {\n return object.name;\n }\n\n if (object.type === \"JSXNamespacedName\") {\n return object.namespace.name + \":\" + object.name.name;\n }\n\n if (object.type === \"JSXMemberExpression\") {\n return (\n getQualifiedJSXName(object.object) +\n \".\" +\n getQualifiedJSXName(object.property)\n );\n }\n\n // istanbul ignore next\n throw new Error(\"Node had unexpected type: \" + object.type);\n}\n\nexport interface IJSXParserMixin {\n jsxParseOpeningElementAfterName(\n node: N.JSXOpeningElement,\n ): N.JSXOpeningElement;\n}\n\nexport default (superClass: typeof Parser) =>\n class JSXParserMixin extends superClass implements Parser, IJSXParserMixin {\n // Reads inline JSX contents token.\n\n jsxReadToken(): void {\n let out = \"\";\n let chunkStart = this.state.pos;\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(JsxErrors.UnterminatedJsxContent, {\n at: this.state.startLoc,\n });\n }\n\n const ch = this.input.charCodeAt(this.state.pos);\n\n switch (ch) {\n case charCodes.lessThan:\n case charCodes.leftCurlyBrace:\n if (this.state.pos === this.state.start) {\n if (ch === charCodes.lessThan && this.state.canStartJSXElement) {\n ++this.state.pos;\n this.finishToken(tt.jsxTagStart);\n } else {\n super.getTokenFromCode(ch);\n }\n return;\n }\n out += this.input.slice(chunkStart, this.state.pos);\n this.finishToken(tt.jsxText, out);\n return;\n\n case charCodes.ampersand:\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadEntity();\n chunkStart = this.state.pos;\n break;\n\n case charCodes.greaterThan:\n case charCodes.rightCurlyBrace:\n if (process.env.BABEL_8_BREAKING) {\n this.raise(JsxErrors.UnexpectedToken, {\n at: this.state.curPosition(),\n unexpected: this.input[this.state.pos],\n HTMLEntity:\n ch === charCodes.rightCurlyBrace ? \"}\" : \">\",\n });\n }\n /* falls through */\n\n default:\n if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadNewLine(true);\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n }\n }\n }\n\n jsxReadNewLine(normalizeCRLF: boolean): string {\n const ch = this.input.charCodeAt(this.state.pos);\n let out;\n ++this.state.pos;\n if (\n ch === charCodes.carriageReturn &&\n this.input.charCodeAt(this.state.pos) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n out = normalizeCRLF ? \"\\n\" : \"\\r\\n\";\n } else {\n out = String.fromCharCode(ch);\n }\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n\n return out;\n }\n\n jsxReadString(quote: number): void {\n let out = \"\";\n let chunkStart = ++this.state.pos;\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(Errors.UnterminatedString, {\n at: this.state.startLoc,\n });\n }\n\n const ch = this.input.charCodeAt(this.state.pos);\n if (ch === quote) break;\n if (ch === charCodes.ampersand) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadEntity();\n chunkStart = this.state.pos;\n } else if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadNewLine(false);\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n }\n out += this.input.slice(chunkStart, this.state.pos++);\n this.finishToken(tt.string, out);\n }\n\n jsxReadEntity(): string {\n const startPos = ++this.state.pos;\n if (this.codePointAtPos(this.state.pos) === charCodes.numberSign) {\n ++this.state.pos;\n\n let radix = 10;\n if (this.codePointAtPos(this.state.pos) === charCodes.lowercaseX) {\n radix = 16;\n ++this.state.pos;\n }\n\n const codePoint = this.readInt(\n radix,\n /* len */ undefined,\n /* forceLen */ false,\n /* allowNumSeparator */ \"bail\",\n );\n if (\n codePoint !== null &&\n this.codePointAtPos(this.state.pos) === charCodes.semicolon\n ) {\n ++this.state.pos;\n return String.fromCodePoint(codePoint);\n }\n } else {\n let count = 0;\n let semi = false;\n while (\n count++ < 10 &&\n this.state.pos < this.length &&\n !(semi = this.codePointAtPos(this.state.pos) == charCodes.semicolon)\n ) {\n ++this.state.pos;\n }\n\n if (semi) {\n const desc = this.input.slice(startPos, this.state.pos);\n const entity = XHTMLEntities[desc];\n ++this.state.pos;\n\n if (entity) {\n return entity;\n }\n }\n }\n\n // Not a valid entity\n this.state.pos = startPos;\n return \"&\";\n }\n\n // Read a JSX identifier (valid tag or attribute name).\n //\n // Optimized version since JSX identifiers can\"t contain\n // escape characters and so can be read as single slice.\n // Also assumes that first character was already checked\n // by isIdentifierStart in readToken.\n\n jsxReadWord(): void {\n let ch;\n const start = this.state.pos;\n do {\n ch = this.input.charCodeAt(++this.state.pos);\n } while (isIdentifierChar(ch) || ch === charCodes.dash);\n this.finishToken(tt.jsxName, this.input.slice(start, this.state.pos));\n }\n\n // Parse next token as JSX identifier\n\n jsxParseIdentifier(): N.JSXIdentifier {\n const node = this.startNode();\n if (this.match(tt.jsxName)) {\n node.name = this.state.value;\n } else if (tokenIsKeyword(this.state.type)) {\n node.name = tokenLabelName(this.state.type);\n } else {\n this.unexpected();\n }\n this.next();\n return this.finishNode(node, \"JSXIdentifier\");\n }\n\n // Parse namespaced identifier.\n\n jsxParseNamespacedName(): N.JSXNamespacedName {\n const startLoc = this.state.startLoc;\n const name = this.jsxParseIdentifier();\n if (!this.eat(tt.colon)) return name;\n\n const node = this.startNodeAt(startLoc);\n node.namespace = name;\n node.name = this.jsxParseIdentifier();\n return this.finishNode(node, \"JSXNamespacedName\");\n }\n\n // Parses element name in any form - namespaced, member\n // or single identifier.\n\n jsxParseElementName():\n | N.JSXIdentifier\n | N.JSXNamespacedName\n | N.JSXMemberExpression {\n const startLoc = this.state.startLoc;\n let node = this.jsxParseNamespacedName();\n if (node.type === \"JSXNamespacedName\") {\n return node;\n }\n while (this.eat(tt.dot)) {\n const newNode = this.startNodeAt(startLoc);\n newNode.object = node;\n newNode.property = this.jsxParseIdentifier();\n node = this.finishNode(newNode, \"JSXMemberExpression\");\n }\n return node;\n }\n\n // Parses any type of JSX attribute value.\n\n jsxParseAttributeValue(): N.Expression {\n let node;\n switch (this.state.type) {\n case tt.braceL:\n node = this.startNode();\n this.setContext(tc.brace);\n this.next();\n node = this.jsxParseExpressionContainer(node, tc.j_oTag);\n if (node.expression.type === \"JSXEmptyExpression\") {\n this.raise(JsxErrors.AttributeIsEmpty, { at: node });\n }\n return node;\n\n case tt.jsxTagStart:\n case tt.string:\n return this.parseExprAtom();\n\n default:\n throw this.raise(JsxErrors.UnsupportedJsxValue, {\n at: this.state.startLoc,\n });\n }\n }\n\n // JSXEmptyExpression is unique type since it doesn't actually parse anything,\n // and so it should start at the end of last read token (left brace) and finish\n // at the beginning of the next one (right brace).\n\n jsxParseEmptyExpression(): N.JSXEmptyExpression {\n const node = this.startNodeAt(this.state.lastTokEndLoc);\n return this.finishNodeAt(node, \"JSXEmptyExpression\", this.state.startLoc);\n }\n\n // Parse JSX spread child\n\n jsxParseSpreadChild(node: Undone<N.JSXSpreadChild>): N.JSXSpreadChild {\n this.next(); // ellipsis\n node.expression = this.parseExpression();\n this.setContext(tc.j_expr);\n this.state.canStartJSXElement = true;\n this.expect(tt.braceR);\n\n return this.finishNode(node, \"JSXSpreadChild\");\n }\n\n // Parses JSX expression enclosed into curly brackets.\n\n jsxParseExpressionContainer(\n node: Undone<N.JSXExpressionContainer>,\n previousContext: TokContext,\n ): N.JSXExpressionContainer {\n if (this.match(tt.braceR)) {\n node.expression = this.jsxParseEmptyExpression();\n } else {\n const expression = this.parseExpression();\n\n if (process.env.BABEL_8_BREAKING) {\n if (\n expression.type === \"SequenceExpression\" &&\n !expression.extra?.parenthesized\n ) {\n this.raise(JsxErrors.UnexpectedSequenceExpression, {\n at: expression.expressions[1],\n });\n }\n }\n\n node.expression = expression;\n }\n this.setContext(previousContext);\n this.state.canStartJSXElement = true;\n this.expect(tt.braceR);\n\n return this.finishNode(node, \"JSXExpressionContainer\");\n }\n\n // Parses following JSX attribute name-value pair.\n\n jsxParseAttribute(): N.JSXAttribute {\n const node = this.startNode();\n if (this.match(tt.braceL)) {\n this.setContext(tc.brace);\n this.next();\n this.expect(tt.ellipsis);\n node.argument = this.parseMaybeAssignAllowIn();\n this.setContext(tc.j_oTag);\n this.state.canStartJSXElement = true;\n this.expect(tt.braceR);\n return this.finishNode(node, \"JSXSpreadAttribute\");\n }\n node.name = this.jsxParseNamespacedName();\n node.value = this.eat(tt.eq) ? this.jsxParseAttributeValue() : null;\n return this.finishNode(node, \"JSXAttribute\");\n }\n\n // Parses JSX opening tag starting after \"<\".\n\n jsxParseOpeningElementAt(startLoc: Position): N.JSXOpeningElement {\n const node = this.startNodeAt<N.JSXOpeningElement | N.JSXOpeningFragment>(\n startLoc,\n );\n if (this.eat(tt.jsxTagEnd)) {\n // @ts-expect-error migrate to Babel types\n return this.finishNode(node, \"JSXOpeningFragment\");\n }\n node.name = this.jsxParseElementName();\n return this.jsxParseOpeningElementAfterName(\n node as Undone<N.JSXOpeningElement>,\n );\n }\n\n jsxParseOpeningElementAfterName(\n node: Undone<N.JSXOpeningElement>,\n ): N.JSXOpeningElement {\n const attributes: N.JSXAttribute[] = [];\n while (!this.match(tt.slash) && !this.match(tt.jsxTagEnd)) {\n attributes.push(this.jsxParseAttribute());\n }\n node.attributes = attributes;\n node.selfClosing = this.eat(tt.slash);\n this.expect(tt.jsxTagEnd);\n return this.finishNode(node, \"JSXOpeningElement\");\n }\n\n // Parses JSX closing tag starting after \"</\".\n\n jsxParseClosingElementAt(startLoc: Position): N.JSXClosingElement {\n const node = this.startNodeAt(startLoc);\n if (this.eat(tt.jsxTagEnd)) {\n return this.finishNode(node, \"JSXClosingFragment\");\n }\n node.name = this.jsxParseElementName();\n this.expect(tt.jsxTagEnd);\n return this.finishNode(node, \"JSXClosingElement\");\n }\n\n // Parses entire JSX element, including it\"s opening tag\n // (starting after \"<\"), attributes, contents and closing tag.\n\n jsxParseElementAt(startLoc: Position): N.JSXElement {\n const node = this.startNodeAt(startLoc);\n const children = [];\n const openingElement = this.jsxParseOpeningElementAt(startLoc);\n let closingElement = null;\n\n if (!openingElement.selfClosing) {\n contents: for (;;) {\n switch (this.state.type) {\n case tt.jsxTagStart:\n startLoc = this.state.startLoc;\n this.next();\n if (this.eat(tt.slash)) {\n closingElement = this.jsxParseClosingElementAt(startLoc);\n break contents;\n }\n children.push(this.jsxParseElementAt(startLoc));\n break;\n\n case tt.jsxText:\n children.push(this.parseExprAtom());\n break;\n\n case tt.braceL: {\n const node = this.startNode<\n N.JSXSpreadChild | N.JSXExpressionContainer\n >();\n this.setContext(tc.brace);\n this.next();\n if (this.match(tt.ellipsis)) {\n children.push(this.jsxParseSpreadChild(node));\n } else {\n children.push(\n this.jsxParseExpressionContainer(node, tc.j_expr),\n );\n }\n\n break;\n }\n // istanbul ignore next - should never happen\n default:\n this.unexpected();\n }\n }\n\n if (\n isFragment(openingElement) &&\n !isFragment(closingElement) &&\n closingElement !== null\n ) {\n this.raise(JsxErrors.MissingClosingTagFragment, {\n at: closingElement,\n });\n } else if (!isFragment(openingElement) && isFragment(closingElement)) {\n this.raise(JsxErrors.MissingClosingTagElement, {\n at: closingElement,\n openingTagName: getQualifiedJSXName(openingElement.name),\n });\n } else if (!isFragment(openingElement) && !isFragment(closingElement)) {\n if (\n getQualifiedJSXName(closingElement.name) !==\n getQualifiedJSXName(openingElement.name)\n ) {\n this.raise(JsxErrors.MissingClosingTagElement, {\n at: closingElement,\n openingTagName: getQualifiedJSXName(openingElement.name),\n });\n }\n }\n }\n\n if (isFragment(openingElement)) {\n node.openingFragment = openingElement;\n node.closingFragment = closingElement;\n } else {\n node.openingElement = openingElement;\n node.closingElement = closingElement;\n }\n node.children = children;\n if (this.match(tt.lt)) {\n throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, {\n at: this.state.startLoc,\n });\n }\n\n return isFragment(openingElement)\n ? this.finishNode(node, \"JSXFragment\")\n : this.finishNode(node, \"JSXElement\");\n }\n\n // Parses entire JSX element from current position.\n\n jsxParseElement(): N.JSXElement {\n const startLoc = this.state.startLoc;\n this.next();\n return this.jsxParseElementAt(startLoc);\n }\n\n setContext(newContext: TokContext) {\n const { context } = this.state;\n context[context.length - 1] = newContext;\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n parseExprAtom(refExpressionErrors?: ExpressionErrors | null): N.Expression {\n if (this.match(tt.jsxText)) {\n return this.parseLiteral(this.state.value, \"JSXText\");\n } else if (this.match(tt.jsxTagStart)) {\n return this.jsxParseElement();\n } else if (\n this.match(tt.lt) &&\n this.input.charCodeAt(this.state.pos) !== charCodes.exclamationMark\n ) {\n // In case we encounter an lt token here it will always be the start of\n // jsx as the lt sign is not allowed in places that expect an expression\n this.replaceToken(tt.jsxTagStart);\n return this.jsxParseElement();\n } else {\n return super.parseExprAtom(refExpressionErrors);\n }\n }\n\n skipSpace() {\n const curContext = this.curContext();\n if (!curContext.preserveSpace) super.skipSpace();\n }\n\n getTokenFromCode(code: number): void {\n const context = this.curContext();\n\n if (context === tc.j_expr) {\n this.jsxReadToken();\n return;\n }\n\n if (context === tc.j_oTag || context === tc.j_cTag) {\n if (isIdentifierStart(code)) {\n this.jsxReadWord();\n return;\n }\n\n if (code === charCodes.greaterThan) {\n ++this.state.pos;\n this.finishToken(tt.jsxTagEnd);\n return;\n }\n\n if (\n (code === charCodes.quotationMark || code === charCodes.apostrophe) &&\n context === tc.j_oTag\n ) {\n this.jsxReadString(code);\n return;\n }\n }\n\n if (\n code === charCodes.lessThan &&\n this.state.canStartJSXElement &&\n this.input.charCodeAt(this.state.pos + 1) !== charCodes.exclamationMark\n ) {\n ++this.state.pos;\n this.finishToken(tt.jsxTagStart);\n return;\n }\n\n super.getTokenFromCode(code);\n }\n\n updateContext(prevType: TokenType): void {\n const { context, type } = this.state;\n if (type === tt.slash && prevType === tt.jsxTagStart) {\n // do not consider JSX expr -> JSX open tag -> ... anymore\n // reconsider as closing tag context\n context.splice(-2, 2, tc.j_cTag);\n this.state.canStartJSXElement = false;\n } else if (type === tt.jsxTagStart) {\n // start opening tag context\n context.push(tc.j_oTag);\n } else if (type === tt.jsxTagEnd) {\n const out = context[context.length - 1];\n if ((out === tc.j_oTag && prevType === tt.slash) || out === tc.j_cTag) {\n context.pop();\n this.state.canStartJSXElement =\n context[context.length - 1] === tc.j_expr;\n } else {\n this.setContext(tc.j_expr);\n this.state.canStartJSXElement = true;\n }\n } else {\n this.state.canStartJSXElement = tokenComesBeforeExpression(type);\n }\n }\n };\n","import type { Position } from \"../../util/location\";\nimport ScopeHandler, { Scope } from \"../../util/scope\";\nimport {\n BIND_KIND_TYPE,\n BIND_FLAGS_TS_ENUM,\n BIND_FLAGS_TS_CONST_ENUM,\n BIND_FLAGS_TS_EXPORT_ONLY,\n BIND_KIND_VALUE,\n BIND_FLAGS_CLASS,\n type ScopeFlags,\n type BindingTypes,\n BIND_FLAGS_TS_IMPORT,\n SCOPE_TS_MODULE,\n} from \"../../util/scopeflags\";\nimport type * as N from \"../../types\";\nimport { Errors } from \"../../parse-error\";\n\nclass TypeScriptScope extends Scope {\n types: Set<string> = new Set();\n\n // enums (which are also in .types)\n enums: Set<string> = new Set();\n\n // const enums (which are also in .enums and .types)\n constEnums: Set<string> = new Set();\n\n // classes (which are also in .lexical) and interface (which are also in .types)\n classes: Set<string> = new Set();\n\n // namespaces and ambient functions (or classes) are too difficult to track,\n // especially without type analysis.\n // We need to track them anyway, to avoid \"X is not defined\" errors\n // when exporting them.\n exportOnlyBindings: Set<string> = new Set();\n}\n\n// See https://github.com/babel/babel/pull/9766#discussion_r268920730 for an\n// explanation of how typescript handles scope.\n\nexport default class TypeScriptScopeHandler extends ScopeHandler<TypeScriptScope> {\n importsStack: Set<string>[] = [];\n\n createScope(flags: ScopeFlags): TypeScriptScope {\n this.importsStack.push(new Set()); // Always keep the top-level scope for export checks.\n\n return new TypeScriptScope(flags);\n }\n\n enter(flags: number): void {\n if (flags == SCOPE_TS_MODULE) {\n this.importsStack.push(new Set());\n }\n\n super.enter(flags);\n }\n\n exit() {\n const flags = super.exit();\n\n if (flags == SCOPE_TS_MODULE) {\n this.importsStack.pop();\n }\n\n return flags;\n }\n\n hasImport(name: string, allowShadow?: boolean) {\n const len = this.importsStack.length;\n if (this.importsStack[len - 1].has(name)) {\n return true;\n }\n if (!allowShadow && len > 1) {\n for (let i = 0; i < len - 1; i++) {\n if (this.importsStack[i].has(name)) return true;\n }\n }\n return false;\n }\n\n declareName(name: string, bindingType: BindingTypes, loc: Position) {\n if (bindingType & BIND_FLAGS_TS_IMPORT) {\n if (this.hasImport(name, true)) {\n this.parser.raise(Errors.VarRedeclaration, {\n at: loc,\n identifierName: name,\n });\n }\n this.importsStack[this.importsStack.length - 1].add(name);\n return;\n }\n\n const scope = this.currentScope();\n if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) {\n this.maybeExportDefined(scope, name);\n scope.exportOnlyBindings.add(name);\n return;\n }\n\n super.declareName(name, bindingType, loc);\n\n if (bindingType & BIND_KIND_TYPE) {\n if (!(bindingType & BIND_KIND_VALUE)) {\n // \"Value\" bindings have already been registered by the superclass.\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n this.maybeExportDefined(scope, name);\n }\n scope.types.add(name);\n }\n if (bindingType & BIND_FLAGS_TS_ENUM) scope.enums.add(name);\n if (bindingType & BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.add(name);\n if (bindingType & BIND_FLAGS_CLASS) scope.classes.add(name);\n }\n\n isRedeclaredInScope(\n scope: TypeScriptScope,\n name: string,\n bindingType: BindingTypes,\n ): boolean {\n if (scope.enums.has(name)) {\n if (bindingType & BIND_FLAGS_TS_ENUM) {\n // Enums can be merged with other enums if they are both\n // const or both non-const.\n const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM);\n const wasConst = scope.constEnums.has(name);\n return isConst !== wasConst;\n }\n return true;\n }\n if (bindingType & BIND_FLAGS_CLASS && scope.classes.has(name)) {\n if (scope.lexical.has(name)) {\n // Classes can be merged with interfaces\n return !!(bindingType & BIND_KIND_VALUE);\n } else {\n // Interface can be merged with other classes or interfaces\n return false;\n }\n }\n if (bindingType & BIND_KIND_TYPE && scope.types.has(name)) {\n return true;\n }\n\n return super.isRedeclaredInScope(scope, name, bindingType);\n }\n\n checkLocalExport(id: N.Identifier) {\n const { name } = id;\n\n if (this.hasImport(name)) return;\n\n const len = this.scopeStack.length;\n for (let i = len - 1; i >= 0; i--) {\n const scope = this.scopeStack[i];\n if (scope.types.has(name) || scope.exportOnlyBindings.has(name)) return;\n }\n\n super.checkLocalExport(id);\n }\n}\n","import * as charCodes from \"charcodes\";\nimport { tt, type TokenType } from \"../tokenizer/types\";\nimport type {\n AssignmentPattern,\n TSParameterProperty,\n Decorator,\n Expression,\n Identifier,\n Node,\n Pattern,\n RestElement,\n SpreadElement,\n ObjectOrClassMember,\n ClassMember,\n ObjectMember,\n TsNamedTypeElementBase,\n PrivateName,\n ObjectExpression,\n ObjectPattern,\n ArrayExpression,\n ArrayPattern,\n} from \"../types\";\nimport type { Pos, Position } from \"../util/location\";\nimport {\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n} from \"../util/identifier\";\nimport { NodeUtils, type Undone } from \"./node\";\nimport {\n type BindingTypes,\n BIND_NONE,\n BIND_FLAGS_NO_LET_IN_LEXICAL,\n} from \"../util/scopeflags\";\nimport type { ExpressionErrors } from \"./util\";\nimport { Errors, type LValAncestor } from \"../parse-error\";\nimport type Parser from \"./index\";\n\nconst getOwn = <T extends {}>(object: T, key: keyof T) =>\n Object.hasOwnProperty.call(object, key) && object[key];\n\nconst unwrapParenthesizedExpression = (node: Node): Node => {\n return node.type === \"ParenthesizedExpression\"\n ? unwrapParenthesizedExpression(node.expression)\n : node;\n};\n\nexport const enum ParseBindingListFlags {\n ALLOW_EMPTY = 1 << 0,\n IS_FUNCTION_PARAMS = 1 << 1,\n IS_CONSTRUCTOR_PARAMS = 1 << 2,\n}\n\nexport default abstract class LValParser extends NodeUtils {\n // Forward-declaration: defined in expression.js\n abstract parseIdentifier(liberal?: boolean): Identifier;\n abstract parseMaybeAssign(\n refExpressionErrors?: ExpressionErrors | null,\n afterLeftParse?: Function,\n refNeedsArrowPos?: Pos | null,\n ): Expression;\n\n abstract parseMaybeAssignAllowIn(\n refExpressionErrors?: ExpressionErrors | null,\n afterLeftParse?: Function,\n refNeedsArrowPos?: Pos | null,\n ): Expression;\n\n abstract parseObjectLike<T extends ObjectPattern | ObjectExpression>(\n close: TokenType,\n isPattern: boolean,\n isRecord?: boolean,\n refExpressionErrors?: ExpressionErrors,\n ): T;\n abstract parseObjPropValue(\n prop: any,\n startLoc: Position | null,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): void;\n abstract parsePropertyName(\n prop: ObjectOrClassMember | ClassMember | TsNamedTypeElementBase,\n ): Expression | Identifier;\n abstract parsePrivateName(): PrivateName;\n // Forward-declaration: defined in statement.js\n abstract parseDecorator(): Decorator;\n\n /**\n * Convert existing expression atom to assignable pattern\n * if possible. Also checks invalid destructuring targets:\n *\n * - Parenthesized Destructuring patterns\n * - RestElement is not the last element\n * - Missing `=` in assignment pattern\n *\n * NOTE: There is a corresponding \"isAssignable\" method.\n * When this one is updated, please check if also that one needs to be updated.\n *\n * @param node The expression atom\n * @param isLHS Whether we are parsing a LeftHandSideExpression.\n * If isLHS is `true`, the following cases are allowed: `[(a)] = [0]`, `[(a.b)] = [0]`\n * If isLHS is `false`, we are in an arrow function parameters list.\n */\n toAssignable(node: Node, isLHS: boolean = false): void {\n let parenthesized = undefined;\n if (node.type === \"ParenthesizedExpression\" || node.extra?.parenthesized) {\n parenthesized = unwrapParenthesizedExpression(node);\n if (isLHS) {\n // an LHS can be reinterpreted to a binding pattern but not vice versa.\n // therefore a parenthesized identifier is ambiguous until we are sure it is an assignment expression\n // i.e. `([(a) = []] = []) => {}`\n // see also `recordArrowParameterBindingError` signature in packages/babel-parser/src/util/expression-scope.js\n if (parenthesized.type === \"Identifier\") {\n this.expressionScope.recordArrowParameterBindingError(\n Errors.InvalidParenthesizedAssignment,\n { at: node },\n );\n } else if (parenthesized.type !== \"MemberExpression\") {\n // A parenthesized member expression can be in LHS but not in pattern.\n // If the LHS is later interpreted as a pattern, `checkLVal` will throw for member expression binding\n // i.e. `([(a.b) = []] = []) => {}`\n this.raise(Errors.InvalidParenthesizedAssignment, { at: node });\n }\n } else {\n this.raise(Errors.InvalidParenthesizedAssignment, { at: node });\n }\n }\n\n switch (node.type) {\n case \"Identifier\":\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"AssignmentPattern\":\n case \"RestElement\":\n break;\n\n case \"ObjectExpression\":\n node.type = \"ObjectPattern\";\n for (\n let i = 0, length = node.properties.length, last = length - 1;\n i < length;\n i++\n ) {\n const prop = node.properties[i];\n const isLast = i === last;\n this.toAssignableObjectExpressionProp(prop, isLast, isLHS);\n\n if (\n isLast &&\n prop.type === \"RestElement\" &&\n node.extra?.trailingCommaLoc\n ) {\n this.raise(Errors.RestTrailingComma, {\n at: node.extra.trailingCommaLoc,\n });\n }\n }\n break;\n\n case \"ObjectProperty\": {\n const { key, value } = node;\n if (this.isPrivateName(key)) {\n this.classScope.usePrivateName(\n this.getPrivateNameSV(key),\n key.loc.start,\n );\n }\n this.toAssignable(value, isLHS);\n break;\n }\n\n case \"SpreadElement\": {\n throw new Error(\n \"Internal @babel/parser error (this is a bug, please report it).\" +\n \" SpreadElement should be converted by .toAssignable's caller.\",\n );\n }\n\n case \"ArrayExpression\":\n node.type = \"ArrayPattern\";\n this.toAssignableList(\n node.elements,\n node.extra?.trailingCommaLoc,\n isLHS,\n );\n break;\n\n case \"AssignmentExpression\":\n if (node.operator !== \"=\") {\n this.raise(Errors.MissingEqInAssignment, { at: node.left.loc.end });\n }\n\n node.type = \"AssignmentPattern\";\n delete node.operator;\n this.toAssignable(node.left, isLHS);\n break;\n\n case \"ParenthesizedExpression\":\n /*::invariant (parenthesized !== undefined) */\n this.toAssignable(parenthesized, isLHS);\n break;\n\n default:\n // We don't know how to deal with this node. It will\n // be reported by a later call to checkLVal\n }\n }\n\n toAssignableObjectExpressionProp(\n prop: Node,\n isLast: boolean,\n isLHS: boolean,\n ) {\n if (prop.type === \"ObjectMethod\") {\n this.raise(\n prop.kind === \"get\" || prop.kind === \"set\"\n ? Errors.PatternHasAccessor\n : Errors.PatternHasMethod,\n { at: prop.key },\n );\n } else if (prop.type === \"SpreadElement\") {\n prop.type = \"RestElement\";\n const arg = prop.argument;\n this.checkToRestConversion(arg, /* allowPattern */ false);\n this.toAssignable(arg, isLHS);\n\n if (!isLast) {\n this.raise(Errors.RestTrailingComma, { at: prop });\n }\n } else {\n this.toAssignable(prop, isLHS);\n }\n }\n\n // Convert list of expression atoms to binding list.\n\n toAssignableList(\n exprList: Expression[],\n trailingCommaLoc: Position | undefined | null,\n isLHS: boolean,\n ): void {\n const end = exprList.length - 1;\n\n for (let i = 0; i <= end; i++) {\n const elt = exprList[i];\n if (!elt) continue;\n\n if (elt.type === \"SpreadElement\") {\n elt.type = \"RestElement\";\n const arg = elt.argument;\n this.checkToRestConversion(arg, /* allowPattern */ true);\n this.toAssignable(arg, isLHS);\n } else {\n this.toAssignable(elt, isLHS);\n }\n\n if (elt.type === \"RestElement\") {\n if (i < end) {\n this.raise(Errors.RestTrailingComma, { at: elt });\n } else if (trailingCommaLoc) {\n this.raise(Errors.RestTrailingComma, { at: trailingCommaLoc });\n }\n }\n }\n }\n\n isAssignable(node: Node, isBinding?: boolean): boolean {\n switch (node.type) {\n case \"Identifier\":\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"AssignmentPattern\":\n case \"RestElement\":\n return true;\n\n case \"ObjectExpression\": {\n const last = node.properties.length - 1;\n return (node.properties as ObjectExpression[\"properties\"]).every(\n (prop, i) => {\n return (\n prop.type !== \"ObjectMethod\" &&\n (i === last || prop.type !== \"SpreadElement\") &&\n this.isAssignable(prop)\n );\n },\n );\n }\n\n case \"ObjectProperty\":\n return this.isAssignable(node.value);\n\n case \"SpreadElement\":\n return this.isAssignable(node.argument);\n\n case \"ArrayExpression\":\n return (node as ArrayExpression).elements.every(\n element => element === null || this.isAssignable(element),\n );\n\n case \"AssignmentExpression\":\n return node.operator === \"=\";\n\n case \"ParenthesizedExpression\":\n return this.isAssignable(node.expression);\n\n case \"MemberExpression\":\n case \"OptionalMemberExpression\":\n return !isBinding;\n\n default:\n return false;\n }\n }\n\n // Convert list of expression atoms to a list of\n\n toReferencedList(\n exprList: ReadonlyArray<Expression | undefined | null>,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n isParenthesizedExpr?: boolean,\n ): ReadonlyArray<Expression | undefined | null> {\n return exprList;\n }\n\n toReferencedListDeep(\n exprList: ReadonlyArray<Expression | undefined | null>,\n isParenthesizedExpr?: boolean,\n ): void {\n this.toReferencedList(exprList, isParenthesizedExpr);\n\n for (const expr of exprList) {\n if (expr?.type === \"ArrayExpression\") {\n this.toReferencedListDeep(expr.elements);\n }\n }\n }\n\n // Parses spread element.\n\n parseSpread(\n this: Parser,\n refExpressionErrors?: ExpressionErrors | null,\n ): SpreadElement {\n const node = this.startNode<SpreadElement>();\n this.next();\n node.argument = this.parseMaybeAssignAllowIn(\n refExpressionErrors,\n undefined,\n );\n return this.finishNode(node, \"SpreadElement\");\n }\n\n // https://tc39.es/ecma262/#prod-BindingRestProperty\n // https://tc39.es/ecma262/#prod-BindingRestElement\n parseRestBinding(this: Parser): RestElement {\n const node = this.startNode<RestElement>();\n this.next(); // eat `...`\n node.argument = this.parseBindingAtom();\n return this.finishNode(node, \"RestElement\");\n }\n\n // Parses lvalue (assignable) atom.\n parseBindingAtom(this: Parser): Pattern {\n // https://tc39.es/ecma262/#prod-BindingPattern\n switch (this.state.type) {\n case tt.bracketL: {\n const node = this.startNode<ArrayPattern>();\n this.next();\n // @ts-expect-error: Fixme: TSParameterProperty can not be assigned to node.elements\n node.elements = this.parseBindingList(\n tt.bracketR,\n charCodes.rightSquareBracket,\n ParseBindingListFlags.ALLOW_EMPTY,\n );\n return this.finishNode(node, \"ArrayPattern\");\n }\n\n case tt.braceL:\n return this.parseObjectLike(tt.braceR, true);\n }\n\n // https://tc39.es/ecma262/#prod-BindingIdentifier\n return this.parseIdentifier();\n }\n\n // https://tc39.es/ecma262/#prod-BindingElementList\n parseBindingList(\n this: Parser,\n close: TokenType,\n closeCharCode: (typeof charCodes)[keyof typeof charCodes],\n flags: ParseBindingListFlags,\n ): Array<Pattern | TSParameterProperty> {\n const allowEmpty = flags & ParseBindingListFlags.ALLOW_EMPTY;\n\n const elts: Array<Pattern | TSParameterProperty> = [];\n let first = true;\n while (!this.eat(close)) {\n if (first) {\n first = false;\n } else {\n this.expect(tt.comma);\n }\n if (allowEmpty && this.match(tt.comma)) {\n elts.push(null);\n } else if (this.eat(close)) {\n break;\n } else if (this.match(tt.ellipsis)) {\n elts.push(\n this.parseAssignableListItemTypes(this.parseRestBinding(), flags),\n );\n if (!this.checkCommaAfterRest(closeCharCode)) {\n this.expect(close);\n break;\n }\n } else {\n const decorators = [];\n if (this.match(tt.at) && this.hasPlugin(\"decorators\")) {\n this.raise(Errors.UnsupportedParameterDecorator, {\n at: this.state.startLoc,\n });\n }\n // invariant: hasPlugin(\"decorators-legacy\")\n while (this.match(tt.at)) {\n decorators.push(this.parseDecorator());\n }\n elts.push(this.parseAssignableListItem(flags, decorators));\n }\n }\n return elts;\n }\n\n // https://tc39.es/ecma262/#prod-BindingRestProperty\n parseBindingRestProperty(\n this: Parser,\n prop: Undone<RestElement>,\n ): RestElement {\n this.next(); // eat '...'\n // Don't use parseRestBinding() as we only allow Identifier here.\n prop.argument = this.parseIdentifier();\n this.checkCommaAfterRest(charCodes.rightCurlyBrace);\n return this.finishNode(prop, \"RestElement\");\n }\n\n // https://tc39.es/ecma262/#prod-BindingProperty\n parseBindingProperty(this: Parser): ObjectMember | RestElement {\n const prop = this.startNode<ObjectMember | RestElement>();\n const { type, startLoc } = this.state;\n if (type === tt.ellipsis) {\n return this.parseBindingRestProperty(prop as Undone<RestElement>);\n } else if (type === tt.privateName) {\n this.expectPlugin(\"destructuringPrivate\", startLoc);\n this.classScope.usePrivateName(this.state.value, startLoc);\n (prop as Undone<ObjectMember>).key = this.parsePrivateName();\n } else {\n this.parsePropertyName(prop as Undone<ObjectMember>);\n }\n (prop as Undone<ObjectMember>).method = false;\n return this.parseObjPropValue(\n prop as Undone<ObjectMember>,\n startLoc,\n false /* isGenerator */,\n false /* isAsync */,\n true /* isPattern */,\n false /* isAccessor */,\n );\n }\n\n parseAssignableListItem(\n this: Parser,\n flags: ParseBindingListFlags,\n decorators: Decorator[],\n ): Pattern | TSParameterProperty {\n const left = this.parseMaybeDefault();\n this.parseAssignableListItemTypes(left, flags);\n const elt = this.parseMaybeDefault(left.loc.start, left);\n if (decorators.length) {\n left.decorators = decorators;\n }\n return elt;\n }\n\n // Used by flow/typescript plugin to add type annotations to binding elements\n parseAssignableListItemTypes(\n param: Pattern,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n flags: ParseBindingListFlags,\n ): Pattern {\n return param;\n }\n\n // Parses assignment pattern around given atom if possible.\n // https://tc39.es/ecma262/#prod-BindingElement\n parseMaybeDefault(\n this: Parser,\n startLoc?: Position | null,\n left?: Pattern | null,\n ): Pattern {\n startLoc ??= this.state.startLoc;\n left = left ?? this.parseBindingAtom();\n if (!this.eat(tt.eq)) return left;\n\n const node = this.startNodeAt<AssignmentPattern>(startLoc);\n node.left = left;\n node.right = this.parseMaybeAssignAllowIn();\n return this.finishNode(node, \"AssignmentPattern\");\n }\n /**\n * Return information use in determining whether a Node of a given type is an LVal,\n * possibly given certain additional context information.\n *\n * Subclasser notes: This method has kind of a lot of mixed, but related,\n * responsibilities. If we can definitively determine with the information\n * provided that this either *is* or *isn't* a valid `LVal`, then the return\n * value is easy: just return `true` or `false`. However, if it is a valid\n * LVal *ancestor*, and thus its descendants must be subsequently visited to\n * continue the \"investigation\", then this method should return the relevant\n * child key as a `string`. In some special cases, you additionally want to\n * convey that this node should be treated as if it were parenthesized. In\n * that case, a tuple of [key: string, parenthesized: boolean] is returned.\n * The `string`-only return option is actually just a shorthand for:\n * `[key: string, parenthesized: false]`.\n *\n * @param type A Node `type` string\n * @param isUnparenthesizedInAssign\n * Whether the node in question is unparenthesized and its parent\n * is either an assignment pattern or an assignment expression.\n * @param binding\n * The binding operation that is being considered for this potential\n * LVal.\n * @returns `true` or `false` if we can immediately determine whether the node\n * type in question can be treated as an `LVal`.\n * A `string` key to traverse if we must check this child.\n * A `[string, boolean]` tuple if we need to check this child and\n * treat is as parenthesized.\n */\n isValidLVal(\n type: string,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n isUnparenthesizedInAssign: boolean,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n binding: BindingTypes,\n ): string | boolean {\n return getOwn(\n {\n AssignmentPattern: \"left\",\n RestElement: \"argument\",\n ObjectProperty: \"value\",\n ParenthesizedExpression: \"expression\",\n ArrayPattern: \"elements\",\n ObjectPattern: \"properties\",\n },\n // @ts-expect-error refine string to enum\n type,\n );\n }\n\n /**\n * Verify that a target expression is an lval (something that can be assigned to).\n *\n * @param expression The expression in question to check.\n * @param options A set of options described below.\n * @param options.in\n * The relevant ancestor to provide context information for the error\n * if the check fails.\n * @param options.binding\n * The desired binding type. If the given expression is an identifier\n * and `binding` is not `BIND_NONE`, `checkLVal` will register binding\n * to the parser scope See also `src/util/scopeflags.js`\n * @param options.checkClashes\n * An optional string set to check if an identifier name is included.\n * `checkLVal` will add checked identifier name to `checkClashes` It is\n * used in tracking duplicates in function parameter lists. If it is\n * false, `checkLVal` will skip duplicate checks\n * @param options.strictModeChanged\n * Whether an identifier has been parsed in a sloppy context but should\n * be reinterpreted as strict-mode. e.g. `(arguments) => { \"use strict \"}`\n * @param options.hasParenthesizedAncestor\n * This is only used internally during recursive calls, and you should\n * not have to set it yourself.\n */\n\n checkLVal(\n expression: Expression | ObjectMember | RestElement,\n {\n in: ancestor,\n binding = BIND_NONE,\n checkClashes = false,\n strictModeChanged = false,\n hasParenthesizedAncestor = false,\n }: {\n in: LValAncestor;\n binding?: BindingTypes;\n checkClashes?: Set<string> | false;\n strictModeChanged?: boolean;\n hasParenthesizedAncestor?: boolean;\n },\n ): void {\n const type = expression.type;\n\n // If we find here an ObjectMethod, it's because this was originally\n // an ObjectExpression which has then been converted.\n // toAssignable already reported this error with a nicer message.\n if (this.isObjectMethod(expression)) return;\n\n if (type === \"MemberExpression\") {\n if (binding !== BIND_NONE) {\n this.raise(Errors.InvalidPropertyBindingPattern, { at: expression });\n }\n return;\n }\n\n if (type === \"Identifier\") {\n this.checkIdentifier(\n expression as Identifier,\n binding,\n strictModeChanged,\n );\n\n const { name } = expression as Identifier;\n\n if (checkClashes) {\n if (checkClashes.has(name)) {\n this.raise(Errors.ParamDupe, { at: expression });\n } else {\n checkClashes.add(name);\n }\n }\n\n return;\n }\n\n const validity = this.isValidLVal(\n type,\n !(hasParenthesizedAncestor || expression.extra?.parenthesized) &&\n ancestor.type === \"AssignmentExpression\",\n binding,\n );\n\n if (validity === true) return;\n if (validity === false) {\n const ParseErrorClass =\n binding === BIND_NONE ? Errors.InvalidLhs : Errors.InvalidLhsBinding;\n\n this.raise(ParseErrorClass, { at: expression, ancestor });\n return;\n }\n\n const [key, isParenthesizedExpression] = Array.isArray(validity)\n ? validity\n : [validity, type === \"ParenthesizedExpression\"];\n const nextAncestor =\n type === \"ArrayPattern\" ||\n type === \"ObjectPattern\" ||\n type === \"ParenthesizedExpression\"\n ? ({ type } as const)\n : ancestor;\n\n // @ts-expect-error key may not index expression.\n for (const child of [].concat(expression[key])) {\n if (child) {\n this.checkLVal(child, {\n in: nextAncestor,\n binding,\n checkClashes,\n strictModeChanged,\n hasParenthesizedAncestor: isParenthesizedExpression,\n });\n }\n }\n }\n\n checkIdentifier(\n at: Identifier,\n bindingType: BindingTypes,\n strictModeChanged: boolean = false,\n ) {\n if (\n this.state.strict &&\n (strictModeChanged\n ? isStrictBindReservedWord(at.name, this.inModule)\n : isStrictBindOnlyReservedWord(at.name))\n ) {\n if (bindingType === BIND_NONE) {\n this.raise(Errors.StrictEvalArguments, { at, referenceName: at.name });\n } else {\n this.raise(Errors.StrictEvalArgumentsBinding, {\n at,\n bindingName: at.name,\n });\n }\n }\n\n if (bindingType & BIND_FLAGS_NO_LET_IN_LEXICAL && at.name === \"let\") {\n this.raise(Errors.LetInLexicalBinding, { at });\n }\n\n if (!(bindingType & BIND_NONE)) {\n this.declareNameFromIdentifier(at, bindingType);\n }\n }\n\n declareNameFromIdentifier(identifier: Identifier, binding: BindingTypes) {\n this.scope.declareName(identifier.name, binding, identifier.loc.start);\n }\n\n checkToRestConversion(node: Node, allowPattern: boolean): void {\n switch (node.type) {\n case \"ParenthesizedExpression\":\n this.checkToRestConversion(node.expression, allowPattern);\n break;\n case \"Identifier\":\n case \"MemberExpression\":\n break;\n case \"ArrayExpression\":\n case \"ObjectExpression\":\n if (allowPattern) break;\n /* falls through */\n default:\n this.raise(Errors.InvalidRestAssignmentPattern, { at: node });\n }\n }\n\n checkCommaAfterRest(\n close: (typeof charCodes)[keyof typeof charCodes],\n ): boolean {\n if (!this.match(tt.comma)) {\n return false;\n }\n\n this.raise(\n this.lookaheadCharCode() === close\n ? Errors.RestTrailingComma\n : Errors.ElementAfterRest,\n { at: this.state.startLoc },\n );\n\n return true;\n }\n}\n","/*:: declare var invariant; */\n\nimport type State from \"../../tokenizer/state\";\nimport {\n tokenIsIdentifier,\n tokenIsTSDeclarationStart,\n tokenIsTSTypeOperator,\n tokenOperatorPrecedence,\n tokenIsKeywordOrIdentifier,\n tt,\n type TokenType,\n tokenIsTemplate,\n tokenCanStartExpression,\n} from \"../../tokenizer/types\";\nimport { types as tc } from \"../../tokenizer/context\";\nimport type * as N from \"../../types\";\nimport type { Position } from \"../../util/location\";\nimport { createPositionWithColumnOffset } from \"../../util/location\";\nimport type Parser from \"../../parser\";\nimport {\n type BindingTypes,\n SCOPE_TS_MODULE,\n SCOPE_OTHER,\n BIND_TS_ENUM,\n BIND_TS_CONST_ENUM,\n BIND_TS_TYPE,\n BIND_TS_INTERFACE,\n BIND_TS_AMBIENT,\n BIND_TS_NAMESPACE,\n BIND_TS_TYPE_IMPORT,\n BIND_CLASS,\n BIND_NONE,\n BIND_FLAGS_TS_IMPORT,\n} from \"../../util/scopeflags\";\nimport TypeScriptScopeHandler from \"./scope\";\nimport * as charCodes from \"charcodes\";\nimport type { ExpressionErrors } from \"../../parser/util\";\nimport type { ParseStatementFlag } from \"../../parser/statement\";\nimport { PARAM } from \"../../util/production-parameter\";\nimport { Errors, ParseErrorEnum } from \"../../parse-error\";\nimport { cloneIdentifier, type Undone } from \"../../parser/node\";\nimport type { Pattern } from \"../../types\";\nimport type { Expression } from \"../../types\";\nimport type { IJSXParserMixin } from \"../jsx\";\nimport { ParseBindingListFlags } from \"../../parser/lval\";\n\nconst getOwn = <T extends {}>(object: T, key: keyof T) =>\n Object.hasOwnProperty.call(object, key) && object[key];\n\ntype TsModifier =\n | \"readonly\"\n | \"abstract\"\n | \"declare\"\n | \"static\"\n | \"override\"\n | \"const\"\n | N.Accessibility\n | N.VarianceAnnotations;\n\nfunction nonNull<T>(x?: T | null): T {\n if (x == null) {\n throw new Error(`Unexpected ${x} value.`);\n }\n return x;\n}\n\nfunction assert(x: boolean): void {\n if (!x) {\n throw new Error(\"Assert fail\");\n }\n}\n\ntype ParsingContext =\n | \"EnumMembers\"\n | \"HeritageClauseElement\"\n | \"TupleElementTypes\"\n | \"TypeMembers\"\n | \"TypeParametersOrArguments\";\n\ntype ModifierBase = {\n accessibility?: N.Accessibility;\n} & {\n [key in TsModifier]?: boolean | undefined | null;\n};\n\n/* eslint sort-keys: \"error\" */\nconst TSErrors = ParseErrorEnum`typescript`({\n AbstractMethodHasImplementation: ({ methodName }: { methodName: string }) =>\n `Method '${methodName}' cannot have an implementation because it is marked abstract.`,\n AbstractPropertyHasInitializer: ({\n propertyName,\n }: {\n propertyName: string;\n }) =>\n `Property '${propertyName}' cannot have an initializer because it is marked abstract.`,\n AccesorCannotDeclareThisParameter:\n \"'get' and 'set' accessors cannot declare 'this' parameters.\",\n AccesorCannotHaveTypeParameters: \"An accessor cannot have type parameters.\",\n AccessorCannotBeOptional:\n \"An 'accessor' property cannot be declared optional.\",\n ClassMethodHasDeclare: \"Class methods cannot have the 'declare' modifier.\",\n ClassMethodHasReadonly: \"Class methods cannot have the 'readonly' modifier.\",\n ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference:\n \"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.\",\n ConstructorHasTypeParameters:\n \"Type parameters cannot appear on a constructor declaration.\",\n DeclareAccessor: ({ kind }: { kind: \"get\" | \"set\" }) =>\n `'declare' is not allowed in ${kind}ters.`,\n DeclareClassFieldHasInitializer:\n \"Initializers are not allowed in ambient contexts.\",\n DeclareFunctionHasImplementation:\n \"An implementation cannot be declared in ambient contexts.\",\n DuplicateAccessibilityModifier:\n // `Accessibility modifier already seen: ${modifier}` would be more helpful.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ({ modifier }: { modifier: N.Accessibility }) =>\n `Accessibility modifier already seen.`,\n DuplicateModifier: ({ modifier }: { modifier: TsModifier }) =>\n `Duplicate modifier: '${modifier}'.`,\n // `token` matches the terminology used by typescript:\n // https://github.com/microsoft/TypeScript/blob/main/src/compiler/types.ts#L2915\n EmptyHeritageClauseType: ({ token }: { token: \"extends\" | \"implements\" }) =>\n `'${token}' list cannot be empty.`,\n EmptyTypeArguments: \"Type argument list cannot be empty.\",\n EmptyTypeParameters: \"Type parameter list cannot be empty.\",\n ExpectedAmbientAfterExportDeclare:\n \"'export declare' must be followed by an ambient declaration.\",\n ImportAliasHasImportType: \"An import alias can not use 'import type'.\",\n ImportReflectionHasImportType:\n \"An `import module` declaration can not use `type` modifier\",\n IncompatibleModifiers: ({\n modifiers,\n }: {\n modifiers: [TsModifier, TsModifier];\n }) =>\n `'${modifiers[0]}' modifier cannot be used with '${modifiers[1]}' modifier.`,\n IndexSignatureHasAbstract:\n \"Index signatures cannot have the 'abstract' modifier.\",\n IndexSignatureHasAccessibility: ({\n modifier,\n }: {\n modifier: N.Accessibility;\n }) =>\n `Index signatures cannot have an accessibility modifier ('${modifier}').`,\n IndexSignatureHasDeclare:\n \"Index signatures cannot have the 'declare' modifier.\",\n IndexSignatureHasOverride:\n \"'override' modifier cannot appear on an index signature.\",\n IndexSignatureHasStatic:\n \"Index signatures cannot have the 'static' modifier.\",\n InitializerNotAllowedInAmbientContext:\n \"Initializers are not allowed in ambient contexts.\",\n InvalidModifierOnTypeMember: ({ modifier }: { modifier: TsModifier }) =>\n `'${modifier}' modifier cannot appear on a type member.`,\n InvalidModifierOnTypeParameter: ({ modifier }: { modifier: TsModifier }) =>\n `'${modifier}' modifier cannot appear on a type parameter.`,\n InvalidModifierOnTypeParameterPositions: ({\n modifier,\n }: {\n modifier: TsModifier;\n }) =>\n `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`,\n InvalidModifiersOrder: ({\n orderedModifiers,\n }: {\n orderedModifiers: [TsModifier, TsModifier];\n }) =>\n `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`,\n InvalidPropertyAccessAfterInstantiationExpression:\n \"Invalid property access after an instantiation expression. \" +\n \"You can either wrap the instantiation expression in parentheses, or delete the type arguments.\",\n InvalidTupleMemberLabel:\n \"Tuple members must be labeled with a simple identifier.\",\n MissingInterfaceName:\n \"'interface' declarations must be followed by an identifier.\",\n MixedLabeledAndUnlabeledElements:\n \"Tuple members must all have names or all not have names.\",\n NonAbstractClassHasAbstractMethod:\n \"Abstract methods can only appear within an abstract class.\",\n NonClassMethodPropertyHasAbstractModifer:\n \"'abstract' modifier can only appear on a class, method, or property declaration.\",\n OptionalTypeBeforeRequired:\n \"A required element cannot follow an optional element.\",\n OverrideNotInSubClass:\n \"This member cannot have an 'override' modifier because its containing class does not extend another class.\",\n PatternIsOptional:\n \"A binding pattern parameter cannot be optional in an implementation signature.\",\n PrivateElementHasAbstract:\n \"Private elements cannot have the 'abstract' modifier.\",\n PrivateElementHasAccessibility: ({\n modifier,\n }: {\n modifier: N.Accessibility;\n }) =>\n `Private elements cannot have an accessibility modifier ('${modifier}').`,\n ReadonlyForMethodSignature:\n \"'readonly' modifier can only appear on a property declaration or index signature.\",\n ReservedArrowTypeParam:\n \"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.\",\n ReservedTypeAssertion:\n \"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.\",\n // TODO: Accesor -> Accessor\n SetAccesorCannotHaveOptionalParameter:\n \"A 'set' accessor cannot have an optional parameter.\",\n SetAccesorCannotHaveRestParameter:\n \"A 'set' accessor cannot have rest parameter.\",\n SetAccesorCannotHaveReturnType:\n \"A 'set' accessor cannot have a return type annotation.\",\n SingleTypeParameterWithoutTrailingComma: ({\n typeParameterName,\n }: {\n typeParameterName: string;\n }) =>\n `Single type parameter ${typeParameterName} should have a trailing comma. Example usage: <${typeParameterName},>.`,\n StaticBlockCannotHaveModifier:\n \"Static class blocks cannot have any modifier.\",\n TupleOptionalAfterType:\n \"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).\",\n TypeAnnotationAfterAssign:\n \"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.\",\n TypeImportCannotSpecifyDefaultAndNamed:\n \"A type-only import can specify a default import or named bindings, but not both.\",\n TypeModifierIsUsedInTypeExports:\n \"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.\",\n TypeModifierIsUsedInTypeImports:\n \"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.\",\n UnexpectedParameterModifier:\n \"A parameter property is only allowed in a constructor implementation.\",\n UnexpectedReadonly:\n \"'readonly' type modifier is only permitted on array and tuple literal types.\",\n UnexpectedTypeAnnotation: \"Did not expect a type annotation here.\",\n UnexpectedTypeCastInParameter: \"Unexpected type cast in parameter position.\",\n UnsupportedImportTypeArgument:\n \"Argument in a type import must be a string literal.\",\n UnsupportedParameterPropertyKind:\n \"A parameter property may not be declared using a binding pattern.\",\n UnsupportedSignatureParameterKind: ({ type }: { type: string }) =>\n `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.`,\n});\n\n/* eslint-disable sort-keys */\n\n// Doesn't handle \"void\" or \"null\" because those are keywords, not identifiers.\n// It also doesn't handle \"intrinsic\", since usually it's not a keyword.\nfunction keywordTypeFromName(value: string): N.TsKeywordTypeType | undefined {\n switch (value) {\n case \"any\":\n return \"TSAnyKeyword\";\n case \"boolean\":\n return \"TSBooleanKeyword\";\n case \"bigint\":\n return \"TSBigIntKeyword\";\n case \"never\":\n return \"TSNeverKeyword\";\n case \"number\":\n return \"TSNumberKeyword\";\n case \"object\":\n return \"TSObjectKeyword\";\n case \"string\":\n return \"TSStringKeyword\";\n case \"symbol\":\n return \"TSSymbolKeyword\";\n case \"undefined\":\n return \"TSUndefinedKeyword\";\n case \"unknown\":\n return \"TSUnknownKeyword\";\n default:\n return undefined;\n }\n}\n\nfunction tsIsAccessModifier(modifier: string): modifier is N.Accessibility {\n return (\n modifier === \"private\" || modifier === \"public\" || modifier === \"protected\"\n );\n}\n\nfunction tsIsVarianceAnnotations(\n modifier: string,\n): modifier is N.VarianceAnnotations {\n return modifier === \"in\" || modifier === \"out\";\n}\n\ntype ClassWithMixin<\n T extends new (...args: any) => any,\n M extends object,\n> = T extends new (...args: infer P) => infer I\n ? new (...args: P) => I & M\n : never;\n\nexport default (superClass: ClassWithMixin<typeof Parser, IJSXParserMixin>) =>\n class TypeScriptParserMixin extends superClass implements Parser {\n getScopeHandler(): {\n new (...args: any): TypeScriptScopeHandler;\n } {\n return TypeScriptScopeHandler;\n }\n\n tsIsIdentifier(): boolean {\n // TODO: actually a bit more complex in TypeScript, but shouldn't matter.\n // See https://github.com/Microsoft/TypeScript/issues/15008\n return tokenIsIdentifier(this.state.type);\n }\n\n tsTokenCanFollowModifier() {\n return (\n (this.match(tt.bracketL) ||\n this.match(tt.braceL) ||\n this.match(tt.star) ||\n this.match(tt.ellipsis) ||\n this.match(tt.privateName) ||\n this.isLiteralPropertyName()) &&\n !this.hasPrecedingLineBreak()\n );\n }\n\n 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 @babel/parser itself. And \"static\".\n // TODO: Would be nice to avoid lookahead. Want a hasLineBreakUpNext() method...\n this.next();\n return this.tsTokenCanFollowModifier();\n }\n\n /** Parses a modifier matching one the given modifier names. */\n tsParseModifier<T extends TsModifier>(\n allowedModifiers: T[],\n stopOnStartOfClassStaticBlock?: boolean,\n ): T | undefined | null {\n if (\n !tokenIsIdentifier(this.state.type) &&\n this.state.type !== tt._in &&\n this.state.type !== tt._const\n ) {\n return undefined;\n }\n\n const modifier = this.state.value;\n if (allowedModifiers.indexOf(modifier) !== -1) {\n if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) {\n return undefined;\n }\n if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) {\n return modifier;\n }\n }\n return undefined;\n }\n\n /** Parses a list of modifiers, in any order.\n * If you need a specific order, you must call this function multiple times:\n * this.tsParseModifiers({ modified: node, allowedModifiers: [\"public\"] });\n * this.tsParseModifiers({ modified: node, allowedModifiers: [\"abstract\", \"readonly\"] });\n */\n tsParseModifiers<N extends ModifierBase>(\n {\n allowedModifiers,\n disallowedModifiers,\n stopOnStartOfClassStaticBlock,\n errorTemplate = TSErrors.InvalidModifierOnTypeMember,\n }: {\n allowedModifiers: readonly TsModifier[];\n disallowedModifiers?: TsModifier[];\n stopOnStartOfClassStaticBlock?: boolean;\n errorTemplate?: typeof TSErrors.InvalidModifierOnTypeMember;\n },\n modified: N,\n ): void {\n const enforceOrder = (\n loc: Position,\n modifier: TsModifier,\n before: TsModifier,\n after: TsModifier,\n ) => {\n if (modifier === before && modified[after]) {\n this.raise(TSErrors.InvalidModifiersOrder, {\n at: loc,\n orderedModifiers: [before, after],\n });\n }\n };\n const incompatible = (\n loc: Position,\n modifier: TsModifier,\n mod1: TsModifier,\n mod2: TsModifier,\n ) => {\n if (\n (modified[mod1] && modifier === mod2) ||\n (modified[mod2] && modifier === mod1)\n ) {\n this.raise(TSErrors.IncompatibleModifiers, {\n at: loc,\n modifiers: [mod1, mod2],\n });\n }\n };\n\n for (;;) {\n const { startLoc } = this.state;\n const modifier: TsModifier | undefined | null = this.tsParseModifier(\n allowedModifiers.concat(disallowedModifiers ?? []),\n stopOnStartOfClassStaticBlock,\n );\n\n if (!modifier) break;\n\n if (tsIsAccessModifier(modifier)) {\n if (modified.accessibility) {\n this.raise(TSErrors.DuplicateAccessibilityModifier, {\n at: startLoc,\n modifier,\n });\n } else {\n enforceOrder(startLoc, modifier, modifier, \"override\");\n enforceOrder(startLoc, modifier, modifier, \"static\");\n enforceOrder(startLoc, modifier, modifier, \"readonly\");\n\n modified.accessibility = modifier;\n }\n } else if (tsIsVarianceAnnotations(modifier)) {\n if (modified[modifier]) {\n this.raise(TSErrors.DuplicateModifier, { at: startLoc, modifier });\n }\n modified[modifier] = true;\n\n enforceOrder(startLoc, modifier, \"in\", \"out\");\n } else {\n if (Object.hasOwnProperty.call(modified, modifier)) {\n this.raise(TSErrors.DuplicateModifier, { at: startLoc, modifier });\n } else {\n enforceOrder(startLoc, modifier, \"static\", \"readonly\");\n enforceOrder(startLoc, modifier, \"static\", \"override\");\n enforceOrder(startLoc, modifier, \"override\", \"readonly\");\n enforceOrder(startLoc, modifier, \"abstract\", \"override\");\n\n incompatible(startLoc, modifier, \"declare\", \"override\");\n incompatible(startLoc, modifier, \"static\", \"abstract\");\n }\n modified[modifier] = true;\n }\n\n if (disallowedModifiers?.includes(modifier)) {\n this.raise(errorTemplate, {\n at: startLoc,\n modifier,\n });\n }\n }\n }\n\n tsIsListTerminator(kind: ParsingContext): boolean {\n switch (kind) {\n case \"EnumMembers\":\n case \"TypeMembers\":\n return this.match(tt.braceR);\n case \"HeritageClauseElement\":\n return this.match(tt.braceL);\n case \"TupleElementTypes\":\n return this.match(tt.bracketR);\n case \"TypeParametersOrArguments\":\n return this.match(tt.gt);\n }\n }\n\n tsParseList<T extends N.Node>(\n kind: ParsingContext,\n parseElement: () => T,\n ): T[] {\n const result: T[] = [];\n while (!this.tsIsListTerminator(kind)) {\n // Skipping \"parseListElement\" from the TS source since that's just for error handling.\n result.push(parseElement());\n }\n return result;\n }\n\n tsParseDelimitedList<T extends N.Node>(\n kind: ParsingContext,\n parseElement: () => T,\n refTrailingCommaPos?: {\n value: number;\n },\n ): T[] {\n return nonNull(\n this.tsParseDelimitedListWorker(\n kind,\n parseElement,\n /* expectSuccess */ true,\n refTrailingCommaPos,\n ),\n );\n }\n\n /**\n * If !expectSuccess, returns undefined instead of failing to parse.\n * If expectSuccess, parseElement should always return a defined value.\n */\n tsParseDelimitedListWorker<T extends N.Node>(\n kind: ParsingContext,\n parseElement: () => T | undefined | null,\n expectSuccess: boolean,\n refTrailingCommaPos?: {\n value: number;\n },\n ): T[] | undefined | null {\n const result = [];\n let trailingCommaPos = -1;\n\n for (;;) {\n if (this.tsIsListTerminator(kind)) {\n break;\n }\n trailingCommaPos = -1;\n\n const element = parseElement();\n if (element == null) {\n return undefined;\n }\n result.push(element);\n\n if (this.eat(tt.comma)) {\n trailingCommaPos = this.state.lastTokStart;\n continue;\n }\n\n if (this.tsIsListTerminator(kind)) {\n break;\n }\n\n if (expectSuccess) {\n // This will fail with an error about a missing comma\n this.expect(tt.comma);\n }\n return undefined;\n }\n\n if (refTrailingCommaPos) {\n refTrailingCommaPos.value = trailingCommaPos;\n }\n\n return result;\n }\n\n tsParseBracketedList<T extends N.Node>(\n kind: ParsingContext,\n parseElement: () => T,\n bracket: boolean,\n skipFirstToken: boolean,\n refTrailingCommaPos?: {\n value: number;\n },\n ): T[] {\n if (!skipFirstToken) {\n if (bracket) {\n this.expect(tt.bracketL);\n } else {\n this.expect(tt.lt);\n }\n }\n\n const result = this.tsParseDelimitedList(\n kind,\n parseElement,\n refTrailingCommaPos,\n );\n\n if (bracket) {\n this.expect(tt.bracketR);\n } else {\n this.expect(tt.gt);\n }\n\n return result;\n }\n\n tsParseImportType(): N.TsImportType {\n const node = this.startNode<N.TsImportType>();\n this.expect(tt._import);\n this.expect(tt.parenL);\n if (!this.match(tt.string)) {\n this.raise(TSErrors.UnsupportedImportTypeArgument, {\n at: this.state.startLoc,\n });\n }\n\n // For compatibility to estree we cannot call parseLiteral directly here\n node.argument = super.parseExprAtom() as N.StringLiteral;\n this.expect(tt.parenR);\n\n if (this.eat(tt.dot)) {\n // In this instance, the entity name will actually itself be a\n // qualifier, so allow it to be a reserved word as well.\n node.qualifier = this.tsParseEntityName();\n }\n if (this.match(tt.lt)) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n return this.finishNode(node, \"TSImportType\");\n }\n\n tsParseEntityName(allowReservedWords: boolean = true): N.TsEntityName {\n let entity: N.TsEntityName = this.parseIdentifier(allowReservedWords);\n while (this.eat(tt.dot)) {\n const node: Undone<N.TsQualifiedName> =\n this.startNodeAtNode<N.TsQualifiedName>(entity);\n node.left = entity;\n node.right = this.parseIdentifier(allowReservedWords);\n entity = this.finishNode(node, \"TSQualifiedName\");\n }\n return entity;\n }\n\n tsParseTypeReference(): N.TsTypeReference {\n const node = this.startNode<N.TsTypeReference>();\n node.typeName = this.tsParseEntityName();\n if (!this.hasPrecedingLineBreak() && this.match(tt.lt)) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n return this.finishNode(node, \"TSTypeReference\");\n }\n\n tsParseThisTypePredicate(lhs: N.TsThisType): N.TsTypePredicate {\n this.next();\n const node = this.startNodeAtNode<N.TsTypePredicate>(lhs);\n node.parameterName = lhs;\n node.typeAnnotation = this.tsParseTypeAnnotation(/* eatColon */ false);\n node.asserts = false;\n return this.finishNode(node, \"TSTypePredicate\");\n }\n\n tsParseThisTypeNode(): N.TsThisType {\n const node = this.startNode<N.TsThisType>();\n this.next();\n return this.finishNode(node, \"TSThisType\");\n }\n\n tsParseTypeQuery(): N.TsTypeQuery {\n const node = this.startNode<N.TsTypeQuery>();\n this.expect(tt._typeof);\n if (this.match(tt._import)) {\n node.exprName = this.tsParseImportType();\n } else {\n node.exprName = this.tsParseEntityName();\n }\n if (!this.hasPrecedingLineBreak() && this.match(tt.lt)) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n return this.finishNode(node, \"TSTypeQuery\");\n }\n\n tsParseInOutModifiers = this.tsParseModifiers.bind(this, {\n allowedModifiers: [\"in\", \"out\"],\n disallowedModifiers: [\n \"const\",\n \"public\",\n \"private\",\n \"protected\",\n \"readonly\",\n \"declare\",\n \"abstract\",\n \"override\",\n ],\n errorTemplate: TSErrors.InvalidModifierOnTypeParameter,\n });\n\n tsParseConstModifier = this.tsParseModifiers.bind(this, {\n allowedModifiers: [\"const\"],\n // for better error recovery\n disallowedModifiers: [\"in\", \"out\"],\n errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions,\n });\n\n tsParseInOutConstModifiers = this.tsParseModifiers.bind(this, {\n allowedModifiers: [\"in\", \"out\", \"const\"],\n disallowedModifiers: [\n \"public\",\n \"private\",\n \"protected\",\n \"readonly\",\n \"declare\",\n \"abstract\",\n \"override\",\n ],\n errorTemplate: TSErrors.InvalidModifierOnTypeParameter,\n });\n\n tsParseTypeParameter(\n parseModifiers: (node: Undone<N.TsTypeParameter>) => void,\n ): N.TsTypeParameter {\n const node = this.startNode<N.TsTypeParameter>();\n\n parseModifiers(node);\n\n node.name = this.tsParseTypeParameterName();\n node.constraint = this.tsEatThenParseType(tt._extends);\n node.default = this.tsEatThenParseType(tt.eq);\n return this.finishNode(node, \"TSTypeParameter\");\n }\n\n tsTryParseTypeParameters(\n parseModifiers: (node: N.TsTypeParameter) => void,\n ): N.TsTypeParameterDeclaration | undefined | null {\n if (this.match(tt.lt)) {\n return this.tsParseTypeParameters(parseModifiers);\n }\n }\n\n tsParseTypeParameters(parseModifiers: (node: N.TsTypeParameter) => void) {\n const node = this.startNode<N.TsTypeParameterDeclaration>();\n\n if (this.match(tt.lt) || this.match(tt.jsxTagStart)) {\n this.next();\n } else {\n this.unexpected();\n }\n\n const refTrailingCommaPos = { value: -1 };\n\n node.params = this.tsParseBracketedList(\n \"TypeParametersOrArguments\",\n // @ts-expect-error refine typings\n this.tsParseTypeParameter.bind(this, parseModifiers),\n /* bracket */ false,\n /* skipFirstToken */ true,\n refTrailingCommaPos,\n );\n if (node.params.length === 0) {\n this.raise(TSErrors.EmptyTypeParameters, { at: node });\n }\n if (refTrailingCommaPos.value !== -1) {\n this.addExtra(node, \"trailingComma\", refTrailingCommaPos.value);\n }\n return this.finishNode(node, \"TSTypeParameterDeclaration\");\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.\n tsFillSignature(\n returnToken: TokenType,\n signature: Undone<N.TsSignatureDeclaration>,\n ): void {\n // Arrow fns *must* have return token (`=>`). Normal functions can omit it.\n const returnTokenRequired = returnToken === tt.arrow;\n\n // https://github.com/babel/babel/issues/9231\n const paramsKey = process.env.BABEL_8_BREAKING ? \"params\" : \"parameters\";\n const returnTypeKey = process.env.BABEL_8_BREAKING\n ? \"returnType\"\n : \"typeAnnotation\";\n\n signature.typeParameters = this.tsTryParseTypeParameters(\n this.tsParseConstModifier,\n );\n this.expect(tt.parenL);\n signature[paramsKey] = this.tsParseBindingListForSignature();\n if (returnTokenRequired) {\n signature[returnTypeKey] =\n this.tsParseTypeOrTypePredicateAnnotation(returnToken);\n } else if (this.match(returnToken)) {\n signature[returnTypeKey] =\n this.tsParseTypeOrTypePredicateAnnotation(returnToken);\n }\n }\n\n tsParseBindingListForSignature(): Array<\n N.Identifier | N.RestElement | N.ObjectPattern | N.ArrayPattern\n > {\n const list = super.parseBindingList(\n tt.parenR,\n charCodes.rightParenthesis,\n ParseBindingListFlags.IS_FUNCTION_PARAMS,\n );\n for (const pattern of list) {\n const { type } = pattern;\n if (type === \"AssignmentPattern\" || type === \"TSParameterProperty\") {\n this.raise(TSErrors.UnsupportedSignatureParameterKind, {\n at: pattern,\n type,\n });\n }\n }\n return list as Exclude<\n (typeof list)[0],\n N.AssignmentPattern | N.TSParameterProperty\n >[];\n }\n\n tsParseTypeMemberSemicolon(): void {\n if (!this.eat(tt.comma) && !this.isLineTerminator()) {\n this.expect(tt.semi);\n }\n }\n\n tsParseSignatureMember(\n kind: \"TSCallSignatureDeclaration\" | \"TSConstructSignatureDeclaration\",\n node: Undone<\n N.TsCallSignatureDeclaration | N.TsConstructSignatureDeclaration\n >,\n ): N.TsCallSignatureDeclaration | N.TsConstructSignatureDeclaration {\n this.tsFillSignature(tt.colon, node);\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(node, kind);\n }\n\n tsIsUnambiguouslyIndexSignature() {\n this.next(); // Skip '{'\n if (tokenIsIdentifier(this.state.type)) {\n this.next();\n return this.match(tt.colon);\n }\n return false;\n }\n\n tsTryParseIndexSignature(\n node: Undone<N.TsIndexSignature>,\n ): N.TsIndexSignature | undefined {\n if (\n !(\n this.match(tt.bracketL) &&\n this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))\n )\n ) {\n return;\n }\n\n this.expect(tt.bracketL);\n const id = this.parseIdentifier();\n id.typeAnnotation = this.tsParseTypeAnnotation();\n this.resetEndLocation(id); // set end position to end of type\n\n this.expect(tt.bracketR);\n node.parameters = [id];\n\n const type = this.tsTryParseTypeAnnotation();\n if (type) node.typeAnnotation = type;\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(node, \"TSIndexSignature\");\n }\n\n tsParsePropertyOrMethodSignature(\n node: N.TsPropertySignature | N.TsMethodSignature,\n readonly: boolean,\n ): N.TsPropertySignature | N.TsMethodSignature {\n if (this.eat(tt.question)) node.optional = true;\n const nodeAny: any = node;\n\n if (this.match(tt.parenL) || this.match(tt.lt)) {\n if (readonly) {\n this.raise(TSErrors.ReadonlyForMethodSignature, { at: node });\n }\n const method: N.TsMethodSignature = nodeAny;\n if (method.kind && this.match(tt.lt)) {\n this.raise(TSErrors.AccesorCannotHaveTypeParameters, {\n at: this.state.curPosition(),\n });\n }\n this.tsFillSignature(tt.colon, method);\n this.tsParseTypeMemberSemicolon();\n const paramsKey = process.env.BABEL_8_BREAKING\n ? \"params\"\n : \"parameters\";\n const returnTypeKey = process.env.BABEL_8_BREAKING\n ? \"returnType\"\n : \"typeAnnotation\";\n if (method.kind === \"get\") {\n if (method[paramsKey].length > 0) {\n this.raise(Errors.BadGetterArity, { at: this.state.curPosition() });\n if (this.isThisParam(method[paramsKey][0])) {\n this.raise(TSErrors.AccesorCannotDeclareThisParameter, {\n at: this.state.curPosition(),\n });\n }\n }\n } else if (method.kind === \"set\") {\n if (method[paramsKey].length !== 1) {\n this.raise(Errors.BadSetterArity, { at: this.state.curPosition() });\n } else {\n const firstParameter = method[paramsKey][0];\n if (this.isThisParam(firstParameter)) {\n this.raise(TSErrors.AccesorCannotDeclareThisParameter, {\n at: this.state.curPosition(),\n });\n }\n if (\n firstParameter.type === \"Identifier\" &&\n firstParameter.optional\n ) {\n this.raise(TSErrors.SetAccesorCannotHaveOptionalParameter, {\n at: this.state.curPosition(),\n });\n }\n if (firstParameter.type === \"RestElement\") {\n this.raise(TSErrors.SetAccesorCannotHaveRestParameter, {\n at: this.state.curPosition(),\n });\n }\n }\n if (method[returnTypeKey]) {\n this.raise(TSErrors.SetAccesorCannotHaveReturnType, {\n at: method[returnTypeKey],\n });\n }\n } else {\n method.kind = \"method\";\n }\n return this.finishNode(method, \"TSMethodSignature\");\n } else {\n const property: N.TsPropertySignature = nodeAny;\n if (readonly) property.readonly = true;\n const type = this.tsTryParseTypeAnnotation();\n if (type) property.typeAnnotation = type;\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(property, \"TSPropertySignature\");\n }\n }\n\n tsParseTypeMember(): N.TsTypeElement {\n const node: any = this.startNode();\n\n if (this.match(tt.parenL) || this.match(tt.lt)) {\n return this.tsParseSignatureMember(\"TSCallSignatureDeclaration\", node);\n }\n\n if (this.match(tt._new)) {\n const id = this.startNode<N.Identifier>();\n this.next();\n if (this.match(tt.parenL) || this.match(tt.lt)) {\n return this.tsParseSignatureMember(\n \"TSConstructSignatureDeclaration\",\n node,\n );\n } else {\n node.key = this.createIdentifier(id, \"new\");\n return this.tsParsePropertyOrMethodSignature(node, false);\n }\n }\n\n this.tsParseModifiers(\n {\n allowedModifiers: [\"readonly\"],\n disallowedModifiers: [\n \"declare\",\n \"abstract\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"override\",\n ],\n },\n node,\n );\n\n const idx = this.tsTryParseIndexSignature(node);\n if (idx) {\n return idx;\n }\n\n super.parsePropertyName(node);\n if (\n !node.computed &&\n node.key.type === \"Identifier\" &&\n (node.key.name === \"get\" || node.key.name === \"set\") &&\n this.tsTokenCanFollowModifier()\n ) {\n node.kind = node.key.name;\n super.parsePropertyName(node);\n }\n return this.tsParsePropertyOrMethodSignature(node, !!node.readonly);\n }\n\n tsParseTypeLiteral(): N.TsTypeLiteral {\n const node = this.startNode<N.TsTypeLiteral>();\n node.members = this.tsParseObjectTypeMembers();\n return this.finishNode(node, \"TSTypeLiteral\");\n }\n\n tsParseObjectTypeMembers(): Array<N.TsTypeElement> {\n this.expect(tt.braceL);\n const members = this.tsParseList(\n \"TypeMembers\",\n this.tsParseTypeMember.bind(this),\n );\n this.expect(tt.braceR);\n return members;\n }\n\n tsIsStartOfMappedType(): boolean {\n this.next();\n if (this.eat(tt.plusMin)) {\n return this.isContextual(tt._readonly);\n }\n if (this.isContextual(tt._readonly)) {\n this.next();\n }\n if (!this.match(tt.bracketL)) {\n return false;\n }\n this.next();\n if (!this.tsIsIdentifier()) {\n return false;\n }\n this.next();\n return this.match(tt._in);\n }\n\n tsParseMappedTypeParameter(): N.TsTypeParameter {\n const node = this.startNode<N.TsTypeParameter>();\n node.name = this.tsParseTypeParameterName();\n node.constraint = this.tsExpectThenParseType(tt._in);\n return this.finishNode(node, \"TSTypeParameter\");\n }\n\n tsParseMappedType(): N.TsMappedType {\n const node = this.startNode<N.TsMappedType>();\n\n this.expect(tt.braceL);\n\n if (this.match(tt.plusMin)) {\n node.readonly = this.state.value;\n this.next();\n this.expectContextual(tt._readonly);\n } else if (this.eatContextual(tt._readonly)) {\n node.readonly = true;\n }\n\n this.expect(tt.bracketL);\n node.typeParameter = this.tsParseMappedTypeParameter();\n node.nameType = this.eatContextual(tt._as) ? this.tsParseType() : null;\n\n this.expect(tt.bracketR);\n\n if (this.match(tt.plusMin)) {\n node.optional = this.state.value;\n this.next();\n this.expect(tt.question);\n } else if (this.eat(tt.question)) {\n node.optional = true;\n }\n\n node.typeAnnotation = this.tsTryParseType();\n this.semicolon();\n this.expect(tt.braceR);\n\n return this.finishNode(node, \"TSMappedType\");\n }\n\n tsParseTupleType(): N.TsTupleType {\n const node = this.startNode<N.TsTupleType>();\n node.elementTypes = this.tsParseBracketedList(\n \"TupleElementTypes\",\n this.tsParseTupleElementType.bind(this),\n /* bracket */ true,\n /* skipFirstToken */ false,\n );\n\n // Validate the elementTypes to ensure that no mandatory elements\n // follow optional elements\n let seenOptionalElement = false;\n let labeledElements: boolean | null = null;\n node.elementTypes.forEach(elementNode => {\n const { type } = elementNode;\n\n if (\n seenOptionalElement &&\n type !== \"TSRestType\" &&\n type !== \"TSOptionalType\" &&\n !(type === \"TSNamedTupleMember\" && elementNode.optional)\n ) {\n this.raise(TSErrors.OptionalTypeBeforeRequired, {\n at: elementNode,\n });\n }\n\n seenOptionalElement ||=\n (type === \"TSNamedTupleMember\" && elementNode.optional) ||\n type === \"TSOptionalType\";\n\n // When checking labels, check the argument of the spread operator\n let checkType = type;\n if (type === \"TSRestType\") {\n elementNode = elementNode.typeAnnotation;\n checkType = elementNode.type;\n }\n\n const isLabeled = checkType === \"TSNamedTupleMember\";\n labeledElements ??= isLabeled;\n if (labeledElements !== isLabeled) {\n this.raise(TSErrors.MixedLabeledAndUnlabeledElements, {\n at: elementNode,\n });\n }\n });\n\n return this.finishNode(node, \"TSTupleType\");\n }\n\n tsParseTupleElementType(): N.TsNamedTupleMember | N.TsType {\n // parses `...TsType[]`\n\n const { startLoc } = this.state;\n\n const rest = this.eat(tt.ellipsis);\n\n let labeled: boolean;\n let label: N.Identifier;\n let optional: boolean;\n let type: N.TsNamedTupleMember | N.TsType;\n\n const isWord = tokenIsKeywordOrIdentifier(this.state.type);\n const chAfterWord = isWord ? this.lookaheadCharCode() : null;\n if (chAfterWord === charCodes.colon) {\n labeled = true;\n optional = false;\n label = this.parseIdentifier(true);\n this.expect(tt.colon);\n type = this.tsParseType();\n } else if (chAfterWord === charCodes.questionMark) {\n optional = true;\n const startLoc = this.state.startLoc;\n const wordName = this.state.value;\n const typeOrLabel = this.tsParseNonArrayType();\n\n if (this.lookaheadCharCode() === charCodes.colon) {\n labeled = true;\n label = this.createIdentifier(\n this.startNodeAt<N.Identifier>(startLoc),\n wordName,\n );\n this.expect(tt.question);\n this.expect(tt.colon);\n type = this.tsParseType();\n } else {\n labeled = false;\n type = typeOrLabel;\n this.expect(tt.question);\n }\n } else {\n type = this.tsParseType();\n optional = this.eat(tt.question);\n // In this case (labeled === true) could be only in invalid label.\n // E.g. [x.y:type]\n // An error is raised while processing node.\n labeled = this.eat(tt.colon);\n }\n\n if (labeled) {\n let labeledNode: Undone<N.TsNamedTupleMember>;\n if (label) {\n labeledNode = this.startNodeAtNode<N.TsNamedTupleMember>(label);\n labeledNode.optional = optional;\n labeledNode.label = label;\n labeledNode.elementType = type;\n\n if (this.eat(tt.question)) {\n labeledNode.optional = true;\n this.raise(TSErrors.TupleOptionalAfterType, {\n at: this.state.lastTokStartLoc,\n });\n }\n } else {\n labeledNode = this.startNodeAtNode<N.TsNamedTupleMember>(type);\n labeledNode.optional = optional;\n this.raise(TSErrors.InvalidTupleMemberLabel, { at: type });\n // @ts-expect-error This produces an invalid AST, but at least we don't drop\n // nodes representing the invalid source.\n labeledNode.label = type;\n labeledNode.elementType = this.tsParseType();\n }\n type = this.finishNode(labeledNode, \"TSNamedTupleMember\");\n } else if (optional) {\n const optionalTypeNode = this.startNodeAtNode<N.TsOptionalType>(type);\n optionalTypeNode.typeAnnotation = type;\n type = this.finishNode(optionalTypeNode, \"TSOptionalType\");\n }\n\n if (rest) {\n const restNode = this.startNodeAt<N.TsRestType>(startLoc);\n restNode.typeAnnotation = type;\n type = this.finishNode(restNode, \"TSRestType\");\n }\n\n return type;\n }\n\n tsParseParenthesizedType(): N.TsParenthesizedType {\n const node = this.startNode<N.TsParenthesizedType>();\n this.expect(tt.parenL);\n node.typeAnnotation = this.tsParseType();\n this.expect(tt.parenR);\n return this.finishNode(node, \"TSParenthesizedType\");\n }\n\n tsParseFunctionOrConstructorType(\n type: \"TSFunctionType\" | \"TSConstructorType\",\n abstract?: boolean,\n ): N.TsFunctionOrConstructorType {\n const node = this.startNode<\n N.TsFunctionOrConstructorType | N.TsConstructorType\n >();\n if (type === \"TSConstructorType\") {\n (node as Undone<N.TsConstructorType>).abstract = !!abstract;\n if (abstract) this.next();\n this.next(); // eat `new`\n }\n this.tsInAllowConditionalTypesContext(() =>\n this.tsFillSignature(tt.arrow, node),\n );\n return this.finishNode(node, type);\n }\n\n tsParseLiteralTypeNode(): N.TsLiteralType {\n const node = this.startNode<N.TsLiteralType>();\n switch (this.state.type) {\n case tt.num:\n case tt.bigint:\n case tt.string:\n case tt._true:\n case tt._false:\n // For compatibility to estree we cannot call parseLiteral directly here\n // @ts-expect-error refine typings\n node.literal = super.parseExprAtom();\n break;\n default:\n this.unexpected();\n }\n return this.finishNode(node, \"TSLiteralType\");\n }\n\n tsParseTemplateLiteralType(): N.TsType {\n const node = this.startNode<N.TsLiteralType>();\n node.literal = super.parseTemplate(false);\n return this.finishNode(node, \"TSLiteralType\");\n }\n\n parseTemplateSubstitution(): N.TsType | N.Node {\n if (this.state.inType) return this.tsParseType();\n return super.parseTemplateSubstitution();\n }\n\n tsParseThisTypeOrThisTypePredicate(): N.TsThisType | N.TsTypePredicate {\n const thisKeyword = this.tsParseThisTypeNode();\n if (this.isContextual(tt._is) && !this.hasPrecedingLineBreak()) {\n return this.tsParseThisTypePredicate(thisKeyword);\n } else {\n return thisKeyword;\n }\n }\n\n tsParseNonArrayType(): N.TsType {\n switch (this.state.type) {\n case tt.string:\n case tt.num:\n case tt.bigint:\n case tt._true:\n case tt._false:\n return this.tsParseLiteralTypeNode();\n case tt.plusMin:\n if (this.state.value === \"-\") {\n const node = this.startNode<N.TsLiteralType>();\n const nextToken = this.lookahead();\n if (nextToken.type !== tt.num && nextToken.type !== tt.bigint) {\n this.unexpected();\n }\n // @ts-expect-error: parseMaybeUnary must returns unary expression\n node.literal = this.parseMaybeUnary();\n return this.finishNode(node, \"TSLiteralType\");\n }\n break;\n case tt._this:\n return this.tsParseThisTypeOrThisTypePredicate();\n case tt._typeof:\n return this.tsParseTypeQuery();\n case tt._import:\n return this.tsParseImportType();\n case tt.braceL:\n return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))\n ? this.tsParseMappedType()\n : this.tsParseTypeLiteral();\n case tt.bracketL:\n return this.tsParseTupleType();\n case tt.parenL:\n if (process.env.BABEL_8_BREAKING) {\n if (!this.options.createParenthesizedExpressions) {\n const startLoc = this.state.startLoc;\n this.next();\n const type = this.tsParseType();\n this.expect(tt.parenR);\n this.addExtra(type, \"parenthesized\", true);\n this.addExtra(type, \"parenStart\", startLoc.index);\n return type;\n }\n }\n\n return this.tsParseParenthesizedType();\n case tt.templateNonTail:\n case tt.templateTail:\n return this.tsParseTemplateLiteralType();\n default: {\n const { type } = this.state;\n if (\n tokenIsIdentifier(type) ||\n type === tt._void ||\n type === tt._null\n ) {\n const nodeType =\n type === tt._void\n ? \"TSVoidKeyword\"\n : type === tt._null\n ? \"TSNullKeyword\"\n : keywordTypeFromName(this.state.value);\n if (\n nodeType !== undefined &&\n this.lookaheadCharCode() !== charCodes.dot\n ) {\n const node = this.startNode<N.TsKeywordType>();\n this.next();\n return this.finishNode(node, nodeType);\n }\n return this.tsParseTypeReference();\n }\n }\n }\n\n this.unexpected();\n }\n\n tsParseArrayTypeOrHigher(): N.TsType {\n let type = this.tsParseNonArrayType();\n while (!this.hasPrecedingLineBreak() && this.eat(tt.bracketL)) {\n if (this.match(tt.bracketR)) {\n const node = this.startNodeAtNode<N.TsArrayType>(type);\n node.elementType = type;\n this.expect(tt.bracketR);\n type = this.finishNode(node, \"TSArrayType\");\n } else {\n const node = this.startNodeAtNode<N.TsIndexedAccessType>(type);\n node.objectType = type;\n node.indexType = this.tsParseType();\n this.expect(tt.bracketR);\n type = this.finishNode(node, \"TSIndexedAccessType\");\n }\n }\n return type;\n }\n\n tsParseTypeOperator(): N.TsTypeOperator {\n const node = this.startNode<N.TsTypeOperator>();\n const operator = this.state.value;\n this.next(); // eat operator\n node.operator = operator;\n node.typeAnnotation = this.tsParseTypeOperatorOrHigher();\n\n if (operator === \"readonly\") {\n this.tsCheckTypeAnnotationForReadOnly(\n // @ts-expect-error todo(flow->ts)\n node,\n );\n }\n\n return this.finishNode(node, \"TSTypeOperator\");\n }\n\n tsCheckTypeAnnotationForReadOnly(node: N.Node) {\n switch (node.typeAnnotation.type) {\n case \"TSTupleType\":\n case \"TSArrayType\":\n return;\n default:\n this.raise(TSErrors.UnexpectedReadonly, { at: node });\n }\n }\n\n tsParseInferType(): N.TsInferType {\n const node = this.startNode<N.TsInferType>();\n this.expectContextual(tt._infer);\n const typeParameter = this.startNode<N.TsTypeParameter>();\n typeParameter.name = this.tsParseTypeParameterName();\n typeParameter.constraint = this.tsTryParse(() =>\n this.tsParseConstraintForInferType(),\n );\n node.typeParameter = this.finishNode(typeParameter, \"TSTypeParameter\");\n return this.finishNode(node, \"TSInferType\");\n }\n\n tsParseConstraintForInferType() {\n if (this.eat(tt._extends)) {\n const constraint = this.tsInDisallowConditionalTypesContext(() =>\n this.tsParseType(),\n );\n if (\n this.state.inDisallowConditionalTypesContext ||\n !this.match(tt.question)\n ) {\n return constraint;\n }\n }\n }\n\n tsParseTypeOperatorOrHigher(): N.TsType {\n const isTypeOperator =\n tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc;\n return isTypeOperator\n ? this.tsParseTypeOperator()\n : this.isContextual(tt._infer)\n ? this.tsParseInferType()\n : this.tsInAllowConditionalTypesContext(() =>\n this.tsParseArrayTypeOrHigher(),\n );\n }\n\n tsParseUnionOrIntersectionType(\n kind: \"TSUnionType\" | \"TSIntersectionType\",\n parseConstituentType: () => N.TsType,\n operator: TokenType,\n ): N.TsType {\n const node = this.startNode<N.TsUnionType | N.TsIntersectionType>();\n const hasLeadingOperator = this.eat(operator);\n const types = [];\n do {\n types.push(parseConstituentType());\n } while (this.eat(operator));\n if (types.length === 1 && !hasLeadingOperator) {\n return types[0];\n }\n node.types = types;\n return this.finishNode(node, kind);\n }\n\n tsParseIntersectionTypeOrHigher(): N.TsType {\n return this.tsParseUnionOrIntersectionType(\n \"TSIntersectionType\",\n this.tsParseTypeOperatorOrHigher.bind(this),\n tt.bitwiseAND,\n );\n }\n\n tsParseUnionTypeOrHigher() {\n return this.tsParseUnionOrIntersectionType(\n \"TSUnionType\",\n this.tsParseIntersectionTypeOrHigher.bind(this),\n tt.bitwiseOR,\n );\n }\n\n tsIsStartOfFunctionType() {\n if (this.match(tt.lt)) {\n return true;\n }\n return (\n this.match(tt.parenL) &&\n this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))\n );\n }\n\n tsSkipParameterStart(): boolean {\n if (tokenIsIdentifier(this.state.type) || this.match(tt._this)) {\n this.next();\n return true;\n }\n\n if (this.match(tt.braceL)) {\n // Return true if we can parse an object pattern without errors\n const { errors } = this.state;\n const previousErrorCount = errors.length;\n try {\n this.parseObjectLike(tt.braceR, true);\n return errors.length === previousErrorCount;\n } catch {\n return false;\n }\n }\n\n if (this.match(tt.bracketL)) {\n this.next();\n // Return true if we can parse an array pattern without errors\n const { errors } = this.state;\n const previousErrorCount = errors.length;\n try {\n super.parseBindingList(\n tt.bracketR,\n charCodes.rightSquareBracket,\n ParseBindingListFlags.ALLOW_EMPTY,\n );\n return errors.length === previousErrorCount;\n } catch {\n return false;\n }\n }\n\n return false;\n }\n\n tsIsUnambiguouslyStartOfFunctionType(): boolean {\n this.next();\n if (this.match(tt.parenR) || this.match(tt.ellipsis)) {\n // ( )\n // ( ...\n return true;\n }\n if (this.tsSkipParameterStart()) {\n if (\n this.match(tt.colon) ||\n this.match(tt.comma) ||\n this.match(tt.question) ||\n this.match(tt.eq)\n ) {\n // ( xxx :\n // ( xxx ,\n // ( xxx ?\n // ( xxx =\n return true;\n }\n if (this.match(tt.parenR)) {\n this.next();\n if (this.match(tt.arrow)) {\n // ( xxx ) =>\n return true;\n }\n }\n }\n return false;\n }\n\n tsParseTypeOrTypePredicateAnnotation(\n returnToken: TokenType,\n ): N.TsTypeAnnotation {\n return this.tsInType(() => {\n const t = this.startNode<N.TsTypeAnnotation>();\n this.expect(returnToken);\n\n const node = this.startNode<N.TsTypePredicate>();\n\n const asserts = !!this.tsTryParse(\n this.tsParseTypePredicateAsserts.bind(this),\n );\n\n if (asserts && this.match(tt._this)) {\n // When asserts is false, thisKeyword is handled by tsParseNonArrayType\n // : asserts this is type\n let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate();\n // if it turns out to be a `TSThisType`, wrap it with `TSTypePredicate`\n // : asserts this\n if (thisTypePredicate.type === \"TSThisType\") {\n node.parameterName = thisTypePredicate;\n node.asserts = true;\n (node as N.TsTypePredicate).typeAnnotation = null;\n thisTypePredicate = this.finishNode(node, \"TSTypePredicate\");\n } else {\n this.resetStartLocationFromNode(thisTypePredicate, node);\n thisTypePredicate.asserts = true;\n }\n t.typeAnnotation = thisTypePredicate;\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n const typePredicateVariable =\n this.tsIsIdentifier() &&\n this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));\n\n if (!typePredicateVariable) {\n if (!asserts) {\n // : type\n return this.tsParseTypeAnnotation(/* eatColon */ false, t);\n }\n\n // : asserts foo\n node.parameterName = this.parseIdentifier();\n node.asserts = asserts;\n (node as N.TsTypePredicate).typeAnnotation = null;\n t.typeAnnotation = this.finishNode(node, \"TSTypePredicate\");\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n // : asserts foo is type\n const type = this.tsParseTypeAnnotation(/* eatColon */ false);\n node.parameterName = typePredicateVariable;\n node.typeAnnotation = type;\n node.asserts = asserts;\n t.typeAnnotation = this.finishNode(node, \"TSTypePredicate\");\n return this.finishNode(t, \"TSTypeAnnotation\");\n });\n }\n\n tsTryParseTypeOrTypePredicateAnnotation(): N.TsTypeAnnotation | undefined {\n if (this.match(tt.colon)) {\n return this.tsParseTypeOrTypePredicateAnnotation(tt.colon);\n }\n }\n\n tsTryParseTypeAnnotation(): N.TsTypeAnnotation | undefined {\n if (this.match(tt.colon)) {\n return this.tsParseTypeAnnotation();\n }\n }\n\n tsTryParseType(): N.TsType | undefined {\n return this.tsEatThenParseType(tt.colon);\n }\n\n tsParseTypePredicatePrefix(): N.Identifier | undefined {\n const id = this.parseIdentifier();\n if (this.isContextual(tt._is) && !this.hasPrecedingLineBreak()) {\n this.next();\n return id;\n }\n }\n\n tsParseTypePredicateAsserts(): boolean {\n if (this.state.type !== tt._asserts) {\n return false;\n }\n const containsEsc = this.state.containsEsc;\n this.next();\n if (!tokenIsIdentifier(this.state.type) && !this.match(tt._this)) {\n return false;\n }\n\n if (containsEsc) {\n this.raise(Errors.InvalidEscapedReservedWord, {\n at: this.state.lastTokStartLoc,\n reservedWord: \"asserts\",\n });\n }\n\n return true;\n }\n\n tsParseTypeAnnotation(\n eatColon = true,\n t: Undone<N.TsTypeAnnotation> = this.startNode<N.TsTypeAnnotation>(),\n ): N.TsTypeAnnotation {\n this.tsInType(() => {\n if (eatColon) this.expect(tt.colon);\n t.typeAnnotation = this.tsParseType();\n });\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n /** Be sure to be in a type context before calling this, using `tsInType`. */\n tsParseType(): N.TsType {\n // Need to set `state.inType` so that we don't parse JSX in a type context.\n assert(this.state.inType);\n const type = this.tsParseNonConditionalType();\n\n if (\n this.state.inDisallowConditionalTypesContext ||\n this.hasPrecedingLineBreak() ||\n !this.eat(tt._extends)\n ) {\n return type;\n }\n const node = this.startNodeAtNode<N.TsConditionalType>(type);\n node.checkType = type;\n\n node.extendsType = this.tsInDisallowConditionalTypesContext(() =>\n this.tsParseNonConditionalType(),\n );\n\n this.expect(tt.question);\n node.trueType = this.tsInAllowConditionalTypesContext(() =>\n this.tsParseType(),\n );\n\n this.expect(tt.colon);\n node.falseType = this.tsInAllowConditionalTypesContext(() =>\n this.tsParseType(),\n );\n\n return this.finishNode(node, \"TSConditionalType\");\n }\n\n isAbstractConstructorSignature(): boolean {\n return (\n this.isContextual(tt._abstract) && this.lookahead().type === tt._new\n );\n }\n\n tsParseNonConditionalType(): N.TsType {\n if (this.tsIsStartOfFunctionType()) {\n return this.tsParseFunctionOrConstructorType(\"TSFunctionType\");\n }\n if (this.match(tt._new)) {\n // As in `new () => Date`\n return this.tsParseFunctionOrConstructorType(\"TSConstructorType\");\n } else if (this.isAbstractConstructorSignature()) {\n // As in `abstract new () => Date`\n return this.tsParseFunctionOrConstructorType(\n \"TSConstructorType\",\n /* abstract */ true,\n );\n }\n return this.tsParseUnionTypeOrHigher();\n }\n\n tsParseTypeAssertion(): N.TsTypeAssertion {\n if (this.getPluginOption(\"typescript\", \"disallowAmbiguousJSXLike\")) {\n this.raise(TSErrors.ReservedTypeAssertion, { at: this.state.startLoc });\n }\n\n const node = this.startNode<N.TsTypeAssertion>();\n node.typeAnnotation = this.tsInType(() => {\n this.next(); // \"<\"\n return this.match(tt._const)\n ? this.tsParseTypeReference()\n : this.tsParseType();\n });\n this.expect(tt.gt);\n node.expression = this.parseMaybeUnary();\n return this.finishNode(node, \"TSTypeAssertion\");\n }\n\n tsParseHeritageClause(\n token: \"extends\" | \"implements\",\n ): Array<N.TsExpressionWithTypeArguments> {\n const originalStartLoc = this.state.startLoc;\n\n const delimitedList = this.tsParseDelimitedList(\n \"HeritageClauseElement\",\n () => {\n const node = this.startNode<N.TsExpressionWithTypeArguments>();\n node.expression = this.tsParseEntityName();\n if (this.match(tt.lt)) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n\n return this.finishNode(node, \"TSExpressionWithTypeArguments\");\n },\n );\n\n if (!delimitedList.length) {\n this.raise(TSErrors.EmptyHeritageClauseType, {\n at: originalStartLoc,\n token,\n });\n }\n\n return delimitedList;\n }\n\n tsParseInterfaceDeclaration(\n node: Undone<N.TsInterfaceDeclaration>,\n properties: {\n declare?: true;\n } = {},\n ): N.TsInterfaceDeclaration | null {\n if (this.hasFollowingLineBreak()) return null;\n this.expectContextual(tt._interface);\n if (properties.declare) node.declare = true;\n if (tokenIsIdentifier(this.state.type)) {\n node.id = this.parseIdentifier();\n this.checkIdentifier(node.id, BIND_TS_INTERFACE);\n } else {\n node.id = null;\n this.raise(TSErrors.MissingInterfaceName, { at: this.state.startLoc });\n }\n\n node.typeParameters = this.tsTryParseTypeParameters(\n this.tsParseInOutConstModifiers,\n );\n if (this.eat(tt._extends)) {\n node.extends = this.tsParseHeritageClause(\"extends\");\n }\n const body = this.startNode<N.TSInterfaceBody>();\n body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this));\n node.body = this.finishNode(body, \"TSInterfaceBody\");\n return this.finishNode(node, \"TSInterfaceDeclaration\");\n }\n\n tsParseTypeAliasDeclaration(\n node: N.TsTypeAliasDeclaration,\n ): N.TsTypeAliasDeclaration {\n node.id = this.parseIdentifier();\n this.checkIdentifier(node.id, BIND_TS_TYPE);\n\n node.typeAnnotation = this.tsInType(() => {\n node.typeParameters = this.tsTryParseTypeParameters(\n this.tsParseInOutModifiers,\n );\n\n this.expect(tt.eq);\n\n if (\n this.isContextual(tt._intrinsic) &&\n this.lookahead().type !== tt.dot\n ) {\n const node = this.startNode<N.TsKeywordType>();\n this.next();\n return this.finishNode(node, \"TSIntrinsicKeyword\");\n }\n\n return this.tsParseType();\n });\n\n this.semicolon();\n return this.finishNode(node, \"TSTypeAliasDeclaration\");\n }\n\n tsInNoContext<T>(cb: () => T): T {\n const oldContext = this.state.context;\n this.state.context = [oldContext[0]];\n try {\n return cb();\n } finally {\n this.state.context = oldContext;\n }\n }\n\n /**\n * Runs `cb` in a type context.\n * This should be called one token *before* the first type token,\n * so that the call to `next()` is run in type context.\n */\n tsInType<T>(cb: () => T): T {\n const oldInType = this.state.inType;\n this.state.inType = true;\n try {\n return cb();\n } finally {\n this.state.inType = oldInType;\n }\n }\n\n tsInDisallowConditionalTypesContext<T>(cb: () => T): T {\n const oldInDisallowConditionalTypesContext =\n this.state.inDisallowConditionalTypesContext;\n this.state.inDisallowConditionalTypesContext = true;\n try {\n return cb();\n } finally {\n this.state.inDisallowConditionalTypesContext =\n oldInDisallowConditionalTypesContext;\n }\n }\n\n tsInAllowConditionalTypesContext<T>(cb: () => T): T {\n const oldInDisallowConditionalTypesContext =\n this.state.inDisallowConditionalTypesContext;\n this.state.inDisallowConditionalTypesContext = false;\n try {\n return cb();\n } finally {\n this.state.inDisallowConditionalTypesContext =\n oldInDisallowConditionalTypesContext;\n }\n }\n\n tsEatThenParseType(token: TokenType): N.TsType | undefined {\n if (this.match(token)) {\n return this.tsNextThenParseType();\n }\n }\n\n tsExpectThenParseType(token: TokenType): N.TsType {\n return this.tsInType(() => {\n this.expect(token);\n return this.tsParseType();\n });\n }\n\n tsNextThenParseType(): N.TsType {\n return this.tsInType(() => {\n this.next();\n return this.tsParseType();\n });\n }\n\n tsParseEnumMember(): N.TsEnumMember {\n const node = this.startNode<N.TsEnumMember>();\n // Computed property names are grammar errors in an enum, so accept just string literal or identifier.\n node.id = this.match(tt.string)\n ? super.parseStringLiteral(this.state.value)\n : this.parseIdentifier(/* liberal */ true);\n if (this.eat(tt.eq)) {\n node.initializer = super.parseMaybeAssignAllowIn();\n }\n return this.finishNode(node, \"TSEnumMember\");\n }\n\n tsParseEnumDeclaration(\n node: Undone<N.TsEnumDeclaration>,\n properties: {\n const?: true;\n declare?: true;\n } = {},\n ): N.TsEnumDeclaration {\n if (properties.const) node.const = true;\n if (properties.declare) node.declare = true;\n this.expectContextual(tt._enum);\n node.id = this.parseIdentifier();\n this.checkIdentifier(\n node.id,\n node.const ? BIND_TS_CONST_ENUM : BIND_TS_ENUM,\n );\n\n this.expect(tt.braceL);\n node.members = this.tsParseDelimitedList(\n \"EnumMembers\",\n this.tsParseEnumMember.bind(this),\n );\n this.expect(tt.braceR);\n return this.finishNode(node, \"TSEnumDeclaration\");\n }\n\n tsParseModuleBlock(): N.TsModuleBlock {\n const node = this.startNode<N.TsModuleBlock>();\n this.scope.enter(SCOPE_OTHER);\n\n this.expect(tt.braceL);\n // Inside of a module block is considered \"top-level\", meaning it can have imports and exports.\n super.parseBlockOrModuleBlockBody(\n (node.body = []),\n /* directives */ undefined,\n /* topLevel */ true,\n /* end */ tt.braceR,\n );\n this.scope.exit();\n return this.finishNode(node, \"TSModuleBlock\");\n }\n\n tsParseModuleOrNamespaceDeclaration(\n node: Undone<N.TsModuleDeclaration>,\n nested: boolean = false,\n ): N.TsModuleDeclaration {\n node.id = this.parseIdentifier();\n\n if (!nested) {\n this.checkIdentifier(node.id, BIND_TS_NAMESPACE);\n }\n\n if (this.eat(tt.dot)) {\n const inner = this.startNode<N.TsModuleDeclaration>();\n this.tsParseModuleOrNamespaceDeclaration(inner, true);\n // @ts-expect-error Fixme: refine typings\n node.body = inner;\n } else {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n node.body = this.tsParseModuleBlock();\n this.prodParam.exit();\n this.scope.exit();\n }\n return this.finishNode(node, \"TSModuleDeclaration\");\n }\n\n tsParseAmbientExternalModuleDeclaration(\n node: N.TsModuleDeclaration,\n ): N.TsModuleDeclaration {\n if (this.isContextual(tt._global)) {\n node.global = true;\n node.id = this.parseIdentifier();\n } else if (this.match(tt.string)) {\n node.id = super.parseStringLiteral(this.state.value);\n } else {\n this.unexpected();\n }\n if (this.match(tt.braceL)) {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n node.body = this.tsParseModuleBlock();\n this.prodParam.exit();\n this.scope.exit();\n } else {\n this.semicolon();\n }\n\n return this.finishNode(node, \"TSModuleDeclaration\");\n }\n\n tsParseImportEqualsDeclaration(\n node: Undone<N.TsImportEqualsDeclaration>,\n maybeDefaultIdentifier?: N.Identifier | null,\n isExport?: boolean,\n ): N.TsImportEqualsDeclaration {\n node.isExport = isExport || false;\n node.id = maybeDefaultIdentifier || this.parseIdentifier();\n this.checkIdentifier(node.id, BIND_FLAGS_TS_IMPORT);\n this.expect(tt.eq);\n const moduleReference = this.tsParseModuleReference();\n if (\n node.importKind === \"type\" &&\n moduleReference.type !== \"TSExternalModuleReference\"\n ) {\n this.raise(TSErrors.ImportAliasHasImportType, {\n at: moduleReference,\n });\n }\n node.moduleReference = moduleReference;\n this.semicolon();\n return this.finishNode(node, \"TSImportEqualsDeclaration\");\n }\n\n tsIsExternalModuleReference(): boolean {\n return (\n this.isContextual(tt._require) &&\n this.lookaheadCharCode() === charCodes.leftParenthesis\n );\n }\n\n tsParseModuleReference(): N.TsModuleReference {\n return this.tsIsExternalModuleReference()\n ? this.tsParseExternalModuleReference()\n : this.tsParseEntityName(/* allowReservedWords */ false);\n }\n\n tsParseExternalModuleReference(): N.TsExternalModuleReference {\n const node = this.startNode<N.TsExternalModuleReference>();\n this.expectContextual(tt._require);\n this.expect(tt.parenL);\n if (!this.match(tt.string)) {\n this.unexpected();\n }\n // For compatibility to estree we cannot call parseLiteral directly here\n node.expression = super.parseExprAtom() as N.StringLiteral;\n this.expect(tt.parenR);\n this.sawUnambiguousESM = true;\n return this.finishNode(node, \"TSExternalModuleReference\");\n }\n\n // Utilities\n\n tsLookAhead<T>(f: () => T): T {\n const state = this.state.clone();\n const res = f();\n this.state = state;\n return res;\n }\n\n tsTryParseAndCatch<T extends N.NodeBase | undefined | null>(\n f: () => T,\n ): T | undefined | null {\n const result = this.tryParse(\n abort =>\n // @ts-expect-error todo(flow->ts)\n f() || abort(),\n );\n\n if (result.aborted || !result.node) return;\n if (result.error) this.state = result.failState;\n // @ts-expect-error refine typings\n return result.node;\n }\n\n tsTryParse<T>(f: () => T | undefined | false): T | undefined {\n const state = this.state.clone();\n const result = f();\n if (result !== undefined && result !== false) {\n return result;\n }\n this.state = state;\n }\n\n tsTryParseDeclare(nany: any): N.Declaration | undefined {\n if (this.isLineTerminator()) {\n return;\n }\n let startType = this.state.type;\n let kind: \"let\" | null;\n\n if (this.isContextual(tt._let)) {\n startType = tt._var;\n kind = \"let\";\n }\n\n // @ts-expect-error refine typings\n return this.tsInAmbientContext(() => {\n switch (startType) {\n case tt._function:\n nany.declare = true;\n return super.parseFunctionStatement(\n nany,\n /* async */ false,\n /* isHangingDeclaration */ false,\n );\n case tt._class:\n // While this is also set by tsParseExpressionStatement, we need to set it\n // before parsing the class declaration to know how to register it in the scope.\n nany.declare = true;\n return this.parseClass(\n nany,\n /* isStatement */ true,\n /* optionalId */ false,\n );\n case tt._enum:\n return this.tsParseEnumDeclaration(nany, { declare: true });\n case tt._global:\n return this.tsParseAmbientExternalModuleDeclaration(nany);\n case tt._const:\n case tt._var:\n if (!this.match(tt._const) || !this.isLookaheadContextual(\"enum\")) {\n nany.declare = true;\n return this.parseVarStatement(\n nany,\n kind || this.state.value,\n true,\n );\n }\n\n // `const enum = 0;` not allowed because \"enum\" is a strict mode reserved word.\n this.expect(tt._const);\n return this.tsParseEnumDeclaration(nany, {\n const: true,\n declare: true,\n });\n case tt._interface: {\n const result = this.tsParseInterfaceDeclaration(nany, {\n declare: true,\n });\n if (result) return result;\n }\n // fallthrough\n default:\n if (tokenIsIdentifier(startType)) {\n return this.tsParseDeclaration(\n nany,\n this.state.value,\n /* next */ true,\n /* decorators */ null,\n );\n }\n }\n });\n }\n\n // Note: this won't be called unless the keyword is allowed in `shouldParseExportDeclaration`.\n tsTryParseExportDeclaration(): N.Declaration | undefined {\n return this.tsParseDeclaration(\n this.startNode(),\n this.state.value,\n /* next */ true,\n /* decorators */ null,\n );\n }\n\n tsParseExpressionStatement(\n node: Undone<N.TsModuleDeclaration>,\n expr: N.Identifier,\n decorators: N.Decorator[] | null,\n ): N.Declaration | undefined {\n switch (expr.name) {\n case \"declare\": {\n const declaration = this.tsTryParseDeclare(node);\n if (declaration) {\n declaration.declare = true;\n }\n return declaration;\n }\n case \"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 (this.match(tt.braceL)) {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n const mod = node;\n mod.global = true;\n mod.id = expr;\n mod.body = this.tsParseModuleBlock();\n this.scope.exit();\n this.prodParam.exit();\n return this.finishNode(mod, \"TSModuleDeclaration\");\n }\n break;\n\n default:\n return this.tsParseDeclaration(\n node,\n expr.name,\n /* next */ false,\n decorators,\n );\n }\n }\n\n // Common to tsTryParseDeclare, tsTryParseExportDeclaration, and tsParseExpressionStatement.\n tsParseDeclaration(\n node: any,\n value: string,\n next: boolean,\n decorators: N.Decorator[] | null,\n ): N.Declaration | undefined | null {\n // no declaration apart from enum can be followed by a line break.\n switch (value) {\n case \"abstract\":\n if (\n this.tsCheckLineTerminator(next) &&\n (this.match(tt._class) || tokenIsIdentifier(this.state.type))\n ) {\n return this.tsParseAbstractDeclaration(node, decorators);\n }\n break;\n\n case \"module\":\n if (this.tsCheckLineTerminator(next)) {\n if (this.match(tt.string)) {\n return this.tsParseAmbientExternalModuleDeclaration(node);\n } else if (tokenIsIdentifier(this.state.type)) {\n return this.tsParseModuleOrNamespaceDeclaration(node);\n }\n }\n break;\n\n case \"namespace\":\n if (\n this.tsCheckLineTerminator(next) &&\n tokenIsIdentifier(this.state.type)\n ) {\n return this.tsParseModuleOrNamespaceDeclaration(node);\n }\n break;\n\n case \"type\":\n if (\n this.tsCheckLineTerminator(next) &&\n tokenIsIdentifier(this.state.type)\n ) {\n return this.tsParseTypeAliasDeclaration(node);\n }\n break;\n }\n }\n\n tsCheckLineTerminator(next: boolean) {\n if (next) {\n if (this.hasFollowingLineBreak()) return false;\n this.next();\n return true;\n }\n return !this.isLineTerminator();\n }\n\n tsTryParseGenericAsyncArrowFunction(\n startLoc: Position,\n ): N.ArrowFunctionExpression | undefined {\n if (!this.match(tt.lt)) return;\n\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n this.state.maybeInArrowParameters = true;\n\n const res: Undone<N.ArrowFunctionExpression> | undefined =\n this.tsTryParseAndCatch(() => {\n const node = this.startNodeAt<N.ArrowFunctionExpression>(startLoc);\n node.typeParameters = this.tsParseTypeParameters(\n this.tsParseConstModifier,\n );\n // Don't use overloaded parseFunctionParams which would look for \"<\" again.\n super.parseFunctionParams(node);\n node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation();\n this.expect(tt.arrow);\n return node;\n });\n\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n\n if (!res) return;\n\n return super.parseArrowExpression(\n res,\n /* params are already set */ null,\n /* async */ true,\n );\n }\n\n // Used when parsing type arguments from ES productions, where the first token\n // has been created without state.inType. Thus we need to rescan the lt token.\n tsParseTypeArgumentsInExpression(): N.TsTypeParameterInstantiation | void {\n if (this.reScan_lt() !== tt.lt) return;\n return this.tsParseTypeArguments();\n }\n\n tsParseTypeArguments(): N.TsTypeParameterInstantiation {\n const node = this.startNode<N.TsTypeParameterInstantiation>();\n node.params = this.tsInType(() =>\n // Temporarily remove a JSX parsing context, which makes us scan different tokens.\n this.tsInNoContext(() => {\n this.expect(tt.lt);\n return this.tsParseDelimitedList(\n \"TypeParametersOrArguments\",\n this.tsParseType.bind(this),\n );\n }),\n );\n if (node.params.length === 0) {\n this.raise(TSErrors.EmptyTypeArguments, { at: node });\n } else if (!this.state.inType && this.curContext() === tc.brace) {\n // rescan `>` when we are no longer in type context and JSX parsing context\n // since it was tokenized when `inType` is `true`.\n this.reScan_lt_gt();\n }\n this.expect(tt.gt);\n return this.finishNode(node, \"TSTypeParameterInstantiation\");\n }\n\n tsIsDeclarationStart(): boolean {\n return tokenIsTSDeclarationStart(this.state.type);\n }\n\n // ======================================================\n // OVERRIDES\n // ======================================================\n\n isExportDefaultSpecifier(): boolean {\n if (this.tsIsDeclarationStart()) return false;\n return super.isExportDefaultSpecifier();\n }\n\n parseAssignableListItem(\n flags: ParseBindingListFlags,\n decorators: N.Decorator[],\n ): N.Pattern | N.TSParameterProperty {\n // Store original location to include modifiers in range\n const startLoc = this.state.startLoc;\n\n const modified: ModifierBase = {};\n this.tsParseModifiers(\n {\n allowedModifiers: [\n \"public\",\n \"private\",\n \"protected\",\n \"override\",\n \"readonly\",\n ],\n },\n modified,\n );\n const accessibility = modified.accessibility;\n const override = modified.override;\n const readonly = modified.readonly;\n if (\n !(flags & ParseBindingListFlags.IS_CONSTRUCTOR_PARAMS) &&\n (accessibility || readonly || override)\n ) {\n this.raise(TSErrors.UnexpectedParameterModifier, { at: startLoc });\n }\n\n const left = this.parseMaybeDefault();\n this.parseAssignableListItemTypes(left, flags);\n const elt = this.parseMaybeDefault(left.loc.start, left);\n if (accessibility || readonly || override) {\n const pp = this.startNodeAt<N.TSParameterProperty>(startLoc);\n if (decorators.length) {\n pp.decorators = decorators;\n }\n if (accessibility) pp.accessibility = accessibility;\n if (readonly) pp.readonly = readonly;\n if (override) pp.override = override;\n if (elt.type !== \"Identifier\" && elt.type !== \"AssignmentPattern\") {\n this.raise(TSErrors.UnsupportedParameterPropertyKind, { at: pp });\n }\n pp.parameter = elt as any as N.Identifier | N.AssignmentPattern;\n return this.finishNode(pp, \"TSParameterProperty\");\n }\n\n if (decorators.length) {\n left.decorators = decorators;\n }\n\n return elt;\n }\n\n isSimpleParameter(node: N.Pattern | N.TSParameterProperty) {\n return (\n (node.type === \"TSParameterProperty\" &&\n super.isSimpleParameter(node.parameter)) ||\n super.isSimpleParameter(node)\n );\n }\n\n tsDisallowOptionalPattern(node: Undone<N.Function>) {\n for (const param of node.params) {\n if (\n param.type !== \"Identifier\" &&\n (param as any).optional &&\n !this.state.isAmbientContext\n ) {\n this.raise(TSErrors.PatternIsOptional, { at: param });\n }\n }\n }\n\n setArrowFunctionParameters(\n node: Undone<N.ArrowFunctionExpression>,\n params: N.Expression[],\n trailingCommaLoc?: Position | null,\n ): void {\n super.setArrowFunctionParameters(node, params, trailingCommaLoc);\n this.tsDisallowOptionalPattern(node);\n }\n\n parseFunctionBodyAndFinish<\n T extends\n | N.Function\n | N.TSDeclareMethod\n | N.TSDeclareFunction\n | N.ClassPrivateMethod,\n >(node: Undone<T>, type: T[\"type\"], isMethod: boolean = false): T {\n if (this.match(tt.colon)) {\n node.returnType = this.tsParseTypeOrTypePredicateAnnotation(tt.colon);\n }\n\n const bodilessType =\n type === \"FunctionDeclaration\"\n ? \"TSDeclareFunction\"\n : type === \"ClassMethod\" || type === \"ClassPrivateMethod\"\n ? \"TSDeclareMethod\"\n : undefined;\n if (bodilessType && !this.match(tt.braceL) && this.isLineTerminator()) {\n return this.finishNode(node, bodilessType);\n }\n if (bodilessType === \"TSDeclareFunction\" && this.state.isAmbientContext) {\n this.raise(TSErrors.DeclareFunctionHasImplementation, { at: node });\n if ((node as Undone<N.FunctionDeclaration>).declare) {\n return super.parseFunctionBodyAndFinish(node, bodilessType, isMethod);\n }\n }\n this.tsDisallowOptionalPattern(node);\n\n return super.parseFunctionBodyAndFinish(node, type, isMethod);\n }\n\n registerFunctionStatementId(node: N.Function): void {\n if (!node.body && node.id) {\n // Function ids are validated after parsing their body.\n // For bodiless function, we need to do it here.\n this.checkIdentifier(node.id, BIND_TS_AMBIENT);\n } else {\n super.registerFunctionStatementId(node);\n }\n }\n\n tsCheckForInvalidTypeCasts(items: Array<N.Expression | undefined | null>) {\n items.forEach(node => {\n if (node?.type === \"TSTypeCastExpression\") {\n this.raise(TSErrors.UnexpectedTypeAnnotation, {\n at: node.typeAnnotation,\n });\n }\n });\n }\n\n toReferencedList(\n exprList: Array<N.Expression | undefined | null>,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n isInParens?: boolean,\n ): Array<N.Expression | undefined | null> {\n // Handles invalid scenarios like: `f(a:b)`, `(a:b);`, and `(a:b,c:d)`.\n //\n // Note that `f<T>(a:b)` goes through a different path and is handled\n // in `parseSubscript` directly.\n this.tsCheckForInvalidTypeCasts(exprList);\n return exprList;\n }\n\n parseArrayLike(\n close: TokenType,\n canBePattern: boolean,\n isTuple: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ArrayExpression | N.TupleExpression {\n const node = super.parseArrayLike(\n close,\n canBePattern,\n isTuple,\n refExpressionErrors,\n );\n\n if (node.type === \"ArrayExpression\") {\n this.tsCheckForInvalidTypeCasts(node.elements);\n }\n\n return node;\n }\n\n parseSubscript(\n base: N.Expression,\n\n startLoc: Position,\n noCalls: boolean | undefined | null,\n state: N.ParseSubscriptState,\n ): N.Expression {\n if (!this.hasPrecedingLineBreak() && this.match(tt.bang)) {\n // When ! is consumed as a postfix operator (non-null assertion),\n // disallow JSX tag forming after. e.g. When parsing `p! < n.p!`\n // `<n.p` can not be a start of JSX tag\n this.state.canStartJSXElement = false;\n this.next();\n\n const nonNullExpression =\n this.startNodeAt<N.TsNonNullExpression>(startLoc);\n nonNullExpression.expression = base;\n return this.finishNode(nonNullExpression, \"TSNonNullExpression\");\n }\n\n let isOptionalCall = false;\n if (\n this.match(tt.questionDot) &&\n this.lookaheadCharCode() === charCodes.lessThan\n ) {\n if (noCalls) {\n state.stop = true;\n return base;\n }\n state.optionalChainMember = isOptionalCall = true;\n this.next();\n }\n\n // handles 'f<<T>'\n if (this.match(tt.lt) || this.match(tt.bitShiftL)) {\n let missingParenErrorLoc;\n // tsTryParseAndCatch is expensive, so avoid if not necessary.\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 result = this.tsTryParseAndCatch(() => {\n if (!noCalls && this.atPossibleAsyncArrow(base)) {\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 =\n this.tsTryParseGenericAsyncArrowFunction(startLoc);\n if (asyncArrowFn) {\n return asyncArrowFn;\n }\n }\n\n const typeArguments = this.tsParseTypeArgumentsInExpression();\n if (!typeArguments) return;\n\n if (isOptionalCall && !this.match(tt.parenL)) {\n missingParenErrorLoc = this.state.curPosition();\n return;\n }\n\n if (tokenIsTemplate(this.state.type)) {\n const result = super.parseTaggedTemplateExpression(\n base,\n\n startLoc,\n state,\n );\n result.typeParameters = typeArguments;\n return result;\n }\n\n if (!noCalls && this.eat(tt.parenL)) {\n const node = this.startNodeAt<\n N.CallExpression | N.OptionalCallExpression\n >(startLoc);\n node.callee = base;\n // possibleAsync always false here, because we would have handled it above.\n // @ts-expect-error (won't be any undefined arguments)\n node.arguments = this.parseCallExpressionArguments(\n tt.parenR,\n /* possibleAsync */ false,\n );\n\n // Handles invalid case: `f<T>(a:b)`\n this.tsCheckForInvalidTypeCasts(node.arguments);\n\n node.typeParameters = typeArguments;\n if (state.optionalChainMember) {\n (node as Undone<N.OptionalCallExpression>).optional =\n isOptionalCall;\n }\n\n return this.finishCallExpression(node, state.optionalChainMember);\n }\n\n const tokenType = this.state.type;\n if (\n // a<b>>c is not (a<b>)>c, but a<(b>>c)\n tokenType === tt.gt ||\n // a<b>>>c is not (a<b>)>>c, but a<(b>>>c)\n tokenType === tt.bitShiftR ||\n // a<b>c is (a<b)>c\n (tokenType !== tt.parenL &&\n tokenCanStartExpression(tokenType) &&\n !this.hasPrecedingLineBreak())\n ) {\n // Bail out.\n return;\n }\n\n const node = this.startNodeAt<N.TsInstantiationExpression>(startLoc);\n node.expression = base;\n node.typeParameters = typeArguments;\n return this.finishNode(node, \"TSInstantiationExpression\");\n });\n\n if (missingParenErrorLoc) {\n this.unexpected(missingParenErrorLoc, tt.parenL);\n }\n\n if (result) {\n if (\n result.type === \"TSInstantiationExpression\" &&\n (this.match(tt.dot) ||\n (this.match(tt.questionDot) &&\n this.lookaheadCharCode() !== charCodes.leftParenthesis))\n ) {\n this.raise(\n TSErrors.InvalidPropertyAccessAfterInstantiationExpression,\n { at: this.state.startLoc },\n );\n }\n return result;\n }\n }\n\n return super.parseSubscript(base, startLoc, noCalls, state);\n }\n\n parseNewCallee(node: N.NewExpression): void {\n super.parseNewCallee(node);\n\n const { callee } = node;\n if (\n callee.type === \"TSInstantiationExpression\" &&\n !callee.extra?.parenthesized\n ) {\n node.typeParameters = callee.typeParameters;\n node.callee = callee.expression;\n }\n }\n\n parseExprOp(\n left: N.Expression,\n leftStartLoc: Position,\n minPrec: number,\n ): N.Expression {\n let isSatisfies: boolean;\n if (\n tokenOperatorPrecedence(tt._in) > minPrec &&\n !this.hasPrecedingLineBreak() &&\n (this.isContextual(tt._as) ||\n (isSatisfies = this.isContextual(tt._satisfies)))\n ) {\n const node = this.startNodeAt<\n N.TsAsExpression | N.TsSatisfiesExpression\n >(leftStartLoc);\n node.expression = left;\n node.typeAnnotation = this.tsInType(() => {\n this.next(); // \"as\" or \"satisfies\"\n if (this.match(tt._const)) {\n if (isSatisfies) {\n this.raise(Errors.UnexpectedKeyword, {\n at: this.state.startLoc,\n keyword: \"const\",\n });\n }\n return this.tsParseTypeReference();\n }\n\n return this.tsParseType();\n });\n this.finishNode(\n node,\n isSatisfies ? \"TSSatisfiesExpression\" : \"TSAsExpression\",\n );\n // rescan `<`, `>` because they were scanned when this.state.inType was true\n this.reScan_lt_gt();\n return this.parseExprOp(\n // @ts-expect-error todo(flow->ts)\n node,\n leftStartLoc,\n minPrec,\n );\n }\n\n return super.parseExprOp(left, leftStartLoc, minPrec);\n }\n\n checkReservedWord(\n word: string,\n startLoc: Position,\n checkKeywords: boolean,\n isBinding: boolean,\n ): void {\n // Strict mode words may be allowed as in `declare namespace N { const static: number; }`.\n // And we have a type checker anyway, so don't bother having the parser do it.\n if (!this.state.isAmbientContext) {\n super.checkReservedWord(word, startLoc, checkKeywords, isBinding);\n }\n }\n\n checkImportReflection(node: Undone<N.ImportDeclaration>) {\n super.checkImportReflection(node);\n if (node.module && node.importKind !== \"value\") {\n this.raise(TSErrors.ImportReflectionHasImportType, {\n at: node.specifiers[0].loc.start,\n });\n }\n }\n\n /*\n Don't bother doing this check in TypeScript code because:\n 1. We may have a nested export statement with the same name:\n export const x = 0;\n export namespace N {\n export const x = 1;\n }\n 2. We have a type checker to warn us about this sort of thing.\n */\n checkDuplicateExports() {}\n\n isPotentialImportPhase(isExport: boolean): boolean {\n if (super.isPotentialImportPhase(isExport)) return true;\n if (this.isContextual(tt._type)) {\n const ch = this.lookaheadCharCode();\n return isExport\n ? ch === charCodes.leftCurlyBrace || ch === charCodes.asterisk\n : ch !== charCodes.equalsTo;\n }\n return !isExport && this.isContextual(tt._typeof);\n }\n\n applyImportPhase(\n node: Undone<N.ImportDeclaration | N.ExportNamedDeclaration>,\n isExport: boolean,\n phase: string | null,\n loc?: Position,\n ): void {\n super.applyImportPhase(node, isExport, phase, loc);\n if (isExport) {\n (node as N.ExportNamedDeclaration).exportKind =\n phase === \"type\" ? \"type\" : \"value\";\n } else {\n (node as N.ImportDeclaration).importKind =\n phase === \"type\" || phase === \"typeof\" ? phase : \"value\";\n }\n }\n\n parseImport(\n node: Undone<N.ImportDeclaration | N.TsImportEqualsDeclaration>,\n ): N.AnyImport {\n if (this.match(tt.string)) {\n node.importKind = \"value\";\n return super.parseImport(node as Undone<N.ImportDeclaration>);\n }\n\n let importNode;\n if (\n tokenIsIdentifier(this.state.type) &&\n this.lookaheadCharCode() === charCodes.equalsTo\n ) {\n node.importKind = \"value\";\n return this.tsParseImportEqualsDeclaration(\n node as Undone<N.TsImportEqualsDeclaration>,\n );\n } else if (this.isContextual(tt._type)) {\n const maybeDefaultIdentifier = this.parseMaybeImportPhase(\n node as Undone<N.ImportDeclaration>,\n /* isExport */ false,\n );\n if (this.lookaheadCharCode() === charCodes.equalsTo) {\n return this.tsParseImportEqualsDeclaration(\n node as Undone<N.TsImportEqualsDeclaration>,\n maybeDefaultIdentifier,\n );\n } else {\n importNode = super.parseImportSpecifiersAndAfter(\n node as Undone<N.ImportDeclaration>,\n maybeDefaultIdentifier,\n );\n }\n } else {\n importNode = super.parseImport(node as Undone<N.ImportDeclaration>);\n }\n\n // `import type` can only be used on imports with named imports or with a\n // default import - but not both\n if (\n importNode.importKind === \"type\" &&\n // @ts-expect-error refine typings\n importNode.specifiers.length > 1 &&\n // @ts-expect-error refine typings\n importNode.specifiers[0].type === \"ImportDefaultSpecifier\"\n ) {\n this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, {\n at: importNode,\n });\n }\n\n return importNode;\n }\n\n parseExport(\n node: Undone<N.Node>,\n decorators: N.Decorator[] | null,\n ): N.AnyExport {\n if (this.match(tt._import)) {\n // `export import A = B;`\n this.next(); // eat `tt._import`\n let maybeDefaultIdentifier: N.Identifier | null = null;\n if (\n this.isContextual(tt._type) &&\n // We pass false here, because we are parsing an `import ... =`\n this.isPotentialImportPhase(/* isExport */ false)\n ) {\n maybeDefaultIdentifier = this.parseMaybeImportPhase(\n node as Undone<N.TsImportEqualsDeclaration>,\n /* isExport */ false,\n );\n } else {\n node.importKind = \"value\";\n }\n return this.tsParseImportEqualsDeclaration(\n node as Undone<N.TsImportEqualsDeclaration>,\n maybeDefaultIdentifier,\n /* isExport */ true,\n );\n } else if (this.eat(tt.eq)) {\n // `export = x;`\n const assign = node as Undone<N.TsExportAssignment>;\n assign.expression = super.parseExpression();\n this.semicolon();\n this.sawUnambiguousESM = true;\n return this.finishNode(assign, \"TSExportAssignment\");\n } else if (this.eatContextual(tt._as)) {\n // `export as namespace A;`\n const decl = node as Undone<N.TsNamespaceExportDeclaration>;\n // See `parseNamespaceExportDeclaration` in TypeScript's own parser\n this.expectContextual(tt._namespace);\n decl.id = this.parseIdentifier();\n this.semicolon();\n return this.finishNode(decl, \"TSNamespaceExportDeclaration\");\n } else {\n return super.parseExport(\n node as Undone<N.ExportAllDeclaration | N.ExportDefaultDeclaration>,\n decorators,\n );\n }\n }\n\n isAbstractClass(): boolean {\n return (\n this.isContextual(tt._abstract) && this.lookahead().type === tt._class\n );\n }\n\n parseExportDefaultExpression(): N.Expression | N.Declaration {\n if (this.isAbstractClass()) {\n const cls = this.startNode<N.Class>();\n this.next(); // Skip \"abstract\"\n cls.abstract = true;\n return this.parseClass(cls, true, true);\n }\n\n // export default interface allowed in:\n // https://github.com/Microsoft/TypeScript/pull/16040\n if (this.match(tt._interface)) {\n const result = this.tsParseInterfaceDeclaration(\n this.startNode<N.TsInterfaceDeclaration>(),\n );\n if (result) return result;\n }\n\n return super.parseExportDefaultExpression();\n }\n\n parseVarStatement(\n node: N.VariableDeclaration,\n kind: \"var\" | \"let\" | \"const\" | \"using\",\n allowMissingInitializer: boolean = false,\n ) {\n const { isAmbientContext } = this.state;\n const declaration = super.parseVarStatement(\n node,\n kind,\n allowMissingInitializer || isAmbientContext,\n );\n\n if (!isAmbientContext) return declaration;\n\n for (const { id, init } of declaration.declarations) {\n // Empty initializer is the easy case that we want.\n if (!init) continue;\n\n // var and let aren't ever allowed initializers.\n if (kind !== \"const\" || !!id.typeAnnotation) {\n this.raise(TSErrors.InitializerNotAllowedInAmbientContext, {\n at: init,\n });\n } else if (\n !isValidAmbientConstInitializer(init, this.hasPlugin(\"estree\"))\n ) {\n this.raise(\n TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference,\n { at: init },\n );\n }\n }\n\n return declaration;\n }\n\n parseStatementContent(\n flags: ParseStatementFlag,\n decorators?: N.Decorator[] | null,\n ): N.Statement {\n if (this.match(tt._const) && this.isLookaheadContextual(\"enum\")) {\n const node = this.startNode<N.TsEnumDeclaration>();\n this.expect(tt._const); // eat 'const'\n return this.tsParseEnumDeclaration(node, { const: true });\n }\n\n if (this.isContextual(tt._enum)) {\n return this.tsParseEnumDeclaration(\n this.startNode<N.TsEnumDeclaration>(),\n );\n }\n\n if (this.isContextual(tt._interface)) {\n const result = this.tsParseInterfaceDeclaration(this.startNode());\n if (result) return result;\n }\n\n return super.parseStatementContent(flags, decorators);\n }\n\n parseAccessModifier(): N.Accessibility | undefined | null {\n return this.tsParseModifier([\"public\", \"protected\", \"private\"]);\n }\n\n tsHasSomeModifiers(member: any, modifiers: readonly TsModifier[]): boolean {\n return modifiers.some(modifier => {\n if (tsIsAccessModifier(modifier)) {\n return member.accessibility === modifier;\n }\n return !!member[modifier];\n });\n }\n\n tsIsStartOfStaticBlocks() {\n return (\n this.isContextual(tt._static) &&\n this.lookaheadCharCode() === charCodes.leftCurlyBrace\n );\n }\n\n parseClassMember(\n classBody: N.ClassBody,\n member: any,\n state: N.ParseClassMemberState,\n ): void {\n const modifiers = [\n \"declare\",\n \"private\",\n \"public\",\n \"protected\",\n \"override\",\n \"abstract\",\n \"readonly\",\n \"static\",\n ] as const;\n this.tsParseModifiers(\n {\n allowedModifiers: modifiers,\n disallowedModifiers: [\"in\", \"out\"],\n stopOnStartOfClassStaticBlock: true,\n errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions,\n },\n member,\n );\n\n const callParseClassMemberWithIsStatic = () => {\n if (this.tsIsStartOfStaticBlocks()) {\n this.next(); // eat \"static\"\n this.next(); // eat \"{\"\n if (this.tsHasSomeModifiers(member, modifiers)) {\n this.raise(TSErrors.StaticBlockCannotHaveModifier, {\n at: this.state.curPosition(),\n });\n }\n super.parseClassStaticBlock(classBody, member as N.StaticBlock);\n } else {\n this.parseClassMemberWithIsStatic(\n classBody,\n member,\n state,\n !!member.static,\n );\n }\n };\n if (member.declare) {\n this.tsInAmbientContext(callParseClassMemberWithIsStatic);\n } else {\n callParseClassMemberWithIsStatic();\n }\n }\n\n parseClassMemberWithIsStatic(\n classBody: N.ClassBody,\n member: Undone<N.ClassMember | N.TsIndexSignature>,\n state: N.ParseClassMemberState,\n isStatic: boolean,\n ): void {\n const idx = this.tsTryParseIndexSignature(\n member as Undone<N.TsIndexSignature>,\n );\n if (idx) {\n classBody.body.push(idx);\n\n if ((member as any).abstract) {\n this.raise(TSErrors.IndexSignatureHasAbstract, { at: member });\n }\n if ((member as any).accessibility) {\n this.raise(TSErrors.IndexSignatureHasAccessibility, {\n at: member,\n modifier: (member as any).accessibility,\n });\n }\n if ((member as any).declare) {\n this.raise(TSErrors.IndexSignatureHasDeclare, { at: member });\n }\n if ((member as any).override) {\n this.raise(TSErrors.IndexSignatureHasOverride, { at: member });\n }\n\n return;\n }\n\n if (!this.state.inAbstractClass && (member as any).abstract) {\n this.raise(TSErrors.NonAbstractClassHasAbstractMethod, {\n at: member,\n });\n }\n\n if ((member as any).override) {\n if (!state.hadSuperClass) {\n this.raise(TSErrors.OverrideNotInSubClass, { at: member });\n }\n }\n\n /*:: invariant(member.type !== \"TSIndexSignature\") */\n\n super.parseClassMemberWithIsStatic(\n classBody,\n member as Undone<N.ClassMember>,\n state,\n isStatic,\n );\n }\n\n parsePostMemberNameModifiers(\n methodOrProp: N.ClassMethod | N.ClassProperty | N.ClassPrivateProperty,\n ): void {\n const optional = this.eat(tt.question);\n if (optional) methodOrProp.optional = true;\n\n if ((methodOrProp as any).readonly && this.match(tt.parenL)) {\n this.raise(TSErrors.ClassMethodHasReadonly, { at: methodOrProp });\n }\n\n if ((methodOrProp as any).declare && this.match(tt.parenL)) {\n this.raise(TSErrors.ClassMethodHasDeclare, { at: methodOrProp });\n }\n }\n\n // Note: The reason we do this in `parseExpressionStatement` 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.\n // @ts-expect-error plugin overrides interfaces\n parseExpressionStatement(\n node: Undone<N.ExpressionStatement>,\n expr: N.Expression,\n decorators: N.Decorator[] | null,\n ): N.Statement {\n const decl =\n expr.type === \"Identifier\"\n ? // @ts-expect-error refine typings\n this.tsParseExpressionStatement(node, expr, decorators)\n : undefined;\n return decl || super.parseExpressionStatement(node, expr, decorators);\n }\n\n // export type\n // Should be true for anything parsed by `tsTryParseExportDeclaration`.\n shouldParseExportDeclaration(): boolean {\n if (this.tsIsDeclarationStart()) return true;\n return super.shouldParseExportDeclaration();\n }\n\n // An apparent conditional expression could actually be an optional parameter in an arrow function.\n parseConditional(\n expr: N.Expression,\n\n startLoc: Position,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.Expression {\n // only do the expensive clone if there is a question mark\n // and if we come from inside parens\n if (!this.state.maybeInArrowParameters || !this.match(tt.question)) {\n return super.parseConditional(\n expr,\n\n startLoc,\n refExpressionErrors,\n );\n }\n\n const result = this.tryParse(() =>\n super.parseConditional(expr, startLoc),\n );\n\n if (!result.node) {\n if (result.error) {\n /*:: invariant(refExpressionErrors != null) */\n super.setOptionalParametersError(refExpressionErrors, result.error);\n }\n\n return expr;\n }\n if (result.error) this.state = result.failState;\n return result.node;\n }\n\n // Note: These \"type casts\" are *not* valid TS expressions.\n // But we parse them here and change them when completing the arrow function.\n parseParenItem(\n node: N.Expression,\n\n startLoc: Position,\n ): N.Expression {\n node = super.parseParenItem(node, startLoc);\n if (this.eat(tt.question)) {\n node.optional = true;\n // Include questionmark in location of node\n // Don't use this.finishNode() as otherwise we might process comments twice and\n // include already consumed parens\n this.resetEndLocation(node);\n }\n\n if (this.match(tt.colon)) {\n const typeCastNode = this.startNodeAt<N.TsTypeCastExpression>(startLoc);\n typeCastNode.expression = node;\n typeCastNode.typeAnnotation = this.tsParseTypeAnnotation();\n\n return this.finishNode(typeCastNode, \"TSTypeCastExpression\");\n }\n\n return node;\n }\n\n parseExportDeclaration(\n node: N.ExportNamedDeclaration,\n ): N.Declaration | undefined | null {\n if (!this.state.isAmbientContext && this.isContextual(tt._declare)) {\n return this.tsInAmbientContext(() => this.parseExportDeclaration(node));\n }\n\n // Store original location\n const startLoc = this.state.startLoc;\n\n const isDeclare = this.eatContextual(tt._declare);\n\n if (\n isDeclare &&\n (this.isContextual(tt._declare) || !this.shouldParseExportDeclaration())\n ) {\n throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, {\n at: this.state.startLoc,\n });\n }\n\n const isIdentifier = tokenIsIdentifier(this.state.type);\n const declaration: N.Declaration | undefined | null =\n (isIdentifier && this.tsTryParseExportDeclaration()) ||\n super.parseExportDeclaration(node);\n\n if (!declaration) return null;\n\n if (\n declaration.type === \"TSInterfaceDeclaration\" ||\n declaration.type === \"TSTypeAliasDeclaration\" ||\n isDeclare\n ) {\n node.exportKind = \"type\";\n }\n\n if (isDeclare) {\n // Reset location to include `declare` in range\n this.resetStartLocation(declaration, startLoc);\n\n declaration.declare = true;\n }\n\n return declaration;\n }\n\n parseClassId(\n node: N.Class,\n isStatement: boolean,\n optionalId?: boolean | null,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n bindingType?: BindingTypes,\n ): void {\n if ((!isStatement || optionalId) && this.isContextual(tt._implements)) {\n return;\n }\n\n super.parseClassId(\n node,\n isStatement,\n optionalId,\n (node as any).declare ? BIND_TS_AMBIENT : BIND_CLASS,\n );\n const typeParameters = this.tsTryParseTypeParameters(\n this.tsParseInOutConstModifiers,\n );\n if (typeParameters) node.typeParameters = typeParameters;\n }\n\n parseClassPropertyAnnotation(\n node: N.ClassProperty | N.ClassPrivateProperty | N.ClassAccessorProperty,\n ): void {\n if (!node.optional) {\n if (this.eat(tt.bang)) {\n node.definite = true;\n } else if (this.eat(tt.question)) {\n node.optional = true;\n }\n }\n\n const type = this.tsTryParseTypeAnnotation();\n if (type) node.typeAnnotation = type;\n }\n\n parseClassProperty(node: N.ClassProperty): N.ClassProperty {\n this.parseClassPropertyAnnotation(node);\n\n if (\n this.state.isAmbientContext &&\n !(node.readonly && !node.typeAnnotation) &&\n this.match(tt.eq)\n ) {\n this.raise(TSErrors.DeclareClassFieldHasInitializer, {\n at: this.state.startLoc,\n });\n }\n if (node.abstract && this.match(tt.eq)) {\n const { key } = node;\n this.raise(TSErrors.AbstractPropertyHasInitializer, {\n at: this.state.startLoc,\n propertyName:\n key.type === \"Identifier\" && !node.computed\n ? key.name\n : `[${this.input.slice(key.start, key.end)}]`,\n });\n }\n\n return super.parseClassProperty(node);\n }\n\n parseClassPrivateProperty(\n node: N.ClassPrivateProperty,\n ): N.ClassPrivateProperty {\n // @ts-expect-error abstract may not index node\n if (node.abstract) {\n this.raise(TSErrors.PrivateElementHasAbstract, { at: node });\n }\n\n // @ts-expect-error accessibility may not index node\n if (node.accessibility) {\n this.raise(TSErrors.PrivateElementHasAccessibility, {\n at: node,\n // @ts-expect-error refine typings\n modifier: node.accessibility,\n });\n }\n\n this.parseClassPropertyAnnotation(node);\n return super.parseClassPrivateProperty(node);\n }\n\n parseClassAccessorProperty(\n node: N.ClassAccessorProperty,\n ): N.ClassAccessorProperty {\n this.parseClassPropertyAnnotation(node);\n if (node.optional) {\n this.raise(TSErrors.AccessorCannotBeOptional, { at: node });\n }\n return super.parseClassAccessorProperty(node);\n }\n\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n const typeParameters = this.tsTryParseTypeParameters(\n this.tsParseConstModifier,\n );\n if (typeParameters && isConstructor) {\n this.raise(TSErrors.ConstructorHasTypeParameters, {\n at: typeParameters,\n });\n }\n\n // @ts-expect-error declare does not exist in ClassMethod\n const { declare = false, kind } = method;\n\n if (declare && (kind === \"get\" || kind === \"set\")) {\n this.raise(TSErrors.DeclareAccessor, { at: method, kind });\n }\n if (typeParameters) method.typeParameters = typeParameters;\n super.pushClassMethod(\n classBody,\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n );\n }\n\n pushClassPrivateMethod(\n classBody: N.ClassBody,\n method: N.ClassPrivateMethod,\n isGenerator: boolean,\n isAsync: boolean,\n ): void {\n const typeParameters = this.tsTryParseTypeParameters(\n this.tsParseConstModifier,\n );\n if (typeParameters) method.typeParameters = typeParameters;\n super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);\n }\n\n declareClassPrivateMethodInScope(\n node: N.ClassPrivateMethod | N.EstreeMethodDefinition | N.TSDeclareMethod,\n kind: number,\n ) {\n if (node.type === \"TSDeclareMethod\") return;\n // This happens when using the \"estree\" plugin.\n if (node.type === \"MethodDefinition\" && !node.value.body) return;\n\n super.declareClassPrivateMethodInScope(node, kind);\n }\n\n parseClassSuper(node: N.Class): void {\n super.parseClassSuper(node);\n // handle `extends f<<T>\n if (node.superClass && (this.match(tt.lt) || this.match(tt.bitShiftL))) {\n // @ts-expect-error refine typings\n node.superTypeParameters = this.tsParseTypeArgumentsInExpression();\n }\n if (this.eatContextual(tt._implements)) {\n node.implements = this.tsParseHeritageClause(\"implements\");\n }\n }\n\n parseObjPropValue(\n prop: Undone<N.ObjectMethod | N.ObjectProperty>,\n startLoc: Position | undefined | null,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ) {\n const typeParameters = this.tsTryParseTypeParameters(\n this.tsParseConstModifier,\n );\n if (typeParameters) prop.typeParameters = typeParameters;\n\n return super.parseObjPropValue(\n prop,\n\n startLoc,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n refExpressionErrors,\n );\n }\n\n parseFunctionParams(node: N.Function, isConstructor: boolean): void {\n const typeParameters = this.tsTryParseTypeParameters(\n this.tsParseConstModifier,\n );\n if (typeParameters) node.typeParameters = typeParameters;\n super.parseFunctionParams(node, isConstructor);\n }\n\n // `let x: number;`\n parseVarId(\n decl: N.VariableDeclarator,\n kind: \"var\" | \"let\" | \"const\" | \"using\",\n ): void {\n super.parseVarId(decl, kind);\n if (\n decl.id.type === \"Identifier\" &&\n !this.hasPrecedingLineBreak() &&\n this.eat(tt.bang)\n ) {\n decl.definite = true;\n }\n\n const type = this.tsTryParseTypeAnnotation();\n if (type) {\n decl.id.typeAnnotation = type;\n this.resetEndLocation(decl.id); // set end position to end of type\n }\n }\n\n // parse the return type of an async arrow function - let foo = (async (): number => {});\n parseAsyncArrowFromCallExpression(\n node: N.ArrowFunctionExpression,\n call: N.CallExpression,\n ): N.ArrowFunctionExpression {\n if (this.match(tt.colon)) {\n node.returnType = this.tsParseTypeAnnotation();\n }\n return super.parseAsyncArrowFromCallExpression(node, call);\n }\n\n parseMaybeAssign(\n refExpressionErrors?: ExpressionErrors | null,\n afterLeftParse?: Function,\n ): N.Expression {\n // Note: When the JSX plugin is on, type assertions (`<T> x`) aren't valid syntax.\n\n let state: State | undefined | null;\n let jsx;\n let typeCast;\n\n if (\n this.hasPlugin(\"jsx\") &&\n (this.match(tt.jsxTagStart) || this.match(tt.lt))\n ) {\n // Prefer to parse JSX if possible. But may be an arrow fn.\n state = this.state.clone();\n\n jsx = this.tryParse(\n () => super.parseMaybeAssign(refExpressionErrors, afterLeftParse),\n state,\n );\n\n /*:: invariant(!jsx.aborted) */\n /*:: invariant(jsx.node != null) */\n if (!jsx.error) return jsx.node;\n\n // Remove `tc.j_expr` or `tc.j_oTag` from context added\n // by parsing `jsxTagStart` to stop the JSX plugin from\n // messing with the tokens\n const { context } = this.state;\n const currentContext = context[context.length - 1];\n if (currentContext === tc.j_oTag || currentContext === tc.j_expr) {\n context.pop();\n }\n }\n\n if (!jsx?.error && !this.match(tt.lt)) {\n return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);\n }\n\n // Either way, we're looking at a '<': tt.jsxTagStart or relational.\n\n // If the state was cloned in the JSX parsing branch above but there\n // have been any error in the tryParse call, this.state is set to state\n // so we still need to clone it.\n if (!state || state === this.state) state = this.state.clone();\n\n let typeParameters: N.TsTypeParameterDeclaration | undefined | null;\n const arrow = this.tryParse(abort => {\n // This is similar to TypeScript's `tryParseParenthesizedArrowFunctionExpression`.\n typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier);\n const expr = super.parseMaybeAssign(\n refExpressionErrors,\n afterLeftParse,\n );\n\n if (\n expr.type !== \"ArrowFunctionExpression\" ||\n expr.extra?.parenthesized\n ) {\n abort();\n }\n\n // Correct TypeScript code should have at least 1 type parameter, but don't crash on bad code.\n if (typeParameters?.params.length !== 0) {\n this.resetStartLocationFromNode(expr, typeParameters);\n }\n expr.typeParameters = typeParameters;\n\n if (process.env.BABEL_8_BREAKING) {\n if (\n this.hasPlugin(\"jsx\") &&\n expr.typeParameters.params.length === 1 &&\n !expr.typeParameters.extra?.trailingComma\n ) {\n // report error if single type parameter used without trailing comma.\n const parameter = expr.typeParameters.params[0];\n if (!parameter.constraint) {\n // A single type parameter must either have constraints\n // or a trailing comma, otherwise it's ambiguous with JSX.\n this.raise(TSErrors.SingleTypeParameterWithoutTrailingComma, {\n at: createPositionWithColumnOffset(parameter.loc.end, 1),\n typeParameterName: parameter.name.name,\n });\n }\n }\n }\n\n return expr;\n }, state);\n\n /*:: invariant(arrow.node != null) */\n if (!arrow.error && !arrow.aborted) {\n // This error is reported outside of the this.tryParse call so that\n // in case of <T>(x) => 2, we don't consider <T>(x) as a type assertion\n // because of this error.\n if (typeParameters) this.reportReservedArrowTypeParam(typeParameters);\n // @ts-expect-error refine typings\n return arrow.node;\n }\n\n if (!jsx) {\n // Try parsing a type cast instead of an arrow function.\n // This will never happen outside of JSX.\n // (Because in JSX the '<' should be a jsxTagStart and not a relational.\n assert(!this.hasPlugin(\"jsx\"));\n\n // This will start with a type assertion (via parseMaybeUnary).\n // But don't directly call `this.tsParseTypeAssertion` because we want to handle any binary after it.\n typeCast = this.tryParse(\n () => super.parseMaybeAssign(refExpressionErrors, afterLeftParse),\n state,\n );\n /*:: invariant(!typeCast.aborted) */\n /*:: invariant(typeCast.node != null) */\n if (!typeCast.error) return typeCast.node;\n }\n\n if (jsx?.node) {\n /*:: invariant(jsx.failState) */\n this.state = jsx.failState;\n return jsx.node;\n }\n\n if (arrow.node) {\n /*:: invariant(arrow.failState) */\n this.state = arrow.failState;\n if (typeParameters) this.reportReservedArrowTypeParam(typeParameters);\n // @ts-expect-error refine typings\n return arrow.node;\n }\n\n if (typeCast?.node) {\n /*:: invariant(typeCast.failState) */\n this.state = typeCast.failState;\n return typeCast.node;\n }\n\n throw jsx?.error || arrow.error || typeCast?.error;\n }\n\n reportReservedArrowTypeParam(node: any) {\n if (\n node.params.length === 1 &&\n !node.params[0].constraint &&\n !node.extra?.trailingComma &&\n this.getPluginOption(\"typescript\", \"disallowAmbiguousJSXLike\")\n ) {\n this.raise(TSErrors.ReservedArrowTypeParam, { at: node });\n }\n }\n\n // Handle type assertions\n parseMaybeUnary(\n refExpressionErrors?: ExpressionErrors | null,\n sawUnary?: boolean,\n ): N.Expression {\n if (!this.hasPlugin(\"jsx\") && this.match(tt.lt)) {\n return this.tsParseTypeAssertion();\n }\n return super.parseMaybeUnary(refExpressionErrors, sawUnary);\n }\n\n parseArrow(\n node: Undone<N.ArrowFunctionExpression>,\n ): Undone<N.ArrowFunctionExpression> | undefined | null {\n if (this.match(tt.colon)) {\n // This is different from how the TS parser does it.\n // TS uses lookahead. The Babel Parser parses it as a parenthesized expression and converts.\n\n const result = this.tryParse(abort => {\n const returnType = this.tsParseTypeOrTypePredicateAnnotation(\n tt.colon,\n );\n if (this.canInsertSemicolon() || !this.match(tt.arrow)) abort();\n return returnType;\n });\n\n if (result.aborted) return;\n\n if (!result.thrown) {\n if (result.error) this.state = result.failState;\n // @ts-expect-error refine typings\n node.returnType = result.node;\n }\n }\n\n return super.parseArrow(node);\n }\n\n // Allow type annotations inside of a parameter list.\n parseAssignableListItemTypes(\n param: N.Pattern,\n flags: ParseBindingListFlags,\n ) {\n if (!(flags & ParseBindingListFlags.IS_FUNCTION_PARAMS)) return param;\n\n if (this.eat(tt.question)) {\n (param as any as N.Identifier).optional = true;\n }\n const type = this.tsTryParseTypeAnnotation();\n if (type) param.typeAnnotation = type;\n this.resetEndLocation(param);\n\n return param;\n }\n\n isAssignable(node: N.Node, isBinding?: boolean): boolean {\n switch (node.type) {\n case \"TSTypeCastExpression\":\n return this.isAssignable(node.expression, isBinding);\n case \"TSParameterProperty\":\n return true;\n default:\n return super.isAssignable(node, isBinding);\n }\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): void {\n switch (node.type) {\n case \"ParenthesizedExpression\":\n this.toAssignableParenthesizedExpression(node, isLHS);\n break;\n case \"TSAsExpression\":\n case \"TSSatisfiesExpression\":\n case \"TSNonNullExpression\":\n case \"TSTypeAssertion\":\n if (isLHS) {\n this.expressionScope.recordArrowParameterBindingError(\n TSErrors.UnexpectedTypeCastInParameter,\n { at: node },\n );\n } else {\n this.raise(TSErrors.UnexpectedTypeCastInParameter, { at: node });\n }\n this.toAssignable(node.expression, isLHS);\n break;\n case \"AssignmentExpression\":\n if (!isLHS && node.left.type === \"TSTypeCastExpression\") {\n node.left = this.typeCastToParameter(node.left);\n }\n /* fall through */\n default:\n super.toAssignable(node, isLHS);\n }\n }\n\n toAssignableParenthesizedExpression(node: N.Node, isLHS: boolean): void {\n switch (node.expression.type) {\n case \"TSAsExpression\":\n case \"TSSatisfiesExpression\":\n case \"TSNonNullExpression\":\n case \"TSTypeAssertion\":\n case \"ParenthesizedExpression\":\n this.toAssignable(node.expression, isLHS);\n break;\n default:\n super.toAssignable(node, isLHS);\n }\n }\n\n checkToRestConversion(node: N.Node, allowPattern: boolean): void {\n switch (node.type) {\n case \"TSAsExpression\":\n case \"TSSatisfiesExpression\":\n case \"TSTypeAssertion\":\n case \"TSNonNullExpression\":\n this.checkToRestConversion(node.expression, false);\n break;\n default:\n super.checkToRestConversion(node, allowPattern);\n }\n }\n\n // @ts-expect-error plugin overrides interfaces\n isValidLVal(\n type:\n | \"TSTypeCastExpression\"\n | \"TSParameterProperty\"\n | \"TSNonNullExpression\"\n | \"TSAsExpression\"\n | \"TSSatisfiesExpression\"\n | \"TSTypeAssertion\",\n isUnparenthesizedInAssign: boolean,\n binding: BindingTypes,\n ) {\n return (\n getOwn(\n {\n // Allow \"typecasts\" to appear on the left of assignment expressions,\n // because it may be in an arrow function.\n // e.g. `const f = (foo: number = 0) => foo;`\n TSTypeCastExpression: true,\n TSParameterProperty: \"parameter\",\n TSNonNullExpression: \"expression\",\n TSAsExpression: (binding !== BIND_NONE ||\n !isUnparenthesizedInAssign) && [\"expression\", true],\n TSSatisfiesExpression: (binding !== BIND_NONE ||\n !isUnparenthesizedInAssign) && [\"expression\", true],\n TSTypeAssertion: (binding !== BIND_NONE ||\n !isUnparenthesizedInAssign) && [\"expression\", true],\n },\n type,\n ) || super.isValidLVal(type, isUnparenthesizedInAssign, binding)\n );\n }\n\n parseBindingAtom(): N.Pattern {\n if (this.state.type === tt._this) {\n return this.parseIdentifier(/* liberal */ true);\n }\n return super.parseBindingAtom();\n }\n\n parseMaybeDecoratorArguments(expr: N.Expression): N.Expression {\n // handles `@f<<T>`\n if (this.match(tt.lt) || this.match(tt.bitShiftL)) {\n const typeArguments = this.tsParseTypeArgumentsInExpression();\n\n if (this.match(tt.parenL)) {\n const call = super.parseMaybeDecoratorArguments(expr);\n call.typeParameters = typeArguments;\n return call;\n }\n\n this.unexpected(null, tt.parenL);\n }\n\n return super.parseMaybeDecoratorArguments(expr);\n }\n\n checkCommaAfterRest(\n close: (typeof charCodes)[keyof typeof charCodes],\n ): boolean {\n if (\n this.state.isAmbientContext &&\n this.match(tt.comma) &&\n this.lookaheadCharCode() === close\n ) {\n this.next();\n return false;\n }\n return super.checkCommaAfterRest(close);\n }\n\n // === === === === === === === === === === === === === === === ===\n // Note: All below methods are duplicates of something in flow.js.\n // Not sure what the best way to combine these is.\n // === === === === === === === === === === === === === === === ===\n\n isClassMethod(): boolean {\n return this.match(tt.lt) || super.isClassMethod();\n }\n\n isClassProperty(): boolean {\n return (\n this.match(tt.bang) || this.match(tt.colon) || super.isClassProperty()\n );\n }\n\n parseMaybeDefault(\n startLoc?: Position | null,\n left?: Pattern | null,\n ): N.Pattern {\n const node = super.parseMaybeDefault(startLoc, left);\n\n if (\n node.type === \"AssignmentPattern\" &&\n node.typeAnnotation &&\n node.right.start < node.typeAnnotation.start\n ) {\n this.raise(TSErrors.TypeAnnotationAfterAssign, {\n at: node.typeAnnotation,\n });\n }\n\n return node;\n }\n\n // ensure that inside types, we bypass the jsx parser plugin\n getTokenFromCode(code: number): void {\n if (this.state.inType) {\n if (code === charCodes.greaterThan) {\n this.finishOp(tt.gt, 1);\n return;\n }\n if (code === charCodes.lessThan) {\n this.finishOp(tt.lt, 1);\n return;\n }\n }\n super.getTokenFromCode(code);\n }\n\n // used after we have finished parsing types\n reScan_lt_gt() {\n const { type } = this.state;\n if (type === tt.lt) {\n this.state.pos -= 1;\n this.readToken_lt();\n } else if (type === tt.gt) {\n this.state.pos -= 1;\n this.readToken_gt();\n }\n }\n\n reScan_lt() {\n const { type } = this.state;\n if (type === tt.bitShiftL) {\n this.state.pos -= 2;\n this.finishOp(tt.lt, 1);\n return tt.lt;\n }\n return type;\n }\n\n toAssignableList(\n exprList: Expression[],\n trailingCommaLoc: Position | undefined | null,\n isLHS: boolean,\n ): void {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if (expr?.type === \"TSTypeCastExpression\") {\n exprList[i] = this.typeCastToParameter(\n expr as N.TsTypeCastExpression,\n );\n }\n }\n super.toAssignableList(exprList, trailingCommaLoc, isLHS);\n }\n\n typeCastToParameter(node: N.TsTypeCastExpression): N.Node {\n node.expression.typeAnnotation = node.typeAnnotation;\n\n this.resetEndLocation(node.expression, node.typeAnnotation.loc.end);\n\n return node.expression;\n }\n\n shouldParseArrow(params: Array<N.Node>) {\n if (this.match(tt.colon)) {\n return params.every(expr => this.isAssignable(expr, true));\n }\n return super.shouldParseArrow(params);\n }\n\n shouldParseAsyncArrow(): boolean {\n return this.match(tt.colon) || super.shouldParseAsyncArrow();\n }\n\n canHaveLeadingDecorator() {\n // Avoid unnecessary lookahead in checking for abstract class unless needed!\n return super.canHaveLeadingDecorator() || this.isAbstractClass();\n }\n\n jsxParseOpeningElementAfterName(\n node: N.JSXOpeningElement,\n ): N.JSXOpeningElement {\n // handles `<Component<<T>`\n if (this.match(tt.lt) || this.match(tt.bitShiftL)) {\n const typeArguments = this.tsTryParseAndCatch(() =>\n // @ts-expect-error: refine typings\n this.tsParseTypeArgumentsInExpression(),\n );\n // @ts-expect-error: refine typings\n if (typeArguments) node.typeParameters = typeArguments;\n }\n return super.jsxParseOpeningElementAfterName(node);\n }\n\n getGetterSetterExpectedParamCount(\n method: N.ObjectMethod | N.ClassMethod,\n ): number {\n const baseCount = super.getGetterSetterExpectedParamCount(method);\n const params = this.getObjectOrClassMethodParams(method);\n const firstParam = params[0];\n const hasContextParam = firstParam && this.isThisParam(firstParam);\n\n return hasContextParam ? baseCount + 1 : baseCount;\n }\n\n parseCatchClauseParam(): N.Pattern {\n const param = super.parseCatchClauseParam();\n const type = this.tsTryParseTypeAnnotation();\n\n if (type) {\n param.typeAnnotation = type;\n this.resetEndLocation(param);\n }\n\n return param;\n }\n\n tsInAmbientContext<T>(cb: () => T): T {\n const oldIsAmbientContext = this.state.isAmbientContext;\n this.state.isAmbientContext = true;\n try {\n return cb();\n } finally {\n this.state.isAmbientContext = oldIsAmbientContext;\n }\n }\n\n parseClass<T extends N.Class>(\n node: Undone<T>,\n isStatement: boolean,\n optionalId?: boolean,\n ): T {\n const oldInAbstractClass = this.state.inAbstractClass;\n this.state.inAbstractClass = !!(node as any).abstract;\n try {\n return super.parseClass(node, isStatement, optionalId);\n } finally {\n this.state.inAbstractClass = oldInAbstractClass;\n }\n }\n\n tsParseAbstractDeclaration(\n node: any,\n decorators: N.Decorator[] | null,\n ): N.ClassDeclaration | N.TsInterfaceDeclaration | undefined | null {\n if (this.match(tt._class)) {\n node.abstract = true;\n return this.maybeTakeDecorators(\n decorators,\n this.parseClass<N.ClassDeclaration>(\n node as N.ClassDeclaration,\n /* isStatement */ true,\n /* optionalId */ false,\n ),\n );\n } else if (this.isContextual(tt._interface)) {\n // for invalid abstract interface\n\n // To avoid\n // abstract interface\n // Foo {}\n if (!this.hasFollowingLineBreak()) {\n node.abstract = true;\n this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, {\n at: node,\n });\n return this.tsParseInterfaceDeclaration(\n node as N.TsInterfaceDeclaration,\n );\n }\n } else {\n this.unexpected(null, tt._class);\n }\n }\n\n parseMethod<\n T extends N.ObjectMethod | N.ClassMethod | N.ClassPrivateMethod,\n >(\n node: Undone<T>,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowDirectSuper: boolean,\n type: T[\"type\"],\n inClassScope?: boolean,\n ) {\n const method = super.parseMethod<T>(\n node,\n isGenerator,\n isAsync,\n isConstructor,\n allowDirectSuper,\n type,\n inClassScope,\n );\n // @ts-expect-error todo(flow->ts) property not defined for all types in union\n if (method.abstract) {\n const hasBody = this.hasPlugin(\"estree\")\n ? // @ts-expect-error estree typings\n !!method.value.body\n : !!method.body;\n if (hasBody) {\n const { key } = method;\n this.raise(TSErrors.AbstractMethodHasImplementation, {\n at: method,\n methodName:\n key.type === \"Identifier\" && !method.computed\n ? key.name\n : `[${this.input.slice(key.start, key.end)}]`,\n });\n }\n }\n return method;\n }\n\n tsParseTypeParameterName(): N.Identifier | string {\n const typeName: N.Identifier = this.parseIdentifier();\n return process.env.BABEL_8_BREAKING ? typeName : typeName.name;\n }\n\n shouldParseAsAmbientContext(): boolean {\n return !!this.getPluginOption(\"typescript\", \"dts\");\n }\n\n parse() {\n if (this.shouldParseAsAmbientContext()) {\n this.state.isAmbientContext = true;\n }\n return super.parse();\n }\n\n getExpression() {\n if (this.shouldParseAsAmbientContext()) {\n this.state.isAmbientContext = true;\n }\n return super.getExpression();\n }\n\n parseExportSpecifier(\n node: Undone<N.ExportSpecifier>,\n isString: boolean,\n isInTypeExport: boolean,\n isMaybeTypeOnly: boolean,\n ) {\n if (!isString && isMaybeTypeOnly) {\n this.parseTypeOnlyImportExportSpecifier(\n node,\n /* isImport */ false,\n isInTypeExport,\n );\n return this.finishNode<N.ExportSpecifier>(node, \"ExportSpecifier\");\n }\n node.exportKind = \"value\";\n return super.parseExportSpecifier(\n node,\n isString,\n isInTypeExport,\n isMaybeTypeOnly,\n );\n }\n\n parseImportSpecifier(\n specifier: Undone<N.ImportSpecifier>,\n importedIsString: boolean,\n isInTypeOnlyImport: boolean,\n isMaybeTypeOnly: boolean,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n bindingType: BindingTypes | undefined,\n ): N.ImportSpecifier {\n if (!importedIsString && isMaybeTypeOnly) {\n this.parseTypeOnlyImportExportSpecifier(\n specifier,\n /* isImport */ true,\n isInTypeOnlyImport,\n );\n return this.finishNode<N.ImportSpecifier>(specifier, \"ImportSpecifier\");\n }\n specifier.importKind = \"value\";\n return super.parseImportSpecifier(\n specifier,\n importedIsString,\n isInTypeOnlyImport,\n isMaybeTypeOnly,\n isInTypeOnlyImport ? BIND_TS_TYPE_IMPORT : BIND_FLAGS_TS_IMPORT,\n );\n }\n\n parseTypeOnlyImportExportSpecifier(\n node: any,\n isImport: boolean,\n isInTypeOnlyImportExport: boolean,\n ): void {\n const leftOfAsKey = isImport ? \"imported\" : \"local\";\n const rightOfAsKey = isImport ? \"local\" : \"exported\";\n\n let leftOfAs = node[leftOfAsKey];\n let rightOfAs;\n\n let hasTypeSpecifier = false;\n let canParseAsKeyword = true;\n\n const loc = leftOfAs.loc.start;\n\n // https://github.com/microsoft/TypeScript/blob/fc4f9d83d5939047aa6bb2a43965c6e9bbfbc35b/src/compiler/parser.ts#L7411-L7456\n // import { type } from \"mod\"; - hasTypeSpecifier: false, leftOfAs: type\n // import { type as } from \"mod\"; - hasTypeSpecifier: true, leftOfAs: as\n // import { type as as } from \"mod\"; - hasTypeSpecifier: false, leftOfAs: type, rightOfAs: as\n // import { type as as as } from \"mod\"; - hasTypeSpecifier: true, leftOfAs: as, rightOfAs: as\n if (this.isContextual(tt._as)) {\n // { type as ...? }\n const firstAs = this.parseIdentifier();\n if (this.isContextual(tt._as)) {\n // { type as as ...? }\n const secondAs = this.parseIdentifier();\n if (tokenIsKeywordOrIdentifier(this.state.type)) {\n // { type as as something }\n hasTypeSpecifier = true;\n leftOfAs = firstAs;\n rightOfAs = isImport\n ? this.parseIdentifier()\n : this.parseModuleExportName();\n canParseAsKeyword = false;\n } else {\n // { type as as }\n rightOfAs = secondAs;\n canParseAsKeyword = false;\n }\n } else if (tokenIsKeywordOrIdentifier(this.state.type)) {\n // { type as something }\n canParseAsKeyword = false;\n rightOfAs = isImport\n ? this.parseIdentifier()\n : this.parseModuleExportName();\n } else {\n // { type as }\n hasTypeSpecifier = true;\n leftOfAs = firstAs;\n }\n } else if (tokenIsKeywordOrIdentifier(this.state.type)) {\n // { type something ...? }\n hasTypeSpecifier = true;\n if (isImport) {\n leftOfAs = this.parseIdentifier(true);\n if (!this.isContextual(tt._as)) {\n this.checkReservedWord(\n leftOfAs.name,\n leftOfAs.loc.start,\n true,\n true,\n );\n }\n } else {\n leftOfAs = this.parseModuleExportName();\n }\n }\n if (hasTypeSpecifier && isInTypeOnlyImportExport) {\n this.raise(\n isImport\n ? TSErrors.TypeModifierIsUsedInTypeImports\n : TSErrors.TypeModifierIsUsedInTypeExports,\n { at: loc },\n );\n }\n\n node[leftOfAsKey] = leftOfAs;\n node[rightOfAsKey] = rightOfAs;\n\n const kindKey = isImport ? \"importKind\" : \"exportKind\";\n node[kindKey] = hasTypeSpecifier ? \"type\" : \"value\";\n\n if (canParseAsKeyword && this.eatContextual(tt._as)) {\n node[rightOfAsKey] = isImport\n ? this.parseIdentifier()\n : this.parseModuleExportName();\n }\n if (!node[rightOfAsKey]) {\n node[rightOfAsKey] = cloneIdentifier(node[leftOfAsKey]);\n }\n if (isImport) {\n this.checkIdentifier(\n node[rightOfAsKey],\n hasTypeSpecifier ? BIND_TS_TYPE_IMPORT : BIND_FLAGS_TS_IMPORT,\n );\n }\n }\n };\n\nfunction isPossiblyLiteralEnum(expression: N.Expression): boolean {\n if (expression.type !== \"MemberExpression\") return false;\n\n const { computed, property } = expression;\n\n if (\n computed &&\n property.type !== \"StringLiteral\" &&\n (property.type !== \"TemplateLiteral\" || property.expressions.length > 0)\n ) {\n return false;\n }\n\n return isUncomputedMemberExpressionChain(expression.object);\n}\n\n// If a const declaration has no type annotation and is initialized to\n// a string literal, numeric literal, or enum reference, then it is\n// allowed. In an ideal world, we'd check whether init was *actually* an\n// enum reference, but we allow anything that \"could be\" a literal enum\n// in `isPossiblyLiteralEnum` since we don't have all the information\n// that the typescript compiler has.\nfunction isValidAmbientConstInitializer(\n expression: N.Expression,\n estree: boolean,\n): boolean {\n const { type } = expression;\n if (expression.extra?.parenthesized) {\n return false;\n }\n if (estree) {\n if (type === \"Literal\") {\n const { value } = expression;\n if (typeof value === \"string\" || typeof value === \"boolean\") {\n return true;\n }\n }\n } else {\n if (type === \"StringLiteral\" || type === \"BooleanLiteral\") {\n return true;\n }\n }\n if (isNumber(expression, estree) || isNegativeNumber(expression, estree)) {\n return true;\n }\n if (type === \"TemplateLiteral\" && expression.expressions.length === 0) {\n return true;\n }\n if (isPossiblyLiteralEnum(expression)) {\n return true;\n }\n return false;\n}\n\nfunction isNumber(expression: N.Expression, estree: boolean): boolean {\n if (estree) {\n return (\n expression.type === \"Literal\" &&\n (typeof expression.value === \"number\" || \"bigint\" in expression)\n );\n }\n return (\n expression.type === \"NumericLiteral\" || expression.type === \"BigIntLiteral\"\n );\n}\n\nfunction isNegativeNumber(expression: N.Expression, estree: boolean): boolean {\n if (expression.type === \"UnaryExpression\") {\n const { operator, argument } = expression as N.UnaryExpression;\n if (operator === \"-\" && isNumber(argument, estree)) {\n return true;\n }\n }\n return false;\n}\n\nfunction isUncomputedMemberExpressionChain(expression: N.Expression): boolean {\n if (expression.type === \"Identifier\") return true;\n if (expression.type !== \"MemberExpression\" || expression.computed) {\n return false;\n }\n\n return isUncomputedMemberExpressionChain(expression.object);\n}\n","import * as charCodes from \"charcodes\";\n\nimport { tokenLabelName, tt } from \"../tokenizer/types\";\nimport type Parser from \"../parser\";\nimport type * as N from \"../types\";\nimport { ParseErrorEnum } from \"../parse-error\";\nimport type { Undone } from \"../parser/node\";\nimport type { ExpressionErrors } from \"../parser/util\";\nimport type { BindingTypes } from \"../util/scopeflags\";\nimport type { Position } from \"../util/location\";\n\ntype PossiblePlaceholders = {\n Identifier: N.Identifier;\n StringLiteral: N.StringLiteral;\n Expression: N.Expression;\n Statement: N.Statement;\n Declaration: N.Declaration;\n BlockStatement: N.BlockStatement;\n ClassBody: N.ClassBody;\n Pattern: N.Pattern;\n};\nexport type PlaceholderTypes = keyof PossiblePlaceholders;\n\ntype NodeOf<T extends keyof PossiblePlaceholders> = PossiblePlaceholders[T];\n// todo: when there is proper union type for Node\n// type NodeOf<T extends PlaceholderTypes> = Extract<N.Node, { type: T }>;\n\n// todo: Placeholder<T> breaks everything, because its type is incompatible with\n// the substituted nodes.\ntype MaybePlaceholder<T extends PlaceholderTypes> = NodeOf<T>; // | Placeholder<T>\n\n/* eslint sort-keys: \"error\" */\nconst PlaceholderErrors = ParseErrorEnum`placeholders`({\n ClassNameIsRequired: \"A class name is required.\",\n UnexpectedSpace: \"Unexpected space in placeholder.\",\n});\n\n/* eslint-disable sort-keys */\n\nexport default (superClass: typeof Parser) =>\n class PlaceholdersParserMixin extends superClass implements Parser {\n parsePlaceholder<T extends PlaceholderTypes>(\n expectedNode: T,\n ): /*?N.Placeholder<T>*/ MaybePlaceholder<T> | undefined | null {\n if (this.match(tt.placeholder)) {\n const node = this.startNode();\n this.next();\n this.assertNoSpace();\n\n // We can't use this.parseIdentifier because\n // we don't want nested placeholders.\n node.name = super.parseIdentifier(/* liberal */ true);\n\n this.assertNoSpace();\n this.expect(tt.placeholder);\n // @ts-expect-error placeholder typings\n return this.finishPlaceholder(node, expectedNode);\n }\n }\n\n finishPlaceholder<T extends PlaceholderTypes>(\n node: N.Node,\n expectedNode: T,\n ): /*N.Placeholder<T>*/ MaybePlaceholder<T> {\n const isFinished = !!(node.expectedNode && node.type === \"Placeholder\");\n node.expectedNode = expectedNode;\n\n // @ts-expect-error todo(flow->ts)\n return isFinished ? node : this.finishNode(node, \"Placeholder\");\n }\n\n /* ============================================================ *\n * tokenizer/index.js *\n * ============================================================ */\n\n getTokenFromCode(code: number) {\n if (\n code === charCodes.percentSign &&\n this.input.charCodeAt(this.state.pos + 1) === charCodes.percentSign\n ) {\n this.finishOp(tt.placeholder, 2);\n } else {\n super.getTokenFromCode(code);\n }\n }\n\n /* ============================================================ *\n * parser/expression.js *\n * ============================================================ */\n\n parseExprAtom(\n refExpressionErrors?: ExpressionErrors | null,\n ): MaybePlaceholder<\"Expression\"> {\n return (\n this.parsePlaceholder(\"Expression\") ||\n super.parseExprAtom(refExpressionErrors)\n );\n }\n\n parseIdentifier(liberal?: boolean): MaybePlaceholder<\"Identifier\"> {\n // NOTE: This function only handles identifiers outside of\n // expressions and binding patterns, since they are already\n // handled by the parseExprAtom and parseBindingAtom functions.\n // This is needed, for example, to parse \"class %%NAME%% {}\".\n return (\n this.parsePlaceholder(\"Identifier\") || super.parseIdentifier(liberal)\n );\n }\n\n checkReservedWord(\n word: string,\n startLoc: Position,\n checkKeywords: boolean,\n isBinding: boolean,\n ) {\n // Sometimes we call #checkReservedWord(node.name), expecting\n // that node is an Identifier. If it is a Placeholder, name\n // will be undefined.\n if (word !== undefined) {\n super.checkReservedWord(word, startLoc, checkKeywords, isBinding);\n }\n }\n\n /* ============================================================ *\n * parser/lval.js *\n * ============================================================ */\n\n parseBindingAtom(): MaybePlaceholder<\"Pattern\"> {\n return this.parsePlaceholder(\"Pattern\") || super.parseBindingAtom();\n }\n\n isValidLVal(type: string, isParenthesized: boolean, binding: BindingTypes) {\n return (\n type === \"Placeholder\" ||\n super.isValidLVal(type, isParenthesized, binding)\n );\n }\n\n toAssignable(node: N.Node, isLHS: boolean): void {\n if (\n node &&\n node.type === \"Placeholder\" &&\n node.expectedNode === \"Expression\"\n ) {\n node.expectedNode = \"Pattern\";\n } else {\n super.toAssignable(node, isLHS);\n }\n }\n\n /* ============================================================ *\n * parser/statement.js *\n * ============================================================ */\n\n chStartsBindingIdentifier(ch: number, pos: number): boolean {\n if (super.chStartsBindingIdentifier(ch, pos)) {\n return true;\n }\n\n // Accept \"let %%\" as the start of \"let %%placeholder%%\", as though the\n // placeholder were an identifier.\n const nextToken = this.lookahead();\n if (nextToken.type === tt.placeholder) {\n return true;\n }\n\n return false;\n }\n\n verifyBreakContinue(\n node: N.BreakStatement | N.ContinueStatement,\n isBreak: boolean,\n ) {\n // @ts-expect-error: node.label could be Placeholder\n if (node.label && node.label.type === \"Placeholder\") return;\n super.verifyBreakContinue(node, isBreak);\n }\n\n // @ts-expect-error Plugin will override parser interface\n parseExpressionStatement(\n node: MaybePlaceholder<\"Statement\">,\n expr: N.Expression,\n ): MaybePlaceholder<\"Statement\"> {\n if (\n expr.type !== \"Placeholder\" ||\n (expr.extra && expr.extra.parenthesized)\n ) {\n // @ts-expect-error placeholder typings\n return super.parseExpressionStatement(node, expr);\n }\n\n if (this.match(tt.colon)) {\n // @ts-expect-error placeholder typings\n const stmt: N.LabeledStatement = node;\n stmt.label = this.finishPlaceholder(expr, \"Identifier\");\n this.next();\n stmt.body = super.parseStatementOrSloppyAnnexBFunctionDeclaration();\n return this.finishNode(stmt, \"LabeledStatement\");\n }\n\n this.semicolon();\n node.name = expr.name;\n return this.finishPlaceholder(node, \"Statement\");\n }\n\n parseBlock(\n allowDirectives?: boolean,\n createNewLexicalScope?: boolean,\n afterBlockParse?: (hasStrictModeDirective: boolean) => void,\n ): MaybePlaceholder<\"BlockStatement\"> {\n return (\n this.parsePlaceholder(\"BlockStatement\") ||\n super.parseBlock(\n allowDirectives,\n createNewLexicalScope,\n afterBlockParse,\n )\n );\n }\n\n parseFunctionId(\n requireId?: boolean,\n ): MaybePlaceholder<\"Identifier\"> | undefined | null {\n return (\n this.parsePlaceholder(\"Identifier\") || super.parseFunctionId(requireId)\n );\n }\n // @ts-expect-error Plugin will override parser interface\n parseClass<T extends N.Class>(\n node: T,\n isStatement: /* T === ClassDeclaration */ boolean,\n optionalId?: boolean,\n ): T {\n const type = isStatement ? \"ClassDeclaration\" : \"ClassExpression\";\n\n this.next();\n const oldStrict = this.state.strict;\n\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (placeholder) {\n if (\n this.match(tt._extends) ||\n this.match(tt.placeholder) ||\n this.match(tt.braceL)\n ) {\n node.id = placeholder;\n } else if (optionalId || !isStatement) {\n node.id = null;\n node.body = this.finishPlaceholder(placeholder, \"ClassBody\");\n return this.finishNode(node, type);\n } else {\n throw this.raise(PlaceholderErrors.ClassNameIsRequired, {\n at: this.state.startLoc,\n });\n }\n } else {\n this.parseClassId(node, isStatement, optionalId);\n }\n\n super.parseClassSuper(node);\n node.body =\n this.parsePlaceholder(\"ClassBody\") ||\n super.parseClassBody(!!node.superClass, oldStrict);\n return this.finishNode(node, type);\n }\n\n parseExport(node: N.Node, decorators: N.Decorator[] | null): N.AnyExport {\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (!placeholder) return super.parseExport(node, decorators);\n\n if (!this.isContextual(tt._from) && !this.match(tt.comma)) {\n // export %%DECL%%;\n node.specifiers = [];\n node.source = null;\n node.declaration = this.finishPlaceholder(placeholder, \"Declaration\");\n return this.finishNode(node, \"ExportNamedDeclaration\");\n }\n\n // export %%NAME%% from \"foo\";\n this.expectPlugin(\"exportDefaultFrom\");\n const specifier = this.startNode();\n specifier.exported = placeholder;\n node.specifiers = [this.finishNode(specifier, \"ExportDefaultSpecifier\")];\n\n return super.parseExport(node, decorators);\n }\n\n isExportDefaultSpecifier(): boolean {\n if (this.match(tt._default)) {\n const next = this.nextTokenStart();\n if (this.isUnparsedContextual(next, \"from\")) {\n if (\n this.input.startsWith(\n tokenLabelName(tt.placeholder),\n this.nextTokenStartSince(next + 4),\n )\n ) {\n return true;\n }\n }\n }\n return super.isExportDefaultSpecifier();\n }\n\n maybeParseExportDefaultSpecifier(\n node: Undone<\n | N.ExportDefaultDeclaration\n | N.ExportAllDeclaration\n | N.ExportNamedDeclaration\n >,\n maybeDefaultIdentifier: N.Identifier | null,\n ): node is Undone<N.ExportNamedDeclaration> {\n if ((node as N.ExportNamedDeclaration).specifiers?.length) {\n // \"export %%NAME%%\" has already been parsed by #parseExport.\n return true;\n }\n return super.maybeParseExportDefaultSpecifier(\n node,\n maybeDefaultIdentifier,\n );\n }\n\n checkExport(node: N.ExportNamedDeclaration): void {\n const { specifiers } = node;\n if (specifiers?.length) {\n node.specifiers = specifiers.filter(\n // @ts-expect-error placeholder typings\n node => node.exported.type === \"Placeholder\",\n );\n }\n super.checkExport(node);\n node.specifiers = specifiers;\n }\n\n parseImport(\n node: Undone<N.ImportDeclaration>,\n ): N.ImportDeclaration | N.TsImportEqualsDeclaration {\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (!placeholder) return super.parseImport(node);\n\n node.specifiers = [];\n\n if (!this.isContextual(tt._from) && !this.match(tt.comma)) {\n // import %%STRING%%;\n node.source = this.finishPlaceholder(placeholder, \"StringLiteral\");\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n\n // import %%DEFAULT%% ...\n const specifier =\n this.startNodeAtNode<N.ImportDefaultSpecifier>(placeholder);\n specifier.local = placeholder;\n node.specifiers.push(\n this.finishNode(specifier, \"ImportDefaultSpecifier\"),\n );\n\n if (this.eat(tt.comma)) {\n // import %%DEFAULT%%, * as ...\n const hasStarImport = this.maybeParseStarImportSpecifier(node);\n\n // import %%DEFAULT%%, { ...\n if (!hasStarImport) this.parseNamedImportSpecifiers(node);\n }\n\n this.expectContextual(tt._from);\n node.source = this.parseImportSource();\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n\n parseImportSource(): MaybePlaceholder<\"StringLiteral\"> {\n // import ... from %%STRING%%;\n\n return (\n this.parsePlaceholder(\"StringLiteral\") || super.parseImportSource()\n );\n }\n\n // Throws if the current token and the prev one are separated by a space.\n assertNoSpace(): void {\n if (this.state.start > this.state.lastTokEndLoc.index) {\n this.raise(PlaceholderErrors.UnexpectedSpace, {\n at: this.state.lastTokEndLoc,\n });\n }\n }\n };\n","import type Parser from \"../parser\";\nimport { tokenIsIdentifier, tt } from \"../tokenizer/types\";\nimport type * as N from \"../types\";\nimport type { ExpressionErrors } from \"../parser/util\";\n\nexport default (superClass: typeof Parser) =>\n class V8IntrinsicMixin extends superClass implements Parser {\n parseV8Intrinsic(): N.Expression {\n if (this.match(tt.modulo)) {\n const v8IntrinsicStartLoc = this.state.startLoc;\n // let the `loc` of Identifier starts from `%`\n const node = this.startNode<N.Identifier>();\n this.next(); // eat '%'\n if (tokenIsIdentifier(this.state.type)) {\n const name = this.parseIdentifierName();\n const identifier = this.createIdentifier(node, name);\n // @ts-expect-error: avoid mutating AST types\n identifier.type = \"V8IntrinsicIdentifier\";\n if (this.match(tt.parenL)) {\n return identifier;\n }\n }\n this.unexpected(v8IntrinsicStartLoc);\n }\n }\n\n /* ============================================================ *\n * parser/expression.js *\n * ============================================================ */\n\n parseExprAtom(refExpressionErrors?: ExpressionErrors | null): N.Expression {\n return (\n this.parseV8Intrinsic() || super.parseExprAtom(refExpressionErrors)\n );\n }\n };\n","import type Parser from \"./parser\";\nimport type {\n ParserPluginWithOptions,\n PluginConfig,\n PluginOptions,\n} from \"./typings\";\n\nexport type Plugin = PluginConfig;\n\nexport type PluginList = PluginConfig[];\n\nexport type MixinPlugin = (superClass: { new (...args: any): Parser }) => {\n new (...args: any): Parser;\n};\n\n// This function’s second parameter accepts either a string (plugin name) or an\n// array pair (plugin name and options object). If an options object is given,\n// then each value is non-recursively checked for identity with the actual\n// option value of each plugin in the first argument (which is an array of\n// plugin names or array pairs).\nexport function hasPlugin(\n plugins: PluginList,\n expectedConfig: PluginConfig,\n): boolean {\n // The expectedOptions object is by default an empty object if the given\n // expectedConfig argument does not give an options object (i.e., if it is a\n // string).\n const [expectedName, expectedOptions] =\n typeof expectedConfig === \"string\" ? [expectedConfig, {}] : expectedConfig;\n\n const expectedKeys = Object.keys(expectedOptions);\n\n const expectedOptionsIsEmpty = expectedKeys.length === 0;\n\n return plugins.some(p => {\n if (typeof p === \"string\") {\n return expectedOptionsIsEmpty && p === expectedName;\n } else {\n const [pluginName, pluginOptions] = p;\n if (pluginName !== expectedName) {\n return false;\n }\n for (const key of expectedKeys) {\n // @ts-expect-error key may not exist in plugin options\n if (pluginOptions[key] !== expectedOptions[key]) {\n return false;\n }\n }\n return true;\n }\n });\n}\n\nexport function getPluginOption<\n PluginName extends ParserPluginWithOptions[0],\n OptionName extends keyof PluginOptions<PluginName>,\n>(plugins: PluginList, name: PluginName, option: OptionName) {\n const plugin = plugins.find(plugin => {\n if (Array.isArray(plugin)) {\n return plugin[0] === name;\n } else {\n return plugin === name;\n }\n });\n\n if (plugin && Array.isArray(plugin) && plugin.length > 1) {\n return (plugin[1] as PluginOptions<PluginName>)[option];\n }\n\n return null;\n}\n\nconst PIPELINE_PROPOSALS = [\"minimal\", \"fsharp\", \"hack\", \"smart\"];\nconst TOPIC_TOKENS = [\"^^\", \"@@\", \"^\", \"%\", \"#\"];\nconst RECORD_AND_TUPLE_SYNTAX_TYPES = [\"hash\", \"bar\"];\n\nexport function validatePlugins(plugins: PluginList) {\n if (hasPlugin(plugins, \"decorators\")) {\n if (hasPlugin(plugins, \"decorators-legacy\")) {\n throw new Error(\n \"Cannot use the decorators and decorators-legacy plugin together\",\n );\n }\n\n const decoratorsBeforeExport = getPluginOption(\n plugins,\n \"decorators\",\n \"decoratorsBeforeExport\",\n );\n if (\n decoratorsBeforeExport != null &&\n typeof decoratorsBeforeExport !== \"boolean\"\n ) {\n throw new Error(\n \"'decoratorsBeforeExport' must be a boolean, if specified.\",\n );\n }\n\n const allowCallParenthesized = getPluginOption(\n plugins,\n \"decorators\",\n \"allowCallParenthesized\",\n );\n if (\n allowCallParenthesized != null &&\n typeof allowCallParenthesized !== \"boolean\"\n ) {\n throw new Error(\"'allowCallParenthesized' must be a boolean.\");\n }\n }\n\n if (hasPlugin(plugins, \"flow\") && hasPlugin(plugins, \"typescript\")) {\n throw new Error(\"Cannot combine flow and typescript plugins.\");\n }\n\n if (hasPlugin(plugins, \"placeholders\") && hasPlugin(plugins, \"v8intrinsic\")) {\n throw new Error(\"Cannot combine placeholders and v8intrinsic plugins.\");\n }\n\n if (hasPlugin(plugins, \"pipelineOperator\")) {\n const proposal = getPluginOption(plugins, \"pipelineOperator\", \"proposal\");\n\n if (!PIPELINE_PROPOSALS.includes(proposal)) {\n const proposalList = PIPELINE_PROPOSALS.map(p => `\"${p}\"`).join(\", \");\n throw new Error(\n `\"pipelineOperator\" requires \"proposal\" option whose value must be one of: ${proposalList}.`,\n );\n }\n\n const tupleSyntaxIsHash = hasPlugin(plugins, [\n \"recordAndTuple\",\n { syntaxType: \"hash\" },\n ]);\n\n if (proposal === \"hack\") {\n if (hasPlugin(plugins, \"placeholders\")) {\n throw new Error(\n \"Cannot combine placeholders plugin and Hack-style pipes.\",\n );\n }\n\n if (hasPlugin(plugins, \"v8intrinsic\")) {\n throw new Error(\n \"Cannot combine v8intrinsic plugin and Hack-style pipes.\",\n );\n }\n\n const topicToken = getPluginOption(\n plugins,\n \"pipelineOperator\",\n \"topicToken\",\n );\n\n if (!TOPIC_TOKENS.includes(topicToken)) {\n const tokenList = TOPIC_TOKENS.map(t => `\"${t}\"`).join(\", \");\n\n throw new Error(\n `\"pipelineOperator\" in \"proposal\": \"hack\" mode also requires a \"topicToken\" option whose value must be one of: ${tokenList}.`,\n );\n }\n\n if (topicToken === \"#\" && tupleSyntaxIsHash) {\n throw new Error(\n 'Plugin conflict between `[\"pipelineOperator\", { proposal: \"hack\", topicToken: \"#\" }]` and `[\"recordAndtuple\", { syntaxType: \"hash\"}]`.',\n );\n }\n } else if (proposal === \"smart\" && tupleSyntaxIsHash) {\n throw new Error(\n 'Plugin conflict between `[\"pipelineOperator\", { proposal: \"smart\" }]` and `[\"recordAndtuple\", { syntaxType: \"hash\"}]`.',\n );\n }\n }\n\n if (hasPlugin(plugins, \"moduleAttributes\")) {\n if (process.env.BABEL_8_BREAKING) {\n throw new Error(\n \"`moduleAttributes` has been removed in Babel 8, please use `importAttributes` parser plugin, or `@babel/plugin-syntax-import-attributes`.\",\n );\n } else {\n if (\n hasPlugin(plugins, \"importAssertions\") ||\n hasPlugin(plugins, \"importAttributes\")\n ) {\n throw new Error(\n \"Cannot combine importAssertions, importAttributes and moduleAttributes plugins.\",\n );\n }\n const moduleAttributesVersionPluginOption = getPluginOption(\n plugins,\n \"moduleAttributes\",\n \"version\",\n );\n if (moduleAttributesVersionPluginOption !== \"may-2020\") {\n throw new Error(\n \"The 'moduleAttributes' plugin requires a 'version' option,\" +\n \" representing the last proposal update. Currently, the\" +\n \" only supported value is 'may-2020'.\",\n );\n }\n }\n }\n if (\n hasPlugin(plugins, \"importAssertions\") &&\n hasPlugin(plugins, \"importAttributes\")\n ) {\n throw new Error(\n \"Cannot combine importAssertions and importAttributes plugins.\",\n );\n }\n\n if (\n hasPlugin(plugins, \"recordAndTuple\") &&\n getPluginOption(plugins, \"recordAndTuple\", \"syntaxType\") != null &&\n !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(\n getPluginOption(plugins, \"recordAndTuple\", \"syntaxType\"),\n )\n ) {\n throw new Error(\n \"The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: \" +\n RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(\", \"),\n );\n }\n\n if (\n hasPlugin(plugins, \"asyncDoExpressions\") &&\n !hasPlugin(plugins, \"doExpressions\")\n ) {\n const error = new Error(\n \"'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.\",\n );\n // @ts-expect-error so @babel/core can provide better error message\n error.missingPlugins = \"doExpressions\";\n throw error;\n }\n}\n\n// These plugins are defined using a mixin which extends the parser class.\n\nimport estree from \"./plugins/estree\";\nimport flow from \"./plugins/flow\";\nimport jsx from \"./plugins/jsx\";\nimport typescript from \"./plugins/typescript\";\nimport placeholders from \"./plugins/placeholders\";\nimport v8intrinsic from \"./plugins/v8intrinsic\";\n\n// NOTE: order is important. estree must come first; placeholders must come last.\nexport const mixinPlugins = {\n estree,\n jsx,\n flow,\n typescript,\n v8intrinsic,\n placeholders,\n};\n\nexport const mixinPluginNames = Object.keys(mixinPlugins) as ReadonlyArray<\n \"estree\" | \"jsx\" | \"flow\" | \"typescript\" | \"v8intrinsic\" | \"placeholders\"\n>;\n","import type { PluginList } from \"./plugin-utils\";\n\n// A second optional argument can be given to further configure\n// the parser process. These options are recognized:\n\nexport type SourceType = \"script\" | \"module\" | \"unambiguous\";\n\nexport type Options = {\n sourceType: SourceType;\n sourceFilename?: string;\n startColumn: number;\n startLine: number;\n allowAwaitOutsideFunction: boolean;\n allowReturnOutsideFunction: boolean;\n allowNewTargetOutsideFunction: boolean;\n allowImportExportEverywhere: boolean;\n allowSuperOutsideMethod: boolean;\n allowUndeclaredExports: boolean;\n plugins: PluginList;\n strictMode: boolean | undefined | null;\n ranges: boolean;\n tokens: boolean;\n createParenthesizedExpressions: boolean;\n errorRecovery: boolean;\n attachComment: boolean;\n annexB: boolean;\n};\n\nexport const defaultOptions: Options = {\n // Source type (\"script\" or \"module\") for different semantics\n sourceType: \"script\",\n // Source filename.\n sourceFilename: undefined,\n // Column (0-based) from which to start counting source. Useful for\n // integration with other tools.\n startColumn: 0,\n // Line (1-based) from which to start counting source. Useful for\n // integration with other tools.\n startLine: 1,\n // When enabled, await at the top level is not considered an\n // error.\n allowAwaitOutsideFunction: false,\n // When enabled, a return at the top level is not considered an\n // error.\n allowReturnOutsideFunction: false,\n // When enabled, new.target outside a function or class is not\n // considered an error.\n allowNewTargetOutsideFunction: false,\n // When enabled, import/export statements are not constrained to\n // appearing at the top of the program.\n allowImportExportEverywhere: false,\n // TODO\n allowSuperOutsideMethod: false,\n // When enabled, export statements can reference undeclared variables.\n allowUndeclaredExports: false,\n // An array of plugins to enable\n plugins: [],\n // TODO\n strictMode: null,\n // Nodes have their start and end characters offsets recorded in\n // `start` and `end` properties (directly on the node, rather than\n // the `loc` object, which holds line/column data. To also add a\n // [semi-standardized][range] `range` property holding a `[start,\n // end]` array with the same numbers, set the `ranges` option to\n // `true`.\n //\n // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678\n ranges: false,\n // Adds all parsed tokens to a `tokens` property on the `File` node\n tokens: false,\n // Whether to create ParenthesizedExpression AST nodes (if false\n // the parser sets extra.parenthesized on the expression nodes instead).\n createParenthesizedExpressions: false,\n // When enabled, errors are attached to the AST instead of being directly thrown.\n // Some errors will still throw, because @babel/parser can't always recover.\n errorRecovery: false,\n // When enabled, comments will be attached to adjacent AST nodes as one of\n // `leadingComments`, `trailingComments` and `innerComments`. The comment attachment\n // is vital to preserve comments after transform. If you don't print AST back,\n // consider set this option to `false` for performance\n attachComment: true,\n // When enabled, the parser will support Annex B syntax.\n // https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers\n annexB: true,\n};\n\n// Interpret and default an options object\n\nexport function getOptions(opts?: Options | null): Options {\n if (opts && opts.annexB != null && opts.annexB !== false) {\n throw new Error(\"The `annexB` option can only be set to `false`.\");\n }\n\n const options: any = {};\n for (const key of Object.keys(defaultOptions)) {\n // @ts-expect-error key may not exist in opts\n options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key];\n }\n return options;\n}\n","// A recursive descent parser operates by defining functions for all\n// syntactic elements, and recursively calling those, each function\n// advancing the input stream and returning an AST node. Precedence\n// of constructs (for example, the fact that `!x[1]` means `!(x[1])`\n// instead of `(!x)[1]` is handled by the fact that the parser\n// function that parses unary prefix operators is called first, and\n// in turn calls the function that parses `[]` subscripts — that\n// way, it'll receive the node for `x[1]` already parsed, and wraps\n// *that* in the unary operator node.\n//\n// Acorn uses an [operator precedence parser][opp] to handle binary\n// operator precedence, because it is much more compact than using\n// the technique outlined above, which uses different, nesting\n// functions to specify precedence, for all of the ten binary\n// precedence levels that JavaScript defines.\n//\n// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser\n\nimport {\n tokenCanStartExpression,\n tokenIsAssignment,\n tokenIsIdentifier,\n tokenIsKeywordOrIdentifier,\n tokenIsOperator,\n tokenIsPostfix,\n tokenIsPrefix,\n tokenIsRightAssociative,\n tokenIsTemplate,\n tokenKeywordOrIdentifierIsKeyword,\n tokenLabelName,\n tokenOperatorPrecedence,\n tt,\n type TokenType,\n} from \"../tokenizer/types\";\nimport type * as N from \"../types\";\nimport LValParser from \"./lval\";\nimport {\n isKeyword,\n isReservedWord,\n isStrictReservedWord,\n isStrictBindReservedWord,\n isIdentifierStart,\n canBeReservedWord,\n} from \"../util/identifier\";\nimport {\n type Position,\n createPositionWithColumnOffset,\n} from \"../util/location\";\nimport * as charCodes from \"charcodes\";\nimport {\n BIND_OUTSIDE,\n BIND_VAR,\n SCOPE_ARROW,\n SCOPE_CLASS,\n SCOPE_DIRECT_SUPER,\n SCOPE_FUNCTION,\n SCOPE_SUPER,\n} from \"../util/scopeflags\";\nimport { ExpressionErrors } from \"./util\";\nimport {\n PARAM_AWAIT,\n PARAM_IN,\n PARAM_RETURN,\n functionFlags,\n} from \"../util/production-parameter\";\nimport {\n newArrowHeadScope,\n newAsyncArrowScope,\n newExpressionScope,\n} from \"../util/expression-scope\";\nimport { Errors, type ParseError } from \"../parse-error\";\nimport { UnparenthesizedPipeBodyDescriptions } from \"../parse-error/pipeline-operator-errors\";\nimport { setInnerComments } from \"./comments\";\nimport { cloneIdentifier, type Undone } from \"./node\";\nimport type Parser from \".\";\n\nimport type { SourceType } from \"../options\";\n\nexport default abstract class ExpressionParser extends LValParser {\n // Forward-declaration: defined in statement.js\n abstract parseBlock(\n allowDirectives?: boolean,\n createNewLexicalScope?: boolean,\n afterBlockParse?: (hasStrictModeDirective: boolean) => void,\n ): N.BlockStatement;\n abstract parseClass(\n node: N.Class,\n isStatement: boolean,\n optionalId?: boolean,\n ): N.Class;\n abstract parseDecorators(allowExport?: boolean): void;\n abstract parseFunction<T extends N.NormalFunction>(\n node: T,\n statement?: number,\n allowExpressionBody?: boolean,\n isAsync?: boolean,\n ): T;\n abstract parseFunctionParams(node: N.Function, isConstructor?: boolean): void;\n abstract parseBlockOrModuleBlockBody(\n body: N.Statement[],\n directives: N.Directive[] | null | undefined,\n topLevel: boolean,\n end: TokenType,\n afterBlockParse?: (hasStrictModeDirective: boolean) => void,\n ): void;\n abstract parseProgram(\n program: N.Program,\n end: TokenType,\n sourceType?: SourceType,\n ): N.Program;\n\n // For object literal, check if property __proto__ has been used more than once.\n // If the expression is a destructuring assignment, then __proto__ may appear\n // multiple times. Otherwise, __proto__ is a duplicated key.\n\n // For record expression, check if property __proto__ exists\n\n checkProto(\n prop: N.ObjectMember | N.SpreadElement,\n isRecord: boolean | undefined | null,\n protoRef: {\n used: boolean;\n },\n refExpressionErrors?: ExpressionErrors | null,\n ): void {\n if (\n prop.type === \"SpreadElement\" ||\n this.isObjectMethod(prop) ||\n prop.computed ||\n // @ts-expect-error prop must be an ObjectProperty\n prop.shorthand\n ) {\n return;\n }\n\n const key = prop.key;\n // It is either an Identifier or a String/NumericLiteral\n const name = key.type === \"Identifier\" ? key.name : key.value;\n\n if (name === \"__proto__\") {\n if (isRecord) {\n this.raise(Errors.RecordNoProto, { at: key });\n return;\n }\n if (protoRef.used) {\n if (refExpressionErrors) {\n // Store the first redefinition's position, otherwise ignore because\n // we are parsing ambiguous pattern\n if (refExpressionErrors.doubleProtoLoc === null) {\n refExpressionErrors.doubleProtoLoc = key.loc.start;\n }\n } else {\n this.raise(Errors.DuplicateProto, { at: key });\n }\n }\n\n protoRef.used = true;\n }\n }\n\n shouldExitDescending(expr: N.Expression, potentialArrowAt: number): boolean {\n return (\n expr.type === \"ArrowFunctionExpression\" && expr.start === potentialArrowAt\n );\n }\n\n // Convenience method to parse an Expression only\n getExpression(this: Parser): N.Expression & N.ParserOutput {\n this.enterInitialScopes();\n this.nextToken();\n const expr = this.parseExpression();\n if (!this.match(tt.eof)) {\n this.unexpected();\n }\n // Unlike parseTopLevel, we need to drain remaining commentStacks\n // because the top level node is _not_ Program.\n this.finalizeRemainingComments();\n expr.comments = this.state.comments;\n expr.errors = this.state.errors;\n if (this.options.tokens) {\n expr.tokens = this.tokens;\n }\n // @ts-expect-error fixme: refine types\n return expr;\n }\n\n // ### Expression parsing\n\n // These nest, from the most general expression type at the top to\n // 'atomic', nondivisible expression types at the bottom. Most of\n // the functions will simply let the function (s) below them parse,\n // and, *if* the syntactic construct they handle is present, wrap\n // the AST node that the inner parser gave them in another node.\n\n // Parse a full expression.\n // - `disallowIn`\n // is used to forbid the `in` operator (in for loops initialization expressions)\n // When `disallowIn` is true, the production parameter [In] is not present.\n\n // - `refExpressionErrors `\n // provides reference for storing '=' operator inside shorthand\n // property assignment in contexts where both object expression\n // and object pattern might appear (so it's possible to raise\n // delayed syntax error at correct position).\n\n parseExpression(\n this: Parser,\n disallowIn?: boolean,\n refExpressionErrors?: ExpressionErrors,\n ): N.Expression {\n if (disallowIn) {\n return this.disallowInAnd(() =>\n this.parseExpressionBase(refExpressionErrors),\n );\n }\n return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors));\n }\n\n // https://tc39.es/ecma262/#prod-Expression\n parseExpressionBase(\n this: Parser,\n refExpressionErrors?: ExpressionErrors,\n ): N.Expression {\n const startLoc = this.state.startLoc;\n const expr = this.parseMaybeAssign(refExpressionErrors);\n if (this.match(tt.comma)) {\n const node = this.startNodeAt(startLoc);\n node.expressions = [expr];\n while (this.eat(tt.comma)) {\n node.expressions.push(this.parseMaybeAssign(refExpressionErrors));\n }\n this.toReferencedList(node.expressions);\n return this.finishNode(node, \"SequenceExpression\");\n }\n return expr;\n }\n\n // Set [~In] parameter for assignment expression\n parseMaybeAssignDisallowIn(\n this: Parser,\n refExpressionErrors?: ExpressionErrors | null,\n afterLeftParse?: Function,\n ) {\n return this.disallowInAnd(() =>\n this.parseMaybeAssign(refExpressionErrors, afterLeftParse),\n );\n }\n\n // Set [+In] parameter for assignment expression\n parseMaybeAssignAllowIn(\n this: Parser,\n refExpressionErrors?: ExpressionErrors | null,\n afterLeftParse?: Function,\n ) {\n return this.allowInAnd(() =>\n this.parseMaybeAssign(refExpressionErrors, afterLeftParse),\n );\n }\n\n // This method is only used by\n // the typescript and flow plugins.\n setOptionalParametersError(\n refExpressionErrors: ExpressionErrors,\n resultError?: ParseError<any>,\n ) {\n refExpressionErrors.optionalParametersLoc =\n resultError?.loc ?? this.state.startLoc;\n }\n\n // Parse an assignment expression. This includes applications of\n // operators like `+=`.\n // https://tc39.es/ecma262/#prod-AssignmentExpression\n parseMaybeAssign(\n this: Parser,\n refExpressionErrors?: ExpressionErrors | null,\n afterLeftParse?: Function,\n ): N.Expression {\n const startLoc = this.state.startLoc;\n if (this.isContextual(tt._yield)) {\n if (this.prodParam.hasYield) {\n let left = this.parseYield();\n if (afterLeftParse) {\n left = afterLeftParse.call(this, left, startLoc);\n }\n return left;\n }\n }\n\n let ownExpressionErrors;\n if (refExpressionErrors) {\n ownExpressionErrors = false;\n } else {\n refExpressionErrors = new ExpressionErrors();\n ownExpressionErrors = true;\n }\n const { type } = this.state;\n\n if (type === tt.parenL || tokenIsIdentifier(type)) {\n this.state.potentialArrowAt = this.state.start;\n }\n\n let left = this.parseMaybeConditional(refExpressionErrors);\n if (afterLeftParse) {\n left = afterLeftParse.call(this, left, startLoc);\n }\n if (tokenIsAssignment(this.state.type)) {\n const node = this.startNodeAt<N.AssignmentExpression>(startLoc);\n const operator = this.state.value;\n node.operator = operator;\n\n if (this.match(tt.eq)) {\n this.toAssignable(left, /* isLHS */ true);\n node.left = left;\n\n const startIndex = startLoc.index;\n if (\n refExpressionErrors.doubleProtoLoc != null &&\n refExpressionErrors.doubleProtoLoc.index >= startIndex\n ) {\n refExpressionErrors.doubleProtoLoc = null; // reset because double __proto__ is valid in assignment expression\n }\n if (\n refExpressionErrors.shorthandAssignLoc != null &&\n refExpressionErrors.shorthandAssignLoc.index >= startIndex\n ) {\n refExpressionErrors.shorthandAssignLoc = null; // reset because shorthand default was used correctly\n }\n if (\n refExpressionErrors.privateKeyLoc != null &&\n refExpressionErrors.privateKeyLoc.index >= startIndex\n ) {\n this.checkDestructuringPrivate(refExpressionErrors);\n refExpressionErrors.privateKeyLoc = null; // reset because `({ #x: x })` is an assignable pattern\n }\n } else {\n node.left = left;\n }\n\n this.next();\n node.right = this.parseMaybeAssign();\n this.checkLVal(left, {\n in: this.finishNode(node, \"AssignmentExpression\"),\n });\n // @ts-expect-error todo(flow->ts) improve node types\n return node;\n } else if (ownExpressionErrors) {\n this.checkExpressionErrors(refExpressionErrors, true);\n }\n\n return left;\n }\n\n // Parse a ternary conditional (`?:`) operator.\n // https://tc39.es/ecma262/#prod-ConditionalExpression\n\n parseMaybeConditional(\n this: Parser,\n refExpressionErrors: ExpressionErrors,\n ): N.Expression {\n const startLoc = this.state.startLoc;\n const potentialArrowAt = this.state.potentialArrowAt;\n const expr = this.parseExprOps(refExpressionErrors);\n\n if (this.shouldExitDescending(expr, potentialArrowAt)) {\n return expr;\n }\n\n return this.parseConditional(expr, startLoc, refExpressionErrors);\n }\n\n parseConditional(\n this: Parser,\n expr: N.Expression,\n startLoc: Position,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n refExpressionErrors?: ExpressionErrors | null,\n ): N.Expression {\n if (this.eat(tt.question)) {\n const node = this.startNodeAt(startLoc);\n node.test = expr;\n node.consequent = this.parseMaybeAssignAllowIn();\n this.expect(tt.colon);\n node.alternate = this.parseMaybeAssign();\n return this.finishNode(node, \"ConditionalExpression\");\n }\n return expr;\n }\n\n parseMaybeUnaryOrPrivate(\n this: Parser,\n refExpressionErrors?: ExpressionErrors,\n ): N.Expression | N.PrivateName {\n return this.match(tt.privateName)\n ? this.parsePrivateName()\n : this.parseMaybeUnary(refExpressionErrors);\n }\n\n // Start the precedence parser.\n // https://tc39.es/ecma262/#prod-ShortCircuitExpression\n\n parseExprOps(\n this: Parser,\n refExpressionErrors: ExpressionErrors,\n ): N.Expression {\n const startLoc = this.state.startLoc;\n const potentialArrowAt = this.state.potentialArrowAt;\n const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors);\n\n if (this.shouldExitDescending(expr, potentialArrowAt)) {\n return expr;\n }\n\n return this.parseExprOp(expr, startLoc, -1);\n }\n\n // Parse binary operators with the operator precedence parsing\n // algorithm. `left` is the left-hand side of the operator.\n // `minPrec` provides context that allows the function to stop and\n // defer further parser to one of its callers when it encounters an\n // operator that has a lower precedence than the set it is parsing.\n\n parseExprOp(\n this: Parser,\n left: N.Expression | N.PrivateName,\n leftStartLoc: Position,\n minPrec: number,\n ): N.Expression {\n if (this.isPrivateName(left)) {\n // https://tc39.es/ecma262/#prod-RelationalExpression\n // RelationalExpression [In, Yield, Await]\n // [+In] PrivateIdentifier in ShiftExpression[?Yield, ?Await]\n\n const value = this.getPrivateNameSV(left);\n\n if (\n minPrec >= tokenOperatorPrecedence(tt._in) ||\n !this.prodParam.hasIn ||\n !this.match(tt._in)\n ) {\n this.raise(Errors.PrivateInExpectedIn, {\n at: left,\n identifierName: value,\n });\n }\n\n this.classScope.usePrivateName(value, left.loc.start);\n }\n\n const op = this.state.type;\n if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(tt._in))) {\n let prec = tokenOperatorPrecedence(op);\n if (prec > minPrec) {\n if (op === tt.pipeline) {\n this.expectPlugin(\"pipelineOperator\");\n if (this.state.inFSharpPipelineDirectBody) {\n return left;\n }\n this.checkPipelineAtInfixOperator(left, leftStartLoc);\n }\n const node = this.startNodeAt<N.LogicalExpression | N.BinaryExpression>(\n leftStartLoc,\n );\n node.left = left;\n node.operator = this.state.value;\n\n const logical = op === tt.logicalOR || op === tt.logicalAND;\n const coalesce = op === tt.nullishCoalescing;\n\n if (coalesce) {\n // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions.\n // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error.\n prec = tokenOperatorPrecedence(tt.logicalAND);\n }\n\n this.next();\n\n if (\n op === tt.pipeline &&\n this.hasPlugin([\"pipelineOperator\", { proposal: \"minimal\" }])\n ) {\n if (this.state.type === tt._await && this.prodParam.hasAwait) {\n throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody, {\n at: this.state.startLoc,\n });\n }\n }\n\n node.right = this.parseExprOpRightExpr(op, prec);\n const finishedNode = this.finishNode(\n node,\n logical || coalesce ? \"LogicalExpression\" : \"BinaryExpression\",\n );\n /* this check is for all ?? operators\n * a ?? b && c for this example\n * when op is coalesce and nextOp is logical (&&), throw at the pos of nextOp that it can not be mixed.\n * Symmetrically it also throws when op is logical and nextOp is coalesce\n */\n const nextOp = this.state.type;\n if (\n (coalesce && (nextOp === tt.logicalOR || nextOp === tt.logicalAND)) ||\n (logical && nextOp === tt.nullishCoalescing)\n ) {\n throw this.raise(Errors.MixingCoalesceWithLogical, {\n at: this.state.startLoc,\n });\n }\n\n return this.parseExprOp(finishedNode, leftStartLoc, minPrec);\n }\n }\n return left;\n }\n\n // Helper function for `parseExprOp`. Parse the right-hand side of binary-\n // operator expressions, then apply any operator-specific functions.\n\n parseExprOpRightExpr(\n this: Parser,\n op: TokenType,\n prec: number,\n ): N.Expression {\n const startLoc = this.state.startLoc;\n switch (op) {\n case tt.pipeline:\n switch (this.getPluginOption(\"pipelineOperator\", \"proposal\")) {\n case \"hack\":\n return this.withTopicBindingContext(() => {\n return this.parseHackPipeBody();\n });\n\n case \"smart\":\n return this.withTopicBindingContext(() => {\n if (this.prodParam.hasYield && this.isContextual(tt._yield)) {\n throw this.raise(Errors.PipeBodyIsTighter, {\n at: this.state.startLoc,\n });\n }\n return this.parseSmartPipelineBodyInStyle(\n this.parseExprOpBaseRightExpr(op, prec),\n startLoc,\n );\n });\n\n case \"fsharp\":\n return this.withSoloAwaitPermittingContext(() => {\n return this.parseFSharpPipelineBody(prec);\n });\n }\n\n // Falls through.\n default:\n return this.parseExprOpBaseRightExpr(op, prec);\n }\n }\n\n // Helper function for `parseExprOpRightExpr`. Parse the right-hand side of\n // binary-operator expressions without applying any operator-specific functions.\n\n parseExprOpBaseRightExpr(\n this: Parser,\n op: TokenType,\n prec: number,\n ): N.Expression {\n const startLoc = this.state.startLoc;\n\n return this.parseExprOp(\n this.parseMaybeUnaryOrPrivate(),\n startLoc,\n tokenIsRightAssociative(op) ? prec - 1 : prec,\n );\n }\n\n parseHackPipeBody(this: Parser): N.Expression {\n const { startLoc } = this.state;\n const body = this.parseMaybeAssign();\n const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has(\n // @ts-expect-error TS2345: Argument of type 'string' is not assignable to parameter of type '\"ArrowFunctionExpression\" | \"YieldExpression\" | \"AssignmentExpression\" | \"ConditionalExpression\"'.\n body.type,\n );\n\n // TODO: Check how to handle type casts in Flow and TS once they are supported\n if (requiredParentheses && !body.extra?.parenthesized) {\n this.raise(Errors.PipeUnparenthesizedBody, {\n at: startLoc,\n // @ts-expect-error TS2322: Type 'string' is not assignable to type '\"AssignmentExpression\" | \"ArrowFunctionExpression\" | \"ConditionalExpression\" | \"YieldExpression\"'.\n type: body.type,\n });\n }\n if (!this.topicReferenceWasUsedInCurrentContext()) {\n // A Hack pipe body must use the topic reference at least once.\n this.raise(Errors.PipeTopicUnused, { at: startLoc });\n }\n\n return body;\n }\n\n checkExponentialAfterUnary(\n node: N.AwaitExpression | Undone<N.UnaryExpression>,\n ) {\n if (this.match(tt.exponent)) {\n this.raise(Errors.UnexpectedTokenUnaryExponentiation, {\n at: node.argument,\n });\n }\n }\n\n // Parse unary operators, both prefix and postfix.\n // https://tc39.es/ecma262/#prod-UnaryExpression\n parseMaybeUnary(\n this: Parser,\n refExpressionErrors?: ExpressionErrors | null,\n sawUnary?: boolean,\n ): N.Expression {\n const startLoc = this.state.startLoc;\n const isAwait = this.isContextual(tt._await);\n\n if (isAwait && this.isAwaitAllowed()) {\n this.next();\n const expr = this.parseAwait(startLoc);\n if (!sawUnary) this.checkExponentialAfterUnary(expr);\n return expr;\n }\n const update = this.match(tt.incDec);\n const node = this.startNode<N.UnaryExpression | N.UpdateExpression>();\n if (tokenIsPrefix(this.state.type)) {\n node.operator = this.state.value;\n node.prefix = true;\n\n if (this.match(tt._throw)) {\n this.expectPlugin(\"throwExpressions\");\n }\n const isDelete = this.match(tt._delete);\n this.next();\n\n node.argument = this.parseMaybeUnary(null, true);\n\n this.checkExpressionErrors(refExpressionErrors, true);\n\n if (this.state.strict && isDelete) {\n const arg = node.argument;\n\n if (arg.type === \"Identifier\") {\n this.raise(Errors.StrictDelete, { at: node });\n } else if (this.hasPropertyAsPrivateName(arg)) {\n this.raise(Errors.DeletePrivateField, { at: node });\n }\n }\n\n if (!update) {\n if (!sawUnary) {\n this.checkExponentialAfterUnary(node as Undone<N.UnaryExpression>);\n }\n return this.finishNode(node, \"UnaryExpression\");\n }\n }\n\n const expr = this.parseUpdate(\n // @ts-expect-error using \"Undone\" node as \"done\"\n node,\n update,\n refExpressionErrors,\n );\n\n if (isAwait) {\n const { type } = this.state;\n const startsExpr = this.hasPlugin(\"v8intrinsic\")\n ? tokenCanStartExpression(type)\n : tokenCanStartExpression(type) && !this.match(tt.modulo);\n if (startsExpr && !this.isAmbiguousAwait()) {\n this.raiseOverwrite(Errors.AwaitNotInAsyncContext, { at: startLoc });\n return this.parseAwait(startLoc);\n }\n }\n\n return expr;\n }\n\n // https://tc39.es/ecma262/#prod-UpdateExpression\n parseUpdate(\n this: Parser,\n node: N.Expression,\n update: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.Expression {\n if (update) {\n // @ts-expect-error Type 'Node' is missing the following properties from type 'Undone<UpdateExpression>': prefix, operator, argument\n const updateExpressionNode = node as Undone<N.UpdateExpression>;\n this.checkLVal(updateExpressionNode.argument, {\n in: this.finishNode(updateExpressionNode, \"UpdateExpression\"),\n });\n return node;\n }\n\n const startLoc = this.state.startLoc;\n let expr = this.parseExprSubscripts(refExpressionErrors);\n if (this.checkExpressionErrors(refExpressionErrors, false)) return expr;\n while (tokenIsPostfix(this.state.type) && !this.canInsertSemicolon()) {\n const node = this.startNodeAt<N.UpdateExpression>(startLoc);\n node.operator = this.state.value;\n node.prefix = false;\n node.argument = expr;\n this.next();\n this.checkLVal(expr, {\n in: (expr = this.finishNode(node, \"UpdateExpression\")),\n });\n }\n return expr;\n }\n\n // Parse call, dot, and `[]`-subscript expressions.\n // https://tc39.es/ecma262/#prod-LeftHandSideExpression\n parseExprSubscripts(\n this: Parser,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.Expression {\n const startLoc = this.state.startLoc;\n const potentialArrowAt = this.state.potentialArrowAt;\n const expr = this.parseExprAtom(refExpressionErrors);\n\n if (this.shouldExitDescending(expr, potentialArrowAt)) {\n return expr;\n }\n\n return this.parseSubscripts(expr, startLoc);\n }\n\n parseSubscripts(\n this: Parser,\n base: N.Expression,\n startLoc: Position,\n noCalls?: boolean | null,\n ): N.Expression {\n const state = {\n optionalChainMember: false,\n maybeAsyncArrow: this.atPossibleAsyncArrow(base),\n stop: false,\n };\n do {\n base = this.parseSubscript(base, startLoc, noCalls, state);\n\n // After parsing a subscript, this isn't \"async\" for sure.\n state.maybeAsyncArrow = false;\n } while (!state.stop);\n return base;\n }\n\n /**\n * @param state Set 'state.stop = true' to indicate that we should stop parsing subscripts.\n * state.optionalChainMember to indicate that the member is currently in OptionalChain\n */\n parseSubscript(\n this: Parser,\n base: N.Expression,\n startLoc: Position,\n noCalls: boolean | undefined | null,\n state: N.ParseSubscriptState,\n ): N.Expression {\n const { type } = this.state;\n if (!noCalls && type === tt.doubleColon) {\n return this.parseBind(base, startLoc, noCalls, state);\n } else if (tokenIsTemplate(type)) {\n return this.parseTaggedTemplateExpression(base, startLoc, state);\n }\n\n let optional = false;\n\n if (type === tt.questionDot) {\n if (noCalls) {\n this.raise(Errors.OptionalChainingNoNew, {\n at: this.state.startLoc,\n });\n if (this.lookaheadCharCode() === charCodes.leftParenthesis) {\n // stop at `?.` when parsing `new a?.()`\n state.stop = true;\n return base;\n }\n }\n state.optionalChainMember = optional = true;\n this.next();\n }\n\n if (!noCalls && this.match(tt.parenL)) {\n return this.parseCoverCallAndAsyncArrowHead(\n base,\n startLoc,\n state,\n optional,\n );\n } else {\n const computed = this.eat(tt.bracketL);\n if (computed || optional || this.eat(tt.dot)) {\n return this.parseMember(base, startLoc, state, computed, optional);\n } else {\n state.stop = true;\n return base;\n }\n }\n }\n\n // base[?Yield, ?Await] [ Expression[+In, ?Yield, ?Await] ]\n // base[?Yield, ?Await] . IdentifierName\n // base[?Yield, ?Await] . PrivateIdentifier\n // where `base` is one of CallExpression, MemberExpression and OptionalChain\n parseMember(\n this: Parser,\n base: N.Expression,\n startLoc: Position,\n state: N.ParseSubscriptState,\n computed: boolean,\n optional: boolean,\n ): N.OptionalMemberExpression | N.MemberExpression {\n const node = this.startNodeAt<\n N.OptionalMemberExpression | N.MemberExpression\n >(startLoc);\n node.object = base;\n node.computed = computed;\n if (computed) {\n node.property = this.parseExpression();\n this.expect(tt.bracketR);\n } else if (this.match(tt.privateName)) {\n if (base.type === \"Super\") {\n this.raise(Errors.SuperPrivateField, { at: startLoc });\n }\n this.classScope.usePrivateName(this.state.value, this.state.startLoc);\n node.property = this.parsePrivateName();\n } else {\n node.property = this.parseIdentifier(true);\n }\n\n if (state.optionalChainMember) {\n (node as N.OptionalMemberExpression).optional = optional;\n return this.finishNode(node, \"OptionalMemberExpression\");\n } else {\n return this.finishNode(node, \"MemberExpression\");\n }\n }\n\n // https://github.com/tc39/proposal-bind-operator#syntax\n parseBind(\n this: Parser,\n base: N.Expression,\n startLoc: Position,\n noCalls: boolean | undefined | null,\n state: N.ParseSubscriptState,\n ): N.Expression {\n const node = this.startNodeAt(startLoc);\n node.object = base;\n this.next(); // eat '::'\n node.callee = this.parseNoCallExpr();\n state.stop = true;\n return this.parseSubscripts(\n this.finishNode(node, \"BindExpression\"),\n startLoc,\n noCalls,\n );\n }\n\n // https://tc39.es/ecma262/#prod-CoverCallExpressionAndAsyncArrowHead\n // CoverCallExpressionAndAsyncArrowHead\n // CallExpression[?Yield, ?Await] Arguments[?Yield, ?Await]\n // OptionalChain[?Yield, ?Await] Arguments[?Yield, ?Await]\n parseCoverCallAndAsyncArrowHead(\n this: Parser,\n base: N.Expression,\n startLoc: Position,\n state: N.ParseSubscriptState,\n optional: boolean,\n ): N.Expression {\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n let refExpressionErrors: ExpressionErrors | null = null;\n\n this.state.maybeInArrowParameters = true;\n this.next(); // eat `(`\n\n const node = this.startNodeAt<N.CallExpression | N.OptionalCallExpression>(\n startLoc,\n );\n node.callee = base;\n const { maybeAsyncArrow, optionalChainMember } = state;\n\n if (maybeAsyncArrow) {\n this.expressionScope.enter(newAsyncArrowScope());\n refExpressionErrors = new ExpressionErrors();\n }\n\n if (optionalChainMember) {\n // @ts-expect-error when optionalChainMember is true, node must be an optional call\n node.optional = optional;\n }\n\n if (optional) {\n node.arguments = this.parseCallExpressionArguments(tt.parenR);\n } else {\n node.arguments = this.parseCallExpressionArguments(\n tt.parenR,\n base.type === \"Import\",\n base.type !== \"Super\",\n // @ts-expect-error todo(flow->ts)\n node,\n refExpressionErrors,\n );\n }\n let finishedNode:\n | N.CallExpression\n | N.OptionalCallExpression\n | N.ArrowFunctionExpression = this.finishCallExpression(\n node,\n optionalChainMember,\n );\n\n if (maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) {\n /*:: invariant(refExpressionErrors != null) */\n state.stop = true;\n this.checkDestructuringPrivate(refExpressionErrors);\n this.expressionScope.validateAsPattern();\n this.expressionScope.exit();\n finishedNode = this.parseAsyncArrowFromCallExpression(\n this.startNodeAt<N.ArrowFunctionExpression>(startLoc),\n finishedNode as N.CallExpression,\n );\n } else {\n if (maybeAsyncArrow) {\n this.checkExpressionErrors(refExpressionErrors, true);\n this.expressionScope.exit();\n }\n this.toReferencedArguments(finishedNode);\n }\n\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n\n return finishedNode;\n }\n\n toReferencedArguments(\n node: N.CallExpression | N.OptionalCallExpression,\n isParenthesizedExpr?: boolean,\n ) {\n this.toReferencedListDeep(node.arguments, isParenthesizedExpr);\n }\n\n // MemberExpression [?Yield, ?Await] TemplateLiteral[?Yield, ?Await, +Tagged]\n // CallExpression [?Yield, ?Await] TemplateLiteral[?Yield, ?Await, +Tagged]\n parseTaggedTemplateExpression(\n this: Parser,\n base: N.Expression,\n startLoc: Position,\n state: N.ParseSubscriptState,\n ): N.TaggedTemplateExpression {\n const node = this.startNodeAt<N.TaggedTemplateExpression>(startLoc);\n node.tag = base;\n node.quasi = this.parseTemplate(true);\n if (state.optionalChainMember) {\n this.raise(Errors.OptionalChainingNoTemplate, { at: startLoc });\n }\n return this.finishNode(node, \"TaggedTemplateExpression\");\n }\n\n atPossibleAsyncArrow(base: N.Expression): boolean {\n return (\n base.type === \"Identifier\" &&\n base.name === \"async\" &&\n this.state.lastTokEndLoc.index === base.end &&\n !this.canInsertSemicolon() &&\n // check there are no escape sequences, such as \\u{61}sync\n base.end - base.start === 5 &&\n base.start === this.state.potentialArrowAt\n );\n }\n\n expectImportAttributesPlugin() {\n if (!this.hasPlugin(\"importAssertions\")) {\n this.expectPlugin(\"importAttributes\");\n }\n }\n\n finishCallExpression<T extends N.CallExpression | N.OptionalCallExpression>(\n node: Undone<T>,\n optional: boolean,\n ): T {\n if (node.callee.type === \"Import\") {\n if (node.arguments.length === 2) {\n if (process.env.BABEL_8_BREAKING) {\n this.expectImportAttributesPlugin();\n } else {\n if (!this.hasPlugin(\"moduleAttributes\")) {\n this.expectImportAttributesPlugin();\n }\n }\n }\n if (node.arguments.length === 0 || node.arguments.length > 2) {\n this.raise(Errors.ImportCallArity, {\n at: node,\n maxArgumentCount:\n this.hasPlugin(\"importAttributes\") ||\n this.hasPlugin(\"importAssertions\") ||\n this.hasPlugin(\"moduleAttributes\")\n ? 2\n : 1,\n });\n } else {\n for (const arg of node.arguments) {\n if (arg.type === \"SpreadElement\") {\n this.raise(Errors.ImportCallSpreadArgument, { at: arg });\n }\n }\n }\n }\n return this.finishNode(\n node,\n optional ? \"OptionalCallExpression\" : \"CallExpression\",\n );\n }\n\n parseCallExpressionArguments(\n this: Parser,\n close: TokenType,\n dynamicImport?: boolean,\n allowPlaceholder?: boolean,\n nodeForExtra?: N.Node | null,\n refExpressionErrors?: ExpressionErrors | null,\n ): Array<N.Expression | undefined | null> {\n const elts: N.Expression[] = [];\n let first = true;\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.inFSharpPipelineDirectBody = false;\n\n while (!this.eat(close)) {\n if (first) {\n first = false;\n } else {\n this.expect(tt.comma);\n if (this.match(close)) {\n if (\n dynamicImport &&\n !this.hasPlugin(\"importAttributes\") &&\n !this.hasPlugin(\"importAssertions\") &&\n !this.hasPlugin(\"moduleAttributes\")\n ) {\n this.raise(Errors.ImportCallArgumentTrailingComma, {\n at: this.state.lastTokStartLoc,\n });\n }\n if (nodeForExtra) {\n this.addTrailingCommaExtraToNode(nodeForExtra);\n }\n this.next();\n break;\n }\n }\n\n elts.push(\n this.parseExprListItem(false, refExpressionErrors, allowPlaceholder),\n );\n }\n\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n\n return elts;\n }\n\n shouldParseAsyncArrow(): boolean {\n return this.match(tt.arrow) && !this.canInsertSemicolon();\n }\n\n parseAsyncArrowFromCallExpression(\n this: Parser,\n node: Undone<N.ArrowFunctionExpression>,\n call: N.CallExpression,\n ): N.ArrowFunctionExpression {\n this.resetPreviousNodeTrailingComments(call);\n this.expect(tt.arrow);\n this.parseArrowExpression(\n node,\n call.arguments,\n true,\n call.extra?.trailingCommaLoc,\n );\n // mark inner comments of `async()` as inner comments of `async () =>`\n if (call.innerComments) {\n setInnerComments(node, call.innerComments);\n }\n // mark trailing comments of `async` to be inner comments\n if (call.callee.trailingComments) {\n setInnerComments(node, call.callee.trailingComments);\n }\n return node as N.ArrowFunctionExpression;\n }\n\n // Parse a no-call expression (like argument of `new` or `::` operators).\n // https://tc39.es/ecma262/#prod-MemberExpression\n parseNoCallExpr(this: Parser): N.Expression {\n const startLoc = this.state.startLoc;\n return this.parseSubscripts(this.parseExprAtom(), startLoc, true);\n }\n\n // Parse an atomic expression — either a single token that is an\n // expression, an expression started by a keyword like `function` or\n // `new`, or an expression wrapped in punctuation like `()`, `[]`,\n // or `{}`.\n\n // https://tc39.es/ecma262/#prod-PrimaryExpression\n // https://tc39.es/ecma262/#prod-AsyncArrowFunction\n // PrimaryExpression\n // Super\n // Import\n // AsyncArrowFunction\n\n parseExprAtom(\n this: Parser,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.Expression {\n let node;\n let decorators: N.Decorator[] | null = null;\n\n const { type } = this.state;\n switch (type) {\n case tt._super:\n return this.parseSuper();\n\n case tt._import:\n node = this.startNode<N.MetaProperty | N.Import>();\n this.next();\n\n if (this.match(tt.dot)) {\n return this.parseImportMetaProperty(node as Undone<N.MetaProperty>);\n }\n\n if (!this.match(tt.parenL)) {\n this.raise(Errors.UnsupportedImport, {\n at: this.state.lastTokStartLoc,\n });\n }\n return this.finishNode(node, \"Import\");\n case tt._this:\n node = this.startNode();\n this.next();\n return this.finishNode(node, \"ThisExpression\");\n\n case tt._do: {\n return this.parseDo(this.startNode(), false);\n }\n\n case tt.slash:\n case tt.slashAssign: {\n this.readRegexp();\n return this.parseRegExpLiteral(this.state.value);\n }\n\n case tt.num:\n return this.parseNumericLiteral(this.state.value);\n\n case tt.bigint:\n return this.parseBigIntLiteral(this.state.value);\n\n case tt.decimal:\n return this.parseDecimalLiteral(this.state.value);\n\n case tt.string:\n return this.parseStringLiteral(this.state.value);\n\n case tt._null:\n return this.parseNullLiteral();\n\n case tt._true:\n return this.parseBooleanLiteral(true);\n case tt._false:\n return this.parseBooleanLiteral(false);\n\n case tt.parenL: {\n const canBeArrow = this.state.potentialArrowAt === this.state.start;\n return this.parseParenAndDistinguishExpression(canBeArrow);\n }\n\n case tt.bracketBarL:\n case tt.bracketHashL: {\n return this.parseArrayLike(\n this.state.type === tt.bracketBarL ? tt.bracketBarR : tt.bracketR,\n /* canBePattern */ false,\n /* isTuple */ true,\n );\n }\n case tt.bracketL: {\n return this.parseArrayLike(\n tt.bracketR,\n /* canBePattern */ true,\n /* isTuple */ false,\n refExpressionErrors,\n );\n }\n case tt.braceBarL:\n case tt.braceHashL: {\n return this.parseObjectLike(\n this.state.type === tt.braceBarL ? tt.braceBarR : tt.braceR,\n /* isPattern */ false,\n /* isRecord */ true,\n );\n }\n case tt.braceL: {\n return this.parseObjectLike(\n tt.braceR,\n /* isPattern */ false,\n /* isRecord */ false,\n refExpressionErrors,\n );\n }\n case tt._function:\n return this.parseFunctionOrFunctionSent();\n\n case tt.at:\n decorators = this.parseDecorators();\n // fall through\n case tt._class:\n return this.parseClass(\n this.maybeTakeDecorators(decorators, this.startNode()),\n false,\n );\n\n case tt._new:\n return this.parseNewOrNewTarget();\n\n case tt.templateNonTail:\n case tt.templateTail:\n return this.parseTemplate(false);\n\n // BindExpression[Yield]\n // :: MemberExpression[?Yield]\n case tt.doubleColon: {\n node = this.startNode();\n this.next();\n node.object = null;\n const callee = (node.callee = this.parseNoCallExpr());\n if (callee.type === \"MemberExpression\") {\n return this.finishNode(node, \"BindExpression\");\n } else {\n throw this.raise(Errors.UnsupportedBind, { at: callee });\n }\n }\n\n case tt.privateName: {\n // Standalone private names are only allowed in \"#x in obj\"\n // expressions, and they are directly handled by callers of\n // parseExprOp. If we reach this, the input is always invalid.\n // We can throw a better error message and recover, rather than\n // just throwing \"Unexpected token\" (which is the default\n // behavior of this big switch statement).\n this.raise(Errors.PrivateInExpectedIn, {\n at: this.state.startLoc,\n identifierName: this.state.value,\n });\n return this.parsePrivateName();\n }\n\n case tt.moduloAssign: {\n return this.parseTopicReferenceThenEqualsSign(tt.modulo, \"%\");\n }\n\n case tt.xorAssign: {\n return this.parseTopicReferenceThenEqualsSign(tt.bitwiseXOR, \"^\");\n }\n\n case tt.doubleCaret:\n case tt.doubleAt: {\n return this.parseTopicReference(\"hack\");\n }\n\n case tt.bitwiseXOR:\n case tt.modulo:\n case tt.hash: {\n const pipeProposal = this.getPluginOption(\n \"pipelineOperator\",\n \"proposal\",\n );\n\n if (pipeProposal) {\n return this.parseTopicReference(pipeProposal);\n }\n this.unexpected();\n break;\n }\n\n case tt.lt: {\n const lookaheadCh = this.input.codePointAt(this.nextTokenStart());\n if (\n isIdentifierStart(lookaheadCh) || // Element/Type Parameter <foo>\n lookaheadCh === charCodes.greaterThan // Fragment <>\n ) {\n this.expectOnePlugin([\"jsx\", \"flow\", \"typescript\"]);\n } else {\n this.unexpected();\n }\n break;\n }\n\n default:\n if (tokenIsIdentifier(type)) {\n if (\n this.isContextual(tt._module) &&\n this.lookaheadInLineCharCode() === charCodes.leftCurlyBrace\n ) {\n return this.parseModuleExpression();\n }\n const canBeArrow = this.state.potentialArrowAt === this.state.start;\n const containsEsc = this.state.containsEsc;\n const id = this.parseIdentifier();\n\n if (\n !containsEsc &&\n id.name === \"async\" &&\n !this.canInsertSemicolon()\n ) {\n const { type } = this.state;\n if (type === tt._function) {\n this.resetPreviousNodeTrailingComments(id);\n this.next();\n return this.parseAsyncFunctionExpression(\n this.startNodeAtNode(id),\n );\n } else if (tokenIsIdentifier(type)) {\n // If the next token begins with \"=\", commit to parsing an async\n // arrow function. (Peeking ahead for \"=\" lets us avoid a more\n // expensive full-token lookahead on this common path.)\n if (this.lookaheadCharCode() === charCodes.equalsTo) {\n // although `id` is not used in async arrow unary function,\n // we don't need to reset `async`'s trailing comments because\n // it will be attached to the upcoming async arrow binding identifier\n return this.parseAsyncArrowUnaryFunction(\n this.startNodeAtNode(id),\n );\n } else {\n // Otherwise, treat \"async\" as an identifier and let calling code\n // deal with the current tt.name token.\n return id;\n }\n } else if (type === tt._do) {\n this.resetPreviousNodeTrailingComments(id);\n return this.parseDo(this.startNodeAtNode(id), true);\n }\n }\n\n if (\n canBeArrow &&\n this.match(tt.arrow) &&\n !this.canInsertSemicolon()\n ) {\n this.next();\n return this.parseArrowExpression(\n this.startNodeAtNode(id),\n [id],\n false,\n );\n }\n\n return id;\n } else {\n this.unexpected();\n }\n }\n }\n\n // This helper method should only be called\n // when the parser has reached a potential Hack pipe topic token\n // that is followed by an equals sign.\n // See <https://github.com/js-choi/proposal-hack-pipes>.\n // If we find ^= or %= in an expression position\n // (i.e., the tt.moduloAssign or tt.xorAssign token types), and if the\n // Hack-pipes proposal is active with ^ or % as its topicToken, then the ^ or\n // % could be the topic token (e.g., in x |> ^==y or x |> ^===y), and so we\n // reparse the current token as ^ or %.\n // Otherwise, this throws an unexpected-token error.\n parseTopicReferenceThenEqualsSign(\n topicTokenType: TokenType,\n topicTokenValue: string,\n ): N.Expression {\n const pipeProposal = this.getPluginOption(\"pipelineOperator\", \"proposal\");\n\n if (pipeProposal) {\n // Set the most-recent token to be a topic token\n // given by the tokenType and tokenValue.\n // Now the next readToken() call (in parseTopicReference)\n // will consume that “topic token”.\n this.state.type = topicTokenType;\n this.state.value = topicTokenValue;\n // Rewind the tokenizer to the end of the “topic token”, so that the\n // following token starts at the equals sign after that topic token.\n this.state.pos--;\n this.state.end--;\n // This is safe to do since the preceding character was either ^ or %, and\n // thus not a newline.\n this.state.endLoc = createPositionWithColumnOffset(this.state.endLoc, -1);\n // Now actually consume the topic token.\n return this.parseTopicReference(pipeProposal);\n } else {\n this.unexpected();\n }\n }\n\n // This helper method should only be called\n // when the proposal-pipeline-operator plugin is active,\n // and when the parser has reached a potential Hack pipe topic token.\n // Although a pipe-operator proposal is assumed to be active,\n // its configuration might not match the current token’s type.\n // See <https://github.com/js-choi/proposal-hack-pipes>.\n parseTopicReference(pipeProposal: string): N.Expression {\n const node = this.startNode<N.TopicReference>();\n const startLoc = this.state.startLoc;\n const tokenType = this.state.type;\n\n // Consume the current token.\n this.next();\n\n // If the pipe-operator plugin’s configuration matches the current token’s type,\n // then this will return `node`, will have been finished as a topic reference.\n // Otherwise, this will throw a `PipeTopicUnconfiguredToken` error.\n return this.finishTopicReference(node, startLoc, pipeProposal, tokenType);\n }\n\n // This helper method attempts to finish the given `node`\n // into a topic-reference node for the given `pipeProposal`.\n // See <https://github.com/js-choi/proposal-hack-pipes>.\n //\n // The method assumes that any topic token was consumed before it was called.\n //\n // If the `pipelineOperator` plugin is active,\n // and if the given `tokenType` matches the plugin’s configuration,\n // then this method will return the finished `node`.\n //\n // If the `pipelineOperator` plugin is active,\n // but if the given `tokenType` does not match the plugin’s configuration,\n // then this method will throw a `PipeTopicUnconfiguredToken` error.\n finishTopicReference(\n node: Undone<N.Node>,\n startLoc: Position,\n pipeProposal: string,\n tokenType: TokenType,\n ): N.Expression {\n if (\n this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)\n ) {\n // The token matches the plugin’s configuration.\n // The token is therefore a topic reference.\n\n // Determine the node type for the topic reference\n // that is appropriate for the active pipe-operator proposal.\n const nodeType =\n pipeProposal === \"smart\"\n ? \"PipelinePrimaryTopicReference\"\n : // The proposal must otherwise be \"hack\",\n // as enforced by testTopicReferenceConfiguration.\n \"TopicReference\";\n\n if (!this.topicReferenceIsAllowedInCurrentContext()) {\n this.raise(\n // The topic reference is not allowed in the current context:\n // it is outside of a pipe body.\n // Raise recoverable errors.\n pipeProposal === \"smart\"\n ? Errors.PrimaryTopicNotAllowed\n : // In this case, `pipeProposal === \"hack\"` is true.\n Errors.PipeTopicUnbound,\n { at: startLoc },\n );\n }\n\n // Register the topic reference so that its pipe body knows\n // that its topic was used at least once.\n this.registerTopicReference();\n\n return this.finishNode(node, nodeType);\n } else {\n // The token does not match the plugin’s configuration.\n throw this.raise(Errors.PipeTopicUnconfiguredToken, {\n at: startLoc,\n token: tokenLabelName(tokenType),\n });\n }\n }\n\n // This helper method tests whether the given token type\n // matches the pipelineOperator parser plugin’s configuration.\n // If the active pipe proposal is Hack style,\n // and if the given token is the same as the plugin configuration’s `topicToken`,\n // then this is a valid topic reference.\n // If the active pipe proposal is smart mix,\n // then the topic token must always be `#`.\n // If the active pipe proposal is neither (e.g., \"minimal\" or \"fsharp\"),\n // then an error is thrown.\n testTopicReferenceConfiguration(\n pipeProposal: string,\n startLoc: Position,\n tokenType: TokenType,\n ): boolean {\n switch (pipeProposal) {\n case \"hack\": {\n return this.hasPlugin([\n \"pipelineOperator\",\n {\n // @ts-expect-error token must have a label\n topicToken: tokenLabelName(tokenType),\n },\n ]);\n }\n case \"smart\":\n return tokenType === tt.hash;\n default:\n throw this.raise(Errors.PipeTopicRequiresHackPipes, { at: startLoc });\n }\n }\n\n // async [no LineTerminator here] AsyncArrowBindingIdentifier[?Yield] [no LineTerminator here] => AsyncConciseBody[?In]\n parseAsyncArrowUnaryFunction(\n this: Parser,\n node: Undone<N.ArrowFunctionExpression>,\n ): N.ArrowFunctionExpression {\n // We don't need to push a new ParameterDeclarationScope here since we are sure\n // 1) it is an async arrow, 2) no biding pattern is allowed in params\n this.prodParam.enter(functionFlags(true, this.prodParam.hasYield));\n const params = [this.parseIdentifier()];\n this.prodParam.exit();\n if (this.hasPrecedingLineBreak()) {\n this.raise(Errors.LineTerminatorBeforeArrow, {\n at: this.state.curPosition(),\n });\n }\n this.expect(tt.arrow);\n // let foo = async bar => {};\n return this.parseArrowExpression(node, params, true);\n }\n\n // https://github.com/tc39/proposal-do-expressions\n // https://github.com/tc39/proposal-async-do-expressions\n parseDo(\n this: Parser,\n node: Undone<N.DoExpression>,\n isAsync: boolean,\n ): N.DoExpression {\n this.expectPlugin(\"doExpressions\");\n if (isAsync) {\n this.expectPlugin(\"asyncDoExpressions\");\n }\n node.async = isAsync;\n this.next(); // eat `do`\n const oldLabels = this.state.labels;\n this.state.labels = [];\n if (isAsync) {\n // AsyncDoExpression :\n // async [no LineTerminator here] do Block[~Yield, +Await, ~Return]\n this.prodParam.enter(PARAM_AWAIT);\n node.body = this.parseBlock();\n this.prodParam.exit();\n } else {\n node.body = this.parseBlock();\n }\n\n this.state.labels = oldLabels;\n return this.finishNode(node, \"DoExpression\");\n }\n\n // Parse the `super` keyword\n parseSuper(): N.Super {\n const node = this.startNode<N.Super>();\n this.next(); // eat `super`\n if (\n this.match(tt.parenL) &&\n !this.scope.allowDirectSuper &&\n !this.options.allowSuperOutsideMethod\n ) {\n this.raise(Errors.SuperNotAllowed, { at: node });\n } else if (\n !this.scope.allowSuper &&\n !this.options.allowSuperOutsideMethod\n ) {\n this.raise(Errors.UnexpectedSuper, { at: node });\n }\n\n if (\n !this.match(tt.parenL) &&\n !this.match(tt.bracketL) &&\n !this.match(tt.dot)\n ) {\n this.raise(Errors.UnsupportedSuper, { at: node });\n }\n\n return this.finishNode(node, \"Super\");\n }\n\n parsePrivateName(): N.PrivateName {\n const node = this.startNode<N.PrivateName>();\n const id = this.startNodeAt<N.Identifier>(\n // The position is hardcoded because we merge `#` and name into a single\n // tt.privateName token\n createPositionWithColumnOffset(this.state.startLoc, 1),\n );\n const name = this.state.value;\n this.next(); // eat #name;\n node.id = this.createIdentifier(id, name);\n return this.finishNode(node, \"PrivateName\");\n }\n\n parseFunctionOrFunctionSent(\n this: Parser,\n ): N.FunctionExpression | N.MetaProperty {\n const node = this.startNode<N.FunctionExpression | N.MetaProperty>();\n\n // We do not do parseIdentifier here because when parseFunctionOrFunctionSent\n // is called we already know that the current token is a \"name\" with the value \"function\"\n // This will improve perf a tiny little bit as we do not do validation but more importantly\n // here is that parseIdentifier will remove an item from the expression stack\n // if \"function\" or \"class\" is parsed as identifier (in objects e.g.), which should not happen here.\n this.next(); // eat `function`\n\n if (this.prodParam.hasYield && this.match(tt.dot)) {\n const meta = this.createIdentifier(\n this.startNodeAtNode<N.Identifier>(node),\n \"function\",\n );\n this.next(); // eat `.`\n // https://github.com/tc39/proposal-function.sent#syntax-1\n if (this.match(tt._sent)) {\n this.expectPlugin(\"functionSent\");\n } else if (!this.hasPlugin(\"functionSent\")) {\n // The code wasn't `function.sent` but just `function.`, so a simple error is less confusing.\n this.unexpected();\n }\n return this.parseMetaProperty(\n node as Undone<N.MetaProperty>,\n meta,\n \"sent\",\n );\n }\n return this.parseFunction(node as Undone<N.FunctionExpression>);\n }\n\n parseMetaProperty(\n node: Undone<N.MetaProperty>,\n meta: N.Identifier,\n propertyName: string,\n ): N.MetaProperty {\n node.meta = meta;\n\n const containsEsc = this.state.containsEsc;\n\n node.property = this.parseIdentifier(true);\n\n if (node.property.name !== propertyName || containsEsc) {\n this.raise(Errors.UnsupportedMetaProperty, {\n at: node.property,\n target: meta.name,\n onlyValidPropertyName: propertyName,\n });\n }\n\n return this.finishNode(node, \"MetaProperty\");\n }\n\n // https://tc39.es/ecma262/#prod-ImportMeta\n parseImportMetaProperty(node: Undone<N.MetaProperty>): N.MetaProperty {\n const id = this.createIdentifier(\n this.startNodeAtNode<N.Identifier>(node),\n \"import\",\n );\n this.next(); // eat `.`\n\n if (this.isContextual(tt._meta)) {\n if (!this.inModule) {\n this.raise(Errors.ImportMetaOutsideModule, { at: id });\n }\n this.sawUnambiguousESM = true;\n }\n\n return this.parseMetaProperty(node, id, \"meta\");\n }\n\n parseLiteralAtNode<T extends N.Node>(\n value: any,\n type: T[\"type\"],\n node: any,\n ): T {\n this.addExtra(node, \"rawValue\", value);\n this.addExtra(node, \"raw\", this.input.slice(node.start, this.state.end));\n node.value = value;\n this.next();\n return this.finishNode<T>(node, type);\n }\n\n parseLiteral<T extends N.Node>(value: any, type: T[\"type\"]): T {\n const node = this.startNode();\n return this.parseLiteralAtNode(value, type, node);\n }\n\n parseStringLiteral(value: any) {\n return this.parseLiteral<N.StringLiteral>(value, \"StringLiteral\");\n }\n\n parseNumericLiteral(value: any) {\n return this.parseLiteral<N.NumericLiteral>(value, \"NumericLiteral\");\n }\n\n parseBigIntLiteral(value: any) {\n return this.parseLiteral<N.BigIntLiteral>(value, \"BigIntLiteral\");\n }\n\n parseDecimalLiteral(value: any) {\n return this.parseLiteral<N.DecimalLiteral>(value, \"DecimalLiteral\");\n }\n\n parseRegExpLiteral(value: {\n value: any;\n pattern: string;\n flags: N.RegExpLiteral[\"flags\"];\n }) {\n const node = this.parseLiteral<N.RegExpLiteral>(\n value.value,\n \"RegExpLiteral\",\n );\n node.pattern = value.pattern;\n node.flags = value.flags;\n return node;\n }\n\n parseBooleanLiteral(value: boolean) {\n const node = this.startNode<N.BooleanLiteral>();\n node.value = value;\n this.next();\n return this.finishNode(node, \"BooleanLiteral\");\n }\n\n parseNullLiteral() {\n const node = this.startNode<N.NullLiteral>();\n this.next();\n return this.finishNode(node, \"NullLiteral\");\n }\n\n // https://tc39.es/ecma262/#prod-CoverParenthesizedExpressionAndArrowParameterList\n parseParenAndDistinguishExpression(\n this: Parser,\n canBeArrow: boolean,\n ): N.Expression {\n const startLoc = this.state.startLoc;\n\n let val;\n this.next(); // eat `(`\n this.expressionScope.enter(newArrowHeadScope());\n\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.maybeInArrowParameters = true;\n this.state.inFSharpPipelineDirectBody = false;\n\n const innerStartLoc = this.state.startLoc;\n const exprList: N.Expression[] = [];\n const refExpressionErrors = new ExpressionErrors();\n let first = true;\n let spreadStartLoc;\n let optionalCommaStartLoc;\n\n while (!this.match(tt.parenR)) {\n if (first) {\n first = false;\n } else {\n this.expect(\n tt.comma,\n refExpressionErrors.optionalParametersLoc === null\n ? null\n : refExpressionErrors.optionalParametersLoc,\n );\n if (this.match(tt.parenR)) {\n optionalCommaStartLoc = this.state.startLoc;\n break;\n }\n }\n\n if (this.match(tt.ellipsis)) {\n const spreadNodeStartLoc = this.state.startLoc;\n spreadStartLoc = this.state.startLoc;\n exprList.push(\n this.parseParenItem(this.parseRestBinding(), spreadNodeStartLoc),\n );\n\n if (!this.checkCommaAfterRest(charCodes.rightParenthesis)) {\n break;\n }\n } else {\n exprList.push(\n this.parseMaybeAssignAllowIn(\n refExpressionErrors,\n this.parseParenItem,\n ),\n );\n }\n }\n\n const innerEndLoc = this.state.lastTokEndLoc;\n this.expect(tt.parenR);\n\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n\n let arrowNode = this.startNodeAt<N.ArrowFunctionExpression>(startLoc);\n if (\n canBeArrow &&\n this.shouldParseArrow(exprList) &&\n (arrowNode = this.parseArrow(arrowNode))\n ) {\n this.checkDestructuringPrivate(refExpressionErrors);\n this.expressionScope.validateAsPattern();\n this.expressionScope.exit();\n this.parseArrowExpression(arrowNode, exprList, false);\n // @ts-expect-error todo(flow->ts) improve node types\n return arrowNode;\n }\n this.expressionScope.exit();\n\n if (!exprList.length) {\n this.unexpected(this.state.lastTokStartLoc);\n }\n if (optionalCommaStartLoc) this.unexpected(optionalCommaStartLoc);\n if (spreadStartLoc) this.unexpected(spreadStartLoc);\n this.checkExpressionErrors(refExpressionErrors, true);\n\n this.toReferencedListDeep(exprList, /* isParenthesizedExpr */ true);\n if (exprList.length > 1) {\n val = this.startNodeAt<N.SequenceExpression>(innerStartLoc);\n val.expressions = exprList;\n // finish node at current location so it can pick up comments after `)`\n this.finishNode(val, \"SequenceExpression\");\n this.resetEndLocation(val, innerEndLoc);\n } else {\n val = exprList[0];\n }\n\n return this.wrapParenthesis(\n startLoc,\n // @ts-expect-error todo(flow->ts)\n val,\n );\n }\n\n wrapParenthesis(startLoc: Position, expression: N.Expression): N.Expression {\n if (!this.options.createParenthesizedExpressions) {\n this.addExtra(expression, \"parenthesized\", true);\n this.addExtra(expression, \"parenStart\", startLoc.index);\n\n this.takeSurroundingComments(\n expression,\n startLoc.index,\n this.state.lastTokEndLoc.index,\n );\n\n return expression;\n }\n\n const parenExpression =\n this.startNodeAt<N.ParenthesizedExpression>(startLoc);\n parenExpression.expression = expression;\n return this.finishNode(parenExpression, \"ParenthesizedExpression\");\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- `params` is used in typescript plugin\n shouldParseArrow(params: Array<N.Node>): boolean {\n return !this.canInsertSemicolon();\n }\n\n parseArrow(\n node: Undone<N.ArrowFunctionExpression>,\n ): Undone<N.ArrowFunctionExpression> | undefined {\n if (this.eat(tt.arrow)) {\n return node;\n }\n }\n\n parseParenItem(\n node: N.Expression,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n startLoc: Position,\n ): N.Expression {\n return node;\n }\n\n parseNewOrNewTarget(this: Parser): N.NewExpression | N.MetaProperty {\n const node = this.startNode<N.NewExpression | N.MetaProperty>();\n this.next();\n if (this.match(tt.dot)) {\n // https://tc39.es/ecma262/#prod-NewTarget\n const meta = this.createIdentifier(\n this.startNodeAtNode<N.Identifier>(node),\n \"new\",\n );\n this.next();\n const metaProp = this.parseMetaProperty(\n node as Undone<N.MetaProperty>,\n meta,\n \"target\",\n );\n\n if (\n !this.scope.inNonArrowFunction &&\n !this.scope.inClass &&\n !this.options.allowNewTargetOutsideFunction\n ) {\n this.raise(Errors.UnexpectedNewTarget, { at: metaProp });\n }\n\n return metaProp;\n }\n\n return this.parseNew(node as Undone<N.NewExpression>);\n }\n\n // New's precedence is slightly tricky. It must allow its argument to\n // be a `[]` or dot subscript expression, but not a call — at least,\n // not without wrapping it in parentheses. Thus, it uses the noCalls\n // argument to parseSubscripts to prevent it from consuming the\n // argument list.\n // https://tc39.es/ecma262/#prod-NewExpression\n parseNew(this: Parser, node: Undone<N.NewExpression>): N.NewExpression {\n this.parseNewCallee(node);\n\n if (this.eat(tt.parenL)) {\n const args = this.parseExprList(tt.parenR);\n this.toReferencedList(args);\n // (parseExprList should be all non-null in this case)\n node.arguments = args;\n } else {\n node.arguments = [];\n }\n\n return this.finishNode(node, \"NewExpression\");\n }\n\n parseNewCallee(this: Parser, node: Undone<N.NewExpression>): void {\n node.callee = this.parseNoCallExpr();\n if (node.callee.type === \"Import\") {\n this.raise(Errors.ImportCallNotNewExpression, { at: node.callee });\n }\n }\n\n // Parse template expression.\n\n parseTemplateElement(isTagged: boolean): N.TemplateElement {\n const { start, startLoc, end, value } = this.state;\n const elemStart = start + 1;\n const elem = this.startNodeAt<N.TemplateElement>(\n createPositionWithColumnOffset(startLoc, 1),\n );\n if (value === null) {\n if (!isTagged) {\n this.raise(Errors.InvalidEscapeSequenceTemplate, {\n // FIXME: Adding 1 is probably wrong.\n at: createPositionWithColumnOffset(\n this.state.firstInvalidTemplateEscapePos,\n 1,\n ),\n });\n }\n }\n\n const isTail = this.match(tt.templateTail);\n const endOffset = isTail ? -1 : -2;\n const elemEnd = end + endOffset;\n elem.value = {\n raw: this.input.slice(elemStart, elemEnd).replace(/\\r\\n?/g, \"\\n\"),\n cooked: value === null ? null : value.slice(1, endOffset),\n };\n elem.tail = isTail;\n this.next();\n const finishedNode = this.finishNode(elem, \"TemplateElement\");\n this.resetEndLocation(\n finishedNode,\n createPositionWithColumnOffset(this.state.lastTokEndLoc, endOffset),\n );\n return finishedNode;\n }\n\n // https://tc39.es/ecma262/#prod-TemplateLiteral\n parseTemplate(this: Parser, isTagged: boolean): N.TemplateLiteral {\n const node = this.startNode<N.TemplateLiteral>();\n node.expressions = [];\n let curElt = this.parseTemplateElement(isTagged);\n node.quasis = [curElt];\n while (!curElt.tail) {\n node.expressions.push(this.parseTemplateSubstitution());\n this.readTemplateContinuation();\n node.quasis.push((curElt = this.parseTemplateElement(isTagged)));\n }\n return this.finishNode(node, \"TemplateLiteral\");\n }\n\n // This is overwritten by the TypeScript plugin to parse template types\n parseTemplateSubstitution(this: Parser): N.Expression {\n return this.parseExpression();\n }\n\n // Parse an object literal, binding pattern, or record.\n\n parseObjectLike(\n close: TokenType,\n isPattern: true,\n isRecord?: boolean | null,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ObjectPattern;\n parseObjectLike(\n close: TokenType,\n isPattern: false,\n isRecord?: false | null,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ObjectExpression;\n parseObjectLike(\n close: TokenType,\n isPattern: false,\n isRecord?: true,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.RecordExpression;\n parseObjectLike<T extends N.ObjectPattern | N.ObjectExpression>(\n this: Parser,\n close: TokenType,\n isPattern: boolean,\n isRecord?: boolean | null,\n refExpressionErrors?: ExpressionErrors | null,\n ): T {\n if (isRecord) {\n this.expectPlugin(\"recordAndTuple\");\n }\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.inFSharpPipelineDirectBody = false;\n const propHash: any = Object.create(null);\n let first = true;\n const node = this.startNode<\n N.ObjectExpression | N.ObjectPattern | N.RecordExpression\n >();\n\n node.properties = [];\n this.next();\n\n while (!this.match(close)) {\n if (first) {\n first = false;\n } else {\n this.expect(tt.comma);\n if (this.match(close)) {\n this.addTrailingCommaExtraToNode(\n // @ts-expect-error todo(flow->ts) improve node types\n node,\n );\n break;\n }\n }\n\n let prop;\n if (isPattern) {\n prop = this.parseBindingProperty();\n } else {\n prop = this.parsePropertyDefinition(refExpressionErrors);\n this.checkProto(prop, isRecord, propHash, refExpressionErrors);\n }\n\n if (\n isRecord &&\n !this.isObjectProperty(prop) &&\n prop.type !== \"SpreadElement\"\n ) {\n this.raise(Errors.InvalidRecordProperty, { at: prop });\n }\n\n // @ts-expect-error shorthand may not index prop\n if (prop.shorthand) {\n this.addExtra(prop, \"shorthand\", true);\n }\n\n // @ts-expect-error Fixme: refine typings\n node.properties.push(prop);\n }\n\n this.next();\n\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n let type = \"ObjectExpression\";\n if (isPattern) {\n type = \"ObjectPattern\";\n } else if (isRecord) {\n type = \"RecordExpression\";\n }\n // @ts-expect-error type is well defined\n return this.finishNode(node, type);\n }\n\n addTrailingCommaExtraToNode(node: N.Node): void {\n this.addExtra(node, \"trailingComma\", this.state.lastTokStart);\n this.addExtra(node, \"trailingCommaLoc\", this.state.lastTokStartLoc, false);\n }\n\n // Check grammar production:\n // IdentifierName *_opt PropertyName\n // It is used in `parsePropertyDefinition` to detect AsyncMethod and Accessors\n maybeAsyncOrAccessorProp(prop: Undone<N.ObjectProperty>): boolean {\n return (\n !prop.computed &&\n prop.key.type === \"Identifier\" &&\n (this.isLiteralPropertyName() ||\n this.match(tt.bracketL) ||\n this.match(tt.star))\n );\n }\n\n // https://tc39.es/ecma262/#prod-PropertyDefinition\n parsePropertyDefinition(\n this: Parser,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ObjectMember | N.SpreadElement {\n let decorators = [];\n if (this.match(tt.at)) {\n if (this.hasPlugin(\"decorators\")) {\n this.raise(Errors.UnsupportedPropertyDecorator, {\n at: this.state.startLoc,\n });\n }\n\n // we needn't check if decorators (stage 0) plugin is enabled since it's checked by\n // the call to this.parseDecorator\n while (this.match(tt.at)) {\n decorators.push(this.parseDecorator());\n }\n }\n\n const prop = this.startNode<N.ObjectProperty>();\n let isAsync = false;\n let isAccessor = false;\n let startLoc;\n\n if (this.match(tt.ellipsis)) {\n if (decorators.length) this.unexpected();\n return this.parseSpread();\n }\n\n if (decorators.length) {\n prop.decorators = decorators;\n decorators = [];\n }\n\n prop.method = false;\n\n if (refExpressionErrors) {\n startLoc = this.state.startLoc;\n }\n\n let isGenerator = this.eat(tt.star);\n this.parsePropertyNamePrefixOperator(prop);\n const containsEsc = this.state.containsEsc;\n const key = this.parsePropertyName(prop, refExpressionErrors);\n\n if (!isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) {\n const keyName = key.name;\n // https://tc39.es/ecma262/#prod-AsyncMethod\n // https://tc39.es/ecma262/#prod-AsyncGeneratorMethod\n if (keyName === \"async\" && !this.hasPrecedingLineBreak()) {\n isAsync = true;\n this.resetPreviousNodeTrailingComments(key);\n isGenerator = this.eat(tt.star);\n this.parsePropertyName(prop);\n }\n // get PropertyName[?Yield, ?Await] () { FunctionBody[~Yield, ~Await] }\n // set PropertyName[?Yield, ?Await] ( PropertySetParameterList ) { FunctionBody[~Yield, ~Await] }\n if (keyName === \"get\" || keyName === \"set\") {\n isAccessor = true;\n this.resetPreviousNodeTrailingComments(key);\n prop.kind = keyName;\n if (this.match(tt.star)) {\n isGenerator = true;\n this.raise(Errors.AccessorIsGenerator, {\n at: this.state.curPosition(),\n kind: keyName,\n });\n this.next();\n }\n this.parsePropertyName(prop);\n }\n }\n\n return this.parseObjPropValue(\n prop,\n startLoc,\n isGenerator,\n isAsync,\n false /* isPattern */,\n isAccessor,\n refExpressionErrors,\n );\n }\n\n getGetterSetterExpectedParamCount(\n method: N.ObjectMethod | N.ClassMethod,\n ): number {\n return method.kind === \"get\" ? 0 : 1;\n }\n\n // This exists so we can override within the ESTree plugin\n getObjectOrClassMethodParams(method: N.ObjectMethod | N.ClassMethod) {\n return method.params;\n }\n\n // get methods aren't allowed to have any parameters\n // set methods must have exactly 1 parameter which is not a rest parameter\n checkGetterSetterParams(method: N.ObjectMethod | N.ClassMethod): void {\n const paramCount = this.getGetterSetterExpectedParamCount(method);\n const params = this.getObjectOrClassMethodParams(method);\n\n if (params.length !== paramCount) {\n this.raise(\n method.kind === \"get\" ? Errors.BadGetterArity : Errors.BadSetterArity,\n { at: method },\n );\n }\n\n if (\n method.kind === \"set\" &&\n params[params.length - 1]?.type === \"RestElement\"\n ) {\n this.raise(Errors.BadSetterRestParameter, { at: method });\n }\n }\n\n // https://tc39.es/ecma262/#prod-MethodDefinition\n parseObjectMethod(\n this: Parser,\n prop: Undone<N.ObjectMethod>,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n ): N.ObjectMethod | undefined | null {\n if (isAccessor) {\n // isAccessor implies isAsync: false, isPattern: false, isGenerator: false\n const finishedProp = this.parseMethod(\n prop,\n // This _should_ be false, but with error recovery, we allow it to be\n // set for informational purposes\n isGenerator,\n /* isAsync */ false,\n /* isConstructor */ false,\n false,\n \"ObjectMethod\",\n );\n this.checkGetterSetterParams(finishedProp);\n return finishedProp;\n }\n\n if (isAsync || isGenerator || this.match(tt.parenL)) {\n if (isPattern) this.unexpected();\n prop.kind = \"method\";\n prop.method = true;\n return this.parseMethod(\n prop,\n isGenerator,\n isAsync,\n /* isConstructor */ false,\n false,\n \"ObjectMethod\",\n );\n }\n }\n\n // if `isPattern` is true, parse https://tc39.es/ecma262/#prod-BindingProperty\n // else https://tc39.es/ecma262/#prod-PropertyDefinition\n parseObjectProperty(\n this: Parser,\n prop: Undone<N.ObjectProperty>,\n startLoc: Position | undefined | null,\n isPattern: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ObjectProperty | undefined | null {\n prop.shorthand = false;\n\n if (this.eat(tt.colon)) {\n prop.value = isPattern\n ? this.parseMaybeDefault(this.state.startLoc)\n : this.parseMaybeAssignAllowIn(refExpressionErrors);\n\n return this.finishNode(prop, \"ObjectProperty\");\n }\n\n if (!prop.computed && prop.key.type === \"Identifier\") {\n // PropertyDefinition:\n // IdentifierReference\n // CoverInitializedName\n // Note: `{ eval } = {}` will be checked in `checkLVal` later.\n this.checkReservedWord(prop.key.name, prop.key.loc.start, true, false);\n\n if (isPattern) {\n prop.value = this.parseMaybeDefault(\n startLoc,\n cloneIdentifier(prop.key),\n );\n } else if (this.match(tt.eq)) {\n const shorthandAssignLoc = this.state.startLoc;\n if (refExpressionErrors != null) {\n if (refExpressionErrors.shorthandAssignLoc === null) {\n refExpressionErrors.shorthandAssignLoc = shorthandAssignLoc;\n }\n } else {\n this.raise(Errors.InvalidCoverInitializedName, {\n at: shorthandAssignLoc,\n });\n }\n prop.value = this.parseMaybeDefault(\n startLoc,\n cloneIdentifier(prop.key),\n );\n } else {\n prop.value = cloneIdentifier(prop.key);\n }\n prop.shorthand = true;\n\n return this.finishNode(prop, \"ObjectProperty\");\n }\n }\n\n parseObjPropValue(\n this: Parser,\n prop: Undone<N.ObjectMethod | N.ObjectProperty>,\n startLoc: Position | undefined | null,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ObjectMethod | N.ObjectProperty {\n const node =\n this.parseObjectMethod(\n prop as Undone<N.ObjectMethod>,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n ) ||\n this.parseObjectProperty(\n prop as Undone<N.ObjectProperty>,\n startLoc,\n isPattern,\n refExpressionErrors,\n );\n\n if (!node) this.unexpected();\n\n return node;\n }\n\n // https://tc39.es/ecma262/#prod-PropertyName\n // when refExpressionErrors presents, it will parse private name\n // and record the position of the first private name\n parsePropertyName(\n this: Parser,\n prop:\n | Undone<N.ObjectOrClassMember | N.ClassMember>\n | N.TsNamedTypeElementBase,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.Expression | N.Identifier {\n if (this.eat(tt.bracketL)) {\n (prop as Undone<N.ObjectOrClassMember>).computed = true;\n prop.key = this.parseMaybeAssignAllowIn();\n this.expect(tt.bracketR);\n } else {\n // We check if it's valid for it to be a private name when we push it.\n const { type, value } = this.state;\n let key;\n // most un-computed property names are identifiers\n if (tokenIsKeywordOrIdentifier(type)) {\n key = this.parseIdentifier(true);\n } else {\n switch (type) {\n case tt.num:\n key = this.parseNumericLiteral(value);\n break;\n case tt.string:\n key = this.parseStringLiteral(value);\n break;\n case tt.bigint:\n key = this.parseBigIntLiteral(value);\n break;\n case tt.decimal:\n key = this.parseDecimalLiteral(value);\n break;\n case tt.privateName: {\n // the class private key has been handled in parseClassElementName\n const privateKeyLoc = this.state.startLoc;\n if (refExpressionErrors != null) {\n if (refExpressionErrors.privateKeyLoc === null) {\n refExpressionErrors.privateKeyLoc = privateKeyLoc;\n }\n } else {\n this.raise(Errors.UnexpectedPrivateField, {\n at: privateKeyLoc,\n });\n }\n key = this.parsePrivateName();\n break;\n }\n default:\n this.unexpected();\n }\n }\n (prop as any).key = key;\n if (type !== tt.privateName) {\n // ClassPrivateProperty is never computed, so we don't assign in that case.\n prop.computed = false;\n }\n }\n\n return prop.key;\n }\n\n // Initialize empty function node.\n\n initFunction(node: N.BodilessFunctionOrMethodBase, isAsync: boolean): void {\n node.id = null;\n node.generator = false;\n node.async = isAsync;\n }\n\n // Parse object or class method.\n\n parseMethod<T extends N.ObjectMethod | N.ClassMethod | N.ClassPrivateMethod>(\n this: Parser,\n node: Undone<T>,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowDirectSuper: boolean,\n type: T[\"type\"],\n inClassScope: boolean = false,\n ): T {\n this.initFunction(node, isAsync);\n node.generator = isGenerator;\n this.scope.enter(\n SCOPE_FUNCTION |\n SCOPE_SUPER |\n (inClassScope ? SCOPE_CLASS : 0) |\n (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0),\n );\n this.prodParam.enter(functionFlags(isAsync, node.generator));\n this.parseFunctionParams(node, isConstructor);\n const finishedNode = this.parseFunctionBodyAndFinish(node, type, true);\n this.prodParam.exit();\n this.scope.exit();\n\n return finishedNode;\n }\n\n // parse an array literal or tuple literal\n // https://tc39.es/ecma262/#prod-ArrayLiteral\n // https://tc39.es/proposal-record-tuple/#prod-TupleLiteral\n parseArrayLike(\n this: Parser,\n close: TokenType,\n canBePattern: boolean,\n isTuple: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ArrayExpression | N.TupleExpression {\n if (isTuple) {\n this.expectPlugin(\"recordAndTuple\");\n }\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.inFSharpPipelineDirectBody = false;\n const node = this.startNode<N.ArrayExpression | N.TupleExpression>();\n this.next();\n node.elements = this.parseExprList(\n close,\n /* allowEmpty */ !isTuple,\n refExpressionErrors,\n // @ts-expect-error todo(flow->ts)\n node,\n );\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n return this.finishNode(\n node,\n isTuple ? \"TupleExpression\" : \"ArrayExpression\",\n );\n }\n\n // Parse arrow function expression.\n // If the parameters are provided, they will be converted to an\n // assignable list.\n parseArrowExpression(\n this: Parser,\n node: Undone<N.ArrowFunctionExpression>,\n params: N.Expression[] | undefined | null,\n isAsync: boolean,\n trailingCommaLoc?: Position | null,\n ): N.ArrowFunctionExpression {\n this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);\n let flags = functionFlags(isAsync, false);\n // ConciseBody[In] :\n // [lookahead ≠ {] ExpressionBody[?In, ~Await]\n // { FunctionBody[~Yield, ~Await] }\n if (!this.match(tt.braceL) && this.prodParam.hasIn) {\n flags |= PARAM_IN;\n }\n this.prodParam.enter(flags);\n this.initFunction(node, isAsync);\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n\n if (params) {\n this.state.maybeInArrowParameters = true;\n this.setArrowFunctionParameters(node, params, trailingCommaLoc);\n }\n this.state.maybeInArrowParameters = false;\n this.parseFunctionBody(node, true);\n\n this.prodParam.exit();\n this.scope.exit();\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n\n return this.finishNode(node, \"ArrowFunctionExpression\");\n }\n\n setArrowFunctionParameters(\n node: Undone<N.ArrowFunctionExpression>,\n params: N.Expression[],\n trailingCommaLoc?: Position | null,\n ): void {\n this.toAssignableList(params, trailingCommaLoc, false);\n node.params = params as (N.Pattern | N.TSParameterProperty)[];\n }\n\n parseFunctionBodyAndFinish<\n T extends\n | N.Function\n | N.TSDeclareMethod\n | N.TSDeclareFunction\n | N.ClassPrivateMethod,\n >(node: Undone<T>, type: T[\"type\"], isMethod: boolean = false): T {\n // @ts-expect-error (node is not bodiless if we get here)\n this.parseFunctionBody(node, false, isMethod);\n return this.finishNode(node, type);\n }\n\n // Parse function body and check parameters.\n parseFunctionBody(\n this: Parser,\n node: Undone<N.Function>,\n allowExpression?: boolean | null,\n isMethod: boolean = false,\n ): void {\n const isExpression = allowExpression && !this.match(tt.braceL);\n this.expressionScope.enter(newExpressionScope());\n\n if (isExpression) {\n // https://tc39.es/ecma262/#prod-ExpressionBody\n (node as Undone<N.ArrowFunctionExpression>).body =\n this.parseMaybeAssign();\n this.checkParams(node, false, allowExpression, false);\n } else {\n const oldStrict = this.state.strict;\n // Start a new scope with regard to labels\n // flag (restore them to their old value afterwards).\n const oldLabels = this.state.labels;\n this.state.labels = [];\n\n // FunctionBody[Yield, Await]:\n // StatementList[?Yield, ?Await, +Return] opt\n this.prodParam.enter(this.prodParam.currentFlags() | PARAM_RETURN);\n node.body = this.parseBlock(\n true,\n false,\n // Strict mode function checks after we parse the statements in the function body.\n (hasStrictModeDirective: boolean) => {\n const nonSimple = !this.isSimpleParamList(node.params);\n\n if (hasStrictModeDirective && nonSimple) {\n // This logic is here to align the error location with the ESTree plugin.\n this.raise(Errors.IllegalLanguageModeDirective, {\n at:\n // @ts-expect-error kind may not index node\n (node.kind === \"method\" || node.kind === \"constructor\") &&\n // @ts-expect-error key may not index node\n !!node.key\n ? // @ts-expect-error node.key has been guarded\n node.key.loc.end\n : node,\n });\n }\n\n const strictModeChanged = !oldStrict && this.state.strict;\n\n // Add the params to varDeclaredNames to ensure that an error is thrown\n // if a let/const declaration in the function clashes with one of the params.\n this.checkParams(\n node,\n !this.state.strict && !allowExpression && !isMethod && !nonSimple,\n allowExpression,\n strictModeChanged,\n );\n\n // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'\n if (this.state.strict && node.id) {\n this.checkIdentifier(node.id, BIND_OUTSIDE, strictModeChanged);\n }\n },\n );\n this.prodParam.exit();\n this.state.labels = oldLabels;\n }\n this.expressionScope.exit();\n }\n\n isSimpleParameter(node: N.Pattern | N.TSParameterProperty) {\n return node.type === \"Identifier\";\n }\n\n isSimpleParamList(\n params: ReadonlyArray<N.Pattern | N.TSParameterProperty>,\n ): boolean {\n for (let i = 0, len = params.length; i < len; i++) {\n if (!this.isSimpleParameter(params[i])) return false;\n }\n return true;\n }\n\n checkParams(\n node: Undone<N.Function>,\n allowDuplicates: boolean,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n isArrowFunction?: boolean | null,\n strictModeChanged: boolean = true,\n ): void {\n const checkClashes = !allowDuplicates && new Set<string>();\n // We create a fake node with the \"ephemeral\" type `FormalParameters`[1]\n // since we just store an array of parameters. Perhaps someday we can have\n // something like class FormalParameters extends Array { ... }, which would\n // also be helpful when traversing this node.\n //\n // 1. https://tc39.es/ecma262/#prod-FormalParameters\n const formalParameters = { type: \"FormalParameters\" } as const;\n for (const param of node.params) {\n this.checkLVal(param, {\n in: formalParameters,\n binding: BIND_VAR,\n checkClashes,\n strictModeChanged,\n });\n }\n }\n\n // Parses a comma-separated list of expressions, and returns them as\n // an array. `close` is the token type that ends the list, and\n // `allowEmpty` can be turned on to allow subsequent commas with\n // nothing in between them to be parsed as `null` (which is needed\n // for array literals).\n\n parseExprList(\n this: Parser,\n close: TokenType,\n allowEmpty?: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n nodeForExtra?: N.Node | null,\n ): (N.Expression | null)[] {\n const elts: (N.Expression | null)[] = [];\n let first = true;\n\n while (!this.eat(close)) {\n if (first) {\n first = false;\n } else {\n this.expect(tt.comma);\n if (this.match(close)) {\n if (nodeForExtra) {\n this.addTrailingCommaExtraToNode(nodeForExtra);\n }\n this.next();\n break;\n }\n }\n\n elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors));\n }\n return elts;\n }\n\n parseExprListItem(\n this: Parser,\n allowEmpty?: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n allowPlaceholder?: boolean | null,\n ): N.Expression | null;\n parseExprListItem(\n this: Parser,\n allowEmpty?: false,\n refExpressionErrors?: ExpressionErrors | null,\n allowPlaceholder?: boolean | null,\n ): N.Expression;\n parseExprListItem(\n this: Parser,\n allowEmpty?: boolean | null,\n refExpressionErrors?: ExpressionErrors | null,\n allowPlaceholder?: boolean | null,\n ): N.Expression | null {\n let elt;\n if (this.match(tt.comma)) {\n if (!allowEmpty) {\n this.raise(Errors.UnexpectedToken, {\n at: this.state.curPosition(),\n unexpected: \",\",\n });\n }\n elt = null;\n } else if (this.match(tt.ellipsis)) {\n const spreadNodeStartLoc = this.state.startLoc;\n\n elt = this.parseParenItem(\n this.parseSpread(refExpressionErrors),\n spreadNodeStartLoc,\n );\n } else if (this.match(tt.question)) {\n this.expectPlugin(\"partialApplication\");\n if (!allowPlaceholder) {\n this.raise(Errors.UnexpectedArgumentPlaceholder, {\n at: this.state.startLoc,\n });\n }\n const node = this.startNode();\n this.next();\n elt = this.finishNode(node, \"ArgumentPlaceholder\");\n } else {\n elt = this.parseMaybeAssignAllowIn(\n refExpressionErrors,\n this.parseParenItem,\n );\n }\n return elt;\n }\n\n // Parse the next token as an identifier. If `liberal` is true (used\n // when parsing properties), it will also convert keywords into\n // identifiers.\n // This shouldn't be used to parse the keywords of meta properties, since they\n // are not identifiers and cannot contain escape sequences.\n\n parseIdentifier(liberal?: boolean): N.Identifier {\n const node = this.startNode<N.Identifier>();\n const name = this.parseIdentifierName(liberal);\n\n return this.createIdentifier(node, name);\n }\n\n createIdentifier(\n node: Omit<N.Identifier, \"type\">,\n name: string,\n ): N.Identifier {\n node.name = name;\n node.loc.identifierName = name;\n\n return this.finishNode(node, \"Identifier\");\n }\n\n parseIdentifierName(liberal?: boolean): string {\n let name: string;\n\n const { startLoc, type } = this.state;\n\n if (tokenIsKeywordOrIdentifier(type)) {\n name = this.state.value;\n } else {\n this.unexpected();\n }\n\n const tokenIsKeyword = tokenKeywordOrIdentifierIsKeyword(type);\n\n if (liberal) {\n // If the current token is not used as a keyword, set its type to \"tt.name\".\n // This will prevent this.next() from throwing about unexpected escapes.\n if (tokenIsKeyword) {\n this.replaceToken(tt.name);\n }\n } else {\n this.checkReservedWord(name, startLoc, tokenIsKeyword, false);\n }\n\n this.next();\n\n return name;\n }\n\n checkReservedWord(\n word: string,\n startLoc: Position,\n checkKeywords: boolean,\n isBinding: boolean,\n ): void {\n // Every JavaScript reserved word is 10 characters or less.\n if (word.length > 10) {\n return;\n }\n // Most identifiers are not reservedWord-like, they don't need special\n // treatments afterward, which very likely ends up throwing errors\n if (!canBeReservedWord(word)) {\n return;\n }\n\n if (checkKeywords && isKeyword(word)) {\n this.raise(Errors.UnexpectedKeyword, {\n at: startLoc,\n keyword: word,\n });\n return;\n }\n\n const reservedTest = !this.state.strict\n ? isReservedWord\n : isBinding\n ? isStrictBindReservedWord\n : isStrictReservedWord;\n\n if (reservedTest(word, this.inModule)) {\n this.raise(Errors.UnexpectedReservedWord, {\n at: startLoc,\n reservedWord: word,\n });\n return;\n } else if (word === \"yield\") {\n if (this.prodParam.hasYield) {\n this.raise(Errors.YieldBindingIdentifier, { at: startLoc });\n return;\n }\n } else if (word === \"await\") {\n if (this.prodParam.hasAwait) {\n this.raise(Errors.AwaitBindingIdentifier, { at: startLoc });\n return;\n }\n\n if (this.scope.inStaticBlock) {\n this.raise(Errors.AwaitBindingIdentifierInStaticBlock, {\n at: startLoc,\n });\n return;\n }\n\n this.expressionScope.recordAsyncArrowParametersError({ at: startLoc });\n } else if (word === \"arguments\") {\n if (this.scope.inClassAndNotInNonArrowFunction) {\n this.raise(Errors.ArgumentsInClass, { at: startLoc });\n return;\n }\n }\n }\n\n isAwaitAllowed(): boolean {\n if (this.prodParam.hasAwait) return true;\n if (this.options.allowAwaitOutsideFunction && !this.scope.inFunction) {\n return true;\n }\n return false;\n }\n\n // Parses await expression inside async function.\n\n parseAwait(this: Parser, startLoc: Position): N.AwaitExpression {\n const node = this.startNodeAt<N.AwaitExpression>(startLoc);\n\n this.expressionScope.recordParameterInitializerError(\n Errors.AwaitExpressionFormalParameter,\n {\n // @ts-expect-error todo(flow->ts)\n at: node,\n },\n );\n\n if (this.eat(tt.star)) {\n this.raise(Errors.ObsoleteAwaitStar, { at: node });\n }\n\n if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) {\n if (this.isAmbiguousAwait()) {\n this.ambiguousScriptDifferentAst = true;\n } else {\n this.sawUnambiguousESM = true;\n }\n }\n\n if (!this.state.soloAwait) {\n node.argument = this.parseMaybeUnary(null, true);\n }\n\n return this.finishNode(node, \"AwaitExpression\");\n }\n\n isAmbiguousAwait(): boolean {\n if (this.hasPrecedingLineBreak()) return true;\n const { type } = this.state;\n return (\n // All the following expressions are ambiguous:\n // await + 0, await - 0, await ( 0 ), await [ 0 ], await / 0 /u, await ``, await of []\n type === tt.plusMin ||\n type === tt.parenL ||\n type === tt.bracketL ||\n tokenIsTemplate(type) ||\n (type === tt._of && !this.state.containsEsc) ||\n // Sometimes the tokenizer generates tt.slash for regexps, and this is\n // handler by parseExprAtom\n type === tt.regexp ||\n type === tt.slash ||\n // This code could be parsed both as a modulo operator or as an intrinsic:\n // await %x(0)\n (this.hasPlugin(\"v8intrinsic\") && type === tt.modulo)\n );\n }\n\n // Parses yield expression inside generator.\n\n parseYield(this: Parser): N.YieldExpression {\n const node = this.startNode<N.YieldExpression>();\n\n this.expressionScope.recordParameterInitializerError(\n Errors.YieldInParameter,\n {\n // @ts-expect-error todo(flow->ts)\n at: node,\n },\n );\n\n this.next();\n let delegating = false;\n let argument: N.Expression | null = null;\n if (!this.hasPrecedingLineBreak()) {\n delegating = this.eat(tt.star);\n switch (this.state.type) {\n case tt.semi:\n case tt.eof:\n case tt.braceR:\n case tt.parenR:\n case tt.bracketR:\n case tt.braceBarR:\n case tt.colon:\n case tt.comma:\n // The above is the complete set of tokens that can\n // follow an AssignmentExpression, and none of them\n // can start an AssignmentExpression\n if (!delegating) break;\n /* fallthrough */\n default:\n argument = this.parseMaybeAssign();\n }\n }\n node.delegate = delegating;\n node.argument = argument;\n return this.finishNode(node, \"YieldExpression\");\n }\n\n // Validates a pipeline (for any of the pipeline Babylon plugins) at the point\n // of the infix operator `|>`.\n\n checkPipelineAtInfixOperator(left: N.Expression, leftStartLoc: Position) {\n if (this.hasPlugin([\"pipelineOperator\", { proposal: \"smart\" }])) {\n if (left.type === \"SequenceExpression\") {\n // Ensure that the pipeline head is not a comma-delimited\n // sequence expression.\n this.raise(Errors.PipelineHeadSequenceExpression, {\n at: leftStartLoc,\n });\n }\n }\n }\n\n parseSmartPipelineBodyInStyle(childExpr: N.Expression, startLoc: Position) {\n if (this.isSimpleReference(childExpr)) {\n const bodyNode = this.startNodeAt<N.PipelineBareFunction>(startLoc);\n bodyNode.callee = childExpr;\n return this.finishNode(bodyNode, \"PipelineBareFunction\");\n } else {\n const bodyNode = this.startNodeAt<N.PipelineTopicExpression>(startLoc);\n this.checkSmartPipeTopicBodyEarlyErrors(startLoc);\n bodyNode.expression = childExpr;\n return this.finishNode(bodyNode, \"PipelineTopicExpression\");\n }\n }\n\n isSimpleReference(expression: N.Expression): boolean {\n switch (expression.type) {\n case \"MemberExpression\":\n return (\n !expression.computed && this.isSimpleReference(expression.object)\n );\n case \"Identifier\":\n return true;\n default:\n return false;\n }\n }\n\n // This helper method is to be called immediately\n // after a topic-style smart-mix pipe body is parsed.\n // The `startLoc` is the starting position of the pipe body.\n\n checkSmartPipeTopicBodyEarlyErrors(startLoc: Position): void {\n // If the following token is invalidly `=>`, then throw a human-friendly error\n // instead of something like 'Unexpected token, expected \";\"'.\n // For example, `x => x |> y => #` (assuming `#` is the topic reference)\n // groups into `x => (x |> y) => #`,\n // and `(x |> y) => #` is an invalid arrow function.\n // This is because smart-mix `|>` has tighter precedence than `=>`.\n if (this.match(tt.arrow)) {\n throw this.raise(Errors.PipelineBodyNoArrow, { at: this.state.startLoc });\n }\n\n // A topic-style smart-mix pipe body must use the topic reference at least once.\n if (!this.topicReferenceWasUsedInCurrentContext()) {\n this.raise(Errors.PipelineTopicUnused, { at: startLoc });\n }\n }\n\n // Enable topic references from outer contexts within Hack-style pipe bodies.\n // The function modifies the parser's topic-context state to enable or disable\n // the use of topic references.\n // The function then calls a callback, then resets the parser\n // to the old topic-context state that it had before the function was called.\n\n withTopicBindingContext<T>(callback: () => T): T {\n const outerContextTopicState = this.state.topicContext;\n this.state.topicContext = {\n // Enable the use of the primary topic reference.\n maxNumOfResolvableTopics: 1,\n // Hide the use of any topic references from outer contexts.\n maxTopicIndex: null,\n };\n\n try {\n return callback();\n } finally {\n this.state.topicContext = outerContextTopicState;\n }\n }\n\n // This helper method is used only with the deprecated smart-mix pipe proposal.\n // Disables topic references from outer contexts within syntax constructs\n // such as the bodies of iteration statements.\n // The function modifies the parser's topic-context state to enable or disable\n // the use of topic references with the smartPipelines plugin. They then run a\n // callback, then they reset the parser to the old topic-context state that it\n // had before the function was called.\n\n withSmartMixTopicForbiddingContext<T>(callback: () => T): T {\n if (this.hasPlugin([\"pipelineOperator\", { proposal: \"smart\" }])) {\n // Reset the parser’s topic context only if the smart-mix pipe proposal is active.\n const outerContextTopicState = this.state.topicContext;\n this.state.topicContext = {\n // Disable the use of the primary topic reference.\n maxNumOfResolvableTopics: 0,\n // Hide the use of any topic references from outer contexts.\n maxTopicIndex: null,\n };\n\n try {\n return callback();\n } finally {\n this.state.topicContext = outerContextTopicState;\n }\n } else {\n // If the pipe proposal is \"minimal\", \"fsharp\", or \"hack\",\n // or if no pipe proposal is active,\n // then the callback result is returned\n // without touching any extra parser state.\n return callback();\n }\n }\n\n withSoloAwaitPermittingContext<T>(callback: () => T): T {\n const outerContextSoloAwaitState = this.state.soloAwait;\n this.state.soloAwait = true;\n\n try {\n return callback();\n } finally {\n this.state.soloAwait = outerContextSoloAwaitState;\n }\n }\n\n allowInAnd<T>(callback: () => T): T {\n const flags = this.prodParam.currentFlags();\n const prodParamToSet = PARAM_IN & ~flags;\n if (prodParamToSet) {\n this.prodParam.enter(flags | PARAM_IN);\n try {\n return callback();\n } finally {\n this.prodParam.exit();\n }\n }\n return callback();\n }\n\n disallowInAnd<T>(callback: () => T): T {\n const flags = this.prodParam.currentFlags();\n const prodParamToClear = PARAM_IN & flags;\n if (prodParamToClear) {\n this.prodParam.enter(flags & ~PARAM_IN);\n try {\n return callback();\n } finally {\n this.prodParam.exit();\n }\n }\n return callback();\n }\n\n // Register the use of a topic reference within the current\n // topic-binding context.\n registerTopicReference(): void {\n this.state.topicContext.maxTopicIndex = 0;\n }\n\n topicReferenceIsAllowedInCurrentContext(): boolean {\n return this.state.topicContext.maxNumOfResolvableTopics >= 1;\n }\n\n topicReferenceWasUsedInCurrentContext(): boolean {\n return (\n this.state.topicContext.maxTopicIndex != null &&\n this.state.topicContext.maxTopicIndex >= 0\n );\n }\n\n parseFSharpPipelineBody(this: Parser, prec: number): N.Expression {\n const startLoc = this.state.startLoc;\n\n this.state.potentialArrowAt = this.state.start;\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.inFSharpPipelineDirectBody = true;\n\n const ret = this.parseExprOp(\n this.parseMaybeUnaryOrPrivate(),\n startLoc,\n prec,\n );\n\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n\n return ret;\n }\n\n // https://github.com/tc39/proposal-js-module-blocks\n parseModuleExpression(this: Parser): N.ModuleExpression {\n this.expectPlugin(\"moduleBlocks\");\n const node = this.startNode<N.ModuleExpression>();\n this.next(); // eat \"module\"\n if (!this.match(tt.braceL)) {\n this.unexpected(null, tt.braceL);\n }\n // start program node immediately after `{`\n const program = this.startNodeAt<N.Program>(this.state.endLoc);\n this.next(); // eat `{`\n\n const revertScopes = this.initializeScopes(/** inModule */ true);\n this.enterInitialScopes();\n\n try {\n node.body = this.parseProgram(program, tt.braceR, \"module\");\n } finally {\n revertScopes();\n }\n return this.finishNode<N.ModuleExpression>(node, \"ModuleExpression\");\n }\n\n // Used in Flow plugin\n parsePropertyNamePrefixOperator(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n prop: Undone<N.ObjectOrClassMember | N.ClassMember>,\n ): void {}\n}\n","import type * as N from \"../types\";\nimport {\n tokenIsIdentifier,\n tokenIsKeywordOrIdentifier,\n tokenIsLoop,\n tokenIsTemplate,\n tt,\n type TokenType,\n getExportedToken,\n} from \"../tokenizer/types\";\nimport ExpressionParser from \"./expression\";\nimport { Errors } from \"../parse-error\";\nimport { isIdentifierChar, isIdentifierStart } from \"../util/identifier\";\nimport * as charCodes from \"charcodes\";\nimport {\n BIND_CLASS,\n BIND_LEXICAL,\n BIND_VAR,\n BIND_FUNCTION,\n SCOPE_CLASS,\n SCOPE_FUNCTION,\n SCOPE_OTHER,\n SCOPE_SIMPLE_CATCH,\n SCOPE_STATIC_BLOCK,\n SCOPE_SUPER,\n CLASS_ELEMENT_OTHER,\n CLASS_ELEMENT_INSTANCE_GETTER,\n CLASS_ELEMENT_INSTANCE_SETTER,\n CLASS_ELEMENT_STATIC_GETTER,\n CLASS_ELEMENT_STATIC_SETTER,\n type BindingTypes,\n BIND_CATCH_PARAM,\n} from \"../util/scopeflags\";\nimport { ExpressionErrors } from \"./util\";\nimport { PARAM, functionFlags } from \"../util/production-parameter\";\nimport {\n newExpressionScope,\n newParameterDeclarationScope,\n} from \"../util/expression-scope\";\nimport type { SourceType } from \"../options\";\nimport { Token } from \"../tokenizer\";\nimport type { Position } from \"../util/location\";\nimport { createPositionWithColumnOffset } from \"../util/location\";\nimport { cloneStringLiteral, cloneIdentifier, type Undone } from \"./node\";\nimport type Parser from \"./index\";\nimport { ParseBindingListFlags } from \"./lval\";\n\nconst loopLabel = { kind: \"loop\" } as const,\n switchLabel = { kind: \"switch\" } as const;\n\nexport const enum ParseFunctionFlag {\n Expression = 0b0000,\n Declaration = 0b0001,\n HangingDeclaration = 0b0010,\n NullableId = 0b0100,\n Async = 0b1000,\n}\n\nexport const enum ParseStatementFlag {\n StatementOnly = 0b0000,\n AllowImportExport = 0b0001,\n AllowDeclaration = 0b0010,\n AllowFunctionDeclaration = 0b0100,\n AllowLabeledFunction = 0b1000,\n}\n\nconst loneSurrogate = /[\\uD800-\\uDFFF]/u;\n\nconst keywordRelationalOperator = /in(?:stanceof)?/y;\n\n/**\n * Convert tokens for backward Babel 7 compat.\n * tt.privateName => tt.hash + tt.name\n * tt.templateTail => tt.backquote/tt.braceR + tt.template + tt.backquote\n * tt.templateNonTail => tt.backquote/tt.braceR + tt.template + tt.dollarBraceL\n * For performance reasons this routine mutates `tokens`, it is okay\n * here since we execute `parseTopLevel` once for every file.\n */\nfunction babel7CompatTokens(tokens: (Token | N.Comment)[], input: string) {\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n const { type } = token;\n if (typeof type === \"number\") {\n if (!process.env.BABEL_8_BREAKING) {\n if (type === tt.privateName) {\n const { loc, start, value, end } = token;\n const hashEndPos = start + 1;\n const hashEndLoc = createPositionWithColumnOffset(loc.start, 1);\n tokens.splice(\n i,\n 1,\n new Token({\n // @ts-expect-error: hacky way to create token\n type: getExportedToken(tt.hash),\n value: \"#\",\n start: start,\n end: hashEndPos,\n startLoc: loc.start,\n endLoc: hashEndLoc,\n }),\n new Token({\n // @ts-expect-error: hacky way to create token\n type: getExportedToken(tt.name),\n value: value,\n start: hashEndPos,\n end: end,\n startLoc: hashEndLoc,\n endLoc: loc.end,\n }),\n );\n i++;\n continue;\n }\n\n if (tokenIsTemplate(type)) {\n const { loc, start, value, end } = token;\n const backquoteEnd = start + 1;\n const backquoteEndLoc = createPositionWithColumnOffset(loc.start, 1);\n let startToken;\n if (input.charCodeAt(start) === charCodes.graveAccent) {\n startToken = new Token({\n // @ts-expect-error: hacky way to create token\n type: getExportedToken(tt.backQuote),\n value: \"`\",\n start: start,\n end: backquoteEnd,\n startLoc: loc.start,\n endLoc: backquoteEndLoc,\n });\n } else {\n startToken = new Token({\n // @ts-expect-error: hacky way to create token\n type: getExportedToken(tt.braceR),\n value: \"}\",\n start: start,\n end: backquoteEnd,\n startLoc: loc.start,\n endLoc: backquoteEndLoc,\n });\n }\n let templateValue,\n templateElementEnd,\n templateElementEndLoc,\n endToken;\n if (type === tt.templateTail) {\n // ends with '`'\n templateElementEnd = end - 1;\n templateElementEndLoc = createPositionWithColumnOffset(loc.end, -1);\n templateValue = value === null ? null : value.slice(1, -1);\n endToken = new Token({\n // @ts-expect-error: hacky way to create token\n type: getExportedToken(tt.backQuote),\n value: \"`\",\n start: templateElementEnd,\n end: end,\n startLoc: templateElementEndLoc,\n endLoc: loc.end,\n });\n } else {\n // ends with `${`\n templateElementEnd = end - 2;\n templateElementEndLoc = createPositionWithColumnOffset(loc.end, -2);\n templateValue = value === null ? null : value.slice(1, -2);\n endToken = new Token({\n // @ts-expect-error: hacky way to create token\n type: getExportedToken(tt.dollarBraceL),\n value: \"${\",\n start: templateElementEnd,\n end: end,\n startLoc: templateElementEndLoc,\n endLoc: loc.end,\n });\n }\n tokens.splice(\n i,\n 1,\n startToken,\n new Token({\n // @ts-expect-error: hacky way to create token\n type: getExportedToken(tt.template),\n value: templateValue,\n start: backquoteEnd,\n end: templateElementEnd,\n startLoc: backquoteEndLoc,\n endLoc: templateElementEndLoc,\n }),\n endToken,\n );\n i += 2;\n continue;\n }\n }\n // @ts-expect-error: we manipulate `token` for performance reasons\n token.type = getExportedToken(type);\n }\n }\n return tokens;\n}\nexport default abstract class StatementParser extends ExpressionParser {\n // ### Statement parsing\n\n // Parse a program. Initializes the parser, reads any number of\n // statements, and wraps them in a Program node. Optionally takes a\n // `program` argument. If present, the statements will be appended\n // to its body instead of creating a new node.\n\n parseTopLevel(this: Parser, file: N.File, program: N.Program): N.File {\n file.program = this.parseProgram(program);\n file.comments = this.state.comments;\n\n if (this.options.tokens) {\n file.tokens = babel7CompatTokens(this.tokens, this.input);\n }\n\n return this.finishNode(file, \"File\");\n }\n\n parseProgram(\n this: Parser,\n program: Undone<N.Program>,\n end: TokenType = tt.eof,\n sourceType: SourceType = this.options.sourceType,\n ): N.Program {\n program.sourceType = sourceType;\n program.interpreter = this.parseInterpreterDirective();\n this.parseBlockBody(program, true, true, end);\n if (\n this.inModule &&\n !this.options.allowUndeclaredExports &&\n this.scope.undefinedExports.size > 0\n ) {\n for (const [localName, at] of Array.from(this.scope.undefinedExports)) {\n this.raise(Errors.ModuleExportUndefined, { at, localName });\n }\n }\n let finishedProgram: N.Program;\n if (end === tt.eof) {\n // finish at eof for top level program\n finishedProgram = this.finishNode(program, \"Program\");\n } else {\n // finish immediately before the end token\n finishedProgram = this.finishNodeAt(\n program,\n \"Program\",\n createPositionWithColumnOffset(this.state.startLoc, -1),\n );\n }\n return finishedProgram;\n }\n\n /**\n * cast a Statement to a Directive. This method mutates input statement.\n */\n stmtToDirective(stmt: N.Statement): N.Directive {\n const directive = stmt as any;\n directive.type = \"Directive\";\n directive.value = directive.expression;\n delete directive.expression;\n\n const directiveLiteral = directive.value;\n const expressionValue = directiveLiteral.value;\n const raw = this.input.slice(directiveLiteral.start, directiveLiteral.end);\n const val = (directiveLiteral.value = raw.slice(1, -1)); // remove quotes\n\n this.addExtra(directiveLiteral, \"raw\", raw);\n this.addExtra(directiveLiteral, \"rawValue\", val);\n this.addExtra(directiveLiteral, \"expressionValue\", expressionValue);\n\n directiveLiteral.type = \"DirectiveLiteral\";\n\n return directive;\n }\n\n parseInterpreterDirective(): N.InterpreterDirective | null {\n if (!this.match(tt.interpreterDirective)) {\n return null;\n }\n\n const node = this.startNode<N.InterpreterDirective>();\n node.value = this.state.value;\n this.next();\n return this.finishNode(node, \"InterpreterDirective\");\n }\n\n isLet(): boolean {\n if (!this.isContextual(tt._let)) {\n return false;\n }\n return this.hasFollowingBindingAtom();\n }\n\n chStartsBindingIdentifier(ch: number, pos: number) {\n if (isIdentifierStart(ch)) {\n keywordRelationalOperator.lastIndex = pos;\n if (keywordRelationalOperator.test(this.input)) {\n // We have seen `in` or `instanceof` so far, now check if the identifier\n // ends here\n const endCh = this.codePointAtPos(keywordRelationalOperator.lastIndex);\n if (!isIdentifierChar(endCh) && endCh !== charCodes.backslash) {\n return false;\n }\n }\n return true;\n } else if (ch === charCodes.backslash) {\n return true;\n } else {\n return false;\n }\n }\n\n chStartsBindingPattern(ch: number) {\n return (\n ch === charCodes.leftSquareBracket || ch === charCodes.leftCurlyBrace\n );\n }\n\n /**\n * Assuming we have seen a contextual `let` and declaration is allowed, check if it\n * starts a variable declaration so that it should be interpreted as a keyword.\n */\n hasFollowingBindingAtom(): boolean {\n const next = this.nextTokenStart();\n const nextCh = this.codePointAtPos(next);\n return (\n this.chStartsBindingPattern(nextCh) ||\n this.chStartsBindingIdentifier(nextCh, next)\n );\n }\n\n /**\n * Assuming we have seen a contextual `using` and declaration is allowed, check if it\n * starts a variable declaration in the same line so that it should be interpreted as\n * a keyword.\n */\n hasInLineFollowingBindingIdentifier(): boolean {\n const next = this.nextTokenInLineStart();\n const nextCh = this.codePointAtPos(next);\n return this.chStartsBindingIdentifier(nextCh, next);\n }\n\n startsUsingForOf(): boolean {\n const { type, containsEsc } = this.lookahead();\n if (type === tt._of && !containsEsc) {\n // `using of` must start a for-lhs-of statement\n return false;\n } else if (tokenIsIdentifier(type) && !this.hasFollowingLineBreak()) {\n this.expectPlugin(\"explicitResourceManagement\");\n return true;\n }\n }\n\n startsAwaitUsing(): boolean {\n let next = this.nextTokenInLineStart();\n if (this.isUnparsedContextual(next, \"using\")) {\n next = this.nextTokenInLineStartSince(next + 5);\n const nextCh = this.codePointAtPos(next);\n if (this.chStartsBindingIdentifier(nextCh, next)) {\n this.expectPlugin(\"explicitResourceManagement\");\n return true;\n }\n }\n return false;\n }\n\n // https://tc39.es/ecma262/#prod-ModuleItem\n parseModuleItem(this: Parser) {\n return this.parseStatementLike(\n ParseStatementFlag.AllowImportExport |\n ParseStatementFlag.AllowDeclaration |\n ParseStatementFlag.AllowFunctionDeclaration |\n // This function is actually also used to parse StatementItems,\n // which with Annex B enabled allows labeled functions.\n ParseStatementFlag.AllowLabeledFunction,\n );\n }\n\n // https://tc39.es/ecma262/#prod-StatementListItem\n parseStatementListItem(this: Parser) {\n return this.parseStatementLike(\n ParseStatementFlag.AllowDeclaration |\n ParseStatementFlag.AllowFunctionDeclaration |\n (!this.options.annexB || this.state.strict\n ? 0\n : ParseStatementFlag.AllowLabeledFunction),\n );\n }\n\n parseStatementOrSloppyAnnexBFunctionDeclaration(\n this: Parser,\n allowLabeledFunction: boolean = false,\n ) {\n let flags: ParseStatementFlag = ParseStatementFlag.StatementOnly;\n if (this.options.annexB && !this.state.strict) {\n flags |= ParseStatementFlag.AllowFunctionDeclaration;\n if (allowLabeledFunction) {\n flags |= ParseStatementFlag.AllowLabeledFunction;\n }\n }\n return this.parseStatementLike(flags);\n }\n\n // Parse a single statement.\n //\n // If expecting a statement and finding a slash operator, parse a\n // regular expression literal. This is to handle cases like\n // `if (foo) /blah/.exec(foo)`, where looking at the previous token\n // does not help.\n // https://tc39.es/ecma262/#prod-Statement\n parseStatement(this: Parser) {\n return this.parseStatementLike(ParseStatementFlag.StatementOnly);\n }\n\n // ImportDeclaration and ExportDeclaration are also handled here so we can throw recoverable errors\n // when they are not at the top level\n parseStatementLike(\n this: Parser,\n flags: ParseStatementFlag,\n ):\n | N.Statement\n | N.Declaration\n | N.ImportDeclaration\n | N.ExportDefaultDeclaration\n | N.ExportNamedDeclaration\n | N.ExportAllDeclaration {\n let decorators: N.Decorator[] | null = null;\n\n if (this.match(tt.at)) {\n decorators = this.parseDecorators(true);\n }\n return this.parseStatementContent(flags, decorators);\n }\n\n parseStatementContent(\n this: Parser,\n flags: ParseStatementFlag,\n decorators?: N.Decorator[] | null,\n ): N.Statement {\n const starttype = this.state.type;\n const node = this.startNode();\n const allowDeclaration = !!(flags & ParseStatementFlag.AllowDeclaration);\n const allowFunctionDeclaration = !!(\n flags & ParseStatementFlag.AllowFunctionDeclaration\n );\n const topLevel = flags & ParseStatementFlag.AllowImportExport;\n\n // Most types of statements are recognized by the keyword they\n // start with. Many are trivial to parse, some require a bit of\n // complexity.\n\n switch (starttype) {\n case tt._break:\n return this.parseBreakContinueStatement(node, /* isBreak */ true);\n case tt._continue:\n return this.parseBreakContinueStatement(node, /* isBreak */ false);\n case tt._debugger:\n return this.parseDebuggerStatement(node as Undone<N.DebuggerStatement>);\n case tt._do:\n return this.parseDoWhileStatement(node as Undone<N.DoWhileStatement>);\n case tt._for:\n return this.parseForStatement(node as Undone<N.ForStatement>);\n case tt._function:\n if (this.lookaheadCharCode() === charCodes.dot) break;\n if (!allowFunctionDeclaration) {\n this.raise(\n this.state.strict\n ? Errors.StrictFunction\n : this.options.annexB\n ? Errors.SloppyFunctionAnnexB\n : Errors.SloppyFunction,\n { at: this.state.startLoc },\n );\n }\n return this.parseFunctionStatement(\n node as Undone<N.FunctionDeclaration>,\n false,\n !allowDeclaration && allowFunctionDeclaration,\n );\n case tt._class:\n if (!allowDeclaration) this.unexpected();\n return this.parseClass(\n this.maybeTakeDecorators(\n decorators,\n node as Undone<N.ClassDeclaration>,\n ),\n true,\n );\n\n case tt._if:\n return this.parseIfStatement(node as Undone<N.IfStatement>);\n case tt._return:\n return this.parseReturnStatement(node as Undone<N.ReturnStatement>);\n case tt._switch:\n return this.parseSwitchStatement(node as Undone<N.SwitchStatement>);\n case tt._throw:\n return this.parseThrowStatement(node as Undone<N.ThrowStatement>);\n case tt._try:\n return this.parseTryStatement(node as Undone<N.TryStatement>);\n\n case tt._await:\n // [+Await] await [no LineTerminator here] using [no LineTerminator here] BindingList[+Using]\n if (!this.state.containsEsc && this.startsAwaitUsing()) {\n if (!this.isAwaitAllowed()) {\n this.raise(Errors.AwaitUsingNotInAsyncContext, { at: node });\n } else if (!allowDeclaration) {\n this.raise(Errors.UnexpectedLexicalDeclaration, {\n at: node,\n });\n }\n this.next(); // eat 'await'\n return this.parseVarStatement(\n node as Undone<N.VariableDeclaration>,\n \"await using\",\n );\n }\n break;\n case tt._using:\n // using [no LineTerminator here] BindingList[+Using]\n if (\n this.state.containsEsc ||\n !this.hasInLineFollowingBindingIdentifier()\n ) {\n break;\n }\n this.expectPlugin(\"explicitResourceManagement\");\n if (!this.scope.inModule && this.scope.inTopLevel) {\n this.raise(Errors.UnexpectedUsingDeclaration, {\n at: this.state.startLoc,\n });\n } else if (!allowDeclaration) {\n this.raise(Errors.UnexpectedLexicalDeclaration, {\n at: this.state.startLoc,\n });\n }\n return this.parseVarStatement(\n node as Undone<N.VariableDeclaration>,\n \"using\",\n );\n case tt._let: {\n if (this.state.containsEsc) {\n break;\n }\n // `let [` is an explicit negative lookahead for\n // ExpressionStatement, so special-case it first.\n const next = this.nextTokenStart();\n const nextCh = this.codePointAtPos(next);\n if (nextCh !== charCodes.leftSquareBracket) {\n if (!allowDeclaration && this.hasFollowingLineBreak()) break;\n if (\n !this.chStartsBindingIdentifier(nextCh, next) &&\n nextCh !== charCodes.leftCurlyBrace\n ) {\n break;\n }\n }\n }\n // fall through\n case tt._const: {\n if (!allowDeclaration) {\n this.raise(Errors.UnexpectedLexicalDeclaration, {\n at: this.state.startLoc,\n });\n }\n }\n // fall through\n case tt._var: {\n const kind = this.state.value;\n return this.parseVarStatement(\n node as Undone<N.VariableDeclaration>,\n kind,\n );\n }\n case tt._while:\n return this.parseWhileStatement(node as Undone<N.WhileStatement>);\n case tt._with:\n return this.parseWithStatement(node as Undone<N.WithStatement>);\n case tt.braceL:\n return this.parseBlock();\n case tt.semi:\n return this.parseEmptyStatement(node as Undone<N.EmptyStatement>);\n case tt._import: {\n const nextTokenCharCode = this.lookaheadCharCode();\n if (\n nextTokenCharCode === charCodes.leftParenthesis || // import()\n nextTokenCharCode === charCodes.dot // import.meta\n ) {\n break;\n }\n }\n // fall through\n case tt._export: {\n if (!this.options.allowImportExportEverywhere && !topLevel) {\n this.raise(Errors.UnexpectedImportExport, {\n at: this.state.startLoc,\n });\n }\n\n this.next(); // eat `import`/`export`\n\n let result;\n if (starttype === tt._import) {\n result = this.parseImport(node as Undone<N.ImportDeclaration>);\n\n if (\n result.type === \"ImportDeclaration\" &&\n (!result.importKind || result.importKind === \"value\")\n ) {\n this.sawUnambiguousESM = true;\n }\n } else {\n result = this.parseExport(\n node as Undone<\n | N.ExportAllDeclaration\n | N.ExportDefaultDeclaration\n | N.ExportDefaultDeclaration\n >,\n decorators,\n );\n\n if (\n (result.type === \"ExportNamedDeclaration\" &&\n (!result.exportKind || result.exportKind === \"value\")) ||\n (result.type === \"ExportAllDeclaration\" &&\n (!result.exportKind || result.exportKind === \"value\")) ||\n result.type === \"ExportDefaultDeclaration\"\n ) {\n this.sawUnambiguousESM = true;\n }\n }\n\n this.assertModuleNodeAllowed(result);\n\n return result;\n }\n\n default: {\n if (this.isAsyncFunction()) {\n if (!allowDeclaration) {\n this.raise(Errors.AsyncFunctionInSingleStatementContext, {\n at: this.state.startLoc,\n });\n }\n this.next(); // eat 'async'\n return this.parseFunctionStatement(\n node as Undone<N.FunctionDeclaration>,\n true,\n !allowDeclaration && allowFunctionDeclaration,\n );\n }\n }\n }\n\n // If the statement does not start with a statement keyword or a\n // brace, it's an ExpressionStatement or LabeledStatement. We\n // simply start parsing an expression, and afterwards, if the\n // next token is a colon and the expression was a simple\n // Identifier node, we switch to interpreting it as a label.\n const maybeName = this.state.value;\n const expr = this.parseExpression();\n\n if (\n tokenIsIdentifier(starttype) &&\n expr.type === \"Identifier\" &&\n this.eat(tt.colon)\n ) {\n return this.parseLabeledStatement(\n node as Undone<N.LabeledStatement>,\n maybeName,\n // @ts-expect-error migrate to Babel types\n expr,\n flags,\n );\n } else {\n return this.parseExpressionStatement(\n node as Undone<N.ExpressionStatement>,\n expr,\n decorators,\n );\n }\n }\n\n assertModuleNodeAllowed(node: N.Node): void {\n if (!this.options.allowImportExportEverywhere && !this.inModule) {\n this.raise(Errors.ImportOutsideModule, { at: node });\n }\n }\n\n decoratorsEnabledBeforeExport(): boolean {\n if (this.hasPlugin(\"decorators-legacy\")) return true;\n return (\n this.hasPlugin(\"decorators\") &&\n this.getPluginOption(\"decorators\", \"decoratorsBeforeExport\") !== false\n );\n }\n\n // Attach the decorators to the given class.\n // NOTE: This method changes the .start location of the class, and thus\n // can affect comment attachment. Calling it before or after finalizing\n // the class node (and thus finalizing its comments) changes how comments\n // before the `class` keyword or before the final .start location of the\n // class are attached.\n maybeTakeDecorators<T extends Undone<N.Class>>(\n maybeDecorators: N.Decorator[] | null,\n classNode: T,\n exportNode?: Undone<N.ExportDefaultDeclaration | N.ExportNamedDeclaration>,\n ): T {\n if (maybeDecorators) {\n if (classNode.decorators && classNode.decorators.length > 0) {\n // Note: decorators attachment is only attempred multiple times\n // when the class is part of an export declaration.\n if (\n typeof this.getPluginOption(\n \"decorators\",\n \"decoratorsBeforeExport\",\n ) !== \"boolean\"\n ) {\n // If `decoratorsBeforeExport` was set to `true` or `false`, we\n // already threw an error about decorators not being in a valid\n // position.\n this.raise(Errors.DecoratorsBeforeAfterExport, {\n at: classNode.decorators[0],\n });\n }\n classNode.decorators.unshift(...maybeDecorators);\n } else {\n classNode.decorators = maybeDecorators;\n }\n this.resetStartLocationFromNode(classNode, maybeDecorators[0]);\n if (exportNode) this.resetStartLocationFromNode(exportNode, classNode);\n }\n return classNode;\n }\n\n canHaveLeadingDecorator(): boolean {\n return this.match(tt._class);\n }\n\n parseDecorators(this: Parser, allowExport?: boolean): N.Decorator[] {\n const decorators = [];\n do {\n decorators.push(this.parseDecorator());\n } while (this.match(tt.at));\n\n if (this.match(tt._export)) {\n if (!allowExport) {\n this.unexpected();\n }\n\n if (!this.decoratorsEnabledBeforeExport()) {\n this.raise(Errors.DecoratorExportClass, { at: this.state.startLoc });\n }\n } else if (!this.canHaveLeadingDecorator()) {\n throw this.raise(Errors.UnexpectedLeadingDecorator, {\n at: this.state.startLoc,\n });\n }\n\n return decorators;\n }\n\n parseDecorator(this: Parser): N.Decorator {\n this.expectOnePlugin([\"decorators\", \"decorators-legacy\"]);\n\n const node = this.startNode<N.Decorator>();\n this.next();\n\n if (this.hasPlugin(\"decorators\")) {\n const startLoc = this.state.startLoc;\n let expr: N.Expression;\n\n if (this.match(tt.parenL)) {\n const startLoc = this.state.startLoc;\n this.next(); // eat '('\n expr = this.parseExpression();\n this.expect(tt.parenR);\n expr = this.wrapParenthesis(startLoc, expr);\n\n const paramsStartLoc = this.state.startLoc;\n node.expression = this.parseMaybeDecoratorArguments(expr);\n if (\n this.getPluginOption(\"decorators\", \"allowCallParenthesized\") ===\n false &&\n node.expression !== expr\n ) {\n this.raise(Errors.DecoratorArgumentsOutsideParentheses, {\n at: paramsStartLoc,\n });\n }\n } else {\n expr = this.parseIdentifier(false);\n\n while (this.eat(tt.dot)) {\n const node = this.startNodeAt(startLoc);\n node.object = expr;\n if (this.match(tt.privateName)) {\n this.classScope.usePrivateName(\n this.state.value,\n this.state.startLoc,\n );\n node.property = this.parsePrivateName();\n } else {\n node.property = this.parseIdentifier(true);\n }\n node.computed = false;\n expr = this.finishNode(node, \"MemberExpression\");\n }\n\n node.expression = this.parseMaybeDecoratorArguments(expr);\n }\n } else {\n node.expression = this.parseExprSubscripts();\n }\n return this.finishNode(node, \"Decorator\");\n }\n\n parseMaybeDecoratorArguments(this: Parser, expr: N.Expression): N.Expression {\n if (this.eat(tt.parenL)) {\n const node = this.startNodeAtNode(expr);\n node.callee = expr;\n node.arguments = this.parseCallExpressionArguments(tt.parenR, false);\n this.toReferencedList(node.arguments);\n return this.finishNode(node, \"CallExpression\");\n }\n\n return expr;\n }\n\n parseBreakContinueStatement(\n node: Undone<N.Node>,\n isBreak: true,\n ): N.BreakStatement;\n parseBreakContinueStatement(\n node: Undone<N.Node>,\n isBreak: false,\n ): N.ContinueStatement;\n parseBreakContinueStatement(\n node: Undone<N.BreakStatement | N.ContinueStatement>,\n isBreak: boolean,\n ): N.BreakStatement | N.ContinueStatement {\n this.next();\n\n if (this.isLineTerminator()) {\n node.label = null;\n } else {\n node.label = this.parseIdentifier();\n this.semicolon();\n }\n\n this.verifyBreakContinue(node, isBreak);\n\n return this.finishNode(\n node,\n isBreak ? \"BreakStatement\" : \"ContinueStatement\",\n );\n }\n\n verifyBreakContinue(\n node: Undone<N.BreakStatement | N.ContinueStatement>,\n isBreak: boolean,\n ) {\n let i;\n for (i = 0; i < this.state.labels.length; ++i) {\n const lab = this.state.labels[i];\n if (node.label == null || lab.name === node.label.name) {\n if (lab.kind != null && (isBreak || lab.kind === \"loop\")) break;\n if (node.label && isBreak) break;\n }\n }\n if (i === this.state.labels.length) {\n const type = isBreak ? \"BreakStatement\" : \"ContinueStatement\";\n this.raise(Errors.IllegalBreakContinue, { at: node, type });\n }\n }\n\n parseDebuggerStatement(\n node: Undone<N.DebuggerStatement>,\n ): N.DebuggerStatement {\n this.next();\n this.semicolon();\n return this.finishNode(node, \"DebuggerStatement\");\n }\n\n parseHeaderExpression(this: Parser): N.Expression {\n this.expect(tt.parenL);\n const val = this.parseExpression();\n this.expect(tt.parenR);\n return val;\n }\n\n // https://tc39.es/ecma262/#prod-DoWhileStatement\n parseDoWhileStatement(\n this: Parser,\n node: Undone<N.DoWhileStatement>,\n ): N.DoWhileStatement {\n this.next();\n this.state.labels.push(loopLabel);\n\n // Parse the loop body's body.\n node.body =\n // For the smartPipelines plugin: Disable topic references from outer\n // contexts within the loop body. They are permitted in test expressions,\n // outside of the loop body.\n this.withSmartMixTopicForbiddingContext(() =>\n // Parse the loop body's body.\n this.parseStatement(),\n );\n\n this.state.labels.pop();\n\n this.expect(tt._while);\n node.test = this.parseHeaderExpression();\n this.eat(tt.semi);\n return this.finishNode(node, \"DoWhileStatement\");\n }\n\n // Disambiguating between a `for` and a `for`/`in` or `for`/`of`\n // loop is non-trivial. Basically, we have to parse the init `var`\n // statement or expression, disallowing the `in` operator (see\n // the second parameter to `parseExpression`), and then check\n // whether the next token is `in` or `of`. When there is no init\n // part (semicolon immediately after the opening parenthesis), it\n // is a regular `for` loop.\n\n parseForStatement(\n this: Parser,\n node: Undone<N.ForStatement | N.ForInOf>,\n ): N.ForLike {\n this.next();\n this.state.labels.push(loopLabel);\n\n let awaitAt = null;\n\n if (this.isAwaitAllowed() && this.eatContextual(tt._await)) {\n awaitAt = this.state.lastTokStartLoc;\n }\n this.scope.enter(SCOPE_OTHER);\n this.expect(tt.parenL);\n\n if (this.match(tt.semi)) {\n if (awaitAt !== null) {\n this.unexpected(awaitAt);\n }\n return this.parseFor(node as Undone<N.ForStatement>, null);\n }\n\n const startsWithLet = this.isContextual(tt._let);\n {\n const startsWithAwaitUsing =\n this.isContextual(tt._await) && this.startsAwaitUsing();\n const starsWithUsingDeclaration =\n startsWithAwaitUsing ||\n (this.isContextual(tt._using) && this.startsUsingForOf());\n const isLetOrUsing =\n (startsWithLet && this.hasFollowingBindingAtom()) ||\n starsWithUsingDeclaration;\n\n if (this.match(tt._var) || this.match(tt._const) || isLetOrUsing) {\n const initNode = this.startNode<N.VariableDeclaration>();\n let kind;\n if (startsWithAwaitUsing) {\n kind = \"await using\";\n if (!this.isAwaitAllowed()) {\n this.raise(Errors.AwaitUsingNotInAsyncContext, {\n at: this.state.startLoc,\n });\n }\n this.next(); // eat 'await'\n } else {\n kind = this.state.value;\n }\n this.next();\n this.parseVar(initNode, true, kind);\n const init = this.finishNode(initNode, \"VariableDeclaration\");\n\n const isForIn = this.match(tt._in);\n if (isForIn && starsWithUsingDeclaration) {\n this.raise(Errors.ForInUsing, { at: init });\n }\n if (\n (isForIn || this.isContextual(tt._of)) &&\n init.declarations.length === 1\n ) {\n return this.parseForIn(node as Undone<N.ForInOf>, init, awaitAt);\n }\n if (awaitAt !== null) {\n this.unexpected(awaitAt);\n }\n return this.parseFor(node as Undone<N.ForStatement>, init);\n }\n }\n\n // Check whether the first token is possibly a contextual keyword, so that\n // we can forbid `for (async of` if this turns out to be a for-of loop.\n const startsWithAsync = this.isContextual(tt._async);\n\n const refExpressionErrors = new ExpressionErrors();\n const init = this.parseExpression(true, refExpressionErrors);\n const isForOf = this.isContextual(tt._of);\n if (isForOf) {\n // Check for leading tokens that are forbidden in for-of loops:\n if (startsWithLet) {\n this.raise(Errors.ForOfLet, { at: init });\n }\n\n if (\n // `for await (async of []);` is allowed.\n awaitAt === null &&\n startsWithAsync &&\n init.type === \"Identifier\"\n ) {\n // This catches the case where the `async` in `for (async of` was\n // parsed as an identifier. If it was parsed as the start of an async\n // arrow function (e.g. `for (async of => {} of []);`), the LVal check\n // further down will raise a more appropriate error.\n this.raise(Errors.ForOfAsync, { at: init });\n }\n }\n if (isForOf || this.match(tt._in)) {\n this.checkDestructuringPrivate(refExpressionErrors);\n this.toAssignable(init, /* isLHS */ true);\n const type = isForOf ? \"ForOfStatement\" : \"ForInStatement\";\n this.checkLVal(init, { in: { type } });\n return this.parseForIn(\n node as Undone<N.ForInStatement | N.ForOfStatement>,\n // @ts-expect-error init has been transformed to an assignable\n init,\n awaitAt,\n );\n } else {\n this.checkExpressionErrors(refExpressionErrors, true);\n }\n if (awaitAt !== null) {\n this.unexpected(awaitAt);\n }\n return this.parseFor(node as Undone<N.ForStatement>, init);\n }\n\n // https://tc39.es/ecma262/#prod-HoistableDeclaration\n parseFunctionStatement(\n this: Parser,\n node: Undone<N.FunctionDeclaration>,\n isAsync: boolean,\n isHangingDeclaration: boolean,\n ): N.FunctionDeclaration {\n this.next(); // eat 'function'\n return this.parseFunction(\n node,\n ParseFunctionFlag.Declaration |\n (isHangingDeclaration ? ParseFunctionFlag.HangingDeclaration : 0) |\n (isAsync ? ParseFunctionFlag.Async : 0),\n );\n }\n\n // https://tc39.es/ecma262/#prod-IfStatement\n parseIfStatement(this: Parser, node: Undone<N.IfStatement>) {\n this.next();\n node.test = this.parseHeaderExpression();\n // Annex B.3.3\n // https://tc39.es/ecma262/#sec-functiondeclarations-in-ifstatement-statement-clauses\n node.consequent = this.parseStatementOrSloppyAnnexBFunctionDeclaration();\n node.alternate = this.eat(tt._else)\n ? this.parseStatementOrSloppyAnnexBFunctionDeclaration()\n : null;\n return this.finishNode(node, \"IfStatement\");\n }\n\n parseReturnStatement(this: Parser, node: Undone<N.ReturnStatement>) {\n if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) {\n this.raise(Errors.IllegalReturn, { at: this.state.startLoc });\n }\n\n this.next();\n\n // In `return` (and `break`/`continue`), the keywords with\n // optional arguments, we eagerly look for a semicolon or the\n // possibility to insert one.\n\n if (this.isLineTerminator()) {\n node.argument = null;\n } else {\n node.argument = this.parseExpression();\n this.semicolon();\n }\n\n return this.finishNode(node, \"ReturnStatement\");\n }\n\n // https://tc39.es/ecma262/#prod-SwitchStatement\n parseSwitchStatement(this: Parser, node: Undone<N.SwitchStatement>) {\n this.next();\n node.discriminant = this.parseHeaderExpression();\n const cases: N.SwitchStatement[\"cases\"] = (node.cases = []);\n this.expect(tt.braceL);\n this.state.labels.push(switchLabel);\n this.scope.enter(SCOPE_OTHER);\n\n // Statements under must be grouped (by label) in SwitchCase\n // nodes. `cur` is used to keep the node that we are currently\n // adding statements to.\n\n let cur;\n for (let sawDefault; !this.match(tt.braceR); ) {\n if (this.match(tt._case) || this.match(tt._default)) {\n const isCase = this.match(tt._case);\n if (cur) this.finishNode(cur, \"SwitchCase\");\n // @ts-expect-error Fixme\n cases.push((cur = this.startNode()));\n cur.consequent = [];\n this.next();\n if (isCase) {\n cur.test = this.parseExpression();\n } else {\n if (sawDefault) {\n this.raise(Errors.MultipleDefaultsInSwitch, {\n at: this.state.lastTokStartLoc,\n });\n }\n sawDefault = true;\n cur.test = null;\n }\n this.expect(tt.colon);\n } else {\n if (cur) {\n cur.consequent.push(this.parseStatementListItem());\n } else {\n this.unexpected();\n }\n }\n }\n this.scope.exit();\n if (cur) this.finishNode(cur, \"SwitchCase\");\n this.next(); // Closing brace\n this.state.labels.pop();\n return this.finishNode(node, \"SwitchStatement\");\n }\n\n parseThrowStatement(this: Parser, node: Undone<N.ThrowStatement>) {\n this.next();\n if (this.hasPrecedingLineBreak()) {\n this.raise(Errors.NewlineAfterThrow, { at: this.state.lastTokEndLoc });\n }\n node.argument = this.parseExpression();\n this.semicolon();\n return this.finishNode(node, \"ThrowStatement\");\n }\n\n parseCatchClauseParam(this: Parser): N.Pattern {\n const param = this.parseBindingAtom();\n\n this.scope.enter(\n this.options.annexB && param.type === \"Identifier\"\n ? SCOPE_SIMPLE_CATCH\n : 0,\n );\n this.checkLVal(param, {\n in: { type: \"CatchClause\" },\n binding: BIND_CATCH_PARAM,\n });\n\n return param;\n }\n\n parseTryStatement(\n this: Parser,\n node: Undone<N.TryStatement>,\n ): N.TryStatement {\n this.next();\n\n node.block = this.parseBlock();\n node.handler = null;\n\n if (this.match(tt._catch)) {\n const clause = this.startNode<N.CatchClause>();\n this.next();\n if (this.match(tt.parenL)) {\n this.expect(tt.parenL);\n clause.param = this.parseCatchClauseParam();\n this.expect(tt.parenR);\n } else {\n clause.param = null;\n this.scope.enter(SCOPE_OTHER);\n }\n\n // Parse the catch clause's body.\n clause.body =\n // For the smartPipelines plugin: Disable topic references from outer\n // contexts within the catch clause's body.\n this.withSmartMixTopicForbiddingContext(() =>\n // Parse the catch clause's body.\n this.parseBlock(false, false),\n );\n\n this.scope.exit();\n node.handler = this.finishNode(clause, \"CatchClause\");\n }\n\n node.finalizer = this.eat(tt._finally) ? this.parseBlock() : null;\n\n if (!node.handler && !node.finalizer) {\n this.raise(Errors.NoCatchOrFinally, { at: node });\n }\n\n return this.finishNode(node, \"TryStatement\");\n }\n\n // https://tc39.es/ecma262/#prod-VariableStatement\n // https://tc39.es/ecma262/#prod-LexicalDeclaration\n parseVarStatement(\n this: Parser,\n node: Undone<N.VariableDeclaration>,\n kind: \"var\" | \"let\" | \"const\" | \"using\" | \"await using\",\n allowMissingInitializer: boolean = false,\n ): N.VariableDeclaration {\n this.next();\n this.parseVar(node, false, kind, allowMissingInitializer);\n this.semicolon();\n return this.finishNode(node, \"VariableDeclaration\");\n }\n\n // https://tc39.es/ecma262/#prod-WhileStatement\n parseWhileStatement(\n this: Parser,\n node: Undone<N.WhileStatement>,\n ): N.WhileStatement {\n this.next();\n node.test = this.parseHeaderExpression();\n this.state.labels.push(loopLabel);\n\n // Parse the loop body.\n node.body =\n // For the smartPipelines plugin:\n // Disable topic references from outer contexts within the loop body.\n // They are permitted in test expressions, outside of the loop body.\n this.withSmartMixTopicForbiddingContext(() =>\n // Parse loop body.\n this.parseStatement(),\n );\n\n this.state.labels.pop();\n\n return this.finishNode(node, \"WhileStatement\");\n }\n\n parseWithStatement(\n this: Parser,\n node: Undone<N.WithStatement>,\n ): N.WithStatement {\n if (this.state.strict) {\n this.raise(Errors.StrictWith, { at: this.state.startLoc });\n }\n this.next();\n node.object = this.parseHeaderExpression();\n\n // Parse the statement body.\n node.body =\n // For the smartPipelines plugin:\n // Disable topic references from outer contexts within the with statement's body.\n // They are permitted in function default-parameter expressions, which are\n // part of the outer context, outside of the with statement's body.\n this.withSmartMixTopicForbiddingContext(() =>\n // Parse the statement body.\n this.parseStatement(),\n );\n\n return this.finishNode(node, \"WithStatement\");\n }\n\n parseEmptyStatement(node: Undone<N.EmptyStatement>): N.EmptyStatement {\n this.next();\n return this.finishNode(node, \"EmptyStatement\");\n }\n\n // https://tc39.es/ecma262/#prod-LabelledStatement\n parseLabeledStatement(\n this: Parser,\n node: Undone<N.LabeledStatement>,\n maybeName: string,\n expr: N.Identifier,\n flags: ParseStatementFlag,\n ): N.LabeledStatement {\n for (const label of this.state.labels) {\n if (label.name === maybeName) {\n this.raise(Errors.LabelRedeclaration, {\n at: expr,\n labelName: maybeName,\n });\n }\n }\n\n const kind = tokenIsLoop(this.state.type)\n ? \"loop\"\n : this.match(tt._switch)\n ? \"switch\"\n : null;\n for (let i = this.state.labels.length - 1; i >= 0; i--) {\n const label = this.state.labels[i];\n if (label.statementStart === node.start) {\n label.statementStart = this.state.start;\n label.kind = kind;\n } else {\n break;\n }\n }\n\n this.state.labels.push({\n name: maybeName,\n kind: kind,\n statementStart: this.state.start,\n });\n // https://tc39.es/ecma262/#prod-LabelledItem\n node.body =\n flags & ParseStatementFlag.AllowLabeledFunction\n ? this.parseStatementOrSloppyAnnexBFunctionDeclaration(true)\n : this.parseStatement();\n\n this.state.labels.pop();\n node.label = expr;\n return this.finishNode(node, \"LabeledStatement\");\n }\n\n parseExpressionStatement(\n node: Undone<N.ExpressionStatement>,\n expr: N.Expression,\n /* eslint-disable-next-line @typescript-eslint/no-unused-vars -- used in TypeScript parser */\n decorators: N.Decorator[] | null,\n ) {\n node.expression = expr;\n this.semicolon();\n return this.finishNode(node, \"ExpressionStatement\");\n }\n\n // Parse a semicolon-enclosed block of statements, handling `\"use\n // strict\"` declarations when `allowDirectives` is true (used for\n // function bodies).\n\n parseBlock(\n this: Parser,\n allowDirectives: boolean = false,\n createNewLexicalScope: boolean = true,\n afterBlockParse?: (hasStrictModeDirective: boolean) => void,\n ): N.BlockStatement {\n const node = this.startNode<N.BlockStatement>();\n if (allowDirectives) {\n this.state.strictErrors.clear();\n }\n this.expect(tt.braceL);\n if (createNewLexicalScope) {\n this.scope.enter(SCOPE_OTHER);\n }\n this.parseBlockBody(\n node,\n allowDirectives,\n false,\n tt.braceR,\n afterBlockParse,\n );\n if (createNewLexicalScope) {\n this.scope.exit();\n }\n return this.finishNode(node, \"BlockStatement\");\n }\n\n isValidDirective(stmt: N.Statement): boolean {\n return (\n stmt.type === \"ExpressionStatement\" &&\n stmt.expression.type === \"StringLiteral\" &&\n !stmt.expression.extra.parenthesized\n );\n }\n\n parseBlockBody(\n this: Parser,\n node: Undone<N.BlockStatementLike>,\n allowDirectives: boolean | undefined | null,\n topLevel: boolean,\n end: TokenType,\n afterBlockParse?: (hasStrictModeDirective: boolean) => void,\n ): void {\n const body: N.BlockStatementLike[\"body\"] = (node.body = []);\n const directives: N.BlockStatementLike[\"directives\"] = (node.directives =\n []);\n this.parseBlockOrModuleBlockBody(\n body,\n allowDirectives ? directives : undefined,\n topLevel,\n end,\n afterBlockParse,\n );\n }\n\n // Undefined directives means that directives are not allowed.\n // https://tc39.es/ecma262/#prod-Block\n // https://tc39.es/ecma262/#prod-ModuleBody\n parseBlockOrModuleBlockBody(\n this: Parser,\n body: N.Statement[],\n directives: N.Directive[] | undefined | null,\n topLevel: boolean,\n end: TokenType,\n afterBlockParse?: (hasStrictModeDirective: boolean) => void,\n ): void {\n const oldStrict = this.state.strict;\n let hasStrictModeDirective = false;\n let parsedNonDirective = false;\n\n while (!this.match(end)) {\n const stmt = topLevel\n ? this.parseModuleItem()\n : this.parseStatementListItem();\n\n if (directives && !parsedNonDirective) {\n if (this.isValidDirective(stmt)) {\n const directive = this.stmtToDirective(stmt);\n directives.push(directive);\n\n if (\n !hasStrictModeDirective &&\n directive.value.value === \"use strict\"\n ) {\n hasStrictModeDirective = true;\n this.setStrict(true);\n }\n\n continue;\n }\n parsedNonDirective = true;\n // clear strict errors since the strict mode will not change within the block\n this.state.strictErrors.clear();\n }\n body.push(stmt);\n }\n\n if (afterBlockParse) {\n afterBlockParse.call(this, hasStrictModeDirective);\n }\n\n if (!oldStrict) {\n this.setStrict(false);\n }\n\n this.next();\n }\n\n // Parse a regular `for` loop. The disambiguation code in\n // `parseStatement` will already have parsed the init statement or\n // expression.\n\n parseFor(\n this: Parser,\n node: Undone<N.ForStatement>,\n init?: N.VariableDeclaration | N.Expression | null,\n ): N.ForStatement {\n node.init = init;\n this.semicolon(/* allowAsi */ false);\n node.test = this.match(tt.semi) ? null : this.parseExpression();\n this.semicolon(/* allowAsi */ false);\n node.update = this.match(tt.parenR) ? null : this.parseExpression();\n this.expect(tt.parenR);\n\n // Parse the loop body.\n node.body =\n // For the smartPipelines plugin: Disable topic references from outer\n // contexts within the loop body. They are permitted in test expressions,\n // outside of the loop body.\n this.withSmartMixTopicForbiddingContext(() =>\n // Parse the loop body.\n this.parseStatement(),\n );\n\n this.scope.exit();\n this.state.labels.pop();\n\n return this.finishNode(node, \"ForStatement\");\n }\n\n // Parse a `for`/`in` and `for`/`of` loop, which are almost\n // same from parser's perspective.\n\n parseForIn(\n this: Parser,\n node: Undone<N.ForInOf>,\n init: N.VariableDeclaration | N.AssignmentPattern,\n awaitAt?: Position | null,\n ): N.ForInOf {\n const isForIn = this.match(tt._in);\n this.next();\n\n if (isForIn) {\n if (awaitAt !== null) this.unexpected(awaitAt);\n } else {\n node.await = awaitAt !== null;\n }\n\n if (\n init.type === \"VariableDeclaration\" &&\n init.declarations[0].init != null &&\n (!isForIn ||\n !this.options.annexB ||\n this.state.strict ||\n init.kind !== \"var\" ||\n init.declarations[0].id.type !== \"Identifier\")\n ) {\n this.raise(Errors.ForInOfLoopInitializer, {\n at: init,\n type: isForIn ? \"ForInStatement\" : \"ForOfStatement\",\n });\n }\n\n if (init.type === \"AssignmentPattern\") {\n this.raise(Errors.InvalidLhs, {\n at: init,\n ancestor: { type: \"ForStatement\" },\n });\n }\n\n node.left = init;\n node.right = isForIn\n ? this.parseExpression()\n : this.parseMaybeAssignAllowIn();\n this.expect(tt.parenR);\n\n // Parse the loop body.\n node.body =\n // For the smartPipelines plugin:\n // Disable topic references from outer contexts within the loop body.\n // They are permitted in test expressions, outside of the loop body.\n this.withSmartMixTopicForbiddingContext(() =>\n // Parse loop body.\n this.parseStatement(),\n );\n\n this.scope.exit();\n this.state.labels.pop();\n\n return this.finishNode(node, isForIn ? \"ForInStatement\" : \"ForOfStatement\");\n }\n\n // Parse a list of variable declarations.\n\n parseVar(\n this: Parser,\n node: Undone<N.VariableDeclaration>,\n isFor: boolean,\n kind: \"var\" | \"let\" | \"const\" | \"using\" | \"await using\",\n allowMissingInitializer: boolean = false,\n ): Undone<N.VariableDeclaration> {\n const declarations: N.VariableDeclarator[] = (node.declarations = []);\n node.kind = kind;\n for (;;) {\n const decl = this.startNode<N.VariableDeclarator>();\n this.parseVarId(decl, kind);\n decl.init = !this.eat(tt.eq)\n ? null\n : isFor\n ? this.parseMaybeAssignDisallowIn()\n : this.parseMaybeAssignAllowIn();\n\n if (decl.init === null && !allowMissingInitializer) {\n if (\n decl.id.type !== \"Identifier\" &&\n !(isFor && (this.match(tt._in) || this.isContextual(tt._of)))\n ) {\n this.raise(Errors.DeclarationMissingInitializer, {\n at: this.state.lastTokEndLoc,\n kind: \"destructuring\",\n });\n } else if (\n kind === \"const\" &&\n !(this.match(tt._in) || this.isContextual(tt._of))\n ) {\n this.raise(Errors.DeclarationMissingInitializer, {\n at: this.state.lastTokEndLoc,\n kind: \"const\",\n });\n }\n }\n declarations.push(this.finishNode(decl, \"VariableDeclarator\"));\n if (!this.eat(tt.comma)) break;\n }\n return node;\n }\n\n parseVarId(\n this: Parser,\n decl: Undone<N.VariableDeclarator>,\n kind: \"var\" | \"let\" | \"const\" | \"using\" | \"await using\",\n ): void {\n const id = this.parseBindingAtom();\n this.checkLVal(id, {\n in: { type: \"VariableDeclarator\" },\n binding: kind === \"var\" ? BIND_VAR : BIND_LEXICAL,\n });\n decl.id = id;\n }\n\n // https://tc39.es/ecma262/#prod-AsyncFunctionExpression\n parseAsyncFunctionExpression(\n this: Parser,\n node: Undone<N.FunctionExpression>,\n ): N.FunctionExpression {\n return this.parseFunction(node, ParseFunctionFlag.Async);\n }\n\n // Parse a function declaration or expression (depending on the\n // ParseFunctionFlag.Declaration flag).\n\n parseFunction<T extends N.NormalFunction>(\n this: Parser,\n node: Undone<T>,\n flags: ParseFunctionFlag = ParseFunctionFlag.Expression,\n ): T {\n const hangingDeclaration = flags & ParseFunctionFlag.HangingDeclaration;\n const isDeclaration = !!(flags & ParseFunctionFlag.Declaration);\n const requireId = isDeclaration && !(flags & ParseFunctionFlag.NullableId);\n const isAsync = !!(flags & ParseFunctionFlag.Async);\n\n this.initFunction(node, isAsync);\n\n if (this.match(tt.star)) {\n if (hangingDeclaration) {\n this.raise(Errors.GeneratorInSingleStatementContext, {\n at: this.state.startLoc,\n });\n }\n this.next(); // eat *\n node.generator = true;\n }\n\n if (isDeclaration) {\n node.id = this.parseFunctionId(requireId);\n }\n\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n this.state.maybeInArrowParameters = false;\n this.scope.enter(SCOPE_FUNCTION);\n this.prodParam.enter(functionFlags(isAsync, node.generator));\n\n if (!isDeclaration) {\n node.id = this.parseFunctionId();\n }\n\n this.parseFunctionParams(node, /* isConstructor */ false);\n\n // For the smartPipelines plugin: Disable topic references from outer\n // contexts within the function body. They are permitted in function\n // default-parameter expressions, outside of the function body.\n this.withSmartMixTopicForbiddingContext(() => {\n // Parse the function body.\n this.parseFunctionBodyAndFinish(\n node,\n isDeclaration ? \"FunctionDeclaration\" : \"FunctionExpression\",\n );\n });\n\n this.prodParam.exit();\n this.scope.exit();\n\n if (isDeclaration && !hangingDeclaration) {\n // We need to register this _after_ parsing the function body\n // because of TypeScript body-less function declarations,\n // which shouldn't be added to the scope.\n this.registerFunctionStatementId(node as T);\n }\n\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n return node as T;\n }\n\n parseFunctionId(requireId?: boolean): N.Identifier | undefined | null {\n return requireId || tokenIsIdentifier(this.state.type)\n ? this.parseIdentifier()\n : null;\n }\n\n parseFunctionParams(\n this: Parser,\n node: Undone<N.Function>,\n isConstructor?: boolean,\n ): void {\n this.expect(tt.parenL);\n this.expressionScope.enter(newParameterDeclarationScope());\n node.params = this.parseBindingList(\n tt.parenR,\n charCodes.rightParenthesis,\n ParseBindingListFlags.IS_FUNCTION_PARAMS |\n (isConstructor ? ParseBindingListFlags.IS_CONSTRUCTOR_PARAMS : 0),\n );\n\n this.expressionScope.exit();\n }\n\n registerFunctionStatementId(node: N.Function): void {\n if (!node.id) return;\n\n // If it is a regular function declaration in sloppy mode, then it is\n // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding\n // mode depends on properties of the current scope (see\n // treatFunctionsAsVar).\n this.scope.declareName(\n node.id.name,\n !this.options.annexB || this.state.strict || node.generator || node.async\n ? this.scope.treatFunctionsAsVar\n ? BIND_VAR\n : BIND_LEXICAL\n : BIND_FUNCTION,\n node.id.loc.start,\n );\n }\n\n // Parse a class declaration or literal (depending on the\n // `isStatement` parameter).\n\n parseClass<T extends N.Class>(\n this: Parser,\n node: Undone<T>,\n isStatement: /* T === ClassDeclaration */ boolean,\n optionalId?: boolean,\n ): T {\n this.next(); // 'class'\n\n // A class definition is always strict mode code.\n const oldStrict = this.state.strict;\n this.state.strict = true;\n\n this.parseClassId(node, isStatement, optionalId);\n this.parseClassSuper(node);\n // this.state.strict is restored in parseClassBody\n node.body = this.parseClassBody(!!node.superClass, oldStrict);\n\n return this.finishNode(\n node,\n isStatement ? \"ClassDeclaration\" : \"ClassExpression\",\n );\n }\n\n isClassProperty(): boolean {\n return this.match(tt.eq) || this.match(tt.semi) || this.match(tt.braceR);\n }\n\n isClassMethod(): boolean {\n return this.match(tt.parenL);\n }\n\n isNonstaticConstructor(method: N.ClassMethod | N.ClassProperty): boolean {\n return (\n !method.computed &&\n !method.static &&\n (method.key.name === \"constructor\" || // Identifier\n method.key.value === \"constructor\") // String literal\n );\n }\n\n // https://tc39.es/ecma262/#prod-ClassBody\n parseClassBody(\n this: Parser,\n hadSuperClass: boolean,\n oldStrict: boolean,\n ): N.ClassBody {\n this.classScope.enter();\n\n const state: N.ParseClassMemberState = {\n hadConstructor: false,\n hadSuperClass,\n };\n let decorators: N.Decorator[] = [];\n const classBody = this.startNode<N.ClassBody>();\n classBody.body = [];\n\n this.expect(tt.braceL);\n\n // For the smartPipelines plugin: Disable topic references from outer\n // contexts within the class body.\n this.withSmartMixTopicForbiddingContext(() => {\n // Parse the contents within the braces.\n while (!this.match(tt.braceR)) {\n if (this.eat(tt.semi)) {\n if (decorators.length > 0) {\n throw this.raise(Errors.DecoratorSemicolon, {\n at: this.state.lastTokEndLoc,\n });\n }\n continue;\n }\n\n if (this.match(tt.at)) {\n decorators.push(this.parseDecorator());\n continue;\n }\n\n const member = this.startNode<N.ClassMember>();\n\n // steal the decorators if there are any\n if (decorators.length) {\n // @ts-expect-error Fixme\n member.decorators = decorators;\n this.resetStartLocationFromNode(member, decorators[0]);\n decorators = [];\n }\n\n this.parseClassMember(classBody, member, state);\n\n if (\n // @ts-expect-error Fixme\n member.kind === \"constructor\" &&\n // @ts-expect-error Fixme\n member.decorators &&\n // @ts-expect-error Fixme\n member.decorators.length > 0\n ) {\n this.raise(Errors.DecoratorConstructor, { at: member });\n }\n }\n });\n\n this.state.strict = oldStrict;\n\n this.next(); // eat `}`\n\n if (decorators.length) {\n throw this.raise(Errors.TrailingDecorator, { at: this.state.startLoc });\n }\n\n this.classScope.exit();\n\n return this.finishNode(classBody, \"ClassBody\");\n }\n\n // returns true if the current identifier is a method/field name,\n // false if it is a modifier\n parseClassMemberFromModifier(\n this: Parser,\n classBody: Undone<N.ClassBody>,\n member: Undone<N.ClassMember>,\n ): boolean {\n const key = this.parseIdentifier(true); // eats the modifier\n\n if (this.isClassMethod()) {\n const method: N.ClassMethod = member as any;\n\n // a method named like the modifier\n method.kind = \"method\";\n method.computed = false;\n method.key = key;\n method.static = false;\n this.pushClassMethod(\n classBody,\n method,\n false,\n false,\n /* isConstructor */ false,\n false,\n );\n return true;\n } else if (this.isClassProperty()) {\n const prop: N.ClassProperty = member as any;\n\n // a property named like the modifier\n prop.computed = false;\n prop.key = key;\n prop.static = false;\n classBody.body.push(this.parseClassProperty(prop));\n return true;\n }\n this.resetPreviousNodeTrailingComments(key);\n return false;\n }\n\n parseClassMember(\n this: Parser,\n classBody: Undone<N.ClassBody>,\n member: Undone<N.ClassMember>,\n state: N.ParseClassMemberState,\n ): void {\n const isStatic = this.isContextual(tt._static);\n\n if (isStatic) {\n if (this.parseClassMemberFromModifier(classBody, member)) {\n // a class element named 'static'\n return;\n }\n if (this.eat(tt.braceL)) {\n this.parseClassStaticBlock(classBody, member as any as N.StaticBlock);\n return;\n }\n }\n\n this.parseClassMemberWithIsStatic(classBody, member, state, isStatic);\n }\n\n parseClassMemberWithIsStatic(\n this: Parser,\n classBody: Undone<N.ClassBody>,\n member: Undone<N.ClassMember>,\n state: N.ParseClassMemberState,\n isStatic: boolean,\n ) {\n const publicMethod = member as N.ClassMethod;\n const privateMethod = member as N.ClassPrivateMethod;\n const publicProp = member as N.ClassProperty;\n const privateProp = member as N.ClassPrivateProperty;\n const accessorProp = member as N.ClassAccessorProperty;\n\n const method: typeof publicMethod | typeof privateMethod = publicMethod;\n const publicMember: typeof publicMethod | typeof publicProp = publicMethod;\n\n member.static = isStatic;\n this.parsePropertyNamePrefixOperator(member);\n\n if (this.eat(tt.star)) {\n // a generator\n method.kind = \"method\";\n const isPrivateName = this.match(tt.privateName);\n this.parseClassElementName(method);\n\n if (isPrivateName) {\n // Private generator method\n this.pushClassPrivateMethod(classBody, privateMethod, true, false);\n return;\n }\n\n if (this.isNonstaticConstructor(publicMethod)) {\n this.raise(Errors.ConstructorIsGenerator, {\n at: publicMethod.key,\n });\n }\n\n this.pushClassMethod(\n classBody,\n publicMethod,\n true,\n false,\n /* isConstructor */ false,\n false,\n );\n\n return;\n }\n\n const isContextual =\n tokenIsIdentifier(this.state.type) && !this.state.containsEsc;\n const isPrivate = this.match(tt.privateName);\n const key = this.parseClassElementName(member);\n const maybeQuestionTokenStartLoc = this.state.startLoc;\n\n this.parsePostMemberNameModifiers(publicMember);\n\n if (this.isClassMethod()) {\n method.kind = \"method\";\n\n if (isPrivate) {\n this.pushClassPrivateMethod(classBody, privateMethod, false, false);\n return;\n }\n\n // a normal method\n const isConstructor = this.isNonstaticConstructor(publicMethod);\n let allowsDirectSuper = false;\n if (isConstructor) {\n publicMethod.kind = \"constructor\";\n\n // TypeScript allows multiple overloaded constructor declarations.\n if (state.hadConstructor && !this.hasPlugin(\"typescript\")) {\n this.raise(Errors.DuplicateConstructor, { at: key });\n }\n if (isConstructor && this.hasPlugin(\"typescript\") && member.override) {\n this.raise(Errors.OverrideOnConstructor, { at: key });\n }\n state.hadConstructor = true;\n allowsDirectSuper = state.hadSuperClass;\n }\n\n this.pushClassMethod(\n classBody,\n publicMethod,\n false,\n false,\n isConstructor,\n allowsDirectSuper,\n );\n } else if (this.isClassProperty()) {\n if (isPrivate) {\n this.pushClassPrivateProperty(classBody, privateProp);\n } else {\n this.pushClassProperty(classBody, publicProp);\n }\n } else if (\n isContextual &&\n key.name === \"async\" &&\n !this.isLineTerminator()\n ) {\n // an async method\n this.resetPreviousNodeTrailingComments(key);\n const isGenerator = this.eat(tt.star);\n\n if (publicMember.optional) {\n this.unexpected(maybeQuestionTokenStartLoc);\n }\n\n method.kind = \"method\";\n // The so-called parsed name would have been \"async\": get the real name.\n const isPrivate = this.match(tt.privateName);\n this.parseClassElementName(method);\n this.parsePostMemberNameModifiers(publicMember);\n\n if (isPrivate) {\n // private async method\n this.pushClassPrivateMethod(\n classBody,\n privateMethod,\n isGenerator,\n true,\n );\n } else {\n if (this.isNonstaticConstructor(publicMethod)) {\n this.raise(Errors.ConstructorIsAsync, { at: publicMethod.key });\n }\n\n this.pushClassMethod(\n classBody,\n publicMethod,\n isGenerator,\n true,\n /* isConstructor */ false,\n false,\n );\n }\n } else if (\n isContextual &&\n (key.name === \"get\" || key.name === \"set\") &&\n !(this.match(tt.star) && this.isLineTerminator())\n ) {\n // `get\\n*` is an uninitialized property named 'get' followed by a generator.\n // a getter or setter\n this.resetPreviousNodeTrailingComments(key);\n method.kind = key.name;\n // The so-called parsed name would have been \"get/set\": get the real name.\n const isPrivate = this.match(tt.privateName);\n this.parseClassElementName(publicMethod);\n\n if (isPrivate) {\n // private getter/setter\n this.pushClassPrivateMethod(classBody, privateMethod, false, false);\n } else {\n if (this.isNonstaticConstructor(publicMethod)) {\n this.raise(Errors.ConstructorIsAccessor, { at: publicMethod.key });\n }\n this.pushClassMethod(\n classBody,\n publicMethod,\n false,\n false,\n /* isConstructor */ false,\n false,\n );\n }\n\n this.checkGetterSetterParams(publicMethod);\n } else if (\n isContextual &&\n key.name === \"accessor\" &&\n !this.isLineTerminator()\n ) {\n this.expectPlugin(\"decoratorAutoAccessors\");\n this.resetPreviousNodeTrailingComments(key);\n\n // The so-called parsed name would have been \"accessor\": get the real name.\n const isPrivate = this.match(tt.privateName);\n this.parseClassElementName(publicProp);\n this.pushClassAccessorProperty(classBody, accessorProp, isPrivate);\n } else if (this.isLineTerminator()) {\n // an uninitialized class property (due to ASI, since we don't otherwise recognize the next token)\n if (isPrivate) {\n this.pushClassPrivateProperty(classBody, privateProp);\n } else {\n this.pushClassProperty(classBody, publicProp);\n }\n } else {\n this.unexpected();\n }\n }\n\n // https://tc39.es/ecma262/#prod-ClassElementName\n parseClassElementName(\n this: Parser,\n member: Undone<N.ClassMember>,\n ): N.Expression | N.Identifier {\n const { type, value } = this.state;\n if (\n (type === tt.name || type === tt.string) &&\n member.static &&\n value === \"prototype\"\n ) {\n this.raise(Errors.StaticPrototype, { at: this.state.startLoc });\n }\n\n if (type === tt.privateName) {\n if (value === \"constructor\") {\n this.raise(Errors.ConstructorClassPrivateField, {\n at: this.state.startLoc,\n });\n }\n const key = this.parsePrivateName();\n member.key = key;\n return key;\n }\n\n return this.parsePropertyName(member);\n }\n\n parseClassStaticBlock(\n this: Parser,\n classBody: Undone<N.ClassBody>,\n member: Undone<\n N.StaticBlock & {\n decorators?: Array<N.Decorator>;\n }\n >,\n ) {\n // Start a new lexical scope\n this.scope.enter(SCOPE_CLASS | SCOPE_STATIC_BLOCK | SCOPE_SUPER);\n // Start a new scope with regard to loop labels\n const oldLabels = this.state.labels;\n this.state.labels = [];\n // ClassStaticBlockStatementList:\n // StatementList[~Yield, ~Await, ~Return] opt\n this.prodParam.enter(PARAM);\n const body: N.Node[] = (member.body = []);\n this.parseBlockOrModuleBlockBody(body, undefined, false, tt.braceR);\n this.prodParam.exit();\n this.scope.exit();\n this.state.labels = oldLabels;\n classBody.body.push(this.finishNode<N.StaticBlock>(member, \"StaticBlock\"));\n if (member.decorators?.length) {\n this.raise(Errors.DecoratorStaticBlock, { at: member });\n }\n }\n\n pushClassProperty(\n this: Parser,\n classBody: Undone<N.ClassBody>,\n prop: N.ClassProperty,\n ) {\n if (\n !prop.computed &&\n (prop.key.name === \"constructor\" || prop.key.value === \"constructor\")\n ) {\n // Non-computed field, which is either an identifier named \"constructor\"\n // or a string literal named \"constructor\"\n this.raise(Errors.ConstructorClassField, { at: prop.key });\n }\n\n classBody.body.push(this.parseClassProperty(prop));\n }\n\n pushClassPrivateProperty(\n this: Parser,\n classBody: Undone<N.ClassBody>,\n prop: Undone<N.ClassPrivateProperty>,\n ) {\n const node = this.parseClassPrivateProperty(prop);\n classBody.body.push(node);\n\n this.classScope.declarePrivateName(\n this.getPrivateNameSV(node.key),\n CLASS_ELEMENT_OTHER,\n node.key.loc.start,\n );\n }\n\n pushClassAccessorProperty(\n this: Parser,\n classBody: Undone<N.ClassBody>,\n prop: N.ClassAccessorProperty,\n isPrivate: boolean,\n ) {\n if (!isPrivate && !prop.computed) {\n // Not private, so not node is not a PrivateName and we can safely cast\n const key = prop.key as N.Expression;\n\n if (key.name === \"constructor\" || key.value === \"constructor\") {\n // Non-computed field, which is either an identifier named \"constructor\"\n // or a string literal named \"constructor\"\n this.raise(Errors.ConstructorClassField, { at: key });\n }\n }\n\n const node = this.parseClassAccessorProperty(prop);\n classBody.body.push(node);\n\n if (isPrivate) {\n this.classScope.declarePrivateName(\n this.getPrivateNameSV(node.key),\n CLASS_ELEMENT_OTHER,\n node.key.loc.start,\n );\n }\n }\n\n pushClassMethod(\n this: Parser,\n classBody: Undone<N.ClassBody>,\n method: Undone<N.ClassMethod>,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n classBody.body.push(\n this.parseMethod(\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n \"ClassMethod\",\n true,\n ),\n );\n }\n\n pushClassPrivateMethod(\n this: Parser,\n classBody: Undone<N.ClassBody>,\n method: Undone<N.ClassPrivateMethod>,\n isGenerator: boolean,\n isAsync: boolean,\n ): void {\n const node = this.parseMethod(\n method,\n isGenerator,\n isAsync,\n /* isConstructor */ false,\n false,\n \"ClassPrivateMethod\",\n true,\n );\n classBody.body.push(node);\n\n const kind =\n node.kind === \"get\"\n ? node.static\n ? CLASS_ELEMENT_STATIC_GETTER\n : CLASS_ELEMENT_INSTANCE_GETTER\n : node.kind === \"set\"\n ? node.static\n ? CLASS_ELEMENT_STATIC_SETTER\n : CLASS_ELEMENT_INSTANCE_SETTER\n : CLASS_ELEMENT_OTHER;\n this.declareClassPrivateMethodInScope(node, kind);\n }\n\n declareClassPrivateMethodInScope(\n node: Undone<\n N.ClassPrivateMethod | N.EstreeMethodDefinition | N.TSDeclareMethod\n >,\n kind: number,\n ) {\n this.classScope.declarePrivateName(\n this.getPrivateNameSV(node.key),\n kind,\n node.key.loc.start,\n );\n }\n\n // Overridden in typescript.js\n parsePostMemberNameModifiers(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n methodOrProp: Undone<N.ClassMethod | N.ClassProperty>,\n ): void {}\n\n // https://tc39.es/ecma262/#prod-FieldDefinition\n parseClassPrivateProperty(\n this: Parser,\n node: Undone<N.ClassPrivateProperty>,\n ): N.ClassPrivateProperty {\n this.parseInitializer(node);\n this.semicolon();\n return this.finishNode(node, \"ClassPrivateProperty\");\n }\n\n // https://tc39.es/ecma262/#prod-FieldDefinition\n parseClassProperty(this: Parser, node: N.ClassProperty): N.ClassProperty {\n this.parseInitializer(node);\n this.semicolon();\n return this.finishNode(node, \"ClassProperty\");\n }\n\n parseClassAccessorProperty(\n this: Parser,\n node: N.ClassAccessorProperty,\n ): N.ClassAccessorProperty {\n this.parseInitializer(node);\n this.semicolon();\n return this.finishNode(node, \"ClassAccessorProperty\");\n }\n\n // https://tc39.es/ecma262/#prod-Initializer\n parseInitializer(\n this: Parser,\n node: Undone<\n N.ClassProperty | N.ClassPrivateProperty | N.ClassAccessorProperty\n >,\n ): void {\n this.scope.enter(SCOPE_CLASS | SCOPE_SUPER);\n this.expressionScope.enter(newExpressionScope());\n this.prodParam.enter(PARAM);\n node.value = this.eat(tt.eq) ? this.parseMaybeAssignAllowIn() : null;\n this.expressionScope.exit();\n this.prodParam.exit();\n this.scope.exit();\n }\n\n parseClassId(\n node: Undone<N.Class>,\n isStatement: boolean,\n optionalId?: boolean | null,\n bindingType: BindingTypes = BIND_CLASS,\n ): void {\n if (tokenIsIdentifier(this.state.type)) {\n node.id = this.parseIdentifier();\n if (isStatement) {\n this.declareNameFromIdentifier(node.id, bindingType);\n }\n } else {\n if (optionalId || !isStatement) {\n node.id = null;\n } else {\n throw this.raise(Errors.MissingClassName, { at: this.state.startLoc });\n }\n }\n }\n\n // https://tc39.es/ecma262/#prod-ClassHeritage\n parseClassSuper(this: Parser, node: Undone<N.Class>): void {\n node.superClass = this.eat(tt._extends) ? this.parseExprSubscripts() : null;\n }\n\n // Parses module export declaration.\n // https://tc39.es/ecma262/#prod-ExportDeclaration\n\n parseExport(\n this: Parser,\n node: Undone<\n | N.ExportDefaultDeclaration\n | N.ExportAllDeclaration\n | N.ExportNamedDeclaration\n >,\n decorators: N.Decorator[] | null,\n ): N.AnyExport {\n const maybeDefaultIdentifier = this.parseMaybeImportPhase(\n node,\n /* isExport */ true,\n );\n const hasDefault = this.maybeParseExportDefaultSpecifier(\n node,\n maybeDefaultIdentifier,\n );\n const parseAfterDefault = !hasDefault || this.eat(tt.comma);\n const hasStar =\n parseAfterDefault &&\n this.eatExportStar(\n // @ts-expect-error todo(flow->ts)\n node,\n );\n const hasNamespace =\n hasStar &&\n this.maybeParseExportNamespaceSpecifier(\n // @ts-expect-error todo(flow->ts)\n node,\n );\n const parseAfterNamespace =\n parseAfterDefault && (!hasNamespace || this.eat(tt.comma));\n const isFromRequired = hasDefault || hasStar;\n\n if (hasStar && !hasNamespace) {\n if (hasDefault) this.unexpected();\n if (decorators) {\n throw this.raise(Errors.UnsupportedDecoratorExport, { at: node });\n }\n this.parseExportFrom(node as Undone<N.ExportNamedDeclaration>, true);\n\n return this.finishNode(node, \"ExportAllDeclaration\");\n }\n\n const hasSpecifiers = this.maybeParseExportNamedSpecifiers(\n // @ts-expect-error todo(flow->ts)\n node,\n );\n\n if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers) {\n this.unexpected(null, tt.braceL);\n }\n\n if (hasNamespace && parseAfterNamespace) {\n this.unexpected(null, tt._from);\n }\n\n let hasDeclaration;\n if (isFromRequired || hasSpecifiers) {\n hasDeclaration = false;\n if (decorators) {\n throw this.raise(Errors.UnsupportedDecoratorExport, { at: node });\n }\n this.parseExportFrom(\n node as Undone<N.ExportNamedDeclaration>,\n isFromRequired,\n );\n } else {\n hasDeclaration = this.maybeParseExportDeclaration(\n node as Undone<N.ExportNamedDeclaration>,\n );\n }\n\n if (isFromRequired || hasSpecifiers || hasDeclaration) {\n const node2 = node as Undone<N.ExportNamedDeclaration>;\n this.checkExport(node2, true, false, !!node2.source);\n if (node2.declaration?.type === \"ClassDeclaration\") {\n this.maybeTakeDecorators(decorators, node2.declaration, node2);\n } else if (decorators) {\n throw this.raise(Errors.UnsupportedDecoratorExport, { at: node });\n }\n return this.finishNode(node2, \"ExportNamedDeclaration\");\n }\n\n if (this.eat(tt._default)) {\n const node2 = node as Undone<N.ExportDefaultDeclaration>;\n // export default ...\n const decl = this.parseExportDefaultExpression();\n node2.declaration = decl;\n\n if (decl.type === \"ClassDeclaration\") {\n this.maybeTakeDecorators(decorators, decl as N.ClassDeclaration, node2);\n } else if (decorators) {\n throw this.raise(Errors.UnsupportedDecoratorExport, { at: node });\n }\n\n this.checkExport(node2, true, true);\n\n return this.finishNode(node2, \"ExportDefaultDeclaration\");\n }\n\n this.unexpected(null, tt.braceL);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n eatExportStar(node: N.Node): boolean {\n return this.eat(tt.star);\n }\n\n maybeParseExportDefaultSpecifier(\n node: Undone<\n | N.ExportDefaultDeclaration\n | N.ExportAllDeclaration\n | N.ExportNamedDeclaration\n >,\n maybeDefaultIdentifier: N.Identifier | null,\n ): node is Undone<N.ExportNamedDeclaration> {\n if (maybeDefaultIdentifier || this.isExportDefaultSpecifier()) {\n // export defaultObj ...\n this.expectPlugin(\"exportDefaultFrom\", maybeDefaultIdentifier?.loc.start);\n const id = maybeDefaultIdentifier || this.parseIdentifier(true);\n const specifier = this.startNodeAtNode<N.ExportDefaultSpecifier>(id);\n specifier.exported = id;\n (node as Undone<N.ExportNamedDeclaration>).specifiers = [\n this.finishNode(specifier, \"ExportDefaultSpecifier\"),\n ];\n return true;\n }\n return false;\n }\n\n maybeParseExportNamespaceSpecifier(node: N.Node): boolean {\n if (this.isContextual(tt._as)) {\n if (!node.specifiers) node.specifiers = [];\n\n const specifier = this.startNodeAt(this.state.lastTokStartLoc);\n\n this.next();\n\n specifier.exported = this.parseModuleExportName();\n node.specifiers.push(\n this.finishNode(specifier, \"ExportNamespaceSpecifier\"),\n );\n return true;\n }\n return false;\n }\n\n maybeParseExportNamedSpecifiers(node: N.Node): boolean {\n if (this.match(tt.braceL)) {\n if (!node.specifiers) node.specifiers = [];\n const isTypeExport = node.exportKind === \"type\";\n node.specifiers.push(...this.parseExportSpecifiers(isTypeExport));\n\n node.source = null;\n node.declaration = null;\n if (this.hasPlugin(\"importAssertions\")) {\n node.assertions = [];\n }\n\n return true;\n }\n return false;\n }\n\n maybeParseExportDeclaration(\n this: Parser,\n node: Undone<N.ExportNamedDeclaration>,\n ): boolean {\n if (this.shouldParseExportDeclaration()) {\n node.specifiers = [];\n node.source = null;\n if (this.hasPlugin(\"importAssertions\")) {\n node.assertions = [];\n }\n node.declaration = this.parseExportDeclaration(node);\n return true;\n }\n return false;\n }\n\n isAsyncFunction(): boolean {\n if (!this.isContextual(tt._async)) return false;\n const next = this.nextTokenInLineStart();\n return this.isUnparsedContextual(next, \"function\");\n }\n\n parseExportDefaultExpression(this: Parser): N.Expression | N.Declaration {\n const expr = this.startNode();\n\n if (this.match(tt._function)) {\n this.next();\n return this.parseFunction(\n expr as Undone<N.FunctionDeclaration>,\n ParseFunctionFlag.Declaration | ParseFunctionFlag.NullableId,\n );\n } else if (this.isAsyncFunction()) {\n this.next(); // eat 'async'\n this.next(); // eat 'function'\n return this.parseFunction(\n expr as Undone<N.FunctionDeclaration>,\n ParseFunctionFlag.Declaration |\n ParseFunctionFlag.NullableId |\n ParseFunctionFlag.Async,\n );\n }\n\n if (this.match(tt._class)) {\n return this.parseClass(expr as Undone<N.ClassExpression>, true, true);\n }\n\n if (this.match(tt.at)) {\n if (\n this.hasPlugin(\"decorators\") &&\n this.getPluginOption(\"decorators\", \"decoratorsBeforeExport\") === true\n ) {\n this.raise(Errors.DecoratorBeforeExport, { at: this.state.startLoc });\n }\n return this.parseClass(\n this.maybeTakeDecorators(\n this.parseDecorators(false),\n this.startNode<N.ClassDeclaration>(),\n ),\n true,\n true,\n );\n }\n\n if (this.match(tt._const) || this.match(tt._var) || this.isLet()) {\n throw this.raise(Errors.UnsupportedDefaultExport, {\n at: this.state.startLoc,\n });\n }\n\n const res = this.parseMaybeAssignAllowIn();\n this.semicolon();\n return res;\n }\n\n // https://tc39.es/ecma262/#prod-ExportDeclaration\n parseExportDeclaration(\n this: Parser,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n node: Undone<N.ExportNamedDeclaration>,\n ): N.Declaration | undefined | null {\n if (this.match(tt._class)) {\n const node = this.parseClass(\n this.startNode<N.ClassDeclaration>(),\n true,\n false,\n );\n return node;\n }\n return this.parseStatementListItem() as N.Declaration;\n }\n\n isExportDefaultSpecifier(): boolean {\n const { type } = this.state;\n if (tokenIsIdentifier(type)) {\n if ((type === tt._async && !this.state.containsEsc) || type === tt._let) {\n return false;\n }\n if (\n (type === tt._type || type === tt._interface) &&\n !this.state.containsEsc\n ) {\n const { type: nextType } = this.lookahead();\n // If we see any variable name other than `from` after `type` keyword,\n // we consider it as flow/typescript type exports\n // note that this approach may fail on some pedantic cases\n // export type from = number\n if (\n (tokenIsIdentifier(nextType) && nextType !== tt._from) ||\n nextType === tt.braceL\n ) {\n this.expectOnePlugin([\"flow\", \"typescript\"]);\n return false;\n }\n }\n } else if (!this.match(tt._default)) {\n return false;\n }\n\n const next = this.nextTokenStart();\n const hasFrom = this.isUnparsedContextual(next, \"from\");\n if (\n this.input.charCodeAt(next) === charCodes.comma ||\n (tokenIsIdentifier(this.state.type) && hasFrom)\n ) {\n return true;\n }\n // lookahead again when `export default from` is seen\n if (this.match(tt._default) && hasFrom) {\n const nextAfterFrom = this.input.charCodeAt(\n this.nextTokenStartSince(next + 4),\n );\n return (\n nextAfterFrom === charCodes.quotationMark ||\n nextAfterFrom === charCodes.apostrophe\n );\n }\n return false;\n }\n\n parseExportFrom(\n this: Parser,\n node: Undone<N.ExportNamedDeclaration>,\n expect?: boolean,\n ): void {\n if (this.eatContextual(tt._from)) {\n node.source = this.parseImportSource();\n this.checkExport(node);\n this.maybeParseImportAttributes(node);\n this.checkJSONModuleImport(node);\n } else if (expect) {\n this.unexpected();\n }\n\n this.semicolon();\n }\n\n shouldParseExportDeclaration(): boolean {\n const { type } = this.state;\n if (type === tt.at) {\n this.expectOnePlugin([\"decorators\", \"decorators-legacy\"]);\n if (this.hasPlugin(\"decorators\")) {\n if (\n this.getPluginOption(\"decorators\", \"decoratorsBeforeExport\") === true\n ) {\n this.raise(Errors.DecoratorBeforeExport, {\n at: this.state.startLoc,\n });\n }\n\n return true;\n }\n }\n\n return (\n type === tt._var ||\n type === tt._const ||\n type === tt._function ||\n type === tt._class ||\n this.isLet() ||\n this.isAsyncFunction()\n );\n }\n\n checkExport(\n node: Undone<N.ExportNamedDeclaration | N.ExportDefaultDeclaration>,\n checkNames?: boolean,\n isDefault?: boolean,\n isFrom?: boolean,\n ): void {\n if (checkNames) {\n // Check for duplicate exports\n if (isDefault) {\n // Default exports\n this.checkDuplicateExports(node, \"default\");\n if (this.hasPlugin(\"exportDefaultFrom\")) {\n const declaration = (node as any as N.ExportDefaultDeclaration)\n .declaration;\n if (\n declaration.type === \"Identifier\" &&\n declaration.name === \"from\" &&\n declaration.end - declaration.start === 4 && // does not contain escape\n !declaration.extra?.parenthesized\n ) {\n this.raise(Errors.ExportDefaultFromAsIdentifier, {\n at: declaration,\n });\n }\n }\n // @ts-expect-error node.specifiers may not exist\n } else if (node.specifiers && node.specifiers.length) {\n // Named exports\n // @ts-expect-error node.specifiers may not exist\n for (const specifier of node.specifiers) {\n const { exported } = specifier;\n const exportName =\n exported.type === \"Identifier\" ? exported.name : exported.value;\n this.checkDuplicateExports(specifier, exportName);\n if (!isFrom && specifier.local) {\n const { local } = specifier;\n if (local.type !== \"Identifier\") {\n this.raise(Errors.ExportBindingIsString, {\n at: specifier,\n localName: local.value,\n exportName,\n });\n } else {\n // check for keywords used as local names\n this.checkReservedWord(local.name, local.loc.start, true, false);\n // check if export is defined\n this.scope.checkLocalExport(local);\n }\n }\n }\n } else if (node.declaration) {\n // Exported declarations\n if (\n node.declaration.type === \"FunctionDeclaration\" ||\n node.declaration.type === \"ClassDeclaration\"\n ) {\n const id = node.declaration.id;\n if (!id) throw new Error(\"Assertion failure\");\n\n this.checkDuplicateExports(node, id.name);\n } else if (node.declaration.type === \"VariableDeclaration\") {\n for (const declaration of node.declaration.declarations) {\n this.checkDeclaration(declaration.id);\n }\n }\n }\n }\n }\n\n checkDeclaration(node: N.Pattern | N.ObjectProperty): void {\n if (node.type === \"Identifier\") {\n this.checkDuplicateExports(node, node.name);\n } else if (node.type === \"ObjectPattern\") {\n for (const prop of node.properties) {\n this.checkDeclaration(prop);\n }\n } else if (node.type === \"ArrayPattern\") {\n for (const elem of node.elements) {\n if (elem) {\n this.checkDeclaration(elem);\n }\n }\n } else if (node.type === \"ObjectProperty\") {\n // @ts-expect-error migrate to Babel types\n this.checkDeclaration(node.value);\n } else if (node.type === \"RestElement\") {\n this.checkDeclaration(node.argument);\n } else if (node.type === \"AssignmentPattern\") {\n this.checkDeclaration(node.left);\n }\n }\n\n checkDuplicateExports(\n node: Undone<\n | N.Identifier\n | N.StringLiteral\n | N.ExportNamedDeclaration\n | N.ExportSpecifier\n | N.ExportDefaultSpecifier\n >,\n exportName: string,\n ): void {\n if (this.exportedIdentifiers.has(exportName)) {\n if (exportName === \"default\") {\n this.raise(Errors.DuplicateDefaultExport, { at: node });\n } else {\n this.raise(Errors.DuplicateExport, { at: node, exportName });\n }\n }\n this.exportedIdentifiers.add(exportName);\n }\n\n // Parses a comma-separated list of module exports.\n\n parseExportSpecifiers(isInTypeExport: boolean): Array<N.ExportSpecifier> {\n const nodes = [];\n let first = true;\n\n // export { x, y as z } [from '...']\n this.expect(tt.braceL);\n\n while (!this.eat(tt.braceR)) {\n if (first) {\n first = false;\n } else {\n this.expect(tt.comma);\n if (this.eat(tt.braceR)) break;\n }\n const isMaybeTypeOnly = this.isContextual(tt._type);\n const isString = this.match(tt.string);\n const node = this.startNode();\n node.local = this.parseModuleExportName();\n nodes.push(\n this.parseExportSpecifier(\n node,\n isString,\n isInTypeExport,\n isMaybeTypeOnly,\n ),\n );\n }\n\n return nodes;\n }\n\n parseExportSpecifier(\n node: any,\n isString: boolean,\n /* eslint-disable @typescript-eslint/no-unused-vars -- used in TypeScript parser */\n isInTypeExport: boolean,\n isMaybeTypeOnly: boolean,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ): N.ExportSpecifier {\n if (this.eatContextual(tt._as)) {\n node.exported = this.parseModuleExportName();\n } else if (isString) {\n node.exported = cloneStringLiteral(node.local);\n } else if (!node.exported) {\n node.exported = cloneIdentifier(node.local);\n }\n return this.finishNode<N.ExportSpecifier>(node, \"ExportSpecifier\");\n }\n\n // https://tc39.es/ecma262/#prod-ModuleExportName\n parseModuleExportName(): N.StringLiteral | N.Identifier {\n if (this.match(tt.string)) {\n const result = this.parseStringLiteral(this.state.value);\n const surrogate = result.value.match(loneSurrogate);\n if (surrogate) {\n this.raise(Errors.ModuleExportNameHasLoneSurrogate, {\n at: result,\n surrogateCharCode: surrogate[0].charCodeAt(0),\n });\n }\n return result;\n }\n return this.parseIdentifier(true);\n }\n\n isJSONModuleImport(\n node: Undone<\n N.ExportAllDeclaration | N.ExportNamedDeclaration | N.ImportDeclaration\n >,\n ): boolean {\n if (node.assertions != null) {\n return node.assertions.some(({ key, value }) => {\n return (\n value.value === \"json\" &&\n (key.type === \"Identifier\"\n ? key.name === \"type\"\n : key.value === \"type\")\n );\n });\n }\n return false;\n }\n\n checkImportReflection(node: Undone<N.ImportDeclaration>) {\n if (node.module) {\n if (\n node.specifiers.length !== 1 ||\n node.specifiers[0].type !== \"ImportDefaultSpecifier\"\n ) {\n this.raise(Errors.ImportReflectionNotBinding, {\n at: node.specifiers[0].loc.start,\n });\n }\n if (node.assertions?.length > 0) {\n this.raise(Errors.ImportReflectionHasAssertion, {\n at: node.specifiers[0].loc.start,\n });\n }\n }\n }\n\n checkJSONModuleImport(\n node: Undone<\n N.ExportAllDeclaration | N.ExportNamedDeclaration | N.ImportDeclaration\n >,\n ) {\n // @ts-expect-error Fixme: node.type must be undefined because they are undone\n if (this.isJSONModuleImport(node) && node.type !== \"ExportAllDeclaration\") {\n // @ts-expect-error specifiers may not index node\n const { specifiers } = node;\n if (specifiers != null) {\n // @ts-expect-error refine specifier types\n const nonDefaultNamedSpecifier = specifiers.find(specifier => {\n let imported;\n if (specifier.type === \"ExportSpecifier\") {\n imported = specifier.local;\n } else if (specifier.type === \"ImportSpecifier\") {\n imported = specifier.imported;\n }\n if (imported !== undefined) {\n return imported.type === \"Identifier\"\n ? imported.name !== \"default\"\n : imported.value !== \"default\";\n }\n });\n if (nonDefaultNamedSpecifier !== undefined) {\n this.raise(Errors.ImportJSONBindingNotDefault, {\n at: nonDefaultNamedSpecifier.loc.start,\n });\n }\n }\n }\n }\n\n isPotentialImportPhase(isExport: boolean): boolean {\n return !isExport && this.isContextual(tt._module);\n }\n\n applyImportPhase(\n node: Undone<N.ImportDeclaration | N.ExportNamedDeclaration>,\n isExport: boolean,\n phase: string | null,\n loc?: Position,\n ): void {\n if (isExport) {\n if (!process.env.IS_PUBLISH) {\n if (phase === \"module\") {\n throw new Error(\n \"Assertion failure: export declarations do not support the 'module' phase.\",\n );\n }\n }\n return;\n }\n if (phase === \"module\") {\n this.expectPlugin(\"importReflection\", loc);\n (node as N.ImportDeclaration).module = true;\n } else if (this.hasPlugin(\"importReflection\")) {\n (node as N.ImportDeclaration).module = false;\n }\n }\n\n /*\n * Parse `module` in `import module x fro \"x\"`, disambiguating\n * `import module from \"x\"` and `import module from from \"x\"`.\n *\n * This function might return an identifier representing the `module`\n * if it eats `module` and then discovers that it was the default import\n * binding and not the import reflection.\n *\n * This function is also used to parse `import type` and `import typeof`\n * in the TS and Flow plugins.\n *\n * Note: the proposal has been updated to use `source` instead of `module`,\n * but it has not been implemented yet.\n */\n parseMaybeImportPhase(\n node: Undone<N.ImportDeclaration | N.TsImportEqualsDeclaration>,\n isExport: boolean,\n ): N.Identifier | null {\n if (!this.isPotentialImportPhase(isExport)) {\n this.applyImportPhase(\n node as Undone<N.ImportDeclaration>,\n isExport,\n null,\n );\n return null;\n }\n\n const phaseIdentifier = this.parseIdentifier(true);\n\n const { type } = this.state;\n const isImportPhase = tokenIsKeywordOrIdentifier(type)\n ? // OK: import <phase> x from \"foo\";\n // OK: import <phase> from from \"foo\";\n // NO: import <phase> from \"foo\";\n // NO: import <phase> from 'foo';\n // With the module declarations proposals, we will need further disambiguation\n // for `import module from from;`.\n type !== tt._from || this.lookaheadCharCode() === charCodes.lowercaseF\n : // OK: import <phase> { x } from \"foo\";\n // OK: import <phase> x from \"foo\";\n // OK: import <phase> * as T from \"foo\";\n // NO: import <phase> from \"foo\";\n // OK: import <phase> \"foo\";\n // The last one is invalid, we will continue parsing and throw\n // an error later\n type !== tt.comma;\n\n if (isImportPhase) {\n this.resetPreviousIdentifierLeadingComments(phaseIdentifier);\n this.applyImportPhase(\n node as Undone<N.ImportDeclaration>,\n isExport,\n phaseIdentifier.name,\n phaseIdentifier.loc.start,\n );\n return null;\n } else {\n this.applyImportPhase(\n node as Undone<N.ImportDeclaration>,\n isExport,\n null,\n );\n // `<phase>` is a default binding, return it to the main import declaration parser\n return phaseIdentifier;\n }\n }\n\n isPrecedingIdImportPhase(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n phase: string,\n ) {\n const { type } = this.state;\n return tokenIsIdentifier(type)\n ? // OK: import <phase> x from \"foo\";\n // OK: import <phase> from from \"foo\";\n // NO: import <phase> from \"foo\";\n // NO: import <phase> from 'foo';\n // With the module declarations proposals, we will need further disambiguation\n // for `import module from from;`.\n type !== tt._from || this.lookaheadCharCode() === charCodes.lowercaseF\n : // OK: import <phase> { x } from \"foo\";\n // OK: import <phase> x from \"foo\";\n // OK: import <phase> * as T from \"foo\";\n // NO: import <phase> from \"foo\";\n // OK: import <phase> \"foo\";\n // The last one is invalid, we will continue parsing and throw\n // an error later\n type !== tt.comma;\n }\n\n // Parses import declaration.\n // https://tc39.es/ecma262/#prod-ImportDeclaration\n\n parseImport(this: Parser, node: Undone<N.ImportDeclaration>): N.AnyImport {\n if (this.match(tt.string)) {\n // import '...'\n return this.parseImportSourceAndAttributes(node);\n }\n\n return this.parseImportSpecifiersAndAfter(\n node,\n this.parseMaybeImportPhase(node, /* isExport */ false),\n );\n }\n\n parseImportSpecifiersAndAfter(\n this: Parser,\n node: Undone<N.ImportDeclaration>,\n maybeDefaultIdentifier: N.Identifier | null,\n ): N.AnyImport {\n node.specifiers = [];\n\n // check if we have a default import like\n // import React from \"react\";\n const hasDefault = this.maybeParseDefaultImportSpecifier(\n node,\n maybeDefaultIdentifier,\n );\n /* we are checking if we do not have a default import, then it is obvious that we need named imports\n * import { get } from \"axios\";\n * but if we do have a default import\n * we need to check if we have a comma after that and\n * that is where this `|| this.eat` condition comes into play\n */\n const parseNext = !hasDefault || this.eat(tt.comma);\n // if we do have to parse the next set of specifiers, we first check for star imports\n // import React, * from \"react\";\n const hasStar = parseNext && this.maybeParseStarImportSpecifier(node);\n // now we check if we need to parse the next imports\n // but only if they are not importing * (everything)\n if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node);\n this.expectContextual(tt._from);\n\n return this.parseImportSourceAndAttributes(node);\n }\n\n parseImportSourceAndAttributes(\n this: Parser,\n node: Undone<N.ImportDeclaration>,\n ): N.AnyImport {\n node.specifiers ??= [];\n node.source = this.parseImportSource();\n this.maybeParseImportAttributes(node);\n this.checkImportReflection(node);\n this.checkJSONModuleImport(node);\n\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n\n parseImportSource(this: Parser): N.StringLiteral {\n if (!this.match(tt.string)) this.unexpected();\n return this.parseExprAtom() as N.StringLiteral;\n }\n\n parseImportSpecifierLocal<\n T extends\n | N.ImportSpecifier\n | N.ImportDefaultSpecifier\n | N.ImportNamespaceSpecifier,\n >(\n node: Undone<N.ImportDeclaration>,\n specifier: Undone<T>,\n type: T[\"type\"],\n ): void {\n specifier.local = this.parseIdentifier();\n node.specifiers.push(this.finishImportSpecifier(specifier, type));\n }\n\n finishImportSpecifier<\n T extends\n | N.ImportSpecifier\n | N.ImportDefaultSpecifier\n | N.ImportNamespaceSpecifier,\n >(specifier: Undone<T>, type: T[\"type\"], bindingType = BIND_LEXICAL) {\n this.checkLVal(specifier.local, {\n in: { type },\n binding: bindingType,\n });\n return this.finishNode(specifier, type);\n }\n\n /**\n * parse assert entries\n *\n * @see {@link https://tc39.es/proposal-import-attributes/#prod-WithEntries WithEntries}\n */\n parseImportAttributes(): N.ImportAttribute[] {\n this.expect(tt.braceL);\n\n const attrs = [];\n const attrNames = new Set();\n\n do {\n if (this.match(tt.braceR)) {\n break;\n }\n\n const node = this.startNode<N.ImportAttribute>();\n\n // parse AssertionKey : IdentifierName, StringLiteral\n const keyName = this.state.value;\n // check if we already have an entry for an attribute\n // if a duplicate entry is found, throw an error\n // for now this logic will come into play only when someone declares `type` twice\n if (attrNames.has(keyName)) {\n this.raise(Errors.ModuleAttributesWithDuplicateKeys, {\n at: this.state.startLoc,\n key: keyName,\n });\n }\n attrNames.add(keyName);\n if (this.match(tt.string)) {\n node.key = this.parseStringLiteral(keyName);\n } else {\n node.key = this.parseIdentifier(true);\n }\n this.expect(tt.colon);\n\n if (!this.match(tt.string)) {\n throw this.raise(Errors.ModuleAttributeInvalidValue, {\n at: this.state.startLoc,\n });\n }\n node.value = this.parseStringLiteral(this.state.value);\n attrs.push(this.finishNode(node, \"ImportAttribute\"));\n } while (this.eat(tt.comma));\n\n this.expect(tt.braceR);\n\n return attrs;\n }\n\n /**\n * parse module attributes\n * @deprecated It will be removed in Babel 8\n */\n parseModuleAttributes() {\n const attrs: N.ImportAttribute[] = [];\n const attributes = new Set();\n do {\n const node = this.startNode<N.ImportAttribute>();\n node.key = this.parseIdentifier(true);\n\n if (node.key.name !== \"type\") {\n this.raise(Errors.ModuleAttributeDifferentFromType, {\n at: node.key,\n });\n }\n\n if (attributes.has(node.key.name)) {\n this.raise(Errors.ModuleAttributesWithDuplicateKeys, {\n at: node.key,\n key: node.key.name,\n });\n }\n attributes.add(node.key.name);\n this.expect(tt.colon);\n if (!this.match(tt.string)) {\n throw this.raise(Errors.ModuleAttributeInvalidValue, {\n at: this.state.startLoc,\n });\n }\n node.value = this.parseStringLiteral(this.state.value);\n attrs.push(this.finishNode(node, \"ImportAttribute\"));\n } while (this.eat(tt.comma));\n\n return attrs;\n }\n\n maybeParseImportAttributes(\n node: Undone<N.ImportDeclaration | N.ExportNamedDeclaration>,\n ) {\n let attributes: N.ImportAttribute[];\n let useWith = false;\n\n // https://tc39.es/proposal-import-attributes/#prod-WithClause\n if (this.match(tt._with)) {\n if (\n this.hasPrecedingLineBreak() &&\n this.lookaheadCharCode() === charCodes.leftParenthesis\n ) {\n // This will be parsed as a with statement, and we will throw a\n // better error about it not being supported in strict mode.\n return;\n }\n\n this.next(); // eat `with`\n\n if (!process.env.BABEL_8_BREAKING) {\n if (this.hasPlugin(\"moduleAttributes\")) {\n attributes = this.parseModuleAttributes();\n } else {\n this.expectImportAttributesPlugin();\n attributes = this.parseImportAttributes();\n }\n } else {\n this.expectImportAttributesPlugin();\n attributes = this.parseImportAttributes();\n }\n useWith = true;\n } else if (this.isContextual(tt._assert) && !this.hasPrecedingLineBreak()) {\n if (this.hasPlugin(\"importAttributes\")) {\n if (\n this.getPluginOption(\"importAttributes\", \"deprecatedAssertSyntax\") !==\n true\n ) {\n this.raise(Errors.ImportAttributesUseAssert, {\n at: this.state.startLoc,\n });\n }\n this.addExtra(node, \"deprecatedAssertSyntax\", true);\n } else {\n this.expectOnePlugin([\"importAttributes\", \"importAssertions\"]);\n }\n this.next(); // eat `assert`\n attributes = this.parseImportAttributes();\n } else if (\n this.hasPlugin(\"importAttributes\") ||\n this.hasPlugin(\"importAssertions\")\n ) {\n attributes = [];\n } else if (!process.env.BABEL_8_BREAKING) {\n if (this.hasPlugin(\"moduleAttributes\")) {\n attributes = [];\n } else return;\n } else return;\n\n if (!useWith && this.hasPlugin(\"importAssertions\")) {\n node.assertions = attributes;\n } else {\n node.attributes = attributes;\n }\n }\n\n maybeParseDefaultImportSpecifier(\n node: Undone<N.ImportDeclaration>,\n maybeDefaultIdentifier: N.Identifier | null,\n ): boolean {\n // import defaultObj, { x, y as z } from '...'\n if (maybeDefaultIdentifier) {\n const specifier = this.startNodeAtNode<N.ImportDefaultSpecifier>(\n maybeDefaultIdentifier,\n );\n specifier.local = maybeDefaultIdentifier;\n node.specifiers.push(\n this.finishImportSpecifier(specifier, \"ImportDefaultSpecifier\"),\n );\n return true;\n } else if (\n // We allow keywords, and parseImportSpecifierLocal will report a recoverable error\n tokenIsKeywordOrIdentifier(this.state.type)\n ) {\n this.parseImportSpecifierLocal(\n node,\n this.startNode<N.ImportDefaultSpecifier>(),\n \"ImportDefaultSpecifier\",\n );\n return true;\n }\n return false;\n }\n\n maybeParseStarImportSpecifier(node: Undone<N.ImportDeclaration>): boolean {\n if (this.match(tt.star)) {\n const specifier = this.startNode<N.ImportNamespaceSpecifier>();\n this.next();\n this.expectContextual(tt._as);\n\n this.parseImportSpecifierLocal(\n node,\n specifier,\n \"ImportNamespaceSpecifier\",\n );\n return true;\n }\n return false;\n }\n\n parseNamedImportSpecifiers(node: Undone<N.ImportDeclaration>) {\n let first = true;\n this.expect(tt.braceL);\n while (!this.eat(tt.braceR)) {\n if (first) {\n first = false;\n } else {\n // Detect an attempt to deep destructure\n if (this.eat(tt.colon)) {\n throw this.raise(Errors.DestructureNamedImport, {\n at: this.state.startLoc,\n });\n }\n\n this.expect(tt.comma);\n if (this.eat(tt.braceR)) break;\n }\n\n const specifier = this.startNode<N.ImportSpecifier>();\n const importedIsString = this.match(tt.string);\n const isMaybeTypeOnly = this.isContextual(tt._type);\n specifier.imported = this.parseModuleExportName();\n const importSpecifier = this.parseImportSpecifier(\n specifier,\n importedIsString,\n node.importKind === \"type\" || node.importKind === \"typeof\",\n isMaybeTypeOnly,\n undefined,\n );\n node.specifiers.push(importSpecifier);\n }\n }\n\n // https://tc39.es/ecma262/#prod-ImportSpecifier\n parseImportSpecifier(\n specifier: Undone<N.ImportSpecifier>,\n importedIsString: boolean,\n /* eslint-disable @typescript-eslint/no-unused-vars -- used in TypeScript and Flow parser */\n isInTypeOnlyImport: boolean,\n isMaybeTypeOnly: boolean,\n bindingType: BindingTypes | undefined,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ): N.ImportSpecifier {\n if (this.eatContextual(tt._as)) {\n specifier.local = this.parseIdentifier();\n } else {\n const { imported } = specifier;\n if (importedIsString) {\n throw this.raise(Errors.ImportBindingIsString, {\n at: specifier,\n importName: (imported as N.StringLiteral).value,\n });\n }\n this.checkReservedWord(\n (imported as N.Identifier).name,\n specifier.loc.start,\n true,\n true,\n );\n if (!specifier.local) {\n specifier.local = cloneIdentifier(imported);\n }\n }\n return this.finishImportSpecifier(\n specifier,\n \"ImportSpecifier\",\n bindingType,\n );\n }\n\n // This is used in flow and typescript plugin\n // Determine whether a parameter is a this param\n isThisParam(\n param: N.Pattern | N.Identifier | N.TSParameterProperty,\n ): boolean {\n return param.type === \"Identifier\" && param.name === \"this\";\n }\n}\n","import type { Options } from \"../options\";\nimport type * as N from \"../types\";\nimport type { PluginList } from \"../plugin-utils\";\nimport { getOptions } from \"../options\";\nimport StatementParser from \"./statement\";\nimport ScopeHandler from \"../util/scope\";\n\nexport type PluginsMap = Map<\n string,\n {\n [x: string]: any;\n }\n>;\n\nexport default class Parser extends StatementParser {\n // Forward-declaration so typescript plugin can override jsx plugin\n // todo(flow->ts) - this probably can be removed\n // abstract jsxParseOpeningElementAfterName(\n // node: N.JSXOpeningElement,\n // ): N.JSXOpeningElement;\n\n constructor(options: Options | undefined | null, input: string) {\n options = getOptions(options);\n super(options, input);\n\n this.options = options;\n this.initializeScopes();\n this.plugins = pluginsMap(this.options.plugins);\n this.filename = options.sourceFilename;\n }\n\n // This can be overwritten, for example, by the TypeScript plugin.\n getScopeHandler(): {\n new (...args: any): ScopeHandler;\n } {\n return ScopeHandler;\n }\n\n parse(): N.File {\n this.enterInitialScopes();\n const file = this.startNode() as N.File;\n const program = this.startNode() as N.Program;\n this.nextToken();\n file.errors = null;\n this.parseTopLevel(file, program);\n file.errors = this.state.errors;\n return file;\n }\n}\n\nfunction pluginsMap(plugins: PluginList): PluginsMap {\n const pluginMap: PluginsMap = new Map();\n for (const plugin of plugins) {\n const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}];\n if (!pluginMap.has(name)) pluginMap.set(name, options || {});\n }\n return pluginMap;\n}\n","import type { Options } from \"./options\";\nimport {\n hasPlugin,\n validatePlugins,\n mixinPluginNames,\n mixinPlugins,\n type PluginList,\n} from \"./plugin-utils\";\nimport type {\n PluginConfig as ParserPlugin,\n FlowPluginOptions,\n RecordAndTuplePluginOptions,\n PipelineOperatorPluginOptions,\n} from \"./typings\";\nimport Parser from \"./parser\";\n\nimport type { ExportedTokenType } from \"./tokenizer/types\";\nimport {\n getExportedToken,\n tt as internalTokenTypes,\n type InternalTokenTypes,\n} from \"./tokenizer/types\";\nimport \"./tokenizer/context\";\n\nimport type { Expression, File } from \"./types\";\n\nexport function parse(input: string, options?: Options): File {\n if (options?.sourceType === \"unambiguous\") {\n options = {\n ...options,\n };\n try {\n options.sourceType = \"module\";\n const parser = getParser(options, input);\n const ast = parser.parse();\n\n if (parser.sawUnambiguousESM) {\n return ast;\n }\n\n if (parser.ambiguousScriptDifferentAst) {\n // Top level await introduces code which can be both a valid script and\n // a valid module, but which produces different ASTs:\n // await\n // 0\n // can be parsed either as an AwaitExpression, or as two ExpressionStatements.\n try {\n options.sourceType = \"script\";\n return getParser(options, input).parse();\n } catch {}\n } else {\n // This is both a valid module and a valid script, but\n // we parse it as a script by default\n ast.program.sourceType = \"script\";\n }\n\n return ast;\n } catch (moduleError) {\n try {\n options.sourceType = \"script\";\n return getParser(options, input).parse();\n } catch {}\n\n throw moduleError;\n }\n } else {\n return getParser(options, input).parse();\n }\n}\n\nexport function parseExpression(input: string, options?: Options): Expression {\n const parser = getParser(options, input);\n if (parser.options.strictMode) {\n parser.state.strict = true;\n }\n return parser.getExpression();\n}\n\nfunction generateExportedTokenTypes(\n internalTokenTypes: InternalTokenTypes,\n): Record<string, ExportedTokenType> {\n const tokenTypes: Record<string, ExportedTokenType> = {};\n for (const typeName of Object.keys(\n internalTokenTypes,\n ) as (keyof InternalTokenTypes)[]) {\n tokenTypes[typeName] = getExportedToken(internalTokenTypes[typeName]);\n }\n return tokenTypes;\n}\n\nexport const tokTypes = generateExportedTokenTypes(internalTokenTypes);\n\nfunction getParser(options: Options | undefined | null, input: string): Parser {\n let cls = Parser;\n if (options?.plugins) {\n validatePlugins(options.plugins);\n cls = getParserClass(options.plugins);\n }\n\n return new cls(options, input);\n}\n\nconst parserClassCache: { [key: string]: { new (...args: any): Parser } } = {};\n\n/** Get a Parser class with plugins applied. */\nfunction getParserClass(pluginsFromOptions: PluginList): {\n new (...args: any): Parser;\n} {\n const pluginList = mixinPluginNames.filter(name =>\n hasPlugin(pluginsFromOptions, name),\n );\n\n const key = pluginList.join(\"/\");\n let cls = parserClassCache[key];\n if (!cls) {\n cls = Parser;\n for (const plugin of pluginList) {\n // @ts-expect-error todo(flow->ts)\n cls = mixinPlugins[plugin](cls);\n }\n parserClassCache[key] = cls;\n }\n return cls;\n}\n\nexport type {\n FlowPluginOptions,\n ParserPlugin,\n PipelineOperatorPluginOptions,\n RecordAndTuplePluginOptions,\n};\nexport type ParserOptions = Partial<Options>;\n"],"names":["Position","constructor","line","col","index","column","SourceLocation","start","end","filename","identifierName","createPositionWithColumnOffset","position","columnOffset","ParseErrorCode","SyntaxError","SourceTypeModuleError","reflect","keys","last","length","get","reduce","object","key","set","value","item","i","instantiate","properties","descriptors","Object","map","filter","descriptor","enumerable","assign","split","instance","defineProperty","configurable","ModuleErrors","ImportMetaOutsideModule","message","code","ImportOutsideModule","NodeDescriptions","ArrayPattern","AssignmentExpression","AssignmentPattern","ArrowFunctionExpression","ConditionalExpression","CatchClause","ForOfStatement","ForInStatement","ForStatement","FormalParameters","Identifier","ImportSpecifier","ImportDefaultSpecifier","ImportNamespaceSpecifier","ObjectPattern","ParenthesizedExpression","RestElement","UpdateExpression","true","false","VariableDeclarator","YieldExpression","toNodeDescription","type","prefix","String","StandardErrors","AccessorIsGenerator","kind","ArgumentsInClass","AsyncFunctionInSingleStatementContext","AwaitBindingIdentifier","AwaitBindingIdentifierInStaticBlock","AwaitExpressionFormalParameter","AwaitUsingNotInAsyncContext","AwaitNotInAsyncContext","AwaitNotInAsyncFunction","BadGetterArity","BadSetterArity","BadSetterRestParameter","ConstructorClassField","ConstructorClassPrivateField","ConstructorIsAccessor","ConstructorIsAsync","ConstructorIsGenerator","DeclarationMissingInitializer","DecoratorArgumentsOutsideParentheses","DecoratorBeforeExport","DecoratorsBeforeAfterExport","DecoratorConstructor","DecoratorExportClass","DecoratorSemicolon","DecoratorStaticBlock","DeletePrivateField","DestructureNamedImport","DuplicateConstructor","DuplicateDefaultExport","DuplicateExport","exportName","DuplicateProto","DuplicateRegExpFlags","ElementAfterRest","EscapedCharNotAnIdentifier","ExportBindingIsString","localName","ExportDefaultFromAsIdentifier","ForInOfLoopInitializer","ForInUsing","ForOfAsync","ForOfLet","GeneratorInSingleStatementContext","IllegalBreakContinue","IllegalLanguageModeDirective","IllegalReturn","ImportAttributesUseAssert","ImportBindingIsString","importName","ImportCallArgumentTrailingComma","ImportCallArity","maxArgumentCount","ImportCallNotNewExpression","ImportCallSpreadArgument","ImportJSONBindingNotDefault","ImportReflectionHasAssertion","ImportReflectionNotBinding","IncompatibleRegExpUVFlags","InvalidBigIntLiteral","InvalidCodePoint","InvalidCoverInitializedName","InvalidDecimal","InvalidDigit","radix","InvalidEscapeSequence","InvalidEscapeSequenceTemplate","InvalidEscapedReservedWord","reservedWord","InvalidIdentifier","InvalidLhs","ancestor","InvalidLhsBinding","InvalidNumber","InvalidOrMissingExponent","InvalidOrUnexpectedToken","unexpected","InvalidParenthesizedAssignment","InvalidPrivateFieldResolution","InvalidPropertyBindingPattern","InvalidRecordProperty","InvalidRestAssignmentPattern","LabelRedeclaration","labelName","LetInLexicalBinding","LineTerminatorBeforeArrow","MalformedRegExpFlags","MissingClassName","MissingEqInAssignment","MissingSemicolon","MissingPlugin","missingPlugin","name","JSON","stringify","join","MissingOneOfPlugins","MissingUnicodeEscape","MixingCoalesceWithLogical","ModuleAttributeDifferentFromType","ModuleAttributeInvalidValue","ModuleAttributesWithDuplicateKeys","ModuleExportNameHasLoneSurrogate","surrogateCharCode","toString","ModuleExportUndefined","MultipleDefaultsInSwitch","NewlineAfterThrow","NoCatchOrFinally","NumberIdentifier","NumericSeparatorInEscapeSequence","ObsoleteAwaitStar","OptionalChainingNoNew","OptionalChainingNoTemplate","OverrideOnConstructor","ParamDupe","PatternHasAccessor","PatternHasMethod","PrivateInExpectedIn","PrivateNameRedeclaration","RecordExpressionBarIncorrectEndSyntaxType","RecordExpressionBarIncorrectStartSyntaxType","RecordExpressionHashIncorrectStartSyntaxType","RecordNoProto","RestTrailingComma","SloppyFunction","SloppyFunctionAnnexB","StaticPrototype","SuperNotAllowed","SuperPrivateField","TrailingDecorator","TupleExpressionBarIncorrectEndSyntaxType","TupleExpressionBarIncorrectStartSyntaxType","TupleExpressionHashIncorrectStartSyntaxType","UnexpectedArgumentPlaceholder","UnexpectedAwaitAfterPipelineBody","UnexpectedDigitAfterHash","UnexpectedImportExport","UnexpectedKeyword","keyword","UnexpectedLeadingDecorator","UnexpectedLexicalDeclaration","UnexpectedNewTarget","UnexpectedNumericSeparator","UnexpectedPrivateField","UnexpectedReservedWord","UnexpectedSuper","UnexpectedToken","expected","UnexpectedTokenUnaryExponentiation","UnexpectedUsingDeclaration","UnsupportedBind","UnsupportedDecoratorExport","UnsupportedDefaultExport","UnsupportedImport","UnsupportedMetaProperty","target","onlyValidPropertyName","UnsupportedParameterDecorator","UnsupportedPropertyDecorator","UnsupportedSuper","UnterminatedComment","UnterminatedRegExp","UnterminatedString","UnterminatedTemplate","UsingDeclarationHasBindingPattern","VarRedeclaration","YieldBindingIdentifier","YieldInParameter","ZeroDigitNumericSeparator","StrictModeErrors","StrictDelete","StrictEvalArguments","referenceName","StrictEvalArgumentsBinding","bindingName","StrictFunction","StrictNumericEscape","StrictOctalLiteral","StrictWith","UnparenthesizedPipeBodyDescriptions","Set","PipelineOperatorErrors","PipeBodyIsTighter","PipeTopicRequiresHackPipes","PipeTopicUnbound","PipeTopicUnconfiguredToken","token","PipeTopicUnused","PipeUnparenthesizedBody","PipelineBodyNoArrow","PipelineBodySequenceExpression","PipelineHeadSequenceExpression","PipelineTopicUnused","PrimaryTopicNotAllowed","PrimaryTopicRequiresSmartPipeline","toParseErrorConstructor","_ref","toMessage","_objectWithoutPropertiesLoose","_excluded","loc","details","clone","overrides","pos","ParseErrorEnum","argument","syntaxPlugin","Array","isArray","parseErrorTemplates","ParseErrorConstructors","reasonCode","template","_ref2","rest","_excluded2","Errors","toUnenumerable","toESTreeLocation","node","estree","superClass","ESTreeParserMixin","parse","file","options","tokens","parseRegExpLiteral","pattern","flags","regex","RegExp","e","estreeParseLiteral","parseBigIntLiteral","bigInt","BigInt","_unused","bigint","parseDecimalLiteral","decimal","parseLiteral","parseStringLiteral","parseNumericLiteral","parseNullLiteral","parseBooleanLiteral","directiveToStmt","directive","expression","raw","extra","expressionValue","stmt","rawValue","initFunction","isAsync","checkDeclaration","isObjectProperty","getObjectOrClassMethodParams","method","params","isValidDirective","_stmt$expression$extr","parenthesized","parseBlockBody","allowDirectives","topLevel","afterBlockParse","directiveStatements","directives","d","body","concat","pushClassMethod","classBody","isGenerator","isConstructor","allowsDirectSuper","parseMethod","typeParameters","push","parsePrivateName","getPluginOption","convertPrivateNameToPrivateIdentifier","getPrivateNameSV","id","isPrivateName","parseFunctionBody","allowExpression","isMethod","allowDirectSuper","inClassScope","funcNode","startNode","computed","finishNode","parseClassProperty","args","propertyNode","parseClassPrivateProperty","parseObjectMethod","prop","isPattern","isAccessor","shorthand","parseObjectProperty","startLoc","refExpressionErrors","isValidLVal","isUnparenthesizedInAssign","binding","isAssignable","isBinding","toAssignable","isLHS","classScope","usePrivateName","toAssignableObjectExpressionProp","isLast","raise","at","finishCallExpression","unfinished","optional","callee","source","arguments","hasPlugin","_node$arguments$","attributes","toReferencedArguments","parseExport","decorators","exportStartLoc","state","lastTokStartLoc","exported","specifiers","_declaration$decorato","declaration","resetStartLocation","parseSubscript","base","noCalls","optionalChainMember","substring","stop","chain","startNodeAtNode","hasPropertyAsPrivateName","isObjectMethod","finishNodeAt","endLoc","resetEndLocation","lastTokEndLoc","TokContext","preserveSpace","types","brace","j_oTag","j_cTag","j_expr","beforeExpr","startsExpr","isLoop","isAssign","postfix","ExportedTokenType","label","conf","rightAssociative","binop","updateContext","keywords","Map","createKeyword","createToken","createBinop","tokenTypeCounter","tokenTypes","tokenLabels","tokenBinops","tokenBeforeExprs","tokenStartsExprs","tokenPrefixes","_options$binop","_options$beforeExpr","_options$startsExpr","_options$prefix","createKeywordLike","_options$binop2","_options$beforeExpr2","_options$startsExpr2","_options$prefix2","tt","bracketL","bracketHashL","bracketBarL","bracketR","bracketBarR","braceL","braceBarL","braceHashL","braceR","braceBarR","parenL","parenR","comma","semi","colon","doubleColon","dot","question","questionDot","arrow","ellipsis","backQuote","dollarBraceL","templateTail","templateNonTail","hash","interpreterDirective","eq","slashAssign","xorAssign","moduloAssign","incDec","bang","tilde","doubleCaret","doubleAt","pipeline","nullishCoalescing","logicalOR","logicalAND","bitwiseOR","bitwiseXOR","bitwiseAND","equality","lt","gt","relational","bitShift","bitShiftL","bitShiftR","plusMin","modulo","star","slash","exponent","_in","_instanceof","_break","_case","_catch","_continue","_debugger","_default","_else","_finally","_function","_if","_return","_switch","_throw","_try","_var","_const","_with","_new","_this","_super","_class","_extends","_export","_import","_null","_true","_false","_typeof","_void","_delete","_do","_for","_while","_as","_assert","_async","_await","_from","_get","_let","_meta","_of","_sent","_set","_static","_using","_yield","_asserts","_checks","_exports","_global","_implements","_intrinsic","_infer","_is","_mixins","_proto","_require","_satisfies","_keyof","_readonly","_unique","_abstract","_declare","_enum","_module","_namespace","_interface","_type","_opaque","string","num","regexp","privateName","eof","jsxName","jsxText","jsxTagStart","jsxTagEnd","placeholder","tokenIsIdentifier","tokenKeywordOrIdentifierIsKeyword","tokenIsKeywordOrIdentifier","tokenIsLiteralPropertyName","tokenComesBeforeExpression","tokenCanStartExpression","tokenIsAssignment","tokenIsFlowInterfaceOrTypeOrOpaque","tokenIsLoop","tokenIsKeyword","tokenIsOperator","tokenIsPostfix","tokenIsPrefix","tokenIsTSTypeOperator","tokenIsTSDeclarationStart","tokenLabelName","tokenOperatorPrecedence","tokenIsRightAssociative","tokenIsTemplate","getExportedToken","context","pop","tc","nonASCIIidentifierStartChars","nonASCIIidentifierChars","nonASCIIidentifierStart","nonASCIIidentifier","astralIdentifierStartCodes","astralIdentifierCodes","isInAstralSet","isIdentifierStart","test","fromCharCode","isIdentifierChar","reservedWords","strict","strictBind","reservedWordsStrictSet","reservedWordsStrictBindSet","isReservedWord","word","inModule","isStrictReservedWord","has","isStrictBindOnlyReservedWord","isStrictBindReservedWord","isKeyword","isIteratorStart","current","next","next2","reservedWordLikeSet","canBeReservedWord","SCOPE_OTHER","SCOPE_PROGRAM","SCOPE_FUNCTION","SCOPE_ARROW","SCOPE_SIMPLE_CATCH","SCOPE_SUPER","SCOPE_DIRECT_SUPER","SCOPE_CLASS","SCOPE_STATIC_BLOCK","SCOPE_TS_MODULE","SCOPE_VAR","BIND_KIND_VALUE","BIND_KIND_TYPE","BIND_SCOPE_VAR","BIND_SCOPE_LEXICAL","BIND_SCOPE_FUNCTION","BIND_FLAGS_NONE","BIND_FLAGS_CLASS","BIND_FLAGS_TS_ENUM","BIND_FLAGS_TS_CONST_ENUM","BIND_FLAGS_TS_EXPORT_ONLY","BIND_FLAGS_FLOW_DECLARE_FN","BIND_FLAGS_TS_IMPORT","BIND_FLAGS_NO_LET_IN_LEXICAL","BIND_CLASS","BIND_LEXICAL","BIND_CATCH_PARAM","BIND_VAR","BIND_FUNCTION","BIND_TS_INTERFACE","BIND_TS_TYPE","BIND_TS_ENUM","BIND_TS_AMBIENT","BIND_NONE","BIND_OUTSIDE","BIND_TS_CONST_ENUM","BIND_TS_NAMESPACE","BIND_TS_TYPE_IMPORT","BIND_FLOW_DECLARE_FN","CLASS_ELEMENT_FLAG_STATIC","CLASS_ELEMENT_KIND_GETTER","CLASS_ELEMENT_KIND_SETTER","CLASS_ELEMENT_KIND_ACCESSOR","CLASS_ELEMENT_STATIC_GETTER","CLASS_ELEMENT_STATIC_SETTER","CLASS_ELEMENT_INSTANCE_GETTER","CLASS_ELEMENT_INSTANCE_SETTER","CLASS_ELEMENT_OTHER","Scope","var","lexical","functions","ScopeHandler","parser","scopeStack","undefinedExports","inTopLevel","currentScope","inFunction","currentVarScopeFlags","allowSuper","currentThisScopeFlags","inClass","inClassAndNotInNonArrowFunction","inStaticBlock","inNonArrowFunction","treatFunctionsAsVar","treatFunctionsAsVarInScope","createScope","enter","exit","scope","declareName","bindingType","checkRedeclarationInScope","add","maybeExportDefined","delete","isRedeclaredInScope","values","checkLocalExport","topLevelScope","FlowScope","declareFunctions","FlowScopeHandler","BaseParser","sawUnambiguousESM","ambiguousScriptDifferentAst","pluginConfig","plugins","pluginName","pluginOptions","actualOptions","plugin","_this$plugins$get","setTrailingComments","comments","trailingComments","undefined","unshift","setLeadingComments","leadingComments","setInnerComments","innerComments","adjustInnerComments","elements","commentWS","lastElement","CommentsParser","addComment","comment","processComment","commentStack","commentStackLength","lastCommentWS","leadingNode","nodeStart","commentEnd","containingNode","finalizeComment","splice","trailingNode","commentStart","input","charCodeAt","finalizeRemainingComments","resetPreviousNodeTrailingComments","resetPreviousIdentifierLeadingComments","takeSurroundingComments","lineBreak","lineBreakG","isNewLine","skipWhiteSpace","skipWhiteSpaceInLine","skipWhiteSpaceToLineBreak","isWhitespace","State","curLine","lineStart","errors","potentialArrowAt","noArrowAt","noArrowParamsConversionAt","maybeInArrowParameters","inType","noAnonFunctionType","hasFlowComment","isAmbientContext","inAbstractClass","inDisallowConditionalTypesContext","topicContext","maxNumOfResolvableTopics","maxTopicIndex","soloAwait","inFSharpPipelineDirectBody","labels","lastTokStart","ct","canStartJSXElement","containsEsc","firstInvalidTemplateEscapePos","strictErrors","tokensLength","init","strictMode","sourceType","startLine","startColumn","curPosition","skipArrays","val","slice","isDigit","forbiddenNumericSeparatorSiblings","decBinOct","hex","isAllowedNumericSeparatorSibling","bin","ch","oct","dec","readStringContents","initialPos","initialLineStart","initialCurLine","out","firstInvalidLoc","chunkStart","unterminated","isStringEnd","res","readEscapedChar","str","containsInvalid","inTemplate","throwOnInvalid","readHexChar","readCodePoint","fromCodePoint","strictNumericEscape","startPos","match","octalStr","octal","parseInt","len","forceLen","n","readInt","invalidEscapeSequence","allowNumSeparator","bailOnError","forbiddenSiblings","isAllowedSibling","invalid","total","Infinity","prev","numericSeparatorInEscapeSequence","Number","isNaN","unexpectedNumericSeparator","_isDigit","invalidDigit","indexOf","invalidCodePoint","buildPosition","VALID_REGEX_FLAGS","Token","Tokenizer","isLookahead","errorHandlers_readInt","errorRecovery","errorBuilder","errorHandlers_readCodePoint","errorHandlers_readStringContents_string","recordStrictModeErrors","errorHandlers_readStringContents_template","pushToken","checkKeywordEscapes","nextToken","eat","createLookaheadState","curContext","lookahead","old","curr","nextTokenStart","nextTokenStartSince","lastIndex","lookaheadCharCode","nextTokenInLineStart","nextTokenInLineStartSince","lookaheadInLineCharCode","codePointAtPos","cp","trail","setStrict","forEach","toParseError","clear","skipSpace","finishToken","getTokenFromCode","skipBlockComment","skipLineComment","startSkip","spaceStart","loop","attachComment","annexB","commentWhitespace","prevType","replaceToken","readToken_numberSign","readToken_interpreter","nextPos","expectPlugin","readWord1","finishOp","readToken_dot","readNumber","readToken_slash","readToken_mult_modulo","width","readToken_pipe_amp","readToken_caret","proposal","topicToken","lookaheadCh","codePointAt","readToken_atSign","readToken_plus_min","readToken_lt","readToken_gt","size","readToken_eq_excl","readToken_question","readTemplateToken","readRadixNumber","readString","readWord","readRegexp","escaped","content","mods","char","includes","isBigInt","replace","startsWithDot","isFloat","isDecimal","hasExponent","isOctal","hasLeadingZero","integer","underscorePos","parseFloat","quote","readTemplateContinuation","opening","firstCode","escStart","identifierCheck","esc","keywordTypes","raiseProperties","error","raiseOverwrite","expectOnePlugin","pluginNames","some","ClassScope","privateNames","loneAccessors","undefinedPrivateNames","ClassScopeHandler","stack","oldClassScope","from","declarePrivateName","elementType","redefined","accessor","oldStatic","newStatic","oldKind","newKind","kExpression","kMaybeArrowParameterDeclaration","kMaybeAsyncArrowParameterDeclaration","kParameterDeclaration","ExpressionScope","canBeArrowParameterDeclaration","isCertainlyParameterDeclaration","ArrowHeadParsingScope","declarationErrors","recordDeclarationError","ParsingErrorClass","clearDeclarationError","iterateErrors","iterator","ExpressionScopeHandler","recordParameterInitializerError","origin","recordArrowParameterBindingError","recordAsyncArrowParametersError","validateAsPattern","newParameterDeclarationScope","newArrowHeadScope","newAsyncArrowScope","newExpressionScope","PARAM","PARAM_YIELD","PARAM_AWAIT","PARAM_RETURN","PARAM_IN","ProductionParameterHandler","stacks","currentFlags","hasAwait","hasYield","hasReturn","hasIn","functionFlags","UtilParser","addExtra","isContextual","isUnparsedContextual","nameStart","nameEnd","nextCh","isLookaheadContextual","eatContextual","expectContextual","canInsertSemicolon","hasPrecedingLineBreak","hasFollowingLineBreak","isLineTerminator","semicolon","allowAsi","expect","tryParse","fn","oldState","abortSignal","failState","thrown","aborted","checkExpressionErrors","andThrow","shorthandAssignLoc","doubleProtoLoc","privateKeyLoc","optionalParametersLoc","hasErrors","isLiteralPropertyName","property","initializeScopes","oldLabels","oldExportedIdentifiers","exportedIdentifiers","oldInModule","oldScope","getScopeHandler","oldProdParam","prodParam","oldExpressionScope","expressionScope","enterInitialScopes","paramFlags","checkDestructuringPrivate","ExpressionErrors","Node","ranges","range","NodePrototype","prototype","__clone","newNode","clonePlaceholder","cloneIdentifier","cloned","create","expectedNode","cloneStringLiteral","NodeUtils","startNodeAt","resetStartLocationFromNode","locationNode","reservedTypes","FlowErrors","AmbiguousConditionalArrow","AmbiguousDeclareModuleKind","AssignReservedType","reservedType","DeclareClassElement","DeclareClassFieldInitializer","DuplicateDeclareModuleExports","EnumBooleanMemberNotInitialized","memberName","enumName","EnumDuplicateMemberName","EnumInconsistentMemberValues","EnumInvalidExplicitType","invalidEnumType","EnumInvalidExplicitTypeUnknownSupplied","EnumInvalidMemberInitializerPrimaryType","explicitType","EnumInvalidMemberInitializerSymbolType","EnumInvalidMemberInitializerUnknownType","EnumInvalidMemberName","suggestion","EnumNumberMemberNotInitialized","EnumStringMemberInconsistentlyInitailized","GetterMayNotHaveThisParam","ImportReflectionHasImportType","ImportTypeShorthandOnlyInPureImport","InexactInsideExact","InexactInsideNonObject","InexactVariance","InvalidNonTypeImportInDeclareModule","MissingTypeParamDefault","NestedDeclareModule","NestedFlowComment","PatternIsOptional","SetterMayNotHaveThisParam","SpreadVariance","ThisParamAnnotationRequired","ThisParamBannedInConstructor","ThisParamMayNotBeOptional","ThisParamMustBeFirst","ThisParamNoDefault","TypeBeforeInitializer","TypeCastInPattern","UnexpectedExplicitInexactInObject","UnexpectedReservedType","UnexpectedReservedUnderscore","UnexpectedSpaceBetweenModuloChecks","UnexpectedSpreadType","UnexpectedSubtractionOperand","UnexpectedTokenAfterTypeParameter","UnexpectedTypeParameterBeforeAsyncArrowFunction","UnsupportedDeclareExportKind","unsupportedExportKind","UnsupportedStatementInDeclareModule","UnterminatedFlowComment","isEsModuleType","bodyElement","hasTypeImportKind","importKind","exportSuggestions","const","let","interface","partition","list","list1","list2","FLOW_PRAGMA_REGEX","flow","FlowParserMixin","flowPragma","shouldParseTypes","shouldParseEnums","matches","exec","Error","flowParseTypeInitialiser","tok","oldInType","flowParseType","flowParsePredicate","moduloLoc","parseExpression","flowParseTypeAndPredicateInitialiser","predicate","flowParseDeclareClass","flowParseInterfaceish","flowParseDeclareFunction","parseIdentifier","typeNode","typeContainer","flowParseTypeParameterDeclaration","tmp","flowParseFunctionTypeParams","this","returnType","typeAnnotation","flowParseDeclare","insideModule","flowParseDeclareVariable","flowParseDeclareModuleExports","flowParseDeclareModule","flowParseDeclareTypeAlias","flowParseDeclareOpaqueType","flowParseDeclareInterface","flowParseDeclareExportDeclaration","flowParseTypeAnnotatableIdentifier","parseExprAtom","bodyNode","parseImport","hasModuleExport","default","isLet","exportKind","flowParseTypeAnnotation","finished","flowParseTypeAlias","flowParseOpaqueType","isClass","flowParseRestrictedIdentifier","extends","flowParseInterfaceExtends","implements","mixins","flowParseObjectType","allowStatic","allowExact","allowSpread","allowProto","allowInexact","flowParseQualifiedTypeIdentifier","flowParseTypeParameterInstantiation","flowParseInterface","checkNotUnderscore","checkReservedType","liberal","right","declare","supertype","impltype","flowParseTypeParameter","requireDefault","nodeStartLoc","variance","flowParseVariance","ident","bound","defaultRequired","typeParameter","oldNoAnonFunctionType","flowParseTypeParameterInstantiationCallOrNew","flowParseTypeOrImplicitInstantiation","flowParseInterfaceType","flowParseObjectPropertyKey","flowParseObjectTypeIndexer","isStatic","static","flowParseObjectTypeInternalSlot","flowParseObjectTypeMethodish","flowParseFunctionTypeParam","flowParseObjectTypeCallProperty","valueNode","callProperties","indexers","internalSlots","endDelim","exact","inexact","protoStartLoc","inexactStartLoc","propOrInexact","flowParseObjectTypeProperty","flowObjectTypeSemicolon","isInexactToken","proto","flowCheckGetterSetterParams","paramCount","_startLoc","node2","qualification","flowParseGenericType","flowParseTypeofType","flowParsePrimaryType","flowParseTupleType","first","lh","isThis","reinterpretTypeAsFunctionTypeParam","flowIdentToTypeAnnotation","isGroupedType","parseLiteralAtNode","createIdentifier","flowParsePostfixType","seenOptionalIndexedAccess","objectType","indexType","flowParsePrefixType","flowParseAnonFunctionWithoutParens","param","flowParseIntersectionType","flowParseUnionType","allowPrimitiveOverride","typeCastToParameter","allowExpressionBody","forwardNoArrowParamsConversionAt","parseFunctionBodyAndFinish","parseStatementLike","flowParseEnumDeclaration","parseExpressionStatement","expr","shouldParseExportDeclaration","isExportDefaultSpecifier","parseExportDefaultExpression","parseConditional","setOptionalParametersError","originalNoArrowAt","consequent","failed","tryParseConditionalConsequent","valid","getArrowLikeExpressions","alternate","parseMaybeAssign","parseMaybeAssignAllowIn","disallowInvalid","arrows","finishArrowValidation","every","_node$extra","toAssignableList","trailingCommaLoc","checkParams","result","parseParenItem","typeCastNode","assertModuleNodeAllowed","parseExportDeclaration","declarationNode","parseExportSpecifiers","parseExportFrom","eatExportStar","maybeParseExportNamespaceSpecifier","hasNamespace","parseClassId","isStatement","optionalId","parseClassMember","member","parseClassMemberFromModifier","isIterator","readIterator","fullWord","left","exprList","toReferencedList","isParenthesizedExpr","_expr$extra","parseArrayLike","close","canBePattern","isTuple","isParenthesized","isClassMethod","isClassProperty","isNonstaticConstructor","isThisParam","pushClassPrivateMethod","parseClassSuper","superTypeParameters","implemented","checkGetterSetterParams","parsePropertyNamePrefixOperator","parseObjPropValue","parseAssignableListItemTypes","parseMaybeDefault","checkImportReflection","module","parseImportSpecifierLocal","specifier","local","finishImportSpecifier","isPotentialImportPhase","isExport","applyImportPhase","phase","parseImportSpecifier","importedIsString","isInTypeOnlyImport","isMaybeTypeOnly","firstIdent","imported","specifierTypeKind","as_ident","specifierIsTypeImport","checkReservedWord","parseBindingAtom","parseFunctionParams","parseVarId","decl","parseAsyncArrowFromCallExpression","call","shouldParseAsyncArrow","afterLeftParse","_jsx","jsx","currentContext","_jsx2","_jsx3","abort","_arrowExpression$extr","arrowExpression","maybeUnwrapTypeCastExpression","async","parseArrow","shouldParseArrow","setArrowFunctionParameters","allowDuplicates","isArrowFunction","strictModeChanged","parseParenAndDistinguishExpression","canBeArrow","parseSubscripts","parseCallExpressionArguments","parseAsyncArrowWithTypeParameters","subscriptState","isLookaheadToken_lt","typeArguments","parseNewCallee","targs","parseArrowExpression","parseTopLevel","program","fileNode","skipFlowComment","hasFlowCommentCompletion","commentSkip","shiftToFirstNonWhiteSpace","ch2","ch3","flowEnumErrorBooleanMemberNotInitialized","flowEnumErrorInvalidMemberInitializer","enumContext","flowEnumErrorNumberMemberNotInitialized","flowEnumErrorStringMemberInconsistentlyInitailized","flowEnumMemberInit","endOfInit","literal","flowEnumMemberRaw","flowEnumCheckExplicitTypeMismatch","expectedType","flowEnumMembers","seenNames","members","booleanMembers","numberMembers","stringMembers","defaultedMembers","hasUnknownMembers","memberNode","toUpperCase","flowEnumStringMembers","initializedMembers","flowEnumParseExplicitType","flowEnumBody","nameLoc","empty","boolsLen","numsLen","strsLen","defaultedLen","afterNext","entities","__proto__","quot","amp","apos","nbsp","iexcl","cent","pound","curren","yen","brvbar","sect","uml","copy","ordf","laquo","not","shy","reg","macr","deg","plusmn","sup2","sup3","acute","micro","para","middot","cedil","sup1","ordm","raquo","frac14","frac12","frac34","iquest","Agrave","Aacute","Acirc","Atilde","Auml","Aring","AElig","Ccedil","Egrave","Eacute","Ecirc","Euml","Igrave","Iacute","Icirc","Iuml","ETH","Ntilde","Ograve","Oacute","Ocirc","Otilde","Ouml","times","Oslash","Ugrave","Uacute","Ucirc","Uuml","Yacute","THORN","szlig","agrave","aacute","acirc","atilde","auml","aring","aelig","ccedil","egrave","eacute","ecirc","euml","igrave","iacute","icirc","iuml","eth","ntilde","ograve","oacute","ocirc","otilde","ouml","divide","oslash","ugrave","uacute","ucirc","uuml","yacute","thorn","yuml","OElig","oelig","Scaron","scaron","Yuml","fnof","circ","Alpha","Beta","Gamma","Delta","Epsilon","Zeta","Eta","Theta","Iota","Kappa","Lambda","Mu","Nu","Xi","Omicron","Pi","Rho","Sigma","Tau","Upsilon","Phi","Chi","Psi","Omega","alpha","beta","gamma","delta","epsilon","zeta","eta","theta","iota","kappa","lambda","mu","nu","xi","omicron","pi","rho","sigmaf","sigma","tau","upsilon","phi","chi","psi","omega","thetasym","upsih","piv","ensp","emsp","thinsp","zwnj","zwj","lrm","rlm","ndash","mdash","lsquo","rsquo","sbquo","ldquo","rdquo","bdquo","dagger","Dagger","bull","hellip","permil","prime","Prime","lsaquo","rsaquo","oline","frasl","euro","image","weierp","real","trade","alefsym","larr","uarr","rarr","darr","harr","crarr","lArr","uArr","rArr","dArr","hArr","forall","part","exist","nabla","isin","notin","ni","prod","sum","minus","lowast","radic","infin","ang","and","or","cap","cup","int","there4","sim","cong","asymp","ne","equiv","le","ge","sub","sup","nsub","sube","supe","oplus","otimes","perp","sdot","lceil","rceil","lfloor","rfloor","lang","rang","loz","spades","clubs","hearts","diams","JsxErrors","AttributeIsEmpty","MissingClosingTagElement","openingTagName","MissingClosingTagFragment","UnexpectedSequenceExpression","HTMLEntity","UnsupportedJsxValue","UnterminatedJsxContent","UnwrappedAdjacentJSXElements","isFragment","getQualifiedJSXName","namespace","JSXParserMixin","jsxReadToken","jsxReadEntity","jsxReadNewLine","normalizeCRLF","jsxReadString","codePoint","count","desc","entity","XHTMLEntities","jsxReadWord","jsxParseIdentifier","jsxParseNamespacedName","jsxParseElementName","jsxParseAttributeValue","setContext","jsxParseExpressionContainer","jsxParseEmptyExpression","jsxParseSpreadChild","previousContext","jsxParseAttribute","jsxParseOpeningElementAt","jsxParseOpeningElementAfterName","selfClosing","jsxParseClosingElementAt","jsxParseElementAt","children","openingElement","closingElement","contents","openingFragment","closingFragment","jsxParseElement","newContext","TypeScriptScope","enums","constEnums","classes","exportOnlyBindings","TypeScriptScopeHandler","importsStack","hasImport","allowShadow","isConst","wasConst","getOwn","hasOwnProperty","unwrapParenthesizedExpression","LValParser","_node$extra3","_node$extra2","operator","arg","checkToRestConversion","elt","element","toReferencedListDeep","parseSpread","parseRestBinding","parseBindingList","ParseBindingListFlags","parseObjectLike","closeCharCode","allowEmpty","elts","checkCommaAfterRest","parseDecorator","parseAssignableListItem","parseBindingRestProperty","parseBindingProperty","parsePropertyName","_left","ObjectProperty","checkLVal","in","checkClashes","hasParenthesizedAncestor","_expression$extra","checkIdentifier","validity","ParseErrorClass","isParenthesizedExpression","nextAncestor","child","declareNameFromIdentifier","identifier","allowPattern","nonNull","x","assert","TSErrors","AbstractMethodHasImplementation","methodName","AbstractPropertyHasInitializer","propertyName","AccesorCannotDeclareThisParameter","AccesorCannotHaveTypeParameters","AccessorCannotBeOptional","ClassMethodHasDeclare","ClassMethodHasReadonly","ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference","ConstructorHasTypeParameters","DeclareAccessor","DeclareClassFieldHasInitializer","DeclareFunctionHasImplementation","DuplicateAccessibilityModifier","modifier","DuplicateModifier","EmptyHeritageClauseType","EmptyTypeArguments","EmptyTypeParameters","ExpectedAmbientAfterExportDeclare","ImportAliasHasImportType","IncompatibleModifiers","modifiers","IndexSignatureHasAbstract","IndexSignatureHasAccessibility","IndexSignatureHasDeclare","IndexSignatureHasOverride","IndexSignatureHasStatic","InitializerNotAllowedInAmbientContext","InvalidModifierOnTypeMember","InvalidModifierOnTypeParameter","InvalidModifierOnTypeParameterPositions","InvalidModifiersOrder","orderedModifiers","InvalidPropertyAccessAfterInstantiationExpression","InvalidTupleMemberLabel","MissingInterfaceName","MixedLabeledAndUnlabeledElements","NonAbstractClassHasAbstractMethod","NonClassMethodPropertyHasAbstractModifer","OptionalTypeBeforeRequired","OverrideNotInSubClass","PrivateElementHasAbstract","PrivateElementHasAccessibility","ReadonlyForMethodSignature","ReservedArrowTypeParam","ReservedTypeAssertion","SetAccesorCannotHaveOptionalParameter","SetAccesorCannotHaveRestParameter","SetAccesorCannotHaveReturnType","SingleTypeParameterWithoutTrailingComma","typeParameterName","StaticBlockCannotHaveModifier","TupleOptionalAfterType","TypeAnnotationAfterAssign","TypeImportCannotSpecifyDefaultAndNamed","TypeModifierIsUsedInTypeExports","TypeModifierIsUsedInTypeImports","UnexpectedParameterModifier","UnexpectedReadonly","UnexpectedTypeAnnotation","UnexpectedTypeCastInParameter","UnsupportedImportTypeArgument","UnsupportedParameterPropertyKind","UnsupportedSignatureParameterKind","keywordTypeFromName","tsIsAccessModifier","tsIsVarianceAnnotations","typescript","TypeScriptParserMixin","tsParseInOutModifiers","tsParseModifiers","bind","allowedModifiers","disallowedModifiers","errorTemplate","tsParseConstModifier","tsParseInOutConstModifiers","tsIsIdentifier","tsTokenCanFollowModifier","tsNextTokenCanFollowModifier","tsParseModifier","stopOnStartOfClassStaticBlock","tsIsStartOfStaticBlocks","tsTryParse","modified","enforceOrder","before","after","incompatible","mod1","mod2","accessibility","tsIsListTerminator","tsParseList","parseElement","tsParseDelimitedList","refTrailingCommaPos","tsParseDelimitedListWorker","expectSuccess","trailingCommaPos","tsParseBracketedList","bracket","skipFirstToken","tsParseImportType","qualifier","tsParseEntityName","tsParseTypeArguments","allowReservedWords","tsParseTypeReference","typeName","tsParseThisTypePredicate","lhs","parameterName","tsParseTypeAnnotation","asserts","tsParseThisTypeNode","tsParseTypeQuery","exprName","tsParseTypeParameter","parseModifiers","tsParseTypeParameterName","constraint","tsEatThenParseType","tsTryParseTypeParameters","tsParseTypeParameters","tsFillSignature","returnToken","signature","returnTokenRequired","paramsKey","returnTypeKey","tsParseBindingListForSignature","tsParseTypeOrTypePredicateAnnotation","tsParseTypeMemberSemicolon","tsParseSignatureMember","tsIsUnambiguouslyIndexSignature","tsTryParseIndexSignature","tsLookAhead","parameters","tsTryParseTypeAnnotation","tsParsePropertyOrMethodSignature","readonly","nodeAny","firstParameter","tsParseTypeMember","idx","tsParseTypeLiteral","tsParseObjectTypeMembers","tsIsStartOfMappedType","tsParseMappedTypeParameter","tsExpectThenParseType","tsParseMappedType","nameType","tsParseType","tsTryParseType","tsParseTupleType","elementTypes","tsParseTupleElementType","seenOptionalElement","labeledElements","elementNode","_labeledElements","checkType","isLabeled","labeled","isWord","chAfterWord","wordName","typeOrLabel","tsParseNonArrayType","labeledNode","optionalTypeNode","restNode","tsParseParenthesizedType","tsParseFunctionOrConstructorType","abstract","tsInAllowConditionalTypesContext","tsParseLiteralTypeNode","tsParseTemplateLiteralType","parseTemplate","parseTemplateSubstitution","tsParseThisTypeOrThisTypePredicate","thisKeyword","parseMaybeUnary","nodeType","tsParseArrayTypeOrHigher","tsParseTypeOperator","tsParseTypeOperatorOrHigher","tsCheckTypeAnnotationForReadOnly","tsParseInferType","tsParseConstraintForInferType","tsInDisallowConditionalTypesContext","isTypeOperator","tsParseUnionOrIntersectionType","parseConstituentType","hasLeadingOperator","tsParseIntersectionTypeOrHigher","tsParseUnionTypeOrHigher","tsIsStartOfFunctionType","tsIsUnambiguouslyStartOfFunctionType","tsSkipParameterStart","previousErrorCount","_unused2","tsInType","t","tsParseTypePredicateAsserts","thisTypePredicate","typePredicateVariable","tsParseTypePredicatePrefix","tsTryParseTypeOrTypePredicateAnnotation","eatColon","tsParseNonConditionalType","extendsType","trueType","falseType","isAbstractConstructorSignature","tsParseTypeAssertion","tsParseHeritageClause","originalStartLoc","delimitedList","tsParseInterfaceDeclaration","tsParseTypeAliasDeclaration","tsInNoContext","cb","oldContext","oldInDisallowConditionalTypesContext","tsNextThenParseType","tsParseEnumMember","initializer","tsParseEnumDeclaration","tsParseModuleBlock","parseBlockOrModuleBlockBody","tsParseModuleOrNamespaceDeclaration","nested","inner","tsParseAmbientExternalModuleDeclaration","global","tsParseImportEqualsDeclaration","maybeDefaultIdentifier","moduleReference","tsParseModuleReference","tsIsExternalModuleReference","tsParseExternalModuleReference","f","tsTryParseAndCatch","tsTryParseDeclare","nany","startType","tsInAmbientContext","parseFunctionStatement","parseClass","parseVarStatement","tsParseDeclaration","tsTryParseExportDeclaration","tsParseExpressionStatement","mod","tsCheckLineTerminator","tsParseAbstractDeclaration","tsTryParseGenericAsyncArrowFunction","oldMaybeInArrowParameters","tsParseTypeArgumentsInExpression","reScan_lt","reScan_lt_gt","tsIsDeclarationStart","override","pp","parameter","isSimpleParameter","tsDisallowOptionalPattern","bodilessType","registerFunctionStatementId","tsCheckForInvalidTypeCasts","items","isInParens","nonNullExpression","isOptionalCall","missingParenErrorLoc","atPossibleAsyncArrow","asyncArrowFn","parseTaggedTemplateExpression","tokenType","_callee$extra","parseExprOp","leftStartLoc","minPrec","isSatisfies","checkKeywords","checkDuplicateExports","importNode","parseMaybeImportPhase","parseImportSpecifiersAndAfter","isAbstractClass","cls","allowMissingInitializer","declarations","isValidAmbientConstInitializer","parseStatementContent","parseAccessModifier","tsHasSomeModifiers","callParseClassMemberWithIsStatic","parseClassStaticBlock","parseClassMemberWithIsStatic","hadSuperClass","parsePostMemberNameModifiers","methodOrProp","isDeclare","isIdentifier","parseClassPropertyAnnotation","definite","parseClassAccessorProperty","declareClassPrivateMethodInScope","_typeCast","_typeCast2","typeCast","_typeParameters","reportReservedArrowTypeParam","trailingComma","sawUnary","toAssignableParenthesizedExpression","TSTypeCastExpression","TSParameterProperty","TSNonNullExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","parseMaybeDecoratorArguments","canHaveLeadingDecorator","getGetterSetterExpectedParamCount","baseCount","firstParam","hasContextParam","parseCatchClauseParam","oldIsAmbientContext","oldInAbstractClass","maybeTakeDecorators","hasBody","shouldParseAsAmbientContext","getExpression","parseExportSpecifier","isString","isInTypeExport","parseTypeOnlyImportExportSpecifier","isImport","isInTypeOnlyImportExport","leftOfAsKey","rightOfAsKey","leftOfAs","rightOfAs","hasTypeSpecifier","canParseAsKeyword","firstAs","secondAs","parseModuleExportName","kindKey","isPossiblyLiteralEnum","expressions","isUncomputedMemberExpressionChain","isNumber","isNegativeNumber","PlaceholderErrors","ClassNameIsRequired","UnexpectedSpace","placeholders","PlaceholdersParserMixin","parsePlaceholder","assertNoSpace","finishPlaceholder","isFinished","chStartsBindingIdentifier","verifyBreakContinue","isBreak","parseStatementOrSloppyAnnexBFunctionDeclaration","parseBlock","createNewLexicalScope","parseFunctionId","requireId","oldStrict","parseClassBody","startsWith","maybeParseExportDefaultSpecifier","_specifiers","checkExport","hasStarImport","maybeParseStarImportSpecifier","parseNamedImportSpecifiers","parseImportSource","v8intrinsic","V8IntrinsicMixin","parseV8Intrinsic","v8IntrinsicStartLoc","parseIdentifierName","expectedConfig","expectedName","expectedOptions","expectedKeys","expectedOptionsIsEmpty","p","option","find","PIPELINE_PROPOSALS","TOPIC_TOKENS","RECORD_AND_TUPLE_SYNTAX_TYPES","validatePlugins","decoratorsBeforeExport","allowCallParenthesized","proposalList","tupleSyntaxIsHash","syntaxType","tokenList","moduleAttributesVersionPluginOption","missingPlugins","mixinPlugins","mixinPluginNames","defaultOptions","sourceFilename","allowAwaitOutsideFunction","allowReturnOutsideFunction","allowNewTargetOutsideFunction","allowImportExportEverywhere","allowSuperOutsideMethod","allowUndeclaredExports","createParenthesizedExpressions","getOptions","opts","ExpressionParser","checkProto","isRecord","protoRef","used","shouldExitDescending","disallowIn","disallowInAnd","parseExpressionBase","allowInAnd","parseMaybeAssignDisallowIn","resultError","_resultError$loc","parseYield","ownExpressionErrors","parseMaybeConditional","startIndex","parseExprOps","parseMaybeUnaryOrPrivate","op","prec","checkPipelineAtInfixOperator","logical","coalesce","parseExprOpRightExpr","finishedNode","nextOp","withTopicBindingContext","parseHackPipeBody","parseSmartPipelineBodyInStyle","parseExprOpBaseRightExpr","withSoloAwaitPermittingContext","parseFSharpPipelineBody","_body$extra","requiredParentheses","topicReferenceWasUsedInCurrentContext","checkExponentialAfterUnary","isAwait","isAwaitAllowed","parseAwait","update","isDelete","parseUpdate","isAmbiguousAwait","updateExpressionNode","parseExprSubscripts","maybeAsyncArrow","parseBind","parseCoverCallAndAsyncArrowHead","parseMember","parseNoCallExpr","tag","quasi","expectImportAttributesPlugin","dynamicImport","allowPlaceholder","nodeForExtra","oldInFSharpPipelineDirectBody","addTrailingCommaExtraToNode","parseExprListItem","_call$extra","parseSuper","parseImportMetaProperty","parseDo","parseFunctionOrFunctionSent","parseDecorators","parseNewOrNewTarget","parseTopicReferenceThenEqualsSign","parseTopicReference","pipeProposal","parseModuleExpression","parseAsyncFunctionExpression","parseAsyncArrowUnaryFunction","topicTokenType","topicTokenValue","finishTopicReference","testTopicReferenceConfiguration","topicReferenceIsAllowedInCurrentContext","registerTopicReference","meta","parseMetaProperty","parseFunction","innerStartLoc","spreadStartLoc","optionalCommaStartLoc","spreadNodeStartLoc","innerEndLoc","arrowNode","wrapParenthesis","parenExpression","metaProp","parseNew","parseExprList","parseTemplateElement","isTagged","elemStart","elem","isTail","endOffset","elemEnd","cooked","tail","curElt","quasis","propHash","parsePropertyDefinition","maybeAsyncOrAccessorProp","keyName","_params","finishedProp","generator","isExpression","hasStrictModeDirective","nonSimple","isSimpleParamList","formalParameters","reservedTest","delegating","delegate","childExpr","isSimpleReference","checkSmartPipeTopicBodyEarlyErrors","callback","outerContextTopicState","withSmartMixTopicForbiddingContext","outerContextSoloAwaitState","prodParamToSet","prodParamToClear","ret","revertScopes","parseProgram","loopLabel","switchLabel","loneSurrogate","keywordRelationalOperator","babel7CompatTokens","hashEndPos","hashEndLoc","backquoteEnd","backquoteEndLoc","startToken","templateValue","templateElementEnd","templateElementEndLoc","endToken","StatementParser","interpreter","parseInterpreterDirective","finishedProgram","stmtToDirective","directiveLiteral","hasFollowingBindingAtom","endCh","chStartsBindingPattern","hasInLineFollowingBindingIdentifier","startsUsingForOf","startsAwaitUsing","parseModuleItem","ParseStatementFlag","parseStatementListItem","allowLabeledFunction","parseStatement","starttype","allowDeclaration","allowFunctionDeclaration","parseBreakContinueStatement","parseDebuggerStatement","parseDoWhileStatement","parseForStatement","parseIfStatement","parseReturnStatement","parseSwitchStatement","parseThrowStatement","parseTryStatement","parseWhileStatement","parseWithStatement","parseEmptyStatement","nextTokenCharCode","isAsyncFunction","maybeName","parseLabeledStatement","decoratorsEnabledBeforeExport","maybeDecorators","classNode","exportNode","allowExport","paramsStartLoc","lab","parseHeaderExpression","awaitAt","parseFor","startsWithLet","startsWithAwaitUsing","starsWithUsingDeclaration","isLetOrUsing","initNode","parseVar","isForIn","parseForIn","startsWithAsync","isForOf","isHangingDeclaration","ParseFunctionFlag","discriminant","cases","cur","sawDefault","isCase","block","handler","clause","finalizer","statementStart","parsedNonDirective","await","isFor","hangingDeclaration","isDeclaration","hadConstructor","publicMethod","privateMethod","publicProp","privateProp","accessorProp","publicMember","parseClassElementName","isPrivate","maybeQuestionTokenStartLoc","pushClassPrivateProperty","pushClassProperty","pushClassAccessorProperty","_member$decorators","parseInitializer","hasDefault","parseAfterDefault","hasStar","parseAfterNamespace","isFromRequired","hasSpecifiers","maybeParseExportNamedSpecifiers","hasDeclaration","maybeParseExportDeclaration","_node2$declaration","isTypeExport","assertions","nextType","hasFrom","nextAfterFrom","maybeParseImportAttributes","checkJSONModuleImport","checkNames","isDefault","isFrom","_declaration$extra","nodes","surrogate","isJSONModuleImport","_node$assertions","nonDefaultNamedSpecifier","phaseIdentifier","isImportPhase","isPrecedingIdImportPhase","parseImportSourceAndAttributes","maybeParseDefaultImportSpecifier","parseNext","_node$specifiers","parseImportAttributes","attrs","attrNames","parseModuleAttributes","useWith","importSpecifier","Parser","pluginsMap","pluginMap","_options","getParser","ast","moduleError","generateExportedTokenTypes","internalTokenTypes","tokTypes","getParserClass","parserClassCache","pluginsFromOptions","pluginList"],"mappings":";;;;;;;;;;;;;;;;;AAOO,MAAMA,QAAQ,CAAC;EAKpBC,WAAWA,CAACC,IAAY,EAAEC,GAAW,EAAEC,KAAa,EAAE;IAAA,IAAA,CAJtDF,IAAI,GAAA,KAAA,CAAA;IAAA,IAAA,CACJG,MAAM,GAAA,KAAA,CAAA;IAAA,IAAA,CACND,KAAK,GAAA,KAAA,CAAA;IAGH,IAAI,CAACF,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACG,MAAM,GAAGF,GAAG;IACjB,IAAI,CAACC,KAAK,GAAGA,KAAK;EACpB;AACF;AAEO,MAAME,cAAc,CAAC;EAM1BL,WAAWA,CAACM,KAAe,EAAEC,GAAc,EAAE;IAAA,IAAA,CAL7CD,KAAK,GAAA,KAAA,CAAA;IAAA,IAAA,CACLC,GAAG,GAAA,KAAA,CAAA;IAAA,IAAA,CACHC,QAAQ,GAAA,KAAA,CAAA;IAAA,IAAA,CACRC,cAAc,GAAA,KAAA,CAAA;IAGZ,IAAI,CAACH,KAAK,GAAGA,KAAK;IAElB,IAAI,CAACC,GAAG,GAAGA,GAAG;EAChB;AACF;AAQO,SAASG,8BAA8BA,CAC5CC,QAAkB,EAClBC,YAAoB,EACpB;EACA,MAAM;IAAEX,IAAI;IAAEG,MAAM;IAAED;EAAO,CAAA,GAAGQ,QAAQ;EACxC,OAAO,IAAIZ,QAAQ,CAACE,IAAI,EAAEG,MAAM,GAAGQ,YAAY,EAA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,EAAE;IACRA,GAAG,GAAGoZ,MAAM;IACZ,KAAK,MAAMxvD,MAAM,IAAIqwD,UAAU,EAAE;MAE/Bja,GAAG,GAAGuH,YAAY,CAAC39C,MAAM,CAAC,CAACo2C,GAAG,CAAC;IACjC;IACA+Z,gBAAgB,CAAC99E,GAAG,CAAC,GAAG+jE,GAAG;EAC7B;EACA,OAAOA,GAAG;AACZ;;;"} lib/options.js 0000644 00000002060 15120211212 0007324 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.defaultOptions = void 0; exports.getOptions = getOptions; const defaultOptions = { sourceType: "script", sourceFilename: undefined, startColumn: 0, startLine: 1, allowAwaitOutsideFunction: false, allowReturnOutsideFunction: false, allowNewTargetOutsideFunction: false, allowImportExportEverywhere: false, allowSuperOutsideMethod: false, allowUndeclaredExports: false, plugins: [], strictMode: null, ranges: false, tokens: false, createParenthesizedExpressions: false, errorRecovery: false, attachComment: true, annexB: true }; exports.defaultOptions = defaultOptions; function getOptions(opts) { if (opts && opts.annexB != null && opts.annexB !== false) { throw new Error("The `annexB` option can only be set to `false`."); } const options = {}; for (const key of Object.keys(defaultOptions)) { options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key]; } return options; } //# sourceMappingURL=options.js.map lib/options.js.map 0000644 00000012363 15120211212 0010107 0 ustar 00 {"version":3,"names":["defaultOptions","sourceType","sourceFilename","undefined","startColumn","startLine","allowAwaitOutsideFunction","allowReturnOutsideFunction","allowNewTargetOutsideFunction","allowImportExportEverywhere","allowSuperOutsideMethod","allowUndeclaredExports","plugins","strictMode","ranges","tokens","createParenthesizedExpressions","errorRecovery","attachComment","annexB","exports","getOptions","opts","Error","options","key","Object","keys"],"sources":["../src/options.ts"],"sourcesContent":["import type { PluginList } from \"./plugin-utils\";\n\n// A second optional argument can be given to further configure\n// the parser process. These options are recognized:\n\nexport type SourceType = \"script\" | \"module\" | \"unambiguous\";\n\nexport type Options = {\n sourceType: SourceType;\n sourceFilename?: string;\n startColumn: number;\n startLine: number;\n allowAwaitOutsideFunction: boolean;\n allowReturnOutsideFunction: boolean;\n allowNewTargetOutsideFunction: boolean;\n allowImportExportEverywhere: boolean;\n allowSuperOutsideMethod: boolean;\n allowUndeclaredExports: boolean;\n plugins: PluginList;\n strictMode: boolean | undefined | null;\n ranges: boolean;\n tokens: boolean;\n createParenthesizedExpressions: boolean;\n errorRecovery: boolean;\n attachComment: boolean;\n annexB: boolean;\n};\n\nexport const defaultOptions: Options = {\n // Source type (\"script\" or \"module\") for different semantics\n sourceType: \"script\",\n // Source filename.\n sourceFilename: undefined,\n // Column (0-based) from which to start counting source. Useful for\n // integration with other tools.\n startColumn: 0,\n // Line (1-based) from which to start counting source. Useful for\n // integration with other tools.\n startLine: 1,\n // When enabled, await at the top level is not considered an\n // error.\n allowAwaitOutsideFunction: false,\n // When enabled, a return at the top level is not considered an\n // error.\n allowReturnOutsideFunction: false,\n // When enabled, new.target outside a function or class is not\n // considered an error.\n allowNewTargetOutsideFunction: false,\n // When enabled, import/export statements are not constrained to\n // appearing at the top of the program.\n allowImportExportEverywhere: false,\n // TODO\n allowSuperOutsideMethod: false,\n // When enabled, export statements can reference undeclared variables.\n allowUndeclaredExports: false,\n // An array of plugins to enable\n plugins: [],\n // TODO\n strictMode: null,\n // Nodes have their start and end characters offsets recorded in\n // `start` and `end` properties (directly on the node, rather than\n // the `loc` object, which holds line/column data. To also add a\n // [semi-standardized][range] `range` property holding a `[start,\n // end]` array with the same numbers, set the `ranges` option to\n // `true`.\n //\n // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678\n ranges: false,\n // Adds all parsed tokens to a `tokens` property on the `File` node\n tokens: false,\n // Whether to create ParenthesizedExpression AST nodes (if false\n // the parser sets extra.parenthesized on the expression nodes instead).\n createParenthesizedExpressions: false,\n // When enabled, errors are attached to the AST instead of being directly thrown.\n // Some errors will still throw, because @babel/parser can't always recover.\n errorRecovery: false,\n // When enabled, comments will be attached to adjacent AST nodes as one of\n // `leadingComments`, `trailingComments` and `innerComments`. The comment attachment\n // is vital to preserve comments after transform. If you don't print AST back,\n // consider set this option to `false` for performance\n attachComment: true,\n // When enabled, the parser will support Annex B syntax.\n // https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers\n annexB: true,\n};\n\n// Interpret and default an options object\n\nexport function getOptions(opts?: Options | null): Options {\n if (opts && opts.annexB != null && opts.annexB !== false) {\n throw new Error(\"The `annexB` option can only be set to `false`.\");\n }\n\n const options: any = {};\n for (const key of Object.keys(defaultOptions)) {\n // @ts-expect-error key may not exist in opts\n options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key];\n }\n return options;\n}\n"],"mappings":";;;;;;;AA4BO,MAAMA,cAAuB,GAAG;EAErCC,UAAU,EAAE,QAAQ;EAEpBC,cAAc,EAAEC,SAAS;EAGzBC,WAAW,EAAE,CAAC;EAGdC,SAAS,EAAE,CAAC;EAGZC,yBAAyB,EAAE,KAAK;EAGhCC,0BAA0B,EAAE,KAAK;EAGjCC,6BAA6B,EAAE,KAAK;EAGpCC,2BAA2B,EAAE,KAAK;EAElCC,uBAAuB,EAAE,KAAK;EAE9BC,sBAAsB,EAAE,KAAK;EAE7BC,OAAO,EAAE,EAAE;EAEXC,UAAU,EAAE,IAAI;EAShBC,MAAM,EAAE,KAAK;EAEbC,MAAM,EAAE,KAAK;EAGbC,8BAA8B,EAAE,KAAK;EAGrCC,aAAa,EAAE,KAAK;EAKpBC,aAAa,EAAE,IAAI;EAGnBC,MAAM,EAAE;AACV,CAAC;AAACC,OAAA,CAAApB,cAAA,GAAAA,cAAA;AAIK,SAASqB,UAAUA,CAACC,IAAqB,EAAW;EACzD,IAAIA,IAAI,IAAIA,IAAI,CAACH,MAAM,IAAI,IAAI,IAAIG,IAAI,CAACH,MAAM,KAAK,KAAK,EAAE;IACxD,MAAM,IAAII,KAAK,CAAC,iDAAiD,CAAC;EACpE;EAEA,MAAMC,OAAY,GAAG,CAAC,CAAC;EACvB,KAAK,MAAMC,GAAG,IAAIC,MAAM,CAACC,IAAI,CAAC3B,cAAc,CAAC,EAAE;IAE7CwB,OAAO,CAACC,GAAG,CAAC,GAAGH,IAAI,IAAIA,IAAI,CAACG,GAAG,CAAC,IAAI,IAAI,GAAGH,IAAI,CAACG,GAAG,CAAC,GAAGzB,cAAc,CAACyB,GAAG,CAAC;EAC5E;EACA,OAAOD,OAAO;AAChB"} lib/parse-error.js 0000644 00000007276 15120211212 0010110 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _exportNames = { ParseErrorEnum: true, Errors: true }; exports.Errors = void 0; exports.ParseErrorEnum = ParseErrorEnum; var _location = require("./util/location"); var _credentials = require("./parse-error/credentials"); Object.keys(_credentials).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _credentials[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _credentials[key]; } }); }); var _moduleErrors = require("./parse-error/module-errors"); var _standardErrors = require("./parse-error/standard-errors"); var _strictModeErrors = require("./parse-error/strict-mode-errors"); var _pipelineOperatorErrors = require("./parse-error/pipeline-operator-errors"); const _excluded = ["toMessage"], _excluded2 = ["message"]; function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function toParseErrorConstructor(_ref) { let { toMessage } = _ref, properties = _objectWithoutPropertiesLoose(_ref, _excluded); return function constructor({ loc, details }) { return (0, _credentials.instantiate)(SyntaxError, Object.assign({}, properties, { loc }), { clone(overrides = {}) { const loc = overrides.loc || {}; return constructor({ loc: new _location.Position("line" in loc ? loc.line : this.loc.line, "column" in loc ? loc.column : this.loc.column, "index" in loc ? loc.index : this.loc.index), details: Object.assign({}, this.details, overrides.details) }); }, details: { value: details, enumerable: false }, message: { get() { return `${toMessage(this.details)} (${this.loc.line}:${this.loc.column})`; }, set(value) { Object.defineProperty(this, "message", { value }); } }, pos: { reflect: "loc.index", enumerable: true }, missingPlugin: "missingPlugin" in details && { reflect: "details.missingPlugin", enumerable: true } }); }; } function ParseErrorEnum(argument, syntaxPlugin) { if (Array.isArray(argument)) { return parseErrorTemplates => ParseErrorEnum(parseErrorTemplates, argument[0]); } const ParseErrorConstructors = {}; for (const reasonCode of Object.keys(argument)) { const template = argument[reasonCode]; const _ref2 = typeof template === "string" ? { message: () => template } : typeof template === "function" ? { message: template } : template, { message } = _ref2, rest = _objectWithoutPropertiesLoose(_ref2, _excluded2); const toMessage = typeof message === "string" ? () => message : message; ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({ code: _credentials.ParseErrorCode.SyntaxError, reasonCode, toMessage }, syntaxPlugin ? { syntaxPlugin } : {}, rest)); } return ParseErrorConstructors; } const Errors = Object.assign({}, ParseErrorEnum(_moduleErrors.default), ParseErrorEnum(_standardErrors.default), ParseErrorEnum(_strictModeErrors.default), ParseErrorEnum`pipelineOperator`(_pipelineOperatorErrors.default)); exports.Errors = Errors; //# sourceMappingURL=parse-error.js.map lib/parse-error.js.map 0000644 00000027345 15120211212 0010663 0 ustar 00 {"version":3,"names":["_location","require","_credentials","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_moduleErrors","_standardErrors","_strictModeErrors","_pipelineOperatorErrors","_excluded","_excluded2","_objectWithoutPropertiesLoose","source","excluded","target","sourceKeys","i","length","indexOf","toParseErrorConstructor","_ref","toMessage","properties","constructor","loc","details","instantiate","SyntaxError","assign","clone","overrides","Position","line","column","index","value","message","set","pos","reflect","missingPlugin","ParseErrorEnum","argument","syntaxPlugin","Array","isArray","parseErrorTemplates","ParseErrorConstructors","reasonCode","template","_ref2","rest","code","ParseErrorCode","Errors","ModuleErrors","StandardErrors","StrictModeErrors","PipelineOperatorErrors"],"sources":["../src/parse-error.ts"],"sourcesContent":["import { Position } from \"./util/location\";\nimport {\n instantiate,\n ParseErrorCode,\n type ParseErrorCredentials,\n type ToMessage,\n type SyntaxPlugin,\n} from \"./parse-error/credentials\";\nimport type { Undone } from \"./parser/node\";\nimport type { Node } from \"./types\";\n\n// Babel uses \"normal\" SyntaxErrors for it's errors, but adds some extra\n// functionality. This functionality is defined in the\n// `ParseErrorSpecification` interface below. We may choose to change to someday\n// give our errors their own full-blown class, but until then this allow us to\n// keep all the desirable properties of SyntaxErrors (like their name in stack\n// traces, etc.), and also allows us to punt on any publicly facing\n// class-hierarchy decisions until Babel 8.\ninterface ParseErrorSpecification<ErrorDetails> {\n // Look, these *could* be readonly, but then Flow complains when we initially\n // set them. We could do a whole dance and make a special interface that's not\n // readonly for when we create the error, then cast it to the readonly\n // interface for public use, but the previous implementation didn't have them\n // as readonly, so let's just not worry about it for now.\n code: ParseErrorCode;\n reasonCode: string;\n syntaxPlugin?: SyntaxPlugin;\n missingPlugin?: string | string[];\n loc: Position;\n details: ErrorDetails;\n\n // We should consider removing this as it now just contains the same\n // information as `loc.index`.\n // pos: number;\n}\n\nexport type ParseError<ErrorDetails> = SyntaxError &\n ParseErrorSpecification<ErrorDetails>;\n\n// By `ParseErrorConstructor`, we mean something like the new-less style\n// `ErrorConstructor`[1], since `ParseError`'s are not themselves actually\n// separate classes from `SyntaxError`'s.\n//\n// 1. https://github.com/microsoft/TypeScript/blob/v4.5.5/lib/lib.es5.d.ts#L1027\nexport type ParseErrorConstructor<ErrorDetails> = (a: {\n loc: Position;\n details: ErrorDetails;\n}) => ParseError<ErrorDetails>;\n\nfunction toParseErrorConstructor<ErrorDetails extends object>({\n toMessage,\n ...properties\n}: ParseErrorCredentials<ErrorDetails>): ParseErrorConstructor<ErrorDetails> {\n type ConstructorArgument = {\n loc: Position;\n details: ErrorDetails;\n };\n\n return function constructor({ loc, details }: ConstructorArgument) {\n return instantiate(\n SyntaxError,\n { ...properties, loc },\n {\n clone(\n overrides: {\n loc?: Position;\n details?: ErrorDetails;\n } = {},\n ) {\n const loc = (overrides.loc || {}) as Partial<Position>;\n return constructor({\n loc: new Position(\n \"line\" in loc ? loc.line : this.loc.line,\n \"column\" in loc ? loc.column : this.loc.column,\n \"index\" in loc ? loc.index : this.loc.index,\n ),\n details: { ...this.details, ...overrides.details },\n });\n },\n details: { value: details, enumerable: false },\n message: {\n get(this: ConstructorArgument): string {\n return `${toMessage(this.details)} (${this.loc.line}:${\n this.loc.column\n })`;\n },\n set(value: string) {\n Object.defineProperty(this, \"message\", { value });\n },\n },\n pos: { reflect: \"loc.index\", enumerable: true },\n missingPlugin: \"missingPlugin\" in details && {\n reflect: \"details.missingPlugin\",\n enumerable: true,\n },\n },\n ) as ParseError<ErrorDetails>;\n };\n}\n\ntype ParseErrorTemplate =\n | string\n | ToMessage<any>\n | { message: string | ToMessage<any> };\n\ntype ParseErrorTemplates = { [reasonCode: string]: ParseErrorTemplate };\n\n// This is the templated form of `ParseErrorEnum`.\n//\n// Note: We could factor out the return type calculation into something like\n// `ParseErrorConstructor<T extends ParseErrorTemplates>`, and then we could\n// reuse it in the non-templated form of `ParseErrorEnum`, but TypeScript\n// doesn't seem to drill down that far when showing you the computed type of\n// an object in an editor, so we'll leave it inlined for now.\nexport function ParseErrorEnum(a: TemplateStringsArray): <\n T extends ParseErrorTemplates,\n>(\n parseErrorTemplates: T,\n) => {\n [K in keyof T]: ParseErrorConstructor<\n T[K] extends { message: string | ToMessage<any> }\n ? T[K][\"message\"] extends ToMessage<any>\n ? Parameters<T[K][\"message\"]>[0]\n : {}\n : T[K] extends ToMessage<any>\n ? Parameters<T[K]>[0]\n : {}\n >;\n};\n\nexport function ParseErrorEnum<T extends ParseErrorTemplates>(\n parseErrorTemplates: T,\n syntaxPlugin?: SyntaxPlugin,\n): {\n [K in keyof T]: ParseErrorConstructor<\n T[K] extends { message: string | ToMessage<any> }\n ? T[K][\"message\"] extends ToMessage<any>\n ? Parameters<T[K][\"message\"]>[0]\n : {}\n : T[K] extends ToMessage<any>\n ? Parameters<T[K]>[0]\n : {}\n >;\n};\n\n// You call `ParseErrorEnum` with a mapping from `ReasonCode`'s to either:\n//\n// 1. a static error message,\n// 2. `toMessage` functions that define additional necessary `details` needed by\n// the `ParseError`, or\n// 3. Objects that contain a `message` of one of the above and overridden `code`\n// and/or `reasonCode`:\n//\n// ParseErrorEnum `optionalSyntaxPlugin` ({\n// ErrorWithStaticMessage: \"message\",\n// ErrorWithDynamicMessage: ({ type } : { type: string }) => `${type}`),\n// ErrorWithOverriddenCodeAndOrReasonCode: {\n// message: ({ type }: { type: string }) => `${type}`),\n// code: ParseErrorCode.SourceTypeModuleError,\n// ...(BABEL_8_BREAKING ? { } : { reasonCode: \"CustomErrorReasonCode\" })\n// }\n// });\n//\nexport function ParseErrorEnum(\n argument: TemplateStringsArray | ParseErrorTemplates,\n syntaxPlugin?: SyntaxPlugin,\n) {\n // If the first parameter is an array, that means we were called with a tagged\n // template literal. Extract the syntaxPlugin from this, and call again in\n // the \"normalized\" form.\n if (Array.isArray(argument)) {\n return (parseErrorTemplates: ParseErrorTemplates) =>\n ParseErrorEnum(parseErrorTemplates, argument[0]);\n }\n\n const ParseErrorConstructors = {} as Record<\n string,\n ParseErrorConstructor<unknown>\n >;\n\n for (const reasonCode of Object.keys(argument)) {\n const template = (argument as ParseErrorTemplates)[reasonCode];\n const { message, ...rest } =\n typeof template === \"string\"\n ? { message: () => template }\n : typeof template === \"function\"\n ? { message: template }\n : template;\n const toMessage = typeof message === \"string\" ? () => message : message;\n\n ParseErrorConstructors[reasonCode] = toParseErrorConstructor({\n code: ParseErrorCode.SyntaxError,\n reasonCode,\n toMessage,\n ...(syntaxPlugin ? { syntaxPlugin } : {}),\n ...rest,\n });\n }\n\n return ParseErrorConstructors;\n}\n\nexport type RaiseProperties<ErrorDetails> = {\n at: Position | Undone<Node>;\n} & ErrorDetails;\n\nimport ModuleErrors from \"./parse-error/module-errors\";\nimport StandardErrors from \"./parse-error/standard-errors\";\nimport StrictModeErrors from \"./parse-error/strict-mode-errors\";\nimport PipelineOperatorErrors from \"./parse-error/pipeline-operator-errors\";\n\nexport const Errors = {\n ...ParseErrorEnum(ModuleErrors),\n ...ParseErrorEnum(StandardErrors),\n ...ParseErrorEnum(StrictModeErrors),\n ...ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors),\n};\n\nexport type { LValAncestor } from \"./parse-error/standard-errors\";\n\nexport * from \"./parse-error/credentials\";\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AA2NAE,MAAA,CAAAC,IAAA,CAAAF,YAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,YAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,YAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAdA,IAAAS,aAAA,GAAAd,OAAA;AACA,IAAAe,eAAA,GAAAf,OAAA;AACA,IAAAgB,iBAAA,GAAAhB,OAAA;AACA,IAAAiB,uBAAA,GAAAjB,OAAA;AAA4E,MAAAkB,SAAA;EAAAC,UAAA;AAAA,SAAAC,8BAAAC,MAAA,EAAAC,QAAA,QAAAD,MAAA,yBAAAE,MAAA,WAAAC,UAAA,GAAAtB,MAAA,CAAAC,IAAA,CAAAkB,MAAA,OAAAhB,GAAA,EAAAoB,CAAA,OAAAA,CAAA,MAAAA,CAAA,GAAAD,UAAA,CAAAE,MAAA,EAAAD,CAAA,MAAApB,GAAA,GAAAmB,UAAA,CAAAC,CAAA,OAAAH,QAAA,CAAAK,OAAA,CAAAtB,GAAA,kBAAA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;IAAS,GACLsB,YAAY,GAAG;MAAEA;IAAa,CAAC,GAAG,CAAC,CAAC,EACrCQ,IAAI,CACR,CAAC;EACJ;EAEA,OAAOJ,sBAAsB;AAC/B;AAWO,MAAMO,MAAM,GAAA7D,MAAA,CAAAmC,MAAA,KACda,cAAc,CAACc,qBAAY,CAAC,EAC5Bd,cAAc,CAACe,uBAAc,CAAC,EAC9Bf,cAAc,CAACgB,yBAAgB,CAAC,EAChChB,cAAe,kBAAiB,CAACiB,+BAAsB,CAAC,CAC5D;AAACzD,OAAA,CAAAqD,MAAA,GAAAA,MAAA"} lib/parse-error/credentials.js 0000644 00000002270 15120211212 0012372 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.instantiate = exports.ParseErrorCode = void 0; var ParseErrorCode = { SyntaxError: "BABEL_PARSER_SYNTAX_ERROR", SourceTypeModuleError: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED" }; exports.ParseErrorCode = ParseErrorCode; const reflect = (keys, last = keys.length - 1) => ({ get() { return keys.reduce((object, key) => object[key], this); }, set(value) { keys.reduce((item, key, i) => i === last ? item[key] = value : item[key], this); } }); const instantiate = (constructor, properties, descriptors) => Object.keys(descriptors).map(key => [key, descriptors[key]]).filter(([, descriptor]) => !!descriptor).map(([key, descriptor]) => [key, typeof descriptor === "function" ? { value: descriptor, enumerable: false } : typeof descriptor.reflect === "string" ? Object.assign({}, descriptor, reflect(descriptor.reflect.split("."))) : descriptor]).reduce((instance, [key, descriptor]) => Object.defineProperty(instance, key, Object.assign({ configurable: true }, descriptor)), Object.assign(new constructor(), properties)); exports.instantiate = instantiate; //# sourceMappingURL=credentials.js.map lib/parse-error/credentials.js.map 0000644 00000006716 15120211212 0013157 0 ustar 00 {"version":3,"names":["ParseErrorCode","SyntaxError","SourceTypeModuleError","exports","reflect","keys","last","length","get","reduce","object","key","set","value","item","i","instantiate","constructor","properties","descriptors","Object","map","filter","descriptor","enumerable","assign","split","instance","defineProperty","configurable"],"sources":["../../src/parse-error/credentials.ts"],"sourcesContent":["export const enum ParseErrorCode {\n SyntaxError = \"BABEL_PARSER_SYNTAX_ERROR\",\n SourceTypeModuleError = \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\",\n}\n\nexport type SyntaxPlugin =\n | \"flow\"\n | \"typescript\"\n | \"jsx\"\n | \"pipelineOperator\"\n | \"placeholders\";\n\nexport type ToMessage<ErrorDetails> = (self: ErrorDetails) => string;\n\nexport type ParseErrorCredentials<ErrorDetails> = {\n code: ParseErrorCode;\n reasonCode: string;\n syntaxPlugin?: SyntaxPlugin;\n toMessage: ToMessage<ErrorDetails>;\n};\n\nconst reflect = (keys: string[], last = keys.length - 1) => ({\n get(this: unknown): unknown {\n return keys.reduce(\n (object, key) =>\n // @ts-expect-error key should index object\n object[key],\n this,\n );\n },\n set(this: unknown, value: unknown) {\n keys.reduce(\n // @ts-expect-error key should index item\n (item, key, i) => (i === last ? (item[key] = value) : item[key]),\n this,\n );\n },\n});\n\nconst instantiate = <T>(\n constructor: new () => T,\n properties: any,\n descriptors: any,\n) =>\n Object.keys(descriptors)\n .map(key => [key, descriptors[key]])\n .filter(([, descriptor]) => !!descriptor)\n .map(([key, descriptor]) => [\n key,\n typeof descriptor === \"function\"\n ? { value: descriptor, enumerable: false }\n : typeof descriptor.reflect === \"string\"\n ? { ...descriptor, ...reflect(descriptor.reflect.split(\".\")) }\n : descriptor,\n ])\n .reduce(\n (instance, [key, descriptor]) =>\n Object.defineProperty(instance, key, {\n configurable: true,\n ...descriptor,\n }),\n Object.assign(new constructor(), properties),\n );\n\nexport { instantiate };\n"],"mappings":";;;;;;IAAkBA,cAAc;EAAAC,WAAA;EAAAC,qBAAA;AAAA;AAAAC,OAAA,CAAAH,cAAA,GAAAA,cAAA;AAqBhC,MAAMI,OAAO,GAAGA,CAACC,IAAc,EAAEC,IAAI,GAAGD,IAAI,CAACE,MAAM,GAAG,CAAC,MAAM;EAC3DC,GAAGA,CAAA,EAAyB;IAC1B,O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WAAW,CAAC,CAAC,EAAEC,UAAU,CAC7C,CAAC;AAACf,OAAA,CAAAa,WAAA,GAAAA,WAAA"} lib/parse-error/module-errors.js 0000644 00000001101 15120211212 0012664 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _parseError = require("../parse-error"); var _default = { ImportMetaOutsideModule: { message: `import.meta may appear only with 'sourceType: "module"'`, code: _parseError.ParseErrorCode.SourceTypeModuleError }, ImportOutsideModule: { message: `'import' and 'export' may appear only with 'sourceType: "module"'`, code: _parseError.ParseErrorCode.SourceTypeModuleError } }; exports.default = _default; //# sourceMappingURL=module-errors.js.map lib/parse-error/module-errors.js.map 0000644 00000001646 15120211212 0013456 0 ustar 00 {"version":3,"names":["_parseError","require","_default","ImportMetaOutsideModule","message","code","ParseErrorCode","SourceTypeModuleError","ImportOutsideModule","exports","default"],"sources":["../../src/parse-error/module-errors.ts"],"sourcesContent":["import { ParseErrorCode } from \"../parse-error\";\n\nexport default {\n ImportMetaOutsideModule: {\n message: `import.meta may appear only with 'sourceType: \"module\"'`,\n code: ParseErrorCode.SourceTypeModuleError,\n },\n ImportOutsideModule: {\n message: `'import' and 'export' may appear only with 'sourceType: \"module\"'`,\n code: ParseErrorCode.SourceTypeModuleError,\n },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAgD,IAAAC,QAAA,GAEjC;EACbC,uBAAuB,EAAE;IACvBC,OAAO,EAAG,yDAAwD;IAClEC,IAAI,EAAEC,0BAAc,CAACC;EACvB,CAAC;EACDC,mBAAmB,EAAE;IACnBJ,OAAO,EAAG,mEAAkE;IAC5EC,IAAI,EAAEC,0BAAc,CAACC;EACvB;AACF,CAAC;AAAAE,OAAA,CAAAC,OAAA,GAAAR,QAAA"} lib/parse-error/pipeline-operator-errors.js 0000644 00000004152 15120211212 0015046 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.UnparenthesizedPipeBodyDescriptions = void 0; var _toNodeDescription = require("./to-node-description"); const UnparenthesizedPipeBodyDescriptions = new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]); exports.UnparenthesizedPipeBodyDescriptions = UnparenthesizedPipeBodyDescriptions; var _default = { PipeBodyIsTighter: "Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.", PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.', PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.", PipeTopicUnconfiguredToken: ({ token }) => `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${token}" }.`, PipeTopicUnused: "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.", PipeUnparenthesizedBody: ({ type }) => `Hack-style pipe body cannot be an unparenthesized ${(0, _toNodeDescription.default)({ type })}; please wrap it in parentheses.`, PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.', PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression.", PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression.", PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference.", PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.", PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.' }; exports.default = _default; //# sourceMappingURL=pipeline-operator-errors.js.map lib/parse-error/pipeline-operator-errors.js.map 0000644 00000007331 15120211212 0015624 0 ustar 00 {"version":3,"names":["_toNodeDescription","require","UnparenthesizedPipeBodyDescriptions","Set","exports","_default","PipeBodyIsTighter","PipeTopicRequiresHackPipes","PipeTopicUnbound","PipeTopicUnconfiguredToken","token","PipeTopicUnused","PipeUnparenthesizedBody","type","toNodeDescription","PipelineBodyNoArrow","PipelineBodySequenceExpression","PipelineHeadSequenceExpression","PipelineTopicUnused","PrimaryTopicNotAllowed","PrimaryTopicRequiresSmartPipeline","default"],"sources":["../../src/parse-error/pipeline-operator-errors.ts"],"sourcesContent":["import toNodeDescription from \"./to-node-description\";\n\nexport const UnparenthesizedPipeBodyDescriptions = new Set([\n \"ArrowFunctionExpression\",\n \"AssignmentExpression\",\n \"ConditionalExpression\",\n \"YieldExpression\",\n] as const);\n\ntype GetSetMemberType<T extends Set<any>> = T extends Set<infer M>\n ? M\n : unknown;\n\ntype UnparenthesizedPipeBodyTypes = GetSetMemberType<\n typeof UnparenthesizedPipeBodyDescriptions\n>;\n\nexport default {\n // This error is only used by the smart-mix proposal\n PipeBodyIsTighter:\n \"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.\",\n PipeTopicRequiresHackPipes:\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n PipeTopicUnbound:\n \"Topic reference is unbound; it must be inside a pipe body.\",\n PipeTopicUnconfiguredToken: ({ token }: { token: string }) =>\n `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { \"proposal\": \"hack\", \"topicToken\": \"${token}\" }.`,\n PipeTopicUnused:\n \"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.\",\n PipeUnparenthesizedBody: ({ type }: { type: UnparenthesizedPipeBodyTypes }) =>\n `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({\n type,\n })}; please wrap it in parentheses.`,\n\n // Messages whose codes start with “Pipeline” or “PrimaryTopic”\n // are retained for backwards compatibility\n // with the deprecated smart-mix pipe operator proposal plugin.\n // They are subject to removal in a future major version.\n PipelineBodyNoArrow:\n 'Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized.',\n PipelineBodySequenceExpression:\n \"Pipeline body may not be a comma-separated sequence expression.\",\n PipelineHeadSequenceExpression:\n \"Pipeline head should not be a comma-separated sequence expression.\",\n PipelineTopicUnused:\n \"Pipeline is in topic style but does not use topic reference.\",\n PrimaryTopicNotAllowed:\n \"Topic reference was used in a lexical context without topic binding.\",\n PrimaryTopicRequiresSmartPipeline:\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n};\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAEO,MAAMC,mCAAmC,GAAG,IAAIC,GAAG,CAAC,CACzD,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,CACT,CAAC;AAACC,OAAA,CAAAF,mCAAA,GAAAA,mCAAA;AAAA,IAAAG,QAAA,GAUG;EAEbC,iBAAiB,EACf,uJAAuJ;EACzJC,0BAA0B,EACxB,iHAAiH;EACnHC,gBAAgB,EACd,4DAA4D;EAC9DC,0BAA0B,EAAEA,CAAC;IAAEC;EAAyB,CAAC,KACtD,uBAAsBA,KAAM,qBAAoBA,KAAM,mHAAkHA,KAAM,MAAK;EACtLC,eAAe,EACb,yGAAyG;EAC3GC,uBAAuB,EAAEA,CAAC;IAAEC;EAA6C,CAAC,KACvE,qDAAoD,IAAAC,0BAAiB,EAAC;IACrED;EACF,CAAC,CAAE,kCAAiC;EAMtCE,mBAAmB,EACjB,mGAAmG;EACrGC,8BAA8B,EAC5B,iEAAiE;EACnEC,8BAA8B,EAC5B,oEAAoE;EACtEC,mBAAmB,EACjB,8DAA8D;EAChEC,sBAAsB,EACpB,sEAAsE;EACxEC,iCAAiC,EAC/B;AACJ,CAAC;AAAAhB,OAAA,CAAAiB,OAAA,GAAAhB,QAAA"} lib/parse-error/standard-errors.js 0000644 00000034726 15120211212 0013222 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _toNodeDescription = require("./to-node-description"); var _default = { AccessorIsGenerator: ({ kind }) => `A ${kind}ter cannot be a generator.`, ArgumentsInClass: "'arguments' is only allowed in functions and class methods.", AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block.", AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function.", AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block.", AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.", AwaitUsingNotInAsyncContext: "'await using' is only allowed within async functions and at the top levels of modules.", AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.", AwaitNotInAsyncFunction: "'await' is only allowed within async functions.", BadGetterArity: "A 'get' accessor must not have any formal parameters.", BadSetterArity: "A 'set' accessor must have exactly one formal parameter.", BadSetterRestParameter: "A 'set' accessor function argument must not be a rest parameter.", ConstructorClassField: "Classes may not have a field named 'constructor'.", ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.", ConstructorIsAccessor: "Class constructor may not be an accessor.", ConstructorIsAsync: "Constructor can't be an async function.", ConstructorIsGenerator: "Constructor can't be a generator.", DeclarationMissingInitializer: ({ kind }) => `Missing initializer in ${kind} declaration.`, DecoratorArgumentsOutsideParentheses: "Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.", DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.", DecoratorsBeforeAfterExport: "Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.", DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?", DecoratorExportClass: "Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.", DecoratorSemicolon: "Decorators must not be followed by a semicolon.", DecoratorStaticBlock: "Decorators can't be used with a static block.", DeletePrivateField: "Deleting a private field is not allowed.", DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.", DuplicateConstructor: "Duplicate constructor in the same class.", DuplicateDefaultExport: "Only one default export allowed per module.", DuplicateExport: ({ exportName }) => `\`${exportName}\` has already been exported. Exported identifiers must be unique.`, DuplicateProto: "Redefinition of __proto__ property.", DuplicateRegExpFlags: "Duplicate regular expression flag.", ElementAfterRest: "Rest element must be last element.", EscapedCharNotAnIdentifier: "Invalid Unicode escape.", ExportBindingIsString: ({ localName, exportName }) => `A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${localName}' as '${exportName}' } from 'some-module'\`?`, ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.", ForInOfLoopInitializer: ({ type }) => `'${type === "ForInStatement" ? "for-in" : "for-of"}' loop variable declaration may not have an initializer.`, ForInUsing: "For-in loop may not start with 'using' declaration.", ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.", ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.", GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block.", IllegalBreakContinue: ({ type }) => `Unsyntactic ${type === "BreakStatement" ? "break" : "continue"}.`, IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.", IllegalReturn: "'return' outside of function.", ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.", ImportBindingIsString: ({ importName }) => `A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${importName}" as foo }\`?`, ImportCallArgumentTrailingComma: "Trailing comma is disallowed inside import(...) arguments.", ImportCallArity: ({ maxArgumentCount }) => `\`import()\` requires exactly ${maxArgumentCount === 1 ? "one argument" : "one or two arguments"}.`, ImportCallNotNewExpression: "Cannot use new with import(...).", ImportCallSpreadArgument: "`...` is not allowed in `import()`.", ImportJSONBindingNotDefault: "A JSON module can only be imported with `default`.", ImportReflectionHasAssertion: "`import module x` cannot have assertions.", ImportReflectionNotBinding: 'Only `import module x from "./module"` is valid.', IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.", InvalidBigIntLiteral: "Invalid BigIntLiteral.", InvalidCodePoint: "Code point out of bounds.", InvalidCoverInitializedName: "Invalid shorthand property initializer.", InvalidDecimal: "Invalid decimal.", InvalidDigit: ({ radix }) => `Expected number in radix ${radix}.`, InvalidEscapeSequence: "Bad character escape sequence.", InvalidEscapeSequenceTemplate: "Invalid escape sequence in template.", InvalidEscapedReservedWord: ({ reservedWord }) => `Escape sequence in keyword ${reservedWord}.`, InvalidIdentifier: ({ identifierName }) => `Invalid identifier ${identifierName}.`, InvalidLhs: ({ ancestor }) => `Invalid left-hand side in ${(0, _toNodeDescription.default)(ancestor)}.`, InvalidLhsBinding: ({ ancestor }) => `Binding invalid left-hand side in ${(0, _toNodeDescription.default)(ancestor)}.`, InvalidNumber: "Invalid number.", InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.", InvalidOrUnexpectedToken: ({ unexpected }) => `Unexpected character '${unexpected}'.`, InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern.", InvalidPrivateFieldResolution: ({ identifierName }) => `Private name #${identifierName} is not defined.`, InvalidPropertyBindingPattern: "Binding member expression.", InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions.", InvalidRestAssignmentPattern: "Invalid rest operator's argument.", LabelRedeclaration: ({ labelName }) => `Label '${labelName}' is already declared.`, LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations.", LineTerminatorBeforeArrow: "No line break is allowed before '=>'.", MalformedRegExpFlags: "Invalid regular expression flag.", MissingClassName: "A class name is required.", MissingEqInAssignment: "Only '=' operator can be used for specifying default value.", MissingSemicolon: "Missing semicolon.", MissingPlugin: ({ missingPlugin }) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`, MissingOneOfPlugins: ({ missingPlugin }) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`, MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.", MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.", ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.", ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values.", ModuleAttributesWithDuplicateKeys: ({ key }) => `Duplicate key "${key}" is not allowed in module attributes.`, ModuleExportNameHasLoneSurrogate: ({ surrogateCharCode }) => `An export name cannot include a lone surrogate, found '\\u${surrogateCharCode.toString(16)}'.`, ModuleExportUndefined: ({ localName }) => `Export '${localName}' is not defined.`, MultipleDefaultsInSwitch: "Multiple default clauses.", NewlineAfterThrow: "Illegal newline after throw.", NoCatchOrFinally: "Missing catch or finally clause.", NumberIdentifier: "Identifier directly after number.", NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.", ObsoleteAwaitStar: "'await*' has been removed from the async functions proposal. Use Promise.all() instead.", OptionalChainingNoNew: "Constructors in/after an Optional Chain are not allowed.", OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain.", OverrideOnConstructor: "'override' modifier cannot appear on a constructor declaration.", ParamDupe: "Argument name clash.", PatternHasAccessor: "Object pattern can't contain getter or setter.", PatternHasMethod: "Object pattern can't contain methods.", PrivateInExpectedIn: ({ identifierName }) => `Private names are only allowed in property accesses (\`obj.#${identifierName}\`) or in \`in\` expressions (\`#${identifierName} in obj\`).`, PrivateNameRedeclaration: ({ identifierName }) => `Duplicate private name #${identifierName}.`, RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", RecordNoProto: "'__proto__' is not allowed in Record expressions.", RestTrailingComma: "Unexpected trailing comma after rest element.", SloppyFunction: "In non-strict mode code, functions can only be declared at top level or inside a block.", SloppyFunctionAnnexB: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.", StaticPrototype: "Classes may not have static property named prototype.", SuperNotAllowed: "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?", SuperPrivateField: "Private fields can't be accessed on super.", TrailingDecorator: "Decorators must be attached to a class element.", TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", UnexpectedArgumentPlaceholder: "Unexpected argument placeholder.", UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.', UnexpectedDigitAfterHash: "Unexpected digit after hash token.", UnexpectedImportExport: "'import' and 'export' may only appear at the top level.", UnexpectedKeyword: ({ keyword }) => `Unexpected keyword '${keyword}'.`, UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.", UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context.", UnexpectedNewTarget: "`new.target` can only be used in functions or class properties.", UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits.", UnexpectedPrivateField: "Unexpected private name.", UnexpectedReservedWord: ({ reservedWord }) => `Unexpected reserved word '${reservedWord}'.`, UnexpectedSuper: "'super' is only allowed in object methods and classes.", UnexpectedToken: ({ expected, unexpected }) => `Unexpected token${unexpected ? ` '${unexpected}'.` : ""}${expected ? `, expected "${expected}"` : ""}`, UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.", UnexpectedUsingDeclaration: "Using declaration cannot appear in the top level when source type is `script`.", UnsupportedBind: "Binding should be performed on object property.", UnsupportedDecoratorExport: "A decorated export must export a class declaration.", UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.", UnsupportedImport: "`import` can only be used in `import()` or `import.meta`.", UnsupportedMetaProperty: ({ target, onlyValidPropertyName }) => `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`, UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters.", UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties.", UnsupportedSuper: "'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).", UnterminatedComment: "Unterminated comment.", UnterminatedRegExp: "Unterminated regular expression.", UnterminatedString: "Unterminated string constant.", UnterminatedTemplate: "Unterminated template.", UsingDeclarationHasBindingPattern: "Using declaration cannot have destructuring patterns.", VarRedeclaration: ({ identifierName }) => `Identifier '${identifierName}' has already been declared.`, YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.", YieldInParameter: "Yield expression is not allowed in formal parameters.", ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0." }; exports.default = _default; //# sourceMappingURL=standard-errors.js.map lib/parse-error/standard-errors.js.map 0000644 00000064650 15120211212 0013775 0 ustar 00 {"version":3,"names":["_toNodeDescription","require","_default","AccessorIsGenerator","kind","ArgumentsInClass","AsyncFunctionInSingleStatementContext","AwaitBindingIdentifier","AwaitBindingIdentifierInStaticBlock","AwaitExpressionFormalParameter","AwaitUsingNotInAsyncContext","AwaitNotInAsyncContext","AwaitNotInAsyncFunction","BadGetterArity","BadSetterArity","BadSetterRestParameter","ConstructorClassField","ConstructorClassPrivateField","ConstructorIsAccessor","ConstructorIsAsync","ConstructorIsGenerator","DeclarationMissingInitializer","DecoratorArgumentsOutsideParentheses","DecoratorBeforeExport","DecoratorsBeforeAfterExport","DecoratorConstructor","DecoratorExportClass","DecoratorSemicolon","DecoratorStaticBlock","DeletePrivateField","DestructureNamedImport","DuplicateConstructor","DuplicateDefaultExport","DuplicateExport","exportName","DuplicateProto","DuplicateRegExpFlags","ElementAfterRest","EscapedCharNotAnIdentifier","ExportBindingIsString","localName","ExportDefaultFromAsIdentifier","ForInOfLoopInitializer","type","ForInUsing","ForOfAsync","ForOfLet","GeneratorInSingleStatementContext","IllegalBreakContinue","IllegalLanguageModeDirective","IllegalReturn","ImportAttributesUseAssert","ImportBindingIsString","importName","ImportCallArgumentTrailingComma","ImportCallArity","maxArgumentCount","ImportCallNotNewExpression","ImportCallSpreadArgument","ImportJSONBindingNotDefault","ImportReflectionHasAssertion","ImportReflectionNotBinding","IncompatibleRegExpUVFlags","InvalidBigIntLiteral","InvalidCodePoint","InvalidCoverInitializedName","InvalidDecimal","InvalidDigit","radix","InvalidEscapeSequence","InvalidEscapeSequenceTemplate","InvalidEscapedReservedWord","reservedWord","InvalidIdentifier","identifierName","InvalidLhs","ancestor","toNodeDescription","InvalidLhsBinding","InvalidNumber","InvalidOrMissingExponent","InvalidOrUnexpectedToken","unexpected","InvalidParenthesizedAssignment","InvalidPrivateFieldResolution","InvalidPropertyBindingPattern","InvalidRecordProperty","InvalidRestAssignmentPattern","LabelRedeclaration","labelName","LetInLexicalBinding","LineTerminatorBeforeArrow","MalformedRegExpFlags","MissingClassName","MissingEqInAssignment","MissingSemicolon","MissingPlugin","missingPlugin","map","name","JSON","stringify","join","MissingOneOfPlugins","MissingUnicodeEscape","MixingCoalesceWithLogical","ModuleAttributeDifferentFromType","ModuleAttributeInvalidValue","ModuleAttributesWithDuplicateKeys","key","ModuleExportNameHasLoneSurrogate","surrogateCharCode","toString","ModuleExportUndefined","MultipleDefaultsInSwitch","NewlineAfterThrow","NoCatchOrFinally","NumberIdentifier","NumericSeparatorInEscapeSequence","ObsoleteAwaitStar","OptionalChainingNoNew","OptionalChainingNoTemplate","OverrideOnConstructor","ParamDupe","PatternHasAccessor","PatternHasMethod","PrivateInExpectedIn","PrivateNameRedeclaration","RecordExpressionBarIncorrectEndSyntaxType","RecordExpressionBarIncorrectStartSyntaxType","RecordExpressionHashIncorrectStartSyntaxType","RecordNoProto","RestTrailingComma","SloppyFunction","SloppyFunctionAnnexB","StaticPrototype","SuperNotAllowed","SuperPrivateField","TrailingDecorator","TupleExpressionBarIncorrectEndSyntaxType","TupleExpressionBarIncorrectStartSyntaxType","TupleExpressionHashIncorrectStartSyntaxType","UnexpectedArgumentPlaceholder","UnexpectedAwaitAfterPipelineBody","UnexpectedDigitAfterHash","UnexpectedImportExport","UnexpectedKeyword","keyword","UnexpectedLeadingDecorator","UnexpectedLexicalDeclaration","UnexpectedNewTarget","UnexpectedNumericSeparator","UnexpectedPrivateField","UnexpectedReservedWord","UnexpectedSuper","UnexpectedToken","expected","UnexpectedTokenUnaryExponentiation","UnexpectedUsingDeclaration","UnsupportedBind","UnsupportedDecoratorExport","UnsupportedDefaultExport","UnsupportedImport","UnsupportedMetaProperty","target","onlyValidPropertyName","UnsupportedParameterDecorator","UnsupportedPropertyDecorator","UnsupportedSuper","UnterminatedComment","UnterminatedRegExp","UnterminatedString","UnterminatedTemplate","UsingDeclarationHasBindingPattern","VarRedeclaration","YieldBindingIdentifier","YieldInParameter","ZeroDigitNumericSeparator","exports","default"],"sources":["../../src/parse-error/standard-errors.ts"],"sourcesContent":["import toNodeDescription from \"./to-node-description\";\n\nexport type LValAncestor =\n | { type: \"UpdateExpression\"; prefix: boolean }\n | {\n type:\n | \"ArrayPattern\"\n | \"AssignmentExpression\"\n | \"CatchClause\"\n | \"ForOfStatement\"\n | \"FormalParameters\"\n | \"ForInStatement\"\n | \"ForStatement\"\n | \"ImportSpecifier\"\n | \"ImportNamespaceSpecifier\"\n | \"ImportDefaultSpecifier\"\n | \"ParenthesizedExpression\"\n | \"ObjectPattern\"\n | \"RestElement\"\n | \"VariableDeclarator\";\n };\n\nexport default {\n AccessorIsGenerator: ({ kind }: { kind: \"get\" | \"set\" }) =>\n `A ${kind}ter cannot be a generator.`,\n ArgumentsInClass:\n \"'arguments' is only allowed in functions and class methods.\",\n AsyncFunctionInSingleStatementContext:\n \"Async functions can only be declared at the top level or inside a block.\",\n AwaitBindingIdentifier:\n \"Can not use 'await' as identifier inside an async function.\",\n AwaitBindingIdentifierInStaticBlock:\n \"Can not use 'await' as identifier inside a static block.\",\n AwaitExpressionFormalParameter:\n \"'await' is not allowed in async function parameters.\",\n AwaitUsingNotInAsyncContext:\n \"'await using' is only allowed within async functions and at the top levels of modules.\",\n AwaitNotInAsyncContext:\n \"'await' is only allowed within async functions and at the top levels of modules.\",\n AwaitNotInAsyncFunction: \"'await' is only allowed within async functions.\",\n BadGetterArity: \"A 'get' accessor must not have any formal parameters.\",\n BadSetterArity: \"A 'set' accessor must have exactly one formal parameter.\",\n BadSetterRestParameter:\n \"A 'set' accessor function argument must not be a rest parameter.\",\n ConstructorClassField: \"Classes may not have a field named 'constructor'.\",\n ConstructorClassPrivateField:\n \"Classes may not have a private field named '#constructor'.\",\n ConstructorIsAccessor: \"Class constructor may not be an accessor.\",\n ConstructorIsAsync: \"Constructor can't be an async function.\",\n ConstructorIsGenerator: \"Constructor can't be a generator.\",\n DeclarationMissingInitializer: ({\n kind,\n }: {\n kind: \"const\" | \"destructuring\";\n }) => `Missing initializer in ${kind} declaration.`,\n DecoratorArgumentsOutsideParentheses:\n \"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.\",\n DecoratorBeforeExport:\n \"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.\",\n DecoratorsBeforeAfterExport:\n \"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.\",\n DecoratorConstructor:\n \"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?\",\n DecoratorExportClass:\n \"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.\",\n DecoratorSemicolon: \"Decorators must not be followed by a semicolon.\",\n DecoratorStaticBlock: \"Decorators can't be used with a static block.\",\n DeletePrivateField: \"Deleting a private field is not allowed.\",\n DestructureNamedImport:\n \"ES2015 named imports do not destructure. Use another statement for destructuring after the import.\",\n DuplicateConstructor: \"Duplicate constructor in the same class.\",\n DuplicateDefaultExport: \"Only one default export allowed per module.\",\n DuplicateExport: ({ exportName }: { exportName: string }) =>\n `\\`${exportName}\\` has already been exported. Exported identifiers must be unique.`,\n DuplicateProto: \"Redefinition of __proto__ property.\",\n DuplicateRegExpFlags: \"Duplicate regular expression flag.\",\n ElementAfterRest: \"Rest element must be last element.\",\n EscapedCharNotAnIdentifier: \"Invalid Unicode escape.\",\n ExportBindingIsString: ({\n localName,\n exportName,\n }: {\n localName: string;\n exportName: string;\n }) =>\n `A string literal cannot be used as an exported binding without \\`from\\`.\\n- Did you mean \\`export { '${localName}' as '${exportName}' } from 'some-module'\\`?`,\n ExportDefaultFromAsIdentifier:\n \"'from' is not allowed as an identifier after 'export default'.\",\n\n ForInOfLoopInitializer: ({\n type,\n }: {\n type: \"ForInStatement\" | \"ForOfStatement\";\n }) =>\n `'${\n type === \"ForInStatement\" ? \"for-in\" : \"for-of\"\n }' loop variable declaration may not have an initializer.`,\n ForInUsing: \"For-in loop may not start with 'using' declaration.\",\n\n ForOfAsync: \"The left-hand side of a for-of loop may not be 'async'.\",\n ForOfLet: \"The left-hand side of a for-of loop may not start with 'let'.\",\n GeneratorInSingleStatementContext:\n \"Generators can only be declared at the top level or inside a block.\",\n\n IllegalBreakContinue: ({\n type,\n }: {\n type: \"BreakStatement\" | \"ContinueStatement\";\n }) => `Unsyntactic ${type === \"BreakStatement\" ? \"break\" : \"continue\"}.`,\n\n IllegalLanguageModeDirective:\n \"Illegal 'use strict' directive in function with non-simple parameter list.\",\n IllegalReturn: \"'return' outside of function.\",\n ImportAttributesUseAssert:\n \"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.\",\n ImportBindingIsString: ({ importName }: { importName: string }) =>\n `A string literal cannot be used as an imported binding.\\n- Did you mean \\`import { \"${importName}\" as foo }\\`?`,\n ImportCallArgumentTrailingComma:\n \"Trailing comma is disallowed inside import(...) arguments.\",\n ImportCallArity: ({ maxArgumentCount }: { maxArgumentCount: 1 | 2 }) =>\n `\\`import()\\` requires exactly ${\n maxArgumentCount === 1 ? \"one argument\" : \"one or two arguments\"\n }.`,\n ImportCallNotNewExpression: \"Cannot use new with import(...).\",\n ImportCallSpreadArgument: \"`...` is not allowed in `import()`.\",\n ImportJSONBindingNotDefault:\n \"A JSON module can only be imported with `default`.\",\n ImportReflectionHasAssertion: \"`import module x` cannot have assertions.\",\n ImportReflectionNotBinding:\n 'Only `import module x from \"./module\"` is valid.',\n IncompatibleRegExpUVFlags:\n \"The 'u' and 'v' regular expression flags cannot be enabled at the same time.\",\n InvalidBigIntLiteral: \"Invalid BigIntLiteral.\",\n InvalidCodePoint: \"Code point out of bounds.\",\n InvalidCoverInitializedName: \"Invalid shorthand property initializer.\",\n InvalidDecimal: \"Invalid decimal.\",\n InvalidDigit: ({ radix }: { radix: number }) =>\n `Expected number in radix ${radix}.`,\n InvalidEscapeSequence: \"Bad character escape sequence.\",\n InvalidEscapeSequenceTemplate: \"Invalid escape sequence in template.\",\n InvalidEscapedReservedWord: ({ reservedWord }: { reservedWord: string }) =>\n `Escape sequence in keyword ${reservedWord}.`,\n InvalidIdentifier: ({ identifierName }: { identifierName: string }) =>\n `Invalid identifier ${identifierName}.`,\n InvalidLhs: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n InvalidLhsBinding: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n InvalidNumber: \"Invalid number.\",\n InvalidOrMissingExponent:\n \"Floating-point numbers require a valid exponent after the 'e'.\",\n InvalidOrUnexpectedToken: ({ unexpected }: { unexpected: string }) =>\n `Unexpected character '${unexpected}'.`,\n InvalidParenthesizedAssignment: \"Invalid parenthesized assignment pattern.\",\n InvalidPrivateFieldResolution: ({\n identifierName,\n }: {\n identifierName: string;\n }) => `Private name #${identifierName} is not defined.`,\n InvalidPropertyBindingPattern: \"Binding member expression.\",\n InvalidRecordProperty:\n \"Only properties and spread elements are allowed in record definitions.\",\n InvalidRestAssignmentPattern: \"Invalid rest operator's argument.\",\n LabelRedeclaration: ({ labelName }: { labelName: string }) =>\n `Label '${labelName}' is already declared.`,\n LetInLexicalBinding:\n \"'let' is not allowed to be used as a name in 'let' or 'const' declarations.\",\n LineTerminatorBeforeArrow: \"No line break is allowed before '=>'.\",\n MalformedRegExpFlags: \"Invalid regular expression flag.\",\n MissingClassName: \"A class name is required.\",\n MissingEqInAssignment:\n \"Only '=' operator can be used for specifying default value.\",\n MissingSemicolon: \"Missing semicolon.\",\n MissingPlugin: ({ missingPlugin }: { missingPlugin: [string] }) =>\n `This experimental syntax requires enabling the parser plugin: ${missingPlugin\n .map(name => JSON.stringify(name))\n .join(\", \")}.`,\n // FIXME: Would be nice to make this \"missingPlugins\" instead.\n // Also, seems like we can drop the \"(s)\" from the message and just make it \"s\".\n MissingOneOfPlugins: ({ missingPlugin }: { missingPlugin: string[] }) =>\n `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin\n .map(name => JSON.stringify(name))\n .join(\", \")}.`,\n MissingUnicodeEscape: \"Expecting Unicode escape sequence \\\\uXXXX.\",\n MixingCoalesceWithLogical:\n \"Nullish coalescing operator(??) requires parens when mixing with logical operators.\",\n ModuleAttributeDifferentFromType:\n \"The only accepted module attribute is `type`.\",\n ModuleAttributeInvalidValue:\n \"Only string literals are allowed as module attribute values.\",\n ModuleAttributesWithDuplicateKeys: ({ key }: { key: string }) =>\n `Duplicate key \"${key}\" is not allowed in module attributes.`,\n ModuleExportNameHasLoneSurrogate: ({\n surrogateCharCode,\n }: {\n surrogateCharCode: number;\n }) =>\n `An export name cannot include a lone surrogate, found '\\\\u${surrogateCharCode.toString(\n 16,\n )}'.`,\n ModuleExportUndefined: ({ localName }: { localName: string }) =>\n `Export '${localName}' is not defined.`,\n MultipleDefaultsInSwitch: \"Multiple default clauses.\",\n NewlineAfterThrow: \"Illegal newline after throw.\",\n NoCatchOrFinally: \"Missing catch or finally clause.\",\n NumberIdentifier: \"Identifier directly after number.\",\n NumericSeparatorInEscapeSequence:\n \"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.\",\n ObsoleteAwaitStar:\n \"'await*' has been removed from the async functions proposal. Use Promise.all() instead.\",\n OptionalChainingNoNew:\n \"Constructors in/after an Optional Chain are not allowed.\",\n OptionalChainingNoTemplate:\n \"Tagged Template Literals are not allowed in optionalChain.\",\n OverrideOnConstructor:\n \"'override' modifier cannot appear on a constructor declaration.\",\n ParamDupe: \"Argument name clash.\",\n PatternHasAccessor: \"Object pattern can't contain getter or setter.\",\n PatternHasMethod: \"Object pattern can't contain methods.\",\n PrivateInExpectedIn: ({ identifierName }: { identifierName: string }) =>\n `Private names are only allowed in property accesses (\\`obj.#${identifierName}\\`) or in \\`in\\` expressions (\\`#${identifierName} in obj\\`).`,\n PrivateNameRedeclaration: ({ identifierName }: { identifierName: string }) =>\n `Duplicate private name #${identifierName}.`,\n RecordExpressionBarIncorrectEndSyntaxType:\n \"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionBarIncorrectStartSyntaxType:\n \"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionHashIncorrectStartSyntaxType:\n \"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n RecordNoProto: \"'__proto__' is not allowed in Record expressions.\",\n RestTrailingComma: \"Unexpected trailing comma after rest element.\",\n SloppyFunction:\n \"In non-strict mode code, functions can only be declared at top level or inside a block.\",\n SloppyFunctionAnnexB:\n \"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.\",\n StaticPrototype: \"Classes may not have static property named prototype.\",\n SuperNotAllowed:\n \"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?\",\n SuperPrivateField: \"Private fields can't be accessed on super.\",\n TrailingDecorator: \"Decorators must be attached to a class element.\",\n TupleExpressionBarIncorrectEndSyntaxType:\n \"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionBarIncorrectStartSyntaxType:\n \"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionHashIncorrectStartSyntaxType:\n \"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n UnexpectedArgumentPlaceholder: \"Unexpected argument placeholder.\",\n UnexpectedAwaitAfterPipelineBody:\n 'Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal.',\n UnexpectedDigitAfterHash: \"Unexpected digit after hash token.\",\n UnexpectedImportExport:\n \"'import' and 'export' may only appear at the top level.\",\n UnexpectedKeyword: ({ keyword }: { keyword: string }) =>\n `Unexpected keyword '${keyword}'.`,\n UnexpectedLeadingDecorator:\n \"Leading decorators must be attached to a class declaration.\",\n UnexpectedLexicalDeclaration:\n \"Lexical declaration cannot appear in a single-statement context.\",\n UnexpectedNewTarget:\n \"`new.target` can only be used in functions or class properties.\",\n UnexpectedNumericSeparator:\n \"A numeric separator is only allowed between two digits.\",\n UnexpectedPrivateField: \"Unexpected private name.\",\n UnexpectedReservedWord: ({ reservedWord }: { reservedWord: string }) =>\n `Unexpected reserved word '${reservedWord}'.`,\n UnexpectedSuper: \"'super' is only allowed in object methods and classes.\",\n UnexpectedToken: ({\n expected,\n unexpected,\n }: {\n expected?: string | null;\n unexpected?: string | null;\n }) =>\n `Unexpected token${unexpected ? ` '${unexpected}'.` : \"\"}${\n expected ? `, expected \"${expected}\"` : \"\"\n }`,\n UnexpectedTokenUnaryExponentiation:\n \"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.\",\n UnexpectedUsingDeclaration:\n \"Using declaration cannot appear in the top level when source type is `script`.\",\n UnsupportedBind: \"Binding should be performed on object property.\",\n UnsupportedDecoratorExport:\n \"A decorated export must export a class declaration.\",\n UnsupportedDefaultExport:\n \"Only expressions, functions or classes are allowed as the `default` export.\",\n UnsupportedImport:\n \"`import` can only be used in `import()` or `import.meta`.\",\n UnsupportedMetaProperty: ({\n target,\n onlyValidPropertyName,\n }: {\n target: string;\n onlyValidPropertyName: string;\n }) =>\n `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`,\n UnsupportedParameterDecorator:\n \"Decorators cannot be used to decorate parameters.\",\n UnsupportedPropertyDecorator:\n \"Decorators cannot be used to decorate object literal properties.\",\n UnsupportedSuper:\n \"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).\",\n UnterminatedComment: \"Unterminated comment.\",\n UnterminatedRegExp: \"Unterminated regular expression.\",\n UnterminatedString: \"Unterminated string constant.\",\n UnterminatedTemplate: \"Unterminated template.\",\n UsingDeclarationHasBindingPattern:\n \"Using declaration cannot have destructuring patterns.\",\n VarRedeclaration: ({ identifierName }: { identifierName: string }) =>\n `Identifier '${identifierName}' has already been declared.`,\n YieldBindingIdentifier:\n \"Can not use 'yield' as identifier inside a generator.\",\n YieldInParameter: \"Yield expression is not allowed in formal parameters.\",\n ZeroDigitNumericSeparator:\n \"Numeric separator can not be used after leading 0.\",\n};\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAAsD,IAAAC,QAAA,GAsBvC;EACbC,mBAAmB,EAAEA,CAAC;IAAEC;EAA8B,CAAC,KACpD,KAAIA,IAAK,4BAA2B;EACvCC,gBAAgB,EACd,6DAA6D;EAC/DC,qCAAqC,EACnC,0EAA0E;EAC5EC,sBAAsB,EACpB,6DAA6D;EAC/DC,mCAAmC,EACjC,0DAA0D;EAC5DC,8BAA8B,EAC5B,sDAAsD;EACxDC,2BAA2B,EACzB,wFAAwF;EAC1FC,sBAAsB,EACpB,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,OAAA,CAAAC,OAAA,GAAAjL,QAAA"} lib/parse-error/strict-mode-errors.js 0000644 00000001401 15120211212 0013634 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _default = { StrictDelete: "Deleting local variable in strict mode.", StrictEvalArguments: ({ referenceName }) => `Assigning to '${referenceName}' in strict mode.`, StrictEvalArgumentsBinding: ({ bindingName }) => `Binding '${bindingName}' in strict mode.`, StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block.", StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'.", StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.", StrictWith: "'with' in strict mode." }; exports.default = _default; //# sourceMappingURL=strict-mode-errors.js.map lib/parse-error/strict-mode-errors.js.map 0000644 00000003747 15120211212 0014427 0 ustar 00 {"version":3,"names":["StrictDelete","StrictEvalArguments","referenceName","StrictEvalArgumentsBinding","bindingName","StrictFunction","StrictNumericEscape","StrictOctalLiteral","StrictWith","exports","default","_default"],"sources":["../../src/parse-error/strict-mode-errors.ts"],"sourcesContent":["export default {\n StrictDelete: \"Deleting local variable in strict mode.\",\n\n // `referenceName` is the StringValue[1] of an IdentifierReference[2], which\n // is represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-IdentifierReference\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArguments: ({ referenceName }: { referenceName: string }) =>\n `Assigning to '${referenceName}' in strict mode.`,\n\n // `bindingName` is the StringValue[1] of a BindingIdentifier[2], which is\n // represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-BindingIdentifier\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArgumentsBinding: ({ bindingName }: { bindingName: string }) =>\n `Binding '${bindingName}' in strict mode.`,\n\n StrictFunction:\n \"In strict mode code, functions can only be declared at top level or inside a block.\",\n\n StrictNumericEscape: \"The only valid numeric escape in strict mode is '\\\\0'.\",\n\n StrictOctalLiteral: \"Legacy octal literals are not allowed in strict mode.\",\n\n StrictWith: \"'with' in strict mode.\",\n};\n"],"mappings":";;;;;;eAAe;EACbA,YAAY,EAAE,yCAAyC;EAOvDC,mBAAmB,EAAEA,CAAC;IAAEC;EAAyC,CAAC,KAC/D,iBAAgBA,aAAc,mBAAkB;EAOnDC,0BAA0B,EAAEA,CAAC;IAAEC;EAAqC,CAAC,KAClE,YAAWA,WAAY,mBAAkB;EAE5CC,cAAc,EACZ,qFAAqF;EAEvFC,mBAAmB,EAAE,wDAAwD;EAE7EC,kBAAkB,EAAE,uDAAuD;EAE3EC,UAAU,EAAE;AACd,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAC,QAAA"} lib/parse-error/to-node-description.js 0000644 00000002452 15120211212 0013765 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; const NodeDescriptions = { ArrayPattern: "array destructuring pattern", AssignmentExpression: "assignment expression", AssignmentPattern: "assignment expression", ArrowFunctionExpression: "arrow function expression", ConditionalExpression: "conditional expression", CatchClause: "catch clause", ForOfStatement: "for-of statement", ForInStatement: "for-in statement", ForStatement: "for-loop", FormalParameters: "function parameter list", Identifier: "identifier", ImportSpecifier: "import specifier", ImportDefaultSpecifier: "import default specifier", ImportNamespaceSpecifier: "import namespace specifier", ObjectPattern: "object destructuring pattern", ParenthesizedExpression: "parenthesized expression", RestElement: "rest element", UpdateExpression: { true: "prefix operation", false: "postfix operation" }, VariableDeclarator: "variable declaration", YieldExpression: "yield expression" }; const toNodeDescription = ({ type, prefix }) => type === "UpdateExpression" ? NodeDescriptions.UpdateExpression[String(prefix)] : NodeDescriptions[type]; var _default = toNodeDescription; exports.default = _default; //# sourceMappingURL=to-node-description.js.map lib/parse-error/to-node-description.js.map 0000644 00000006004 15120211212 0014536 0 ustar 00 {"version":3,"names":["NodeDescriptions","ArrayPattern","AssignmentExpression","AssignmentPattern","ArrowFunctionExpression","ConditionalExpression","CatchClause","ForOfStatement","ForInStatement","ForStatement","FormalParameters","Identifier","ImportSpecifier","ImportDefaultSpecifier","ImportNamespaceSpecifier","ObjectPattern","ParenthesizedExpression","RestElement","UpdateExpression","true","false","VariableDeclarator","YieldExpression","toNodeDescription","type","prefix","String","_default","exports","default"],"sources":["../../src/parse-error/to-node-description.ts"],"sourcesContent":["const NodeDescriptions = {\n ArrayPattern: \"array destructuring pattern\",\n AssignmentExpression: \"assignment expression\",\n AssignmentPattern: \"assignment expression\",\n ArrowFunctionExpression: \"arrow function expression\",\n ConditionalExpression: \"conditional expression\",\n CatchClause: \"catch clause\",\n ForOfStatement: \"for-of statement\",\n ForInStatement: \"for-in statement\",\n ForStatement: \"for-loop\",\n FormalParameters: \"function parameter list\",\n Identifier: \"identifier\",\n ImportSpecifier: \"import specifier\",\n ImportDefaultSpecifier: \"import default specifier\",\n ImportNamespaceSpecifier: \"import namespace specifier\",\n ObjectPattern: \"object destructuring pattern\",\n ParenthesizedExpression: \"parenthesized expression\",\n RestElement: \"rest element\",\n UpdateExpression: {\n true: \"prefix operation\",\n false: \"postfix operation\",\n },\n VariableDeclarator: \"variable declaration\",\n YieldExpression: \"yield expression\",\n};\n\ntype NodeTypesWithDescriptions = keyof Omit<\n typeof NodeDescriptions,\n \"UpdateExpression\"\n>;\n\ntype NodeWithDescription =\n | {\n type: \"UpdateExpression\";\n prefix: boolean;\n }\n | {\n type: NodeTypesWithDescriptions;\n };\n\n// @ts-expect-error prefix is specified only when type is UpdateExpression\n// eslint-disable-next-line no-confusing-arrow\nconst toNodeDescription = ({ type, prefix }: NodeWithDescription) =>\n type === \"UpdateExpression\"\n ? NodeDescriptions.UpdateExpression[String(prefix) as \"true\" | \"false\"]\n : NodeDescriptions[type];\n\nexport default toNodeDescription;\n"],"mappings":";;;;;;AAAA,MAAMA,gBAAgB,GAAG;EACvBC,YAAY,EAAE,6BAA6B;EAC3CC,oBAAoB,EAAE,uBAAuB;EAC7CC,iBAAiB,EAAE,uBAAuB;EAC1CC,uBAAuB,EAAE,2BAA2B;EACpDC,qBAAqB,EAAE,wBAAwB;EAC/CC,WAAW,EAAE,cAAc;EAC3BC,cAAc,EAAE,kBAAkB;EAClCC,cAAc,EAAE,kBAAkB;EAClCC,YAAY,EAAE,UAAU;EACxBC,gBAAgB,EAAE,yBAAyB;EAC3CC,UAAU,EAAE,YAAY;EACxBC,eAAe,EAAE,kBAAkB;EACnCC,sBAAsB,EAAE,0BAA0B;EAClDC,wBAAwB,EAAE,4BAA4B;EACtDC,aAAa,EAAE,8BAA8B;EAC7CC,uBAAuB,EAAE,0BAA0B;EACnDC,WAAW,EAAE,cAAc;EAC3BC,gBAAgB,EAAE;IAChBC,IAAI,EAAE,kBAAkB;IACxBC,KAAK,EAAE;EACT,CAAC;EACDC,kBAAkB,EAAE,sBAAsB;EAC1CC,eAAe,EAAE;AACnB,CAAC;AAkBD,MAAMC,iBAAiB,GAAGA,CAAC;EAAEC,IAAI;EAAEC;AAA4B,CAAC,KAC9DD,IAAI,KAAK,kBAAkB,GACvBxB,gBAAgB,CAACkB,gBAAgB,CAACQ,MAAM,CAACD,MAAM,CAAC,CAAqB,GACrEzB,gBAAgB,CAACwB,IAAI,CAAC;AAAC,IAAAG,QAAA,GAEdJ,iBAAiB;AAAAK,OAAA,CAAAC,OAAA,GAAAF,QAAA"} lib/parser/base.js 0000644 00000001742 15120211212 0010045 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; class BaseParser { constructor() { this.sawUnambiguousESM = false; this.ambiguousScriptDifferentAst = false; } hasPlugin(pluginConfig) { if (typeof pluginConfig === "string") { return this.plugins.has(pluginConfig); } else { const [pluginName, pluginOptions] = pluginConfig; if (!this.hasPlugin(pluginName)) { return false; } const actualOptions = this.plugins.get(pluginName); for (const key of Object.keys(pluginOptions)) { if ((actualOptions == null ? void 0 : actualOptions[key]) !== pluginOptions[key]) { return false; } } return true; } } getPluginOption(plugin, name) { var _this$plugins$get; return (_this$plugins$get = this.plugins.get(plugin)) == null ? void 0 : _this$plugins$get[name]; } } exports.default = BaseParser; //# sourceMappingURL=base.js.map lib/parser/base.js.map 0000644 00000007235 15120211212 0010624 0 ustar 00 {"version":3,"names":["BaseParser","constructor","sawUnambiguousESM","ambiguousScriptDifferentAst","hasPlugin","pluginConfig","plugins","has","pluginName","pluginOptions","actualOptions","get","key","Object","keys","getPluginOption","plugin","name","_this$plugins$get","exports","default"],"sources":["../../src/parser/base.ts"],"sourcesContent":["import type { Options } from \"../options\";\nimport type State from \"../tokenizer/state\";\nimport type { PluginsMap } from \"./index\";\nimport type ScopeHandler from \"../util/scope\";\nimport type ExpressionScopeHandler from \"../util/expression-scope\";\nimport type ClassScopeHandler from \"../util/class-scope\";\nimport type ProductionParameterHandler from \"../util/production-parameter\";\nimport type {\n ParserPluginWithOptions,\n PluginConfig,\n PluginOptions,\n} from \"../typings\";\n\nexport default class BaseParser {\n // Properties set by constructor in index.js\n declare options: Options;\n declare inModule: boolean;\n declare scope: ScopeHandler<any>;\n declare classScope: ClassScopeHandler;\n declare prodParam: ProductionParameterHandler;\n declare expressionScope: ExpressionScopeHandler;\n declare plugins: PluginsMap;\n declare filename: string | undefined | null;\n // Names of exports store. `default` is stored as a name for both\n // `export default foo;` and `export { foo as default };`.\n declare exportedIdentifiers: Set<string>;\n sawUnambiguousESM: boolean = false;\n ambiguousScriptDifferentAst: boolean = false;\n\n // Initialized by Tokenizer\n declare state: State;\n // input and length are not in state as they are constant and we do\n // not want to ever copy them, which happens if state gets cloned\n declare input: string;\n declare length: number;\n\n // This method accepts either a string (plugin name) or an array pair\n // (plugin name and options object). If an options object is given,\n // then each value is non-recursively checked for identity with that\n // plugin’s actual option value.\n hasPlugin(pluginConfig: PluginConfig): boolean {\n if (typeof pluginConfig === \"string\") {\n return this.plugins.has(pluginConfig);\n } else {\n const [pluginName, pluginOptions] = pluginConfig;\n if (!this.hasPlugin(pluginName)) {\n return false;\n }\n const actualOptions = this.plugins.get(pluginName);\n for (const key of Object.keys(\n pluginOptions,\n ) as (keyof typeof pluginOptions)[]) {\n if (actualOptions?.[key] !== pluginOptions[key]) {\n return false;\n }\n }\n return true;\n }\n }\n\n getPluginOption<\n PluginName extends ParserPluginWithOptions[0],\n OptionName extends keyof PluginOptions<PluginName>,\n >(plugin: PluginName, name: OptionName) {\n return (this.plugins.get(plugin) as null | PluginOptions<PluginName>)?.[\n name\n ];\n }\n}\n"],"mappings":";;;;;;AAae,MAAMA,UAAU,CAAC;EAAAC,YAAA;IAAA,KAa9BC,iBAAiB,GAAY,KAAK;IAAA,KAClCC,2BAA2B,GAAY,KAAK;EAAA;EAa5CC,SAASA,CAACC,YAA0B,EAAW;IAC7C,IAAI,OAAOA,YAAY,KAAK,QAAQ,EAAE;MACpC,OAAO,IAAI,CAACC,OAAO,CAACC,GAAG,CAACF,YAAY,CAAC;IACvC,CAAC,MAAM;MACL,MAAM,CAACG,UAAU,EAAEC,aAAa,CAAC,GAAGJ,YAAY;MAChD,IAAI,CAAC,IAAI,CAACD,SAAS,CAACI,UAAU,CAAC,EAAE;QAC/B,OAAO,KAAK;MACd;MACA,MAAME,aAAa,GAAG,IAAI,CAACJ,OAAO,CAACK,GAAG,CAACH,UAAU,CAAC;MAClD,KAAK,MAAMI,GAAG,IAAIC,MAAM,CAACC,IAAI,CAC3BL,aACF,CAAC,EAAoC;QACnC,IAAI,CAAAC,aAAa,oBAAbA,aAAa,CAAGE,GAAG,CAAC,MAAKH,aAAa,CAACG,GAAG,CAAC,EAAE;UAC/C,OAAO,KAAK;QACd;MACF;MACA,OAAO,IAAI;IACb;EACF;EAEAG,eAAeA,CAGbC,MAAkB,EAAEC,IAAgB,EAAE;IAAA,IAAAC,iBAAA;IACtC,QAAAA,iBAAA,GAAQ,IAAI,CAACZ,OAAO,CAACK,GAAG,CAACK,MAAM,CAAC,qBAAzBE,iBAAA,CACLD,IAAI,CACL;EACH;AACF;AAACE,OAAA,CAAAC,OAAA,GAAApB,UAAA"} lib/parser/comments.js 0000644 00000012566 15120211212 0010766 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; exports.setInnerComments = setInnerComments; var _base = require("./base"); function setTrailingComments(node, comments) { if (node.trailingComments === undefined) { node.trailingComments = comments; } else { node.trailingComments.unshift(...comments); } } function setLeadingComments(node, comments) { if (node.leadingComments === undefined) { node.leadingComments = comments; } else { node.leadingComments.unshift(...comments); } } function setInnerComments(node, comments) { if (node.innerComments === undefined) { node.innerComments = comments; } else { node.innerComments.unshift(...comments); } } function adjustInnerComments(node, elements, commentWS) { let lastElement = null; let i = elements.length; while (lastElement === null && i > 0) { lastElement = elements[--i]; } if (lastElement === null || lastElement.start > commentWS.start) { setInnerComments(node, commentWS.comments); } else { setTrailingComments(lastElement, commentWS.comments); } } class CommentsParser extends _base.default { addComment(comment) { if (this.filename) comment.loc.filename = this.filename; this.state.comments.push(comment); } processComment(node) { const { commentStack } = this.state; const commentStackLength = commentStack.length; if (commentStackLength === 0) return; let i = commentStackLength - 1; const lastCommentWS = commentStack[i]; if (lastCommentWS.start === node.end) { lastCommentWS.leadingNode = node; i--; } const { start: nodeStart } = node; for (; i >= 0; i--) { const commentWS = commentStack[i]; const commentEnd = commentWS.end; if (commentEnd > nodeStart) { commentWS.containingNode = node; this.finalizeComment(commentWS); commentStack.splice(i, 1); } else { if (commentEnd === nodeStart) { commentWS.trailingNode = node; } break; } } } finalizeComment(commentWS) { const { comments } = commentWS; if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) { if (commentWS.leadingNode !== null) { setTrailingComments(commentWS.leadingNode, comments); } if (commentWS.trailingNode !== null) { setLeadingComments(commentWS.trailingNode, comments); } } else { const { containingNode: node, start: commentStart } = commentWS; if (this.input.charCodeAt(commentStart - 1) === 44) { switch (node.type) { case "ObjectExpression": case "ObjectPattern": case "RecordExpression": adjustInnerComments(node, node.properties, commentWS); break; case "CallExpression": case "OptionalCallExpression": adjustInnerComments(node, node.arguments, commentWS); break; case "FunctionDeclaration": case "FunctionExpression": case "ArrowFunctionExpression": case "ObjectMethod": case "ClassMethod": case "ClassPrivateMethod": adjustInnerComments(node, node.params, commentWS); break; case "ArrayExpression": case "ArrayPattern": case "TupleExpression": adjustInnerComments(node, node.elements, commentWS); break; case "ExportNamedDeclaration": case "ImportDeclaration": adjustInnerComments(node, node.specifiers, commentWS); break; default: { setInnerComments(node, comments); } } } else { setInnerComments(node, comments); } } } finalizeRemainingComments() { const { commentStack } = this.state; for (let i = commentStack.length - 1; i >= 0; i--) { this.finalizeComment(commentStack[i]); } this.state.commentStack = []; } resetPreviousNodeTrailingComments(node) { const { commentStack } = this.state; const { length } = commentStack; if (length === 0) return; const commentWS = commentStack[length - 1]; if (commentWS.leadingNode === node) { commentWS.leadingNode = null; } } resetPreviousIdentifierLeadingComments(node) { const { commentStack } = this.state; const { length } = commentStack; if (length === 0) return; if (commentStack[length - 1].trailingNode === node) { commentStack[length - 1].trailingNode = null; } else if (length >= 2 && commentStack[length - 2].trailingNode === node) { commentStack[length - 2].trailingNode = null; } } takeSurroundingComments(node, start, end) { const { commentStack } = this.state; const commentStackLength = commentStack.length; if (commentStackLength === 0) return; let i = commentStackLength - 1; for (; i >= 0; i--) { const commentWS = commentStack[i]; const commentEnd = commentWS.end; const commentStart = commentWS.start; if (commentStart === end) { commentWS.leadingNode = node; } else if (commentEnd === start) { commentWS.trailingNode = node; } else if (commentEnd < start) { break; } } } } exports.default = CommentsParser; //# sourceMappingURL=comments.js.map lib/parser/comments.js.map 0000644 00000040465 15120211212 0011541 0 ustar 00 {"version":3,"names":["_base","require","setTrailingComments","node","comments","trailingComments","undefined","unshift","setLeadingComments","leadingComments","setInnerComments","innerComments","adjustInnerComments","elements","commentWS","lastElement","i","length","start","CommentsParser","BaseParser","addComment","comment","filename","loc","state","push","processComment","commentStack","commentStackLength","lastCommentWS","end","leadingNode","nodeStart","commentEnd","containingNode","finalizeComment","splice","trailingNode","commentStart","input","charCodeAt","type","properties","arguments","params","specifiers","finalizeRemainingComments","resetPreviousNodeTrailingComments","resetPreviousIdentifierLeadingComments","takeSurroundingComments","exports","default"],"sources":["../../src/parser/comments.ts"],"sourcesContent":["/*:: declare var invariant; */\n\nimport BaseParser from \"./base\";\nimport type { Comment, Node, Identifier } from \"../types\";\nimport * as charCodes from \"charcodes\";\nimport type { Undone } from \"./node\";\n\n/**\n * A whitespace token containing comments\n */\nexport type CommentWhitespace = {\n /**\n * the start of the whitespace token.\n */\n start: number;\n /**\n * the end of the whitespace token.\n */\n end: number;\n /**\n * the containing comments\n */\n comments: Array<Comment>;\n /**\n * the immediately preceding AST node of the whitespace token\n */\n leadingNode: Node | null;\n /**\n * the immediately following AST node of the whitespace token\n */\n trailingNode: Node | null;\n /**\n * the innermost AST node containing the whitespace with minimal size (|end - start|)\n */\n containingNode: Node | null;\n};\n\n/**\n * Merge comments with node's trailingComments or assign comments to be\n * trailingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nfunction setTrailingComments(node: Undone<Node>, comments: Array<Comment>) {\n if (node.trailingComments === undefined) {\n node.trailingComments = comments;\n } else {\n node.trailingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's leadingComments or assign comments to be\n * leadingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nfunction setLeadingComments(node: Undone<Node>, comments: Array<Comment>) {\n if (node.leadingComments === undefined) {\n node.leadingComments = comments;\n } else {\n node.leadingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's innerComments or assign comments to be\n * innerComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nexport function setInnerComments(\n node: Undone<Node>,\n comments?: Array<Comment>,\n) {\n if (node.innerComments === undefined) {\n node.innerComments = comments;\n } else {\n node.innerComments.unshift(...comments);\n }\n}\n\n/**\n * Given node and elements array, if elements has non-null element,\n * merge comments to its trailingComments, otherwise merge comments\n * to node's innerComments\n */\nfunction adjustInnerComments(\n node: Undone<Node>,\n elements: Array<Node>,\n commentWS: CommentWhitespace,\n) {\n let lastElement = null;\n let i = elements.length;\n while (lastElement === null && i > 0) {\n lastElement = elements[--i];\n }\n if (lastElement === null || lastElement.start > commentWS.start) {\n setInnerComments(node, commentWS.comments);\n } else {\n setTrailingComments(lastElement, commentWS.comments);\n }\n}\n\nexport default class CommentsParser extends BaseParser {\n addComment(comment: Comment): void {\n if (this.filename) comment.loc.filename = this.filename;\n this.state.comments.push(comment);\n }\n\n /**\n * Given a newly created AST node _n_, attach _n_ to a comment whitespace _w_ if applicable\n * {@see {@link CommentWhitespace}}\n */\n processComment(node: Node): void {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n const lastCommentWS = commentStack[i];\n\n if (lastCommentWS.start === node.end) {\n lastCommentWS.leadingNode = node;\n i--;\n }\n\n const { start: nodeStart } = node;\n // invariant: for all 0 <= j <= i, let c = commentStack[j], c must satisfy c.end < node.end\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n if (commentEnd > nodeStart) {\n // by definition of commentWhiteSpace, this implies commentWS.start > nodeStart\n // so node can be a containingNode candidate. At this time we can finalize the comment\n // whitespace, because\n // 1) its leadingNode or trailingNode, if exists, will not change\n // 2) its containingNode have been assigned and will not change because it is the\n // innermost minimal-sized AST node\n commentWS.containingNode = node;\n this.finalizeComment(commentWS);\n commentStack.splice(i, 1);\n } else {\n if (commentEnd === nodeStart) {\n commentWS.trailingNode = node;\n }\n // stop the loop when commentEnd <= nodeStart\n break;\n }\n }\n }\n\n /**\n * Assign the comments of comment whitespaces to related AST nodes.\n * Also adjust innerComments following trailing comma.\n */\n finalizeComment(commentWS: CommentWhitespace) {\n const { comments } = commentWS;\n if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {\n if (commentWS.leadingNode !== null) {\n setTrailingComments(commentWS.leadingNode, comments);\n }\n if (commentWS.trailingNode !== null) {\n setLeadingComments(commentWS.trailingNode, comments);\n }\n } else {\n /*:: invariant(commentWS.containingNode !== null) */\n const { containingNode: node, start: commentStart } = commentWS;\n if (this.input.charCodeAt(commentStart - 1) === charCodes.comma) {\n // If a commentWhitespace follows a comma and the containingNode allows\n // list structures with trailing comma, merge it to the trailingComment\n // of the last non-null list element\n switch (node.type) {\n case \"ObjectExpression\":\n case \"ObjectPattern\":\n case \"RecordExpression\":\n adjustInnerComments(node, node.properties, commentWS);\n break;\n case \"CallExpression\":\n case \"OptionalCallExpression\":\n adjustInnerComments(node, node.arguments, commentWS);\n break;\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n case \"ArrowFunctionExpression\":\n case \"ObjectMethod\":\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n adjustInnerComments(node, node.params, commentWS);\n break;\n case \"ArrayExpression\":\n case \"ArrayPattern\":\n case \"TupleExpression\":\n adjustInnerComments(node, node.elements, commentWS);\n break;\n case \"ExportNamedDeclaration\":\n case \"ImportDeclaration\":\n adjustInnerComments(node, node.specifiers, commentWS);\n break;\n default: {\n setInnerComments(node, comments);\n }\n }\n } else {\n setInnerComments(node, comments);\n }\n }\n }\n\n /**\n * Drains remaining commentStack and applies finalizeComment\n * to each comment whitespace. Used only in parseExpression\n * where the top level AST node is _not_ Program\n * {@see {@link CommentsParser#finalizeComment}}\n */\n finalizeRemainingComments() {\n const { commentStack } = this.state;\n for (let i = commentStack.length - 1; i >= 0; i--) {\n this.finalizeComment(commentStack[i]);\n }\n this.state.commentStack = [];\n }\n\n /* eslint-disable no-irregular-whitespace */\n /**\n * Reset previous node trailing comments. Used in object / class\n * property parsing. We parse `async`, `static`, `set` and `get`\n * as an identifier but may reinterpret it into an async/static/accessor\n * method later. In this case the identifier is not part of the AST and we\n * should sync the knowledge to commentStacks\n *\n * For example, when parsing\n * ```\n * async /* 1 */ function f() {}\n * ```\n * the comment whitespace `/* 1 */` has leading node Identifier(async). When\n * we see the function token, we create a Function node and mark `/* 1 */` as\n * inner comments. So `/* 1 */` should be detached from the Identifier node.\n *\n * @param node the last finished AST node _before_ current token\n */\n /* eslint-enable no-irregular-whitespace */\n resetPreviousNodeTrailingComments(node: Node) {\n const { commentStack } = this.state;\n const { length } = commentStack;\n if (length === 0) return;\n const commentWS = commentStack[length - 1];\n if (commentWS.leadingNode === node) {\n commentWS.leadingNode = null;\n }\n }\n\n /* eslint-disable no-irregular-whitespace */\n /**\n * Reset previous node leading comments, assuming that `node` is a\n * single-token node. Used in import phase modifiers parsing. We parse\n * `module` in `import module foo from ...` as an identifier but may\n * reinterpret it into a phase modifier later. In this case the identifier is\n * not part of the AST and we should sync the knowledge to commentStacks\n *\n * For example, when parsing\n * ```\n * import /* 1 */ module a from \"a\";\n * ```\n * the comment whitespace `/* 1 */` has trailing node Identifier(module). When\n * we see that `module` is not a default import binding, we mark `/* 1 */` as\n * inner comments of the ImportDeclaration. So `/* 1 */` should be detached from\n * the Identifier node.\n *\n * @param node the last finished AST node _before_ current token\n */\n /* eslint-enable no-irregular-whitespace */\n resetPreviousIdentifierLeadingComments(node: Identifier) {\n const { commentStack } = this.state;\n const { length } = commentStack;\n if (length === 0) return;\n\n if (commentStack[length - 1].trailingNode === node) {\n commentStack[length - 1].trailingNode = null;\n } else if (length >= 2 && commentStack[length - 2].trailingNode === node) {\n commentStack[length - 2].trailingNode = null;\n }\n }\n\n /**\n * Attach a node to the comment whitespaces right before/after\n * the given range.\n *\n * This is used to properly attach comments around parenthesized\n * expressions as leading/trailing comments of the inner expression.\n */\n takeSurroundingComments(node: Node, start: number, end: number) {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n const commentStart = commentWS.start;\n\n if (commentStart === end) {\n commentWS.leadingNode = node;\n } else if (commentEnd === start) {\n commentWS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AC,CAACqB,YAAY,KAAKnC,IAAI,EAAE;MAClDyB,YAAY,CAACX,MAAM,GAAG,CAAC,CAAC,CAACqB,YAAY,GAAG,IAAI;IAC9C,CAAC,MAAM,IAAIrB,MAAM,IAAI,CAAC,IAAIW,YAAY,CAACX,MAAM,GAAG,CAAC,CAAC,CAACqB,YAAY,KAAKnC,IAAI,EAAE;MACxEyB,YAAY,CAACX,MAAM,GAAG,CAAC,CAAC,CAACqB,YAAY,GAAG,IAAI;IAC9C;EACF;EASAY,uBAAuBA,CAAC/C,IAAU,EAAEe,KAAa,EAAEa,GAAW,EAAE;IAC9D,MAAM;MAAEH;IAAa,CAAC,GAAG,IAAI,CAACH,KAAK;IACnC,MAAMI,kBAAkB,GAAGD,YAAY,CAACX,MAAM;IAC9C,IAAIY,kBAAkB,KAAK,CAAC,EAAE;IAC9B,IAAIb,CAAC,GAAGa,kBAAkB,GAAG,CAAC;IAE9B,OAAOb,CAAC,IAAI,CAAC,EAAEA,CAAC,EAAE,EAAE;MAClB,MAAMF,SAAS,GAAGc,YAAY,CAACZ,CAAC,CAAC;MACjC,MAAMkB,UAAU,GAAGpB,SAAS,CAACiB,GAAG;MAChC,MAAMQ,YAAY,GAAGzB,SAAS,CAACI,KAAK;MAEpC,IAAIqB,YAAY,KAAKR,GAAG,EAAE;QACxBjB,SAAS,CAACkB,WAAW,GAAG7B,IAAI;MAC9B,CAAC,MAAM,IAAI+B,UAAU,KAAKhB,KAAK,EAAE;QAC/BJ,SAAS,CAACwB,YAAY,GAAGnC,IAAI;MAC/B,CAAC,MAAM,IAAI+B,UAAU,GAAGhB,KAAK,EAAE;QAC7B;MACF;IACF;EACF;AACF;AAACiC,OAAA,CAAAC,OAAA,GAAAjC,cAAA"} lib/parser/expression.js 0000644 00000172377 15120211212 0011347 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _types = require("../tokenizer/types"); var _lval = require("./lval"); var _identifier = require("../util/identifier"); var _location = require("../util/location"); var _scopeflags = require("../util/scopeflags"); var _util = require("./util"); var _productionParameter = require("../util/production-parameter"); var _expressionScope = require("../util/expression-scope"); var _parseError = require("../parse-error"); var _pipelineOperatorErrors = require("../parse-error/pipeline-operator-errors"); var _comments = require("./comments"); var _node = require("./node"); class ExpressionParser extends _lval.default { checkProto(prop, isRecord, protoRef, refExpressionErrors) { if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) { return; } const key = prop.key; const name = key.type === "Identifier" ? key.name : key.value; if (name === "__proto__") { if (isRecord) { this.raise(_parseError.Errors.RecordNoProto, { at: key }); return; } if (protoRef.used) { if (refExpressionErrors) { if (refExpressionErrors.doubleProtoLoc === null) { refExpressionErrors.doubleProtoLoc = key.loc.start; } } else { this.raise(_parseError.Errors.DuplicateProto, { at: key }); } } protoRef.used = true; } } shouldExitDescending(expr, potentialArrowAt) { return expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt; } getExpression() { this.enterInitialScopes(); this.nextToken(); const expr = this.parseExpression(); if (!this.match(137)) { this.unexpected(); } this.finalizeRemainingComments(); expr.comments = this.state.comments; expr.errors = this.state.errors; if (this.options.tokens) { expr.tokens = this.tokens; } return expr; } parseExpression(disallowIn, refExpressionErrors) { if (disallowIn) { return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors)); } return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors)); } parseExpressionBase(refExpressionErrors) { const startLoc = this.state.startLoc; const expr = this.parseMaybeAssign(refExpressionErrors); if (this.match(12)) { const node = this.startNodeAt(startLoc); node.expressions = [expr]; while (this.eat(12)) { node.expressions.push(this.parseMaybeAssign(refExpressionErrors)); } this.toReferencedList(node.expressions); return this.finishNode(node, "SequenceExpression"); } return expr; } parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse) { return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse)); } parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse) { return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse)); } setOptionalParametersError(refExpressionErrors, resultError) { var _resultError$loc; refExpressionErrors.optionalParametersLoc = (_resultError$loc = resultError == null ? void 0 : resultError.loc) != null ? _resultError$loc : this.state.startLoc; } parseMaybeAssign(refExpressionErrors, afterLeftParse) { const startLoc = this.state.startLoc; if (this.isContextual(106)) { if (this.prodParam.hasYield) { let left = this.parseYield(); if (afterLeftParse) { left = afterLeftParse.call(this, left, startLoc); } return left; } } let ownExpressionErrors; if (refExpressionErrors) { ownExpressionErrors = false; } else { refExpressionErrors = new _util.ExpressionErrors(); ownExpressionErrors = true; } const { type } = this.state; if (type === 10 || (0, _types.tokenIsIdentifier)(type)) { this.state.potentialArrowAt = this.state.start; } let left = this.parseMaybeConditional(refExpressionErrors); if (afterLeftParse) { left = afterLeftParse.call(this, left, startLoc); } if ((0, _types.tokenIsAssignment)(this.state.type)) { const node = this.startNodeAt(startLoc); const operator = this.state.value; node.operator = operator; if (this.match(29)) { this.toAssignable(left, true); node.left = left; const startIndex = startLoc.index; if (refExpressionErrors.doubleProtoLoc != null && refExpressionErrors.doubleProtoLoc.index >= startIndex) { refExpressionErrors.doubleProtoLoc = null; } if (refExpressionErrors.shorthandAssignLoc != null && refExpressionErrors.shorthandAssignLoc.index >= startIndex) { refExpressionErrors.shorthandAssignLoc = null; } if (refExpressionErrors.privateKeyLoc != null && refExpressionErrors.privateKeyLoc.index >= startIndex) { this.checkDestructuringPrivate(refExpressionErrors); refExpressionErrors.privateKeyLoc = null; } } else { node.left = left; } this.next(); node.right = this.parseMaybeAssign(); this.checkLVal(left, { in: this.finishNode(node, "AssignmentExpression") }); return node; } else if (ownExpressionErrors) { this.checkExpressionErrors(refExpressionErrors, true); } return left; } parseMaybeConditional(refExpressionErrors) { const startLoc = this.state.startLoc; const potentialArrowAt = this.state.potentialArrowAt; const expr = this.parseExprOps(refExpressionErrors); if (this.shouldExitDescending(expr, potentialArrowAt)) { return expr; } return this.parseConditional(expr, startLoc, refExpressionErrors); } parseConditional(expr, startLoc, refExpressionErrors) { if (this.eat(17)) { const node = this.startNodeAt(startLoc); node.test = expr; node.consequent = this.parseMaybeAssignAllowIn(); this.expect(14); node.alternate = this.parseMaybeAssign(); return this.finishNode(node, "ConditionalExpression"); } return expr; } parseMaybeUnaryOrPrivate(refExpressionErrors) { return this.match(136) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors); } parseExprOps(refExpressionErrors) { const startLoc = this.state.startLoc; const potentialArrowAt = this.state.potentialArrowAt; const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors); if (this.shouldExitDescending(expr, potentialArrowAt)) { return expr; } return this.parseExprOp(expr, startLoc, -1); } parseExprOp(left, leftStartLoc, minPrec) { if (this.isPrivateName(left)) { const value = this.getPrivateNameSV(left); if (minPrec >= (0, _types.tokenOperatorPrecedence)(58) || !this.prodParam.hasIn || !this.match(58)) { this.raise(_parseError.Errors.PrivateInExpectedIn, { at: left, identifierName: value }); } this.classScope.usePrivateName(value, left.loc.start); } const op = this.state.type; if ((0, _types.tokenIsOperator)(op) && (this.prodParam.hasIn || !this.match(58))) { let prec = (0, _types.tokenOperatorPrecedence)(op); if (prec > minPrec) { if (op === 39) { this.expectPlugin("pipelineOperator"); if (this.state.inFSharpPipelineDirectBody) { return left; } this.checkPipelineAtInfixOperator(left, leftStartLoc); } const node = this.startNodeAt(leftStartLoc); node.left = left; node.operator = this.state.value; const logical = op === 41 || op === 42; const coalesce = op === 40; if (coalesce) { prec = (0, _types.tokenOperatorPrecedence)(42); } this.next(); if (op === 39 && this.hasPlugin(["pipelineOperator", { proposal: "minimal" }])) { if (this.state.type === 96 && this.prodParam.hasAwait) { throw this.raise(_parseError.Errors.UnexpectedAwaitAfterPipelineBody, { at: this.state.startLoc }); } } node.right = this.parseExprOpRightExpr(op, prec); const finishedNode = this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression"); const nextOp = this.state.type; if (coalesce && (nextOp === 41 || nextOp === 42) || logical && nextOp === 40) { throw this.raise(_parseError.Errors.MixingCoalesceWithLogical, { at: this.state.startLoc }); } return this.parseExprOp(finishedNode, leftStartLoc, minPrec); } } return left; } parseExprOpRightExpr(op, prec) { const startLoc = this.state.startLoc; switch (op) { case 39: switch (this.getPluginOption("pipelineOperator", "proposal")) { case "hack": return this.withTopicBindingContext(() => { return this.parseHackPipeBody(); }); case "smart": return this.withTopicBindingContext(() => { if (this.prodParam.hasYield && this.isContextual(106)) { throw this.raise(_parseError.Errors.PipeBodyIsTighter, { at: this.state.startLoc }); } return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startLoc); }); case "fsharp": return this.withSoloAwaitPermittingContext(() => { return this.parseFSharpPipelineBody(prec); }); } default: return this.parseExprOpBaseRightExpr(op, prec); } } parseExprOpBaseRightExpr(op, prec) { const startLoc = this.state.startLoc; return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, (0, _types.tokenIsRightAssociative)(op) ? prec - 1 : prec); } parseHackPipeBody() { var _body$extra; const { startLoc } = this.state; const body = this.parseMaybeAssign(); const requiredParentheses = _pipelineOperatorErrors.UnparenthesizedPipeBodyDescriptions.has(body.type); if (requiredParentheses && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) { this.raise(_parseError.Errors.PipeUnparenthesizedBody, { at: startLoc, type: body.type }); } if (!this.topicReferenceWasUsedInCurrentContext()) { this.raise(_parseError.Errors.PipeTopicUnused, { at: startLoc }); } return body; } checkExponentialAfterUnary(node) { if (this.match(57)) { this.raise(_parseError.Errors.UnexpectedTokenUnaryExponentiation, { at: node.argument }); } } parseMaybeUnary(refExpressionErrors, sawUnary) { const startLoc = this.state.startLoc; const isAwait = this.isContextual(96); if (isAwait && this.isAwaitAllowed()) { this.next(); const expr = this.parseAwait(startLoc); if (!sawUnary) this.checkExponentialAfterUnary(expr); return expr; } const update = this.match(34); const node = this.startNode(); if ((0, _types.tokenIsPrefix)(this.state.type)) { node.operator = this.state.value; node.prefix = true; if (this.match(72)) { this.expectPlugin("throwExpressions"); } const isDelete = this.match(89); this.next(); node.argument = this.parseMaybeUnary(null, true); this.checkExpressionErrors(refExpressionErrors, true); if (this.state.strict && isDelete) { const arg = node.argument; if (arg.type === "Identifier") { this.raise(_parseError.Errors.StrictDelete, { at: node }); } else if (this.hasPropertyAsPrivateName(arg)) { this.raise(_parseError.Errors.DeletePrivateField, { at: node }); } } if (!update) { if (!sawUnary) { this.checkExponentialAfterUnary(node); } return this.finishNode(node, "UnaryExpression"); } } const expr = this.parseUpdate(node, update, refExpressionErrors); if (isAwait) { const { type } = this.state; const startsExpr = this.hasPlugin("v8intrinsic") ? (0, _types.tokenCanStartExpression)(type) : (0, _types.tokenCanStartExpression)(type) && !this.match(54); if (startsExpr && !this.isAmbiguousAwait()) { this.raiseOverwrite(_parseError.Errors.AwaitNotInAsyncContext, { at: startLoc }); return this.parseAwait(startLoc); } } return expr; } parseUpdate(node, update, refExpressionErrors) { if (update) { const updateExpressionNode = node; this.checkLVal(updateExpressionNode.argument, { in: this.finishNode(updateExpressionNode, "UpdateExpression") }); return node; } const startLoc = this.state.startLoc; let expr = this.parseExprSubscripts(refExpressionErrors); if (this.checkExpressionErrors(refExpressionErrors, false)) return expr; while ((0, _types.tokenIsPostfix)(this.state.type) && !this.canInsertSemicolon()) { const node = this.startNodeAt(startLoc); node.operator = this.state.value; node.prefix = false; node.argument = expr; this.next(); this.checkLVal(expr, { in: expr = this.finishNode(node, "UpdateExpression") }); } return expr; } parseExprSubscripts(refExpressionErrors) { const startLoc = this.state.startLoc; const potentialArrowAt = this.state.potentialArrowAt; const expr = this.parseExprAtom(refExpressionErrors); if (this.shouldExitDescending(expr, potentialArrowAt)) { return expr; } return this.parseSubscripts(expr, startLoc); } parseSubscripts(base, startLoc, noCalls) { const state = { optionalChainMember: false, maybeAsyncArrow: this.atPossibleAsyncArrow(base), stop: false }; do { base = this.parseSubscript(base, startLoc, noCalls, state); state.maybeAsyncArrow = false; } while (!state.stop); return base; } parseSubscript(base, startLoc, noCalls, state) { const { type } = this.state; if (!noCalls && type === 15) { return this.parseBind(base, startLoc, noCalls, state); } else if ((0, _types.tokenIsTemplate)(type)) { return this.parseTaggedTemplateExpression(base, startLoc, state); } let optional = false; if (type === 18) { if (noCalls) { this.raise(_parseError.Errors.OptionalChainingNoNew, { at: this.state.startLoc }); if (this.lookaheadCharCode() === 40) { state.stop = true; return base; } } state.optionalChainMember = optional = true; this.next(); } if (!noCalls && this.match(10)) { return this.parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional); } else { const computed = this.eat(0); if (computed || optional || this.eat(16)) { return this.parseMember(base, startLoc, state, computed, optional); } else { state.stop = true; return base; } } } parseMember(base, startLoc, state, computed, optional) { const node = this.startNodeAt(startLoc); node.object = base; node.computed = computed; if (computed) { node.property = this.parseExpression(); this.expect(3); } else if (this.match(136)) { if (base.type === "Super") { this.raise(_parseError.Errors.SuperPrivateField, { at: startLoc }); } this.classScope.usePrivateName(this.state.value, this.state.startLoc); node.property = this.parsePrivateName(); } else { node.property = this.parseIdentifier(true); } if (state.optionalChainMember) { node.optional = optional; return this.finishNode(node, "OptionalMemberExpression"); } else { return this.finishNode(node, "MemberExpression"); } } parseBind(base, startLoc, noCalls, state) { const node = this.startNodeAt(startLoc); node.object = base; this.next(); node.callee = this.parseNoCallExpr(); state.stop = true; return this.parseSubscripts(this.finishNode(node, "BindExpression"), startLoc, noCalls); } parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional) { const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; let refExpressionErrors = null; this.state.maybeInArrowParameters = true; this.next(); const node = this.startNodeAt(startLoc); node.callee = base; const { maybeAsyncArrow, optionalChainMember } = state; if (maybeAsyncArrow) { this.expressionScope.enter((0, _expressionScope.newAsyncArrowScope)()); refExpressionErrors = new _util.ExpressionErrors(); } if (optionalChainMember) { node.optional = optional; } if (optional) { node.arguments = this.parseCallExpressionArguments(11); } else { node.arguments = this.parseCallExpressionArguments(11, base.type === "Import", base.type !== "Super", node, refExpressionErrors); } let finishedNode = this.finishCallExpression(node, optionalChainMember); if (maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) { state.stop = true; this.checkDestructuringPrivate(refExpressionErrors); this.expressionScope.validateAsPattern(); this.expressionScope.exit(); finishedNode = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startLoc), finishedNode); } else { if (maybeAsyncArrow) { this.checkExpressionErrors(refExpressionErrors, true); this.expressionScope.exit(); } this.toReferencedArguments(finishedNode); } this.state.maybeInArrowParameters = oldMaybeInArrowParameters; return finishedNode; } toReferencedArguments(node, isParenthesizedExpr) { this.toReferencedListDeep(node.arguments, isParenthesizedExpr); } parseTaggedTemplateExpression(base, startLoc, state) { const node = this.startNodeAt(startLoc); node.tag = base; node.quasi = this.parseTemplate(true); if (state.optionalChainMember) { this.raise(_parseError.Errors.OptionalChainingNoTemplate, { at: startLoc }); } return this.finishNode(node, "TaggedTemplateExpression"); } atPossibleAsyncArrow(base) { return base.type === "Identifier" && base.name === "async" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && base.start === this.state.potentialArrowAt; } expectImportAttributesPlugin() { if (!this.hasPlugin("importAssertions")) { this.expectPlugin("importAttributes"); } } finishCallExpression(node, optional) { if (node.callee.type === "Import") { if (node.arguments.length === 2) { { if (!this.hasPlugin("moduleAttributes")) { this.expectImportAttributesPlugin(); } } } if (node.arguments.length === 0 || node.arguments.length > 2) { this.raise(_parseError.Errors.ImportCallArity, { at: node, maxArgumentCount: this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions") || this.hasPlugin("moduleAttributes") ? 2 : 1 }); } else { for (const arg of node.arguments) { if (arg.type === "SpreadElement") { this.raise(_parseError.Errors.ImportCallSpreadArgument, { at: arg }); } } } } return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression"); } parseCallExpressionArguments(close, dynamicImport, allowPlaceholder, nodeForExtra, refExpressionErrors) { const elts = []; let first = true; const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.inFSharpPipelineDirectBody = false; while (!this.eat(close)) { if (first) { first = false; } else { this.expect(12); if (this.match(close)) { if (dynamicImport && !this.hasPlugin("importAttributes") && !this.hasPlugin("importAssertions") && !this.hasPlugin("moduleAttributes")) { this.raise(_parseError.Errors.ImportCallArgumentTrailingComma, { at: this.state.lastTokStartLoc }); } if (nodeForExtra) { this.addTrailingCommaExtraToNode(nodeForExtra); } this.next(); break; } } elts.push(this.parseExprListItem(false, refExpressionErrors, allowPlaceholder)); } this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; return elts; } shouldParseAsyncArrow() { return this.match(19) && !this.canInsertSemicolon(); } parseAsyncArrowFromCallExpression(node, call) { var _call$extra; this.resetPreviousNodeTrailingComments(call); this.expect(19); this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingCommaLoc); if (call.innerComments) { (0, _comments.setInnerComments)(node, call.innerComments); } if (call.callee.trailingComments) { (0, _comments.setInnerComments)(node, call.callee.trailingComments); } return node; } parseNoCallExpr() { const startLoc = this.state.startLoc; return this.parseSubscripts(this.parseExprAtom(), startLoc, true); } parseExprAtom(refExpressionErrors) { let node; let decorators = null; const { type } = this.state; switch (type) { case 79: return this.parseSuper(); case 83: node = this.startNode(); this.next(); if (this.match(16)) { return this.parseImportMetaProperty(node); } if (!this.match(10)) { this.raise(_parseError.Errors.UnsupportedImport, { at: this.state.lastTokStartLoc }); } return this.finishNode(node, "Import"); case 78: node = this.startNode(); this.next(); return this.finishNode(node, "ThisExpression"); case 90: { return this.parseDo(this.startNode(), false); } case 56: case 31: { this.readRegexp(); return this.parseRegExpLiteral(this.state.value); } case 132: return this.parseNumericLiteral(this.state.value); case 133: return this.parseBigIntLiteral(this.state.value); case 134: return this.parseDecimalLiteral(this.state.value); case 131: return this.parseStringLiteral(this.state.value); case 84: return this.parseNullLiteral(); case 85: return this.parseBooleanLiteral(true); case 86: return this.parseBooleanLiteral(false); case 10: { const canBeArrow = this.state.potentialArrowAt === this.state.start; return this.parseParenAndDistinguishExpression(canBeArrow); } case 2: case 1: { return this.parseArrayLike(this.state.type === 2 ? 4 : 3, false, true); } case 0: { return this.parseArrayLike(3, true, false, refExpressionErrors); } case 6: case 7: { return this.parseObjectLike(this.state.type === 6 ? 9 : 8, false, true); } case 5: { return this.parseObjectLike(8, false, false, refExpressionErrors); } case 68: return this.parseFunctionOrFunctionSent(); case 26: decorators = this.parseDecorators(); case 80: return this.parseClass(this.maybeTakeDecorators(decorators, this.startNode()), false); case 77: return this.parseNewOrNewTarget(); case 25: case 24: return this.parseTemplate(false); case 15: { node = this.startNode(); this.next(); node.object = null; const callee = node.callee = this.parseNoCallExpr(); if (callee.type === "MemberExpression") { return this.finishNode(node, "BindExpression"); } else { throw this.raise(_parseError.Errors.UnsupportedBind, { at: callee }); } } case 136: { this.raise(_parseError.Errors.PrivateInExpectedIn, { at: this.state.startLoc, identifierName: this.state.value }); return this.parsePrivateName(); } case 33: { return this.parseTopicReferenceThenEqualsSign(54, "%"); } case 32: { return this.parseTopicReferenceThenEqualsSign(44, "^"); } case 37: case 38: { return this.parseTopicReference("hack"); } case 44: case 54: case 27: { const pipeProposal = this.getPluginOption("pipelineOperator", "proposal"); if (pipeProposal) { return this.parseTopicReference(pipeProposal); } this.unexpected(); break; } case 47: { const lookaheadCh = this.input.codePointAt(this.nextTokenStart()); if ((0, _identifier.isIdentifierStart)(lookaheadCh) || lookaheadCh === 62) { this.expectOnePlugin(["jsx", "flow", "typescript"]); } else { this.unexpected(); } break; } default: if ((0, _types.tokenIsIdentifier)(type)) { if (this.isContextual(125) && this.lookaheadInLineCharCode() === 123) { return this.parseModuleExpression(); } const canBeArrow = this.state.potentialArrowAt === this.state.start; const containsEsc = this.state.containsEsc; const id = this.parseIdentifier(); if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) { const { type } = this.state; if (type === 68) { this.resetPreviousNodeTrailingComments(id); this.next(); return this.parseAsyncFunctionExpression(this.startNodeAtNode(id)); } else if ((0, _types.tokenIsIdentifier)(type)) { if (this.lookaheadCharCode() === 61) { return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id)); } else { return id; } } else if (type === 90) { this.resetPreviousNodeTrailingComments(id); return this.parseDo(this.startNodeAtNode(id), true); } } if (canBeArrow && this.match(19) && !this.canInsertSemicolon()) { this.next(); return this.parseArrowExpression(this.startNodeAtNode(id), [id], false); } return id; } else { this.unexpected(); } } } parseTopicReferenceThenEqualsSign(topicTokenType, topicTokenValue) { const pipeProposal = this.getPluginOption("pipelineOperator", "proposal"); if (pipeProposal) { this.state.type = topicTokenType; this.state.value = topicTokenValue; this.state.pos--; this.state.end--; this.state.endLoc = (0, _location.createPositionWithColumnOffset)(this.state.endLoc, -1); return this.parseTopicReference(pipeProposal); } else { this.unexpected(); } } parseTopicReference(pipeProposal) { const node = this.startNode(); const startLoc = this.state.startLoc; const tokenType = this.state.type; this.next(); return this.finishTopicReference(node, startLoc, pipeProposal, tokenType); } finishTopicReference(node, startLoc, pipeProposal, tokenType) { if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) { const nodeType = pipeProposal === "smart" ? "PipelinePrimaryTopicReference" : "TopicReference"; if (!this.topicReferenceIsAllowedInCurrentContext()) { this.raise(pipeProposal === "smart" ? _parseError.Errors.PrimaryTopicNotAllowed : _parseError.Errors.PipeTopicUnbound, { at: startLoc }); } this.registerTopicReference(); return this.finishNode(node, nodeType); } else { throw this.raise(_parseError.Errors.PipeTopicUnconfiguredToken, { at: startLoc, token: (0, _types.tokenLabelName)(tokenType) }); } } testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType) { switch (pipeProposal) { case "hack": { return this.hasPlugin(["pipelineOperator", { topicToken: (0, _types.tokenLabelName)(tokenType) }]); } case "smart": return tokenType === 27; default: throw this.raise(_parseError.Errors.PipeTopicRequiresHackPipes, { at: startLoc }); } } parseAsyncArrowUnaryFunction(node) { this.prodParam.enter((0, _productionParameter.functionFlags)(true, this.prodParam.hasYield)); const params = [this.parseIdentifier()]; this.prodParam.exit(); if (this.hasPrecedingLineBreak()) { this.raise(_parseError.Errors.LineTerminatorBeforeArrow, { at: this.state.curPosition() }); } this.expect(19); return this.parseArrowExpression(node, params, true); } parseDo(node, isAsync) { this.expectPlugin("doExpressions"); if (isAsync) { this.expectPlugin("asyncDoExpressions"); } node.async = isAsync; this.next(); const oldLabels = this.state.labels; this.state.labels = []; if (isAsync) { this.prodParam.enter(_productionParameter.PARAM_AWAIT); node.body = this.parseBlock(); this.prodParam.exit(); } else { node.body = this.parseBlock(); } this.state.labels = oldLabels; return this.finishNode(node, "DoExpression"); } parseSuper() { const node = this.startNode(); this.next(); if (this.match(10) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) { this.raise(_parseError.Errors.SuperNotAllowed, { at: node }); } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) { this.raise(_parseError.Errors.UnexpectedSuper, { at: node }); } if (!this.match(10) && !this.match(0) && !this.match(16)) { this.raise(_parseError.Errors.UnsupportedSuper, { at: node }); } return this.finishNode(node, "Super"); } parsePrivateName() { const node = this.startNode(); const id = this.startNodeAt((0, _location.createPositionWithColumnOffset)(this.state.startLoc, 1)); const name = this.state.value; this.next(); node.id = this.createIdentifier(id, name); return this.finishNode(node, "PrivateName"); } parseFunctionOrFunctionSent() { const node = this.startNode(); this.next(); if (this.prodParam.hasYield && this.match(16)) { const meta = this.createIdentifier(this.startNodeAtNode(node), "function"); this.next(); if (this.match(102)) { this.expectPlugin("functionSent"); } else if (!this.hasPlugin("functionSent")) { this.unexpected(); } return this.parseMetaProperty(node, meta, "sent"); } return this.parseFunction(node); } parseMetaProperty(node, meta, propertyName) { node.meta = meta; const containsEsc = this.state.containsEsc; node.property = this.parseIdentifier(true); if (node.property.name !== propertyName || containsEsc) { this.raise(_parseError.Errors.UnsupportedMetaProperty, { at: node.property, target: meta.name, onlyValidPropertyName: propertyName }); } return this.finishNode(node, "MetaProperty"); } parseImportMetaProperty(node) { const id = this.createIdentifier(this.startNodeAtNode(node), "import"); this.next(); if (this.isContextual(100)) { if (!this.inModule) { this.raise(_parseError.Errors.ImportMetaOutsideModule, { at: id }); } this.sawUnambiguousESM = true; } return this.parseMetaProperty(node, id, "meta"); } parseLiteralAtNode(value, type, node) { this.addExtra(node, "rawValue", value); this.addExtra(node, "raw", this.input.slice(node.start, this.state.end)); node.value = value; this.next(); return this.finishNode(node, type); } parseLiteral(value, type) { const node = this.startNode(); return this.parseLiteralAtNode(value, type, node); } parseStringLiteral(value) { return this.parseLiteral(value, "StringLiteral"); } parseNumericLiteral(value) { return this.parseLiteral(value, "NumericLiteral"); } parseBigIntLiteral(value) { return this.parseLiteral(value, "BigIntLiteral"); } parseDecimalLiteral(value) { return this.parseLiteral(value, "DecimalLiteral"); } parseRegExpLiteral(value) { const node = this.parseLiteral(value.value, "RegExpLiteral"); node.pattern = value.pattern; node.flags = value.flags; return node; } parseBooleanLiteral(value) { const node = this.startNode(); node.value = value; this.next(); return this.finishNode(node, "BooleanLiteral"); } parseNullLiteral() { const node = this.startNode(); this.next(); return this.finishNode(node, "NullLiteral"); } parseParenAndDistinguishExpression(canBeArrow) { const startLoc = this.state.startLoc; let val; this.next(); this.expressionScope.enter((0, _expressionScope.newArrowHeadScope)()); const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.maybeInArrowParameters = true; this.state.inFSharpPipelineDirectBody = false; const innerStartLoc = this.state.startLoc; const exprList = []; const refExpressionErrors = new _util.ExpressionErrors(); let first = true; let spreadStartLoc; let optionalCommaStartLoc; while (!this.match(11)) { if (first) { first = false; } else { this.expect(12, refExpressionErrors.optionalParametersLoc === null ? null : refExpressionErrors.optionalParametersLoc); if (this.match(11)) { optionalCommaStartLoc = this.state.startLoc; break; } } if (this.match(21)) { const spreadNodeStartLoc = this.state.startLoc; spreadStartLoc = this.state.startLoc; exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartLoc)); if (!this.checkCommaAfterRest(41)) { break; } } else { exprList.push(this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem)); } } const innerEndLoc = this.state.lastTokEndLoc; this.expect(11); this.state.maybeInArrowParameters = oldMaybeInArrowParameters; this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; let arrowNode = this.startNodeAt(startLoc); if (canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) { this.checkDestructuringPrivate(refExpressionErrors); this.expressionScope.validateAsPattern(); this.expressionScope.exit(); this.parseArrowExpression(arrowNode, exprList, false); return arrowNode; } this.expressionScope.exit(); if (!exprList.length) { this.unexpected(this.state.lastTokStartLoc); } if (optionalCommaStartLoc) this.unexpected(optionalCommaStartLoc); if (spreadStartLoc) this.unexpected(spreadStartLoc); this.checkExpressionErrors(refExpressionErrors, true); this.toReferencedListDeep(exprList, true); if (exprList.length > 1) { val = this.startNodeAt(innerStartLoc); val.expressions = exprList; this.finishNode(val, "SequenceExpression"); this.resetEndLocation(val, innerEndLoc); } else { val = exprList[0]; } return this.wrapParenthesis(startLoc, val); } wrapParenthesis(startLoc, expression) { if (!this.options.createParenthesizedExpressions) { this.addExtra(expression, "parenthesized", true); this.addExtra(expression, "parenStart", startLoc.index); this.takeSurroundingComments(expression, startLoc.index, this.state.lastTokEndLoc.index); return expression; } const parenExpression = this.startNodeAt(startLoc); parenExpression.expression = expression; return this.finishNode(parenExpression, "ParenthesizedExpression"); } shouldParseArrow(params) { return !this.canInsertSemicolon(); } parseArrow(node) { if (this.eat(19)) { return node; } } parseParenItem(node, startLoc) { return node; } parseNewOrNewTarget() { const node = this.startNode(); this.next(); if (this.match(16)) { const meta = this.createIdentifier(this.startNodeAtNode(node), "new"); this.next(); const metaProp = this.parseMetaProperty(node, meta, "target"); if (!this.scope.inNonArrowFunction && !this.scope.inClass && !this.options.allowNewTargetOutsideFunction) { this.raise(_parseError.Errors.UnexpectedNewTarget, { at: metaProp }); } return metaProp; } return this.parseNew(node); } parseNew(node) { this.parseNewCallee(node); if (this.eat(10)) { const args = this.parseExprList(11); this.toReferencedList(args); node.arguments = args; } else { node.arguments = []; } return this.finishNode(node, "NewExpression"); } parseNewCallee(node) { node.callee = this.parseNoCallExpr(); if (node.callee.type === "Import") { this.raise(_parseError.Errors.ImportCallNotNewExpression, { at: node.callee }); } } parseTemplateElement(isTagged) { const { start, startLoc, end, value } = this.state; const elemStart = start + 1; const elem = this.startNodeAt((0, _location.createPositionWithColumnOffset)(startLoc, 1)); if (value === null) { if (!isTagged) { this.raise(_parseError.Errors.InvalidEscapeSequenceTemplate, { at: (0, _location.createPositionWithColumnOffset)(this.state.firstInvalidTemplateEscapePos, 1) }); } } const isTail = this.match(24); const endOffset = isTail ? -1 : -2; const elemEnd = end + endOffset; elem.value = { raw: this.input.slice(elemStart, elemEnd).replace(/\r\n?/g, "\n"), cooked: value === null ? null : value.slice(1, endOffset) }; elem.tail = isTail; this.next(); const finishedNode = this.finishNode(elem, "TemplateElement"); this.resetEndLocation(finishedNode, (0, _location.createPositionWithColumnOffset)(this.state.lastTokEndLoc, endOffset)); return finishedNode; } parseTemplate(isTagged) { const node = this.startNode(); node.expressions = []; let curElt = this.parseTemplateElement(isTagged); node.quasis = [curElt]; while (!curElt.tail) { node.expressions.push(this.parseTemplateSubstitution()); this.readTemplateContinuation(); node.quasis.push(curElt = this.parseTemplateElement(isTagged)); } return this.finishNode(node, "TemplateLiteral"); } parseTemplateSubstitution() { return this.parseExpression(); } parseObjectLike(close, isPattern, isRecord, refExpressionErrors) { if (isRecord) { this.expectPlugin("recordAndTuple"); } const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.inFSharpPipelineDirectBody = false; const propHash = Object.create(null); let first = true; const node = this.startNode(); node.properties = []; this.next(); while (!this.match(close)) { if (first) { first = false; } else { this.expect(12); if (this.match(close)) { this.addTrailingCommaExtraToNode(node); break; } } let prop; if (isPattern) { prop = this.parseBindingProperty(); } else { prop = this.parsePropertyDefinition(refExpressionErrors); this.checkProto(prop, isRecord, propHash, refExpressionErrors); } if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") { this.raise(_parseError.Errors.InvalidRecordProperty, { at: prop }); } if (prop.shorthand) { this.addExtra(prop, "shorthand", true); } node.properties.push(prop); } this.next(); this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; let type = "ObjectExpression"; if (isPattern) { type = "ObjectPattern"; } else if (isRecord) { type = "RecordExpression"; } return this.finishNode(node, type); } addTrailingCommaExtraToNode(node) { this.addExtra(node, "trailingComma", this.state.lastTokStart); this.addExtra(node, "trailingCommaLoc", this.state.lastTokStartLoc, false); } maybeAsyncOrAccessorProp(prop) { return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(0) || this.match(55)); } parsePropertyDefinition(refExpressionErrors) { let decorators = []; if (this.match(26)) { if (this.hasPlugin("decorators")) { this.raise(_parseError.Errors.UnsupportedPropertyDecorator, { at: this.state.startLoc }); } while (this.match(26)) { decorators.push(this.parseDecorator()); } } const prop = this.startNode(); let isAsync = false; let isAccessor = false; let startLoc; if (this.match(21)) { if (decorators.length) this.unexpected(); return this.parseSpread(); } if (decorators.length) { prop.decorators = decorators; decorators = []; } prop.method = false; if (refExpressionErrors) { startLoc = this.state.startLoc; } let isGenerator = this.eat(55); this.parsePropertyNamePrefixOperator(prop); const containsEsc = this.state.containsEsc; const key = this.parsePropertyName(prop, refExpressionErrors); if (!isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) { const keyName = key.name; if (keyName === "async" && !this.hasPrecedingLineBreak()) { isAsync = true; this.resetPreviousNodeTrailingComments(key); isGenerator = this.eat(55); this.parsePropertyName(prop); } if (keyName === "get" || keyName === "set") { isAccessor = true; this.resetPreviousNodeTrailingComments(key); prop.kind = keyName; if (this.match(55)) { isGenerator = true; this.raise(_parseError.Errors.AccessorIsGenerator, { at: this.state.curPosition(), kind: keyName }); this.next(); } this.parsePropertyName(prop); } } return this.parseObjPropValue(prop, startLoc, isGenerator, isAsync, false, isAccessor, refExpressionErrors); } getGetterSetterExpectedParamCount(method) { return method.kind === "get" ? 0 : 1; } getObjectOrClassMethodParams(method) { return method.params; } checkGetterSetterParams(method) { var _params; const paramCount = this.getGetterSetterExpectedParamCount(method); const params = this.getObjectOrClassMethodParams(method); if (params.length !== paramCount) { this.raise(method.kind === "get" ? _parseError.Errors.BadGetterArity : _parseError.Errors.BadSetterArity, { at: method }); } if (method.kind === "set" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === "RestElement") { this.raise(_parseError.Errors.BadSetterRestParameter, { at: method }); } } parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { if (isAccessor) { const finishedProp = this.parseMethod(prop, isGenerator, false, false, false, "ObjectMethod"); this.checkGetterSetterParams(finishedProp); return finishedProp; } if (isAsync || isGenerator || this.match(10)) { if (isPattern) this.unexpected(); prop.kind = "method"; prop.method = true; return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod"); } } parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) { prop.shorthand = false; if (this.eat(14)) { prop.value = isPattern ? this.parseMaybeDefault(this.state.startLoc) : this.parseMaybeAssignAllowIn(refExpressionErrors); return this.finishNode(prop, "ObjectProperty"); } if (!prop.computed && prop.key.type === "Identifier") { this.checkReservedWord(prop.key.name, prop.key.loc.start, true, false); if (isPattern) { prop.value = this.parseMaybeDefault(startLoc, (0, _node.cloneIdentifier)(prop.key)); } else if (this.match(29)) { const shorthandAssignLoc = this.state.startLoc; if (refExpressionErrors != null) { if (refExpressionErrors.shorthandAssignLoc === null) { refExpressionErrors.shorthandAssignLoc = shorthandAssignLoc; } } else { this.raise(_parseError.Errors.InvalidCoverInitializedName, { at: shorthandAssignLoc }); } prop.value = this.parseMaybeDefault(startLoc, (0, _node.cloneIdentifier)(prop.key)); } else { prop.value = (0, _node.cloneIdentifier)(prop.key); } prop.shorthand = true; return this.finishNode(prop, "ObjectProperty"); } } parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) || this.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors); if (!node) this.unexpected(); return node; } parsePropertyName(prop, refExpressionErrors) { if (this.eat(0)) { prop.computed = true; prop.key = this.parseMaybeAssignAllowIn(); this.expect(3); } else { const { type, value } = this.state; let key; if ((0, _types.tokenIsKeywordOrIdentifier)(type)) { key = this.parseIdentifier(true); } else { switch (type) { case 132: key = this.parseNumericLiteral(value); break; case 131: key = this.parseStringLiteral(value); break; case 133: key = this.parseBigIntLiteral(value); break; case 134: key = this.parseDecimalLiteral(value); break; case 136: { const privateKeyLoc = this.state.startLoc; if (refExpressionErrors != null) { if (refExpressionErrors.privateKeyLoc === null) { refExpressionErrors.privateKeyLoc = privateKeyLoc; } } else { this.raise(_parseError.Errors.UnexpectedPrivateField, { at: privateKeyLoc }); } key = this.parsePrivateName(); break; } default: this.unexpected(); } } prop.key = key; if (type !== 136) { prop.computed = false; } } return prop.key; } initFunction(node, isAsync) { node.id = null; node.generator = false; node.async = isAsync; } parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { this.initFunction(node, isAsync); node.generator = isGenerator; this.scope.enter(_scopeflags.SCOPE_FUNCTION | _scopeflags.SCOPE_SUPER | (inClassScope ? _scopeflags.SCOPE_CLASS : 0) | (allowDirectSuper ? _scopeflags.SCOPE_DIRECT_SUPER : 0)); this.prodParam.enter((0, _productionParameter.functionFlags)(isAsync, node.generator)); this.parseFunctionParams(node, isConstructor); const finishedNode = this.parseFunctionBodyAndFinish(node, type, true); this.prodParam.exit(); this.scope.exit(); return finishedNode; } parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { if (isTuple) { this.expectPlugin("recordAndTuple"); } const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.inFSharpPipelineDirectBody = false; const node = this.startNode(); this.next(); node.elements = this.parseExprList(close, !isTuple, refExpressionErrors, node); this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; return this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression"); } parseArrowExpression(node, params, isAsync, trailingCommaLoc) { this.scope.enter(_scopeflags.SCOPE_FUNCTION | _scopeflags.SCOPE_ARROW); let flags = (0, _productionParameter.functionFlags)(isAsync, false); if (!this.match(5) && this.prodParam.hasIn) { flags |= _productionParameter.PARAM_IN; } this.prodParam.enter(flags); this.initFunction(node, isAsync); const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; if (params) { this.state.maybeInArrowParameters = true; this.setArrowFunctionParameters(node, params, trailingCommaLoc); } this.state.maybeInArrowParameters = false; this.parseFunctionBody(node, true); this.prodParam.exit(); this.scope.exit(); this.state.maybeInArrowParameters = oldMaybeInArrowParameters; return this.finishNode(node, "ArrowFunctionExpression"); } setArrowFunctionParameters(node, params, trailingCommaLoc) { this.toAssignableList(params, trailingCommaLoc, false); node.params = params; } parseFunctionBodyAndFinish(node, type, isMethod = false) { this.parseFunctionBody(node, false, isMethod); return this.finishNode(node, type); } parseFunctionBody(node, allowExpression, isMethod = false) { const isExpression = allowExpression && !this.match(5); this.expressionScope.enter((0, _expressionScope.newExpressionScope)()); if (isExpression) { node.body = this.parseMaybeAssign(); this.checkParams(node, false, allowExpression, false); } else { const oldStrict = this.state.strict; const oldLabels = this.state.labels; this.state.labels = []; this.prodParam.enter(this.prodParam.currentFlags() | _productionParameter.PARAM_RETURN); node.body = this.parseBlock(true, false, hasStrictModeDirective => { const nonSimple = !this.isSimpleParamList(node.params); if (hasStrictModeDirective && nonSimple) { this.raise(_parseError.Errors.IllegalLanguageModeDirective, { at: (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.loc.end : node }); } const strictModeChanged = !oldStrict && this.state.strict; this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged); if (this.state.strict && node.id) { this.checkIdentifier(node.id, _scopeflags.BIND_OUTSIDE, strictModeChanged); } }); this.prodParam.exit(); this.state.labels = oldLabels; } this.expressionScope.exit(); } isSimpleParameter(node) { return node.type === "Identifier"; } isSimpleParamList(params) { for (let i = 0, len = params.length; i < len; i++) { if (!this.isSimpleParameter(params[i])) return false; } return true; } checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { const checkClashes = !allowDuplicates && new Set(); const formalParameters = { type: "FormalParameters" }; for (const param of node.params) { this.checkLVal(param, { in: formalParameters, binding: _scopeflags.BIND_VAR, checkClashes, strictModeChanged }); } } parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) { const elts = []; let first = true; while (!this.eat(close)) { if (first) { first = false; } else { this.expect(12); if (this.match(close)) { if (nodeForExtra) { this.addTrailingCommaExtraToNode(nodeForExtra); } this.next(); break; } } elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors)); } return elts; } parseExprListItem(allowEmpty, refExpressionErrors, allowPlaceholder) { let elt; if (this.match(12)) { if (!allowEmpty) { this.raise(_parseError.Errors.UnexpectedToken, { at: this.state.curPosition(), unexpected: "," }); } elt = null; } else if (this.match(21)) { const spreadNodeStartLoc = this.state.startLoc; elt = this.parseParenItem(this.parseSpread(refExpressionErrors), spreadNodeStartLoc); } else if (this.match(17)) { this.expectPlugin("partialApplication"); if (!allowPlaceholder) { this.raise(_parseError.Errors.UnexpectedArgumentPlaceholder, { at: this.state.startLoc }); } const node = this.startNode(); this.next(); elt = this.finishNode(node, "ArgumentPlaceholder"); } else { elt = this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem); } return elt; } parseIdentifier(liberal) { const node = this.startNode(); const name = this.parseIdentifierName(liberal); return this.createIdentifier(node, name); } createIdentifier(node, name) { node.name = name; node.loc.identifierName = name; return this.finishNode(node, "Identifier"); } parseIdentifierName(liberal) { let name; const { startLoc, type } = this.state; if ((0, _types.tokenIsKeywordOrIdentifier)(type)) { name = this.state.value; } else { this.unexpected(); } const tokenIsKeyword = (0, _types.tokenKeywordOrIdentifierIsKeyword)(type); if (liberal) { if (tokenIsKeyword) { this.replaceToken(130); } } else { this.checkReservedWord(name, startLoc, tokenIsKeyword, false); } this.next(); return name; } checkReservedWord(word, startLoc, checkKeywords, isBinding) { if (word.length > 10) { return; } if (!(0, _identifier.canBeReservedWord)(word)) { return; } if (checkKeywords && (0, _identifier.isKeyword)(word)) { this.raise(_parseError.Errors.UnexpectedKeyword, { at: startLoc, keyword: word }); return; } const reservedTest = !this.state.strict ? _identifier.isReservedWord : isBinding ? _identifier.isStrictBindReservedWord : _identifier.isStrictReservedWord; if (reservedTest(word, this.inModule)) { this.raise(_parseError.Errors.UnexpectedReservedWord, { at: startLoc, reservedWord: word }); return; } else if (word === "yield") { if (this.prodParam.hasYield) { this.raise(_parseError.Errors.YieldBindingIdentifier, { at: startLoc }); return; } } else if (word === "await") { if (this.prodParam.hasAwait) { this.raise(_parseError.Errors.AwaitBindingIdentifier, { at: startLoc }); return; } if (this.scope.inStaticBlock) { this.raise(_parseError.Errors.AwaitBindingIdentifierInStaticBlock, { at: startLoc }); return; } this.expressionScope.recordAsyncArrowParametersError({ at: startLoc }); } else if (word === "arguments") { if (this.scope.inClassAndNotInNonArrowFunction) { this.raise(_parseError.Errors.ArgumentsInClass, { at: startLoc }); return; } } } isAwaitAllowed() { if (this.prodParam.hasAwait) return true; if (this.options.allowAwaitOutsideFunction && !this.scope.inFunction) { return true; } return false; } parseAwait(startLoc) { const node = this.startNodeAt(startLoc); this.expressionScope.recordParameterInitializerError(_parseError.Errors.AwaitExpressionFormalParameter, { at: node }); if (this.eat(55)) { this.raise(_parseError.Errors.ObsoleteAwaitStar, { at: node }); } if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) { if (this.isAmbiguousAwait()) { this.ambiguousScriptDifferentAst = true; } else { this.sawUnambiguousESM = true; } } if (!this.state.soloAwait) { node.argument = this.parseMaybeUnary(null, true); } return this.finishNode(node, "AwaitExpression"); } isAmbiguousAwait() { if (this.hasPrecedingLineBreak()) return true; const { type } = this.state; return type === 53 || type === 10 || type === 0 || (0, _types.tokenIsTemplate)(type) || type === 101 && !this.state.containsEsc || type === 135 || type === 56 || this.hasPlugin("v8intrinsic") && type === 54; } parseYield() { const node = this.startNode(); this.expressionScope.recordParameterInitializerError(_parseError.Errors.YieldInParameter, { at: node }); this.next(); let delegating = false; let argument = null; if (!this.hasPrecedingLineBreak()) { delegating = this.eat(55); switch (this.state.type) { case 13: case 137: case 8: case 11: case 3: case 9: case 14: case 12: if (!delegating) break; default: argument = this.parseMaybeAssign(); } } node.delegate = delegating; node.argument = argument; return this.finishNode(node, "YieldExpression"); } checkPipelineAtInfixOperator(left, leftStartLoc) { if (this.hasPlugin(["pipelineOperator", { proposal: "smart" }])) { if (left.type === "SequenceExpression") { this.raise(_parseError.Errors.PipelineHeadSequenceExpression, { at: leftStartLoc }); } } } parseSmartPipelineBodyInStyle(childExpr, startLoc) { if (this.isSimpleReference(childExpr)) { const bodyNode = this.startNodeAt(startLoc); bodyNode.callee = childExpr; return this.finishNode(bodyNode, "PipelineBareFunction"); } else { const bodyNode = this.startNodeAt(startLoc); this.checkSmartPipeTopicBodyEarlyErrors(startLoc); bodyNode.expression = childExpr; return this.finishNode(bodyNode, "PipelineTopicExpression"); } } isSimpleReference(expression) { switch (expression.type) { case "MemberExpression": return !expression.computed && this.isSimpleReference(expression.object); case "Identifier": return true; default: return false; } } checkSmartPipeTopicBodyEarlyErrors(startLoc) { if (this.match(19)) { throw this.raise(_parseError.Errors.PipelineBodyNoArrow, { at: this.state.startLoc }); } if (!this.topicReferenceWasUsedInCurrentContext()) { this.raise(_parseError.Errors.PipelineTopicUnused, { at: startLoc }); } } withTopicBindingContext(callback) { const outerContextTopicState = this.state.topicContext; this.state.topicContext = { maxNumOfResolvableTopics: 1, maxTopicIndex: null }; try { return callback(); } finally { this.state.topicContext = outerContextTopicState; } } withSmartMixTopicForbiddingContext(callback) { if (this.hasPlugin(["pipelineOperator", { proposal: "smart" }])) { const outerContextTopicState = this.state.topicContext; this.state.topicContext = { maxNumOfResolvableTopics: 0, maxTopicIndex: null }; try { return callback(); } finally { this.state.topicContext = outerContextTopicState; } } else { return callback(); } } withSoloAwaitPermittingContext(callback) { const outerContextSoloAwaitState = this.state.soloAwait; this.state.soloAwait = true; try { return callback(); } finally { this.state.soloAwait = outerContextSoloAwaitState; } } allowInAnd(callback) { const flags = this.prodParam.currentFlags(); const prodParamToSet = _productionParameter.PARAM_IN & ~flags; if (prodParamToSet) { this.prodParam.enter(flags | _productionParameter.PARAM_IN); try { return callback(); } finally { this.prodParam.exit(); } } return callback(); } disallowInAnd(callback) { const flags = this.prodParam.currentFlags(); const prodParamToClear = _productionParameter.PARAM_IN & flags; if (prodParamToClear) { this.prodParam.enter(flags & ~_productionParameter.PARAM_IN); try { return callback(); } finally { this.prodParam.exit(); } } return callback(); } registerTopicReference() { this.state.topicContext.maxTopicIndex = 0; } topicReferenceIsAllowedInCurrentContext() { return this.state.topicContext.maxNumOfResolvableTopics >= 1; } topicReferenceWasUsedInCurrentContext() { return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0; } parseFSharpPipelineBody(prec) { const startLoc = this.state.startLoc; this.state.potentialArrowAt = this.state.start; const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.inFSharpPipelineDirectBody = true; const ret = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, prec); this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; return ret; } parseModuleExpression() { this.expectPlugin("moduleBlocks"); const node = this.startNode(); this.next(); if (!this.match(5)) { this.unexpected(null, 5); } const program = this.startNodeAt(this.state.endLoc); this.next(); const revertScopes = this.initializeScopes(true); this.enterInitialScopes(); try { node.body = this.parseProgram(program, 8, "module"); } finally { revertScopes(); } return this.finishNode(node, "ModuleExpression"); } parsePropertyNamePrefixOperator(prop) {} } exports.default = ExpressionParser; //# sourceMappingURL=expression.js.map lib/parser/expression.js.map 0000644 00000531646 15120211212 0012121 0 ustar 00 {"version":3,"names":["_types","require","_lval","_identifier","_location","_scopeflags","_util","_productionParameter","_expressionScope","_parseError","_pipelineOperatorErrors","_comments","_node","ExpressionParser","LValParser","checkProto","prop","isRecord","protoRef","refExpressionErrors","type","isObjectMethod","computed","shorthand","key","name","value","raise","Errors","RecordNoProto","at","used","doubleProtoLoc","loc","start","DuplicateProto","shouldExitDescending","expr","potentialArrowAt","getExpression","enterInitialScopes","nextToken","parseExpression","match","unexpected","finalizeRemainingComments","comments","state","errors","options","tokens","disallowIn","disallowInAnd","parseExpressionBase","allowInAnd","startLoc","parseMaybeAssign","node","startNodeAt","expressions","eat","push","toReferencedList","finishNode","parseMaybeAssignDisallowIn","afterLeftParse","parseMaybeAssignAllowIn","setOptionalParametersError","resultError","_resultError$loc","optionalParametersLoc","isContextual","prodParam","hasYield","left","parseYield","call","ownExpressionErrors","ExpressionErrors","tokenIsIdentifier","parseMaybeConditional","tokenIsAssignment","operator","toAssignable","startIndex","index","shorthandAssignLoc","privateKeyLoc","checkDestructuringPrivate","next","right","checkLVal","in","checkExpressionErrors","parseExprOps","parseConditional","test","consequent","expect","alternate","parseMaybeUnaryOrPrivate","parsePrivateName","parseMaybeUnary","parseExprOp","leftStartLoc","minPrec","isPrivateName","getPrivateNameSV","tokenOperatorPrecedence","hasIn","PrivateInExpectedIn","identifierName","classScope","usePrivateName","op","tokenIsOperator","prec","expectPlugin","inFSharpPipelineDirectBody","checkPipelineAtInfixOperator","logical","coalesce","hasPlugin","proposal","hasAwait","UnexpectedAwaitAfterPipelineBody","parseExprOpRightExpr","finishedNode","nextOp","MixingCoalesceWithLogical","getPluginOption","withTopicBindingContext","parseHackPipeBody","PipeBodyIsTighter","parseSmartPipelineBodyInStyle","parseExprOpBaseRightExpr","withSoloAwaitPermittingContext","parseFSharpPipelineBody","tokenIsRightAssociative","_body$extra","body","requiredParentheses","UnparenthesizedPipeBodyDescriptions","has","extra","parenthesized","PipeUnparenthesizedBody","topicReferenceWasUsedInCurrentContext","PipeTopicUnused","checkExponentialAfterUnary","UnexpectedTokenUnaryExponentiation","argument","sawUnary","isAwait","isAwaitAllowed","parseAwait","update","startNode","tokenIsPrefix","prefix","isDelete","strict","arg","StrictDelete","hasPropertyAsPrivateName","DeletePrivateField","parseUpdate","startsExpr","tokenCanStartExpression","isAmbiguousAwait","raiseOverwrite","AwaitNotInAsyncContext","updateExpressionNode","parseExprSubscripts","tokenIsPostfix","canInsertSemicolon","parseExprAtom","parseSubscripts","base","noCalls","optionalChainMember","maybeAsyncArrow","atPossibleAsyncArrow","stop","parseSubscript","parseBind","tokenIsTemplate","parseTaggedTemplateExpression","optional","OptionalChainingNoNew","lookaheadCharCode","parseCoverCallAndAsyncArrowHead","parseMember","object","property","SuperPrivateField","parseIdentifier","callee","parseNoCallExpr","oldMaybeInArrowParameters","maybeInArrowParameters","expressionScope","enter","newAsyncArrowScope","arguments","parseCallExpressionArguments","finishCallExpression","shouldParseAsyncArrow","validateAsPattern","exit","parseAsyncArrowFromCallExpression","toReferencedArguments","isParenthesizedExpr","toReferencedListDeep","tag","quasi","parseTemplate","OptionalChainingNoTemplate","lastTokEndLoc","end","expectImportAttributesPlugin","length","ImportCallArity","maxArgumentCount","ImportCallSpreadArgument","close","dynamicImport","allowPlaceholder","nodeForExtra","elts","first","oldInFSharpPipelineDirectBody","ImportCallArgumentTrailingComma","lastTokStartLoc","addTrailingCommaExtraToNode","parseExprListItem","_call$extra","resetPreviousNodeTrailingComments","parseArrowExpression","trailingCommaLoc","innerComments","setInnerComments","trailingComments","decorators","parseSuper","parseImportMetaProperty","UnsupportedImport","parseDo","readRegexp","parseRegExpLiteral","parseNumericLiteral","parseBigIntLiteral","parseDecimalLiteral","parseStringLiteral","parseNullLiteral","parseBooleanLiteral","canBeArrow","parseParenAndDistinguishExpression","parseArrayLike","parseObjectLike","parseFunctionOrFunctionSent","parseDecorators","parseClass","maybeTakeDecorators","parseNewOrNewTarget","UnsupportedBind","parseTopicReferenceThenEqualsSign","parseTopicReference","pipeProposal","lookaheadCh","input","codePointAt","nextTokenStart","isIdentifierStart","expectOnePlugin","lookaheadInLineCharCode","parseModuleExpression","containsEsc","id","parseAsyncFunctionExpression","startNodeAtNode","parseAsyncArrowUnaryFunction","topicTokenType","topicTokenValue","pos","endLoc","createPositionWithColumnOffset","tokenType","finishTopicReference","testTopicReferenceConfiguration","nodeType","topicReferenceIsAllowedInCurrentContext","PrimaryTopicNotAllowed","PipeTopicUnbound","registerTopicReference","PipeTopicUnconfiguredToken","token","tokenLabelName","topicToken","PipeTopicRequiresHackPipes","functionFlags","params","hasPrecedingLineBreak","LineTerminatorBeforeArrow","curPosition","isAsync","async","oldLabels","labels","PARAM_AWAIT","parseBlock","scope","allowDirectSuper","allowSuperOutsideMethod","SuperNotAllowed","allowSuper","UnexpectedSuper","UnsupportedSuper","createIdentifier","meta","parseMetaProperty","parseFunction","propertyName","UnsupportedMetaProperty","target","onlyValidPropertyName","inModule","ImportMetaOutsideModule","sawUnambiguousESM","parseLiteralAtNode","addExtra","slice","parseLiteral","pattern","flags","val","newArrowHeadScope","innerStartLoc","exprList","spreadStartLoc","optionalCommaStartLoc","spreadNodeStartLoc","parseParenItem","parseRestBinding","checkCommaAfterRest","innerEndLoc","arrowNode","shouldParseArrow","parseArrow","resetEndLocation","wrapParenthesis","expression","createParenthesizedExpressions","takeSurroundingComments","parenExpression","metaProp","inNonArrowFunction","inClass","allowNewTargetOutsideFunction","UnexpectedNewTarget","parseNew","parseNewCallee","args","parseExprList","ImportCallNotNewExpression","parseTemplateElement","isTagged","elemStart","elem","InvalidEscapeSequenceTemplate","firstInvalidTemplateEscapePos","isTail","endOffset","elemEnd","raw","replace","cooked","tail","curElt","quasis","parseTemplateSubstitution","readTemplateContinuation","isPattern","propHash","Object","create","properties","parseBindingProperty","parsePropertyDefinition","isObjectProperty","InvalidRecordProperty","lastTokStart","maybeAsyncOrAccessorProp","isLiteralPropertyName","UnsupportedPropertyDecorator","parseDecorator","isAccessor","parseSpread","method","isGenerator","parsePropertyNamePrefixOperator","parsePropertyName","keyName","kind","AccessorIsGenerator","parseObjPropValue","getGetterSetterExpectedParamCount","getObjectOrClassMethodParams","checkGetterSetterParams","_params","paramCount","BadGetterArity","BadSetterArity","BadSetterRestParameter","parseObjectMethod","finishedProp","parseMethod","parseObjectProperty","parseMaybeDefault","checkReservedWord","cloneIdentifier","InvalidCoverInitializedName","tokenIsKeywordOrIdentifier","UnexpectedPrivateField","initFunction","generator","isConstructor","inClassScope","SCOPE_FUNCTION","SCOPE_SUPER","SCOPE_CLASS","SCOPE_DIRECT_SUPER","parseFunctionParams","parseFunctionBodyAndFinish","canBePattern","isTuple","elements","SCOPE_ARROW","PARAM_IN","setArrowFunctionParameters","parseFunctionBody","toAssignableList","isMethod","allowExpression","isExpression","newExpressionScope","checkParams","oldStrict","currentFlags","PARAM_RETURN","hasStrictModeDirective","nonSimple","isSimpleParamList","IllegalLanguageModeDirective","strictModeChanged","checkIdentifier","BIND_OUTSIDE","isSimpleParameter","i","len","allowDuplicates","isArrowFunction","checkClashes","Set","formalParameters","param","binding","BIND_VAR","allowEmpty","elt","UnexpectedToken","UnexpectedArgumentPlaceholder","liberal","parseIdentifierName","tokenIsKeyword","tokenKeywordOrIdentifierIsKeyword","replaceToken","word","checkKeywords","isBinding","canBeReservedWord","isKeyword","UnexpectedKeyword","keyword","reservedTest","isReservedWord","isStrictBindReservedWord","isStrictReservedWord","UnexpectedReservedWord","reservedWord","YieldBindingIdentifier","AwaitBindingIdentifier","inStaticBlock","AwaitBindingIdentifierInStaticBlock","recordAsyncArrowParametersError","inClassAndNotInNonArrowFunction","ArgumentsInClass","allowAwaitOutsideFunction","inFunction","recordParameterInitializerError","AwaitExpressionFormalParameter","ObsoleteAwaitStar","ambiguousScriptDifferentAst","soloAwait","YieldInParameter","delegating","delegate","PipelineHeadSequenceExpression","childExpr","isSimpleReference","bodyNode","checkSmartPipeTopicBodyEarlyErrors","PipelineBodyNoArrow","PipelineTopicUnused","callback","outerContextTopicState","topicContext","maxNumOfResolvableTopics","maxTopicIndex","withSmartMixTopicForbiddingContext","outerContextSoloAwaitState","prodParamToSet","prodParamToClear","ret","program","revertScopes","initializeScopes","parseProgram","exports","default"],"sources":["../../src/parser/expression.ts"],"sourcesContent":["// A recursive descent parser operates by defining functions for all\n// syntactic elements, and recursively calling those, each function\n// advancing the input stream and returning an AST node. Precedence\n// of constructs (for example, the fact that `!x[1]` means `!(x[1])`\n// instead of `(!x)[1]` is handled by the fact that the parser\n// function that parses unary prefix operators is called first, and\n// in turn calls the function that parses `[]` subscripts — that\n// way, it'll receive the node for `x[1]` already parsed, and wraps\n// *that* in the unary operator node.\n//\n// Acorn uses an [operator precedence parser][opp] to handle binary\n// operator precedence, because it is much more compact than using\n// the technique outlined above, which uses different, nesting\n// functions to specify precedence, for all of the ten binary\n// precedence levels that JavaScript defines.\n//\n// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser\n\nimport {\n tokenCanStartExpression,\n tokenIsAssignment,\n tokenIsIdentifier,\n tokenIsKeywordOrIdentifier,\n tokenIsOperator,\n tokenIsPostfix,\n tokenIsPrefix,\n tokenIsRightAssociative,\n tokenIsTemplate,\n tokenKeywordOrIdentifierIsKeyword,\n tokenLabelName,\n tokenOperatorPrecedence,\n tt,\n type TokenType,\n} from \"../tokenizer/types\";\nimport type * as N from \"../types\";\nimport LValParser from \"./lval\";\nimport {\n isKeyword,\n isReservedWord,\n isStrictReservedWord,\n isStrictBindReservedWord,\n isIdentifierStart,\n canBeReservedWord,\n} from \"../util/identifier\";\nimport {\n type Position,\n createPositionWithColumnOffset,\n} from \"../util/location\";\nimport * as charCodes from \"charcodes\";\nimport {\n BIND_OUTSIDE,\n BIND_VAR,\n SCOPE_ARROW,\n SCOPE_CLASS,\n SCOPE_DIRECT_SUPER,\n SCOPE_FUNCTION,\n SCOPE_SUPER,\n} from \"../util/scopeflags\";\nimport { ExpressionErrors } from \"./util\";\nimport {\n PARAM_AWAIT,\n PARAM_IN,\n PARAM_RETURN,\n functionFlags,\n} from \"../util/production-parameter\";\nimport {\n newArrowHeadScope,\n newAsyncArrowScope,\n newExpressionScope,\n} from \"../util/expression-scope\";\nimport { Errors, type ParseError } from \"../parse-error\";\nimport { UnparenthesizedPipeBodyDescriptions } from \"../parse-error/pipeline-operator-errors\";\nimport { setInnerComments } from \"./comments\";\nimport { cloneIdentifier, type Undone } from \"./node\";\nimport type Parser from \".\";\n\nimport type { SourceType } from \"../options\";\n\nexport default abstract class ExpressionParser extends LValParser {\n // Forward-declaration: defined in statement.js\n abstract parseBlock(\n allowDirectives?: boolean,\n createNewLexicalScope?: boolean,\n afterBlockParse?: (hasStrictModeDirective: boolean) => void,\n ): N.BlockStatement;\n abstract parseClass(\n node: N.Class,\n isStatement: boolean,\n optionalId?: boolean,\n ): N.Class;\n abstract parseDecorators(allowExport?: boolean): void;\n abstract parseFunction<T extends N.NormalFunction>(\n node: T,\n statement?: number,\n allowExpressionBody?: boolean,\n isAsync?: boolean,\n ): T;\n abstract parseFunctionParams(node: N.Function, isConstructor?: boolean): void;\n abstract parseBlockOrModuleBlockBody(\n body: N.Statement[],\n directives: N.Directive[] | null | undefined,\n topLevel: boolean,\n end: TokenType,\n afterBlockParse?: (hasStrictModeDirective: boolean) => void,\n ): void;\n abstract parseProgram(\n program: N.Program,\n end: TokenType,\n sourceType?: SourceType,\n ): N.Program;\n\n // For object literal, check if property __proto__ has been used more than once.\n // If the expression is a destructuring assignment, then __proto__ may appear\n // multiple times. Otherwise, __proto__ is a duplicated key.\n\n // For record expression, check if property __proto__ exists\n\n checkProto(\n prop: N.ObjectMember | N.SpreadElement,\n isRecord: boolean | undefined | null,\n protoRef: {\n used: boolean;\n },\n refExpressionErrors?: ExpressionErrors | null,\n ): void {\n if (\n prop.type === \"SpreadElement\" ||\n this.isObjectMethod(prop) ||\n prop.computed ||\n // @ts-expect-error prop must be an ObjectProperty\n prop.shorthand\n ) {\n return;\n }\n\n const key = prop.key;\n // It is either an Identifier or a String/NumericLiteral\n const name = key.type === \"Identifier\" ? key.name : key.value;\n\n if (name === \"__proto__\") {\n if (isRecord) {\n this.raise(Errors.RecordNoProto, { at: key });\n return;\n }\n if (protoRef.used) {\n if (refExpressionErrors) {\n // Store the first redefinition's position, otherwise ignore because\n // we are parsing ambiguous pattern\n if (refExpressionErrors.doubleProtoLoc === null) {\n refExpressionErrors.doubleProtoLoc = key.loc.start;\n }\n } else {\n this.raise(Errors.DuplicateProto, { at: key });\n }\n }\n\n protoRef.used = true;\n }\n }\n\n shouldExitDescending(expr: N.Expression, potentialArrowAt: number): boolean {\n return (\n expr.type === \"ArrowFunctionExpression\" && expr.start === potentialArrowAt\n );\n }\n\n // Convenience method to parse an Expression only\n getExpression(this: Parser): N.Expression & N.ParserOutput {\n this.enterInitialScopes();\n this.nextToken();\n const expr = this.parseExpression();\n if (!this.match(tt.eof)) {\n this.unexpected();\n }\n // Unlike parseTopLevel, we need to drain remaining commentStacks\n // because the top level node is _not_ Program.\n this.finalizeRemainingComments();\n expr.comments = this.state.comments;\n expr.errors = this.state.errors;\n if (this.options.tokens) {\n expr.tokens = this.tokens;\n }\n // @ts-expect-error fixme: refine types\n return expr;\n }\n\n // ### Expression parsing\n\n // These nest, from the most general expression type at the top to\n // 'atomic', nondivisible expression types at the bottom. Most of\n // the functions will simply let the function (s) below them parse,\n // and, *if* the syntactic construct they handle is present, wrap\n // the AST node that the inner parser gave them in another node.\n\n // Parse a full expression.\n // - `disallowIn`\n // is used to forbid the `in` operator (in for loops initialization expressions)\n // When `disallowIn` is true, the production parameter [In] is not present.\n\n // - `refExpressionErrors `\n // provides reference for storing '=' operator inside shorthand\n // property assignment in contexts where both object expression\n // and object pattern might appear (so it's possible to raise\n // delayed syntax error at correct position).\n\n parseExpression(\n this: Parser,\n disallowIn?: boolean,\n refExpressionErrors?: ExpressionErrors,\n ): N.Expression {\n if (disallowIn) {\n return this.disallowInAnd(() =>\n this.parseExpressionBase(refExpressionErrors),\n );\n }\n return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors));\n }\n\n // https://tc39.es/ecma262/#prod-Expression\n parseExpressionBase(\n this: Parser,\n refExpressionErrors?: ExpressionErrors,\n ): N.Expression {\n const startLoc = this.state.startLoc;\n const expr = this.parseMaybeAssign(refExpressionErrors);\n if (this.match(tt.comma)) {\n const node = this.startNodeAt(startLoc);\n node.expressions = [expr];\n while (this.eat(tt.comma)) {\n node.expressions.push(this.parseMaybeAssign(refExpressionErrors));\n }\n this.toReferencedList(node.expressions);\n return this.finishNode(node, \"SequenceExpression\");\n }\n return expr;\n }\n\n // Set [~In] parameter for assignment expression\n parseMaybeAssignDisallowIn(\n this: Parser,\n refExpressionErrors?: ExpressionErrors | null,\n afterLeftParse?: Function,\n ) {\n return this.disallowInAnd(() =>\n this.parseMaybeAssign(refExpressionErrors, afterLeftParse),\n );\n }\n\n // Set [+In] parameter for assignment expression\n parseMaybeAssignAllowIn(\n this: Parser,\n refExpressionErrors?: ExpressionErrors | null,\n afterLeftParse?: Function,\n ) {\n return this.allowInAnd(() =>\n this.parseMaybeAssign(refExpressionErrors, afterLeftParse),\n );\n }\n\n // This method is only used by\n // the typescript and flow plugins.\n setOptionalParametersError(\n refExpressionErrors: ExpressionErrors,\n resultError?: ParseError<any>,\n ) {\n refExpressionErrors.optionalParametersLoc =\n resultError?.loc ?? this.state.startLoc;\n }\n\n // Parse an assignment expression. This includes applications of\n // operators like `+=`.\n // https://tc39.es/ecma262/#prod-AssignmentExpression\n parseMaybeAssign(\n this: Parser,\n refExpressionErrors?: ExpressionErrors | null,\n afterLeftParse?: Function,\n ): N.Expression {\n const startLoc = this.state.startLoc;\n if (this.isContextual(tt._yield)) {\n if (this.prodParam.hasYield) {\n let left = this.parseYield();\n if (afterLeftParse) {\n left = afterLeftParse.call(this, left, startLoc);\n }\n return left;\n }\n }\n\n let ownExpressionErrors;\n if (refExpressionErrors) {\n ownExpressionErrors = false;\n } else {\n refExpressionErrors = new ExpressionErrors();\n ownExpressionErrors = true;\n }\n const { type } = this.state;\n\n if (type === tt.parenL || tokenIsIdentifier(type)) {\n this.state.potentialArrowAt = this.state.start;\n }\n\n let left = this.parseMaybeConditional(refExpressionErrors);\n if (afterLeftParse) {\n left = afterLeftParse.call(this, left, startLoc);\n }\n if (tokenIsAssignment(this.state.type)) {\n const node = this.startNodeAt<N.AssignmentExpression>(startLoc);\n const operator = this.state.value;\n node.operator = operator;\n\n if (this.match(tt.eq)) {\n this.toAssignable(left, /* isLHS */ true);\n node.left = left;\n\n const startIndex = startLoc.index;\n if (\n refExpressionErrors.doubleProtoLoc != null &&\n refExpressionErrors.doubleProtoLoc.index >= startIndex\n ) {\n refExpressionErrors.doubleProtoLoc = null; // reset because double __proto__ is valid in assignment expression\n }\n if (\n refExpressionErrors.shorthandAssignLoc != null &&\n refExpressionErrors.shorthandAssignLoc.index >= startIndex\n ) {\n refExpressionErrors.shorthandAssignLoc = null; // reset because shorthand default was used correctly\n }\n if (\n refExpressionErrors.privateKeyLoc != null &&\n refExpressionErrors.privateKeyLoc.index >= startIndex\n ) {\n this.checkDestructuringPrivate(refExpressionErrors);\n refExpressionErrors.privateKeyLoc = null; // reset because `({ #x: x })` is an assignable pattern\n }\n } else {\n node.left = left;\n }\n\n this.next();\n node.right = this.parseMaybeAssign();\n this.checkLVal(left, {\n in: this.finishNode(node, \"AssignmentExpression\"),\n });\n // @ts-expect-error todo(flow->ts) improve node types\n return node;\n } else if (ownExpressionErrors) {\n this.checkExpressionErrors(refExpressionErrors, true);\n }\n\n return left;\n }\n\n // Parse a ternary conditional (`?:`) operator.\n // https://tc39.es/ecma262/#prod-ConditionalExpression\n\n parseMaybeConditional(\n this: Parser,\n refExpressionErrors: ExpressionErrors,\n ): N.Expression {\n const startLoc = this.state.startLoc;\n const potentialArrowAt = this.state.potentialArrowAt;\n const expr = this.parseExprOps(refExpressionErrors);\n\n if (this.shouldExitDescending(expr, potentialArrowAt)) {\n return expr;\n }\n\n return this.parseConditional(expr, startLoc, refExpressionErrors);\n }\n\n parseConditional(\n this: Parser,\n expr: N.Expression,\n startLoc: Position,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n refExpressionErrors?: ExpressionErrors | null,\n ): N.Expression {\n if (this.eat(tt.question)) {\n const node = this.startNodeAt(startLoc);\n node.test = expr;\n node.consequent = this.parseMaybeAssignAllowIn();\n this.expect(tt.colon);\n node.alternate = this.parseMaybeAssign();\n return this.finishNode(node, \"ConditionalExpression\");\n }\n return expr;\n }\n\n parseMaybeUnaryOrPrivate(\n this: Parser,\n refExpressionErrors?: ExpressionErrors,\n ): N.Expression | N.PrivateName {\n return this.match(tt.privateName)\n ? this.parsePrivateName()\n : this.parseMaybeUnary(refExpressionErrors);\n }\n\n // Start the precedence parser.\n // https://tc39.es/ecma262/#prod-ShortCircuitExpression\n\n parseExprOps(\n this: Parser,\n refExpressionErrors: ExpressionErrors,\n ): N.Expression {\n const startLoc = this.state.startLoc;\n const potentialArrowAt = this.state.potentialArrowAt;\n const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors);\n\n if (this.shouldExitDescending(expr, potentialArrowAt)) {\n return expr;\n }\n\n return this.parseExprOp(expr, startLoc, -1);\n }\n\n // Parse binary operators with the operator precedence parsing\n // algorithm. `left` is the left-hand side of the operator.\n // `minPrec` provides context that allows the function to stop and\n // defer further parser to one of its callers when it encounters an\n // operator that has a lower precedence than the set it is parsing.\n\n parseExprOp(\n this: Parser,\n left: N.Expression | N.PrivateName,\n leftStartLoc: Position,\n minPrec: number,\n ): N.Expression {\n if (this.isPrivateName(left)) {\n // https://tc39.es/ecma262/#prod-RelationalExpression\n // RelationalExpression [In, Yield, Await]\n // [+In] PrivateIdentifier in ShiftExpression[?Yield, ?Await]\n\n const value = this.getPrivateNameSV(left);\n\n if (\n minPrec >= tokenOperatorPrecedence(tt._in) ||\n !this.prodParam.hasIn ||\n !this.match(tt._in)\n ) {\n this.raise(Errors.PrivateInExpectedIn, {\n at: left,\n identifierName: value,\n });\n }\n\n this.classScope.usePrivateName(value, left.loc.start);\n }\n\n const op = this.state.type;\n if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(tt._in))) {\n let prec = tokenOperatorPrecedence(op);\n if (prec > minPrec) {\n if (op === tt.pipeline) {\n this.expectPlugin(\"pipelineOperator\");\n if (this.state.inFSharpPipelineDirectBody) {\n return left;\n }\n this.checkPipelineAtInfixOperator(left, leftStartLoc);\n }\n const node = this.startNodeAt<N.LogicalExpression | N.BinaryExpression>(\n leftStartLoc,\n );\n node.left = left;\n node.operator = this.state.value;\n\n const logical = op === tt.logicalOR || op === tt.logicalAND;\n const coalesce = op === tt.nullishCoalescing;\n\n if (coalesce) {\n // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions.\n // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error.\n prec = tokenOperatorPrecedence(tt.logicalAND);\n }\n\n this.next();\n\n if (\n op === tt.pipeline &&\n this.hasPlugin([\"pipelineOperator\", { proposal: \"minimal\" }])\n ) {\n if (this.state.type === tt._await && this.prodParam.hasAwait) {\n throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody, {\n at: this.state.startLoc,\n });\n }\n }\n\n node.right = this.parseExprOpRightExpr(op, prec);\n const finishedNode = this.finishNode(\n node,\n logical || coalesce ? \"LogicalExpression\" : \"BinaryExpression\",\n );\n /* this check is for all ?? operators\n * a ?? b && c for this example\n * when op is coalesce and nextOp is logical (&&), throw at the pos of nextOp that it can not be mixed.\n * Symmetrically it also throws when op is logical and nextOp is coalesce\n */\n const nextOp = this.state.type;\n if (\n (coalesce && (nextOp === tt.logicalOR || nextOp === tt.logicalAND)) ||\n (logical && nextOp === tt.nullishCoalescing)\n ) {\n throw this.raise(Errors.MixingCoalesceWithLogical, {\n at: this.state.startLoc,\n });\n }\n\n return this.parseExprOp(finishedNode, leftStartLoc, minPrec);\n }\n }\n return left;\n }\n\n // Helper function for `parseExprOp`. Parse the right-hand side of binary-\n // operator expressions, then apply any operator-specific functions.\n\n parseExprOpRightExpr(\n this: Parser,\n op: TokenType,\n prec: number,\n ): N.Expression {\n const startLoc = this.state.startLoc;\n switch (op) {\n case tt.pipeline:\n switch (this.getPluginOption(\"pipelineOperator\", \"proposal\")) {\n case \"hack\":\n return this.withTopicBindingContext(() => {\n return this.parseHackPipeBody();\n });\n\n case \"smart\":\n return this.withTopicBindingContext(() => {\n if (this.prodParam.hasYield && this.isContextual(tt._yield)) {\n throw this.raise(Errors.PipeBodyIsTighter, {\n at: this.state.startLoc,\n });\n }\n return this.parseSmartPipelineBodyInStyle(\n this.parseExprOpBaseRightExpr(op, prec),\n startLoc,\n );\n });\n\n case \"fsharp\":\n return this.withSoloAwaitPermittingContext(() => {\n return this.parseFSharpPipelineBody(prec);\n });\n }\n\n // Falls through.\n default:\n return this.parseExprOpBaseRightExpr(op, prec);\n }\n }\n\n // Helper function for `parseExprOpRightExpr`. Parse the right-hand side of\n // binary-operator expressions without applying any operator-specific functions.\n\n parseExprOpBaseRightExpr(\n this: Parser,\n op: TokenType,\n prec: number,\n ): N.Expression {\n const startLoc = this.state.startLoc;\n\n return this.parseExprOp(\n this.parseMaybeUnaryOrPrivate(),\n startLoc,\n tokenIsRightAssociative(op) ? prec - 1 : prec,\n );\n }\n\n parseHackPipeBody(this: Parser): N.Expression {\n const { startLoc } = this.state;\n const body = this.parseMaybeAssign();\n const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has(\n // @ts-expect-error TS2345: Argument of type 'string' is not assignable to parameter of type '\"ArrowFunctionExpression\" | \"YieldExpression\" | \"AssignmentExpression\" | \"ConditionalExpression\"'.\n body.type,\n );\n\n // TODO: Check how to handle type casts in Flow and TS once they are supported\n if (requiredParentheses && !body.extra?.parenthesized) {\n this.raise(Errors.PipeUnparenthesizedBody, {\n at: startLoc,\n // @ts-expect-error TS2322: Type 'string' is not assignable to type '\"AssignmentExpression\" | \"ArrowFunctionExpression\" | \"ConditionalExpression\" | \"YieldExpression\"'.\n type: body.type,\n });\n }\n if (!this.topicReferenceWasUsedInCurrentContext()) {\n // A Hack pipe body must use the topic reference at least once.\n this.raise(Errors.PipeTopicUnused, { at: startLoc });\n }\n\n return body;\n }\n\n checkExponentialAfterUnary(\n node: N.AwaitExpression | Undone<N.UnaryExpression>,\n ) {\n if (this.match(tt.exponent)) {\n this.raise(Errors.UnexpectedTokenUnaryExponentiation, {\n at: node.argument,\n });\n }\n }\n\n // Parse unary operators, both prefix and postfix.\n // https://tc39.es/ecma262/#prod-UnaryExpression\n parseMaybeUnary(\n this: Parser,\n refExpressionErrors?: ExpressionErrors | null,\n sawUnary?: boolean,\n ): N.Expression {\n const startLoc = this.state.startLoc;\n const isAwait = this.isContextual(tt._await);\n\n if (isAwait && this.isAwaitAllowed()) {\n this.next();\n const expr = this.parseAwait(startLoc);\n if (!sawUnary) this.checkExponentialAfterUnary(expr);\n return expr;\n }\n const update = this.match(tt.incDec);\n const node = this.startNode<N.UnaryExpression | N.UpdateExpression>();\n if (tokenIsPrefix(this.state.type)) {\n node.operator = this.state.value;\n node.prefix = true;\n\n if (this.match(tt._throw)) {\n this.expectPlugin(\"throwExpressions\");\n }\n const isDelete = this.match(tt._delete);\n this.next();\n\n node.argument = this.parseMaybeUnary(null, true);\n\n this.checkExpressionErrors(refExpressionErrors, true);\n\n if (this.state.strict && isDelete) {\n const arg = node.argument;\n\n if (arg.type === \"Identifier\") {\n this.raise(Errors.StrictDelete, { at: node });\n } else if (this.hasPropertyAsPrivateName(arg)) {\n this.raise(Errors.DeletePrivateField, { at: node });\n }\n }\n\n if (!update) {\n if (!sawUnary) {\n this.checkExponentialAfterUnary(node as Undone<N.UnaryExpression>);\n }\n return this.finishNode(node, \"UnaryExpression\");\n }\n }\n\n const expr = this.parseUpdate(\n // @ts-expect-error using \"Undone\" node as \"done\"\n node,\n update,\n refExpressionErrors,\n );\n\n if (isAwait) {\n const { type } = this.state;\n const startsExpr = this.hasPlugin(\"v8intrinsic\")\n ? tokenCanStartExpression(type)\n : tokenCanStartExpression(type) && !this.match(tt.modulo);\n if (startsExpr && !this.isAmbiguousAwait()) {\n this.raiseOverwrite(Errors.AwaitNotInAsyncContext, { at: startLoc });\n return this.parseAwait(startLoc);\n }\n }\n\n return expr;\n }\n\n // https://tc39.es/ecma262/#prod-UpdateExpression\n parseUpdate(\n this: Parser,\n node: N.Expression,\n update: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.Expression {\n if (update) {\n // @ts-expect-error Type 'Node' is missing the following properties from type 'Undone<UpdateExpression>': prefix, operator, argument\n const updateExpressionNode = node as Undone<N.UpdateExpression>;\n this.checkLVal(updateExpressionNode.argument, {\n in: this.finishNode(updateExpressionNode, \"UpdateExpression\"),\n });\n return node;\n }\n\n const startLoc = this.state.startLoc;\n let expr = this.parseExprSubscripts(refExpressionErrors);\n if (this.checkExpressionErrors(refExpressionErrors, false)) return expr;\n while (tokenIsPostfix(this.state.type) && !this.canInsertSemicolon()) {\n const node = this.startNodeAt<N.UpdateExpression>(startLoc);\n node.operator = this.state.value;\n node.prefix = false;\n node.argument = expr;\n this.next();\n this.checkLVal(expr, {\n in: (expr = this.finishNode(node, \"UpdateExpression\")),\n });\n }\n return expr;\n }\n\n // Parse call, dot, and `[]`-subscript expressions.\n // https://tc39.es/ecma262/#prod-LeftHandSideExpression\n parseExprSubscripts(\n this: Parser,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.Expression {\n const startLoc = this.state.startLoc;\n const potentialArrowAt = this.state.potentialArrowAt;\n const expr = this.parseExprAtom(refExpressionErrors);\n\n if (this.shouldExitDescending(expr, potentialArrowAt)) {\n return expr;\n }\n\n return this.parseSubscripts(expr, startLoc);\n }\n\n parseSubscripts(\n this: Parser,\n base: N.Expression,\n startLoc: Position,\n noCalls?: boolean | null,\n ): N.Expression {\n const state = {\n optionalChainMember: false,\n maybeAsyncArrow: this.atPossibleAsyncArrow(base),\n stop: false,\n };\n do {\n base = this.parseSubscript(base, startLoc, noCalls, state);\n\n // After parsing a subscript, this isn't \"async\" for sure.\n state.maybeAsyncArrow = false;\n } while (!state.stop);\n return base;\n }\n\n /**\n * @param state Set 'state.stop = true' to indicate that we should stop parsing subscripts.\n * state.optionalChainMember to indicate that the member is currently in OptionalChain\n */\n parseSubscript(\n this: Parser,\n base: N.Expression,\n startLoc: Position,\n noCalls: boolean | undefined | null,\n state: N.ParseSubscriptState,\n ): N.Expression {\n const { type } = this.state;\n if (!noCalls && type === tt.doubleColon) {\n return this.parseBind(base, startLoc, noCalls, state);\n } else if (tokenIsTemplate(type)) {\n return this.parseTaggedTemplateExpression(base, startLoc, state);\n }\n\n let optional = false;\n\n if (type === tt.questionDot) {\n if (noCalls) {\n this.raise(Errors.OptionalChainingNoNew, {\n at: this.state.startLoc,\n });\n if (this.lookaheadCharCode() === charCodes.leftParenthesis) {\n // stop at `?.` when parsing `new a?.()`\n state.stop = true;\n return base;\n }\n }\n state.optionalChainMember = optional = true;\n this.next();\n }\n\n if (!noCalls && this.match(tt.parenL)) {\n return this.parseCoverCallAndAsyncArrowHead(\n base,\n startLoc,\n state,\n optional,\n );\n } else {\n const computed = this.eat(tt.bracketL);\n if (computed || optional || this.eat(tt.dot)) {\n return this.parseMember(base, startLoc, state, computed, optional);\n } else {\n state.stop = true;\n return base;\n }\n }\n }\n\n // base[?Yield, ?Await] [ Expression[+In, ?Yield, ?Await] ]\n // base[?Yield, ?Await] . IdentifierName\n // base[?Yield, ?Await] . PrivateIdentifier\n // where `base` is one of CallExpression, MemberExpression and OptionalChain\n parseMember(\n this: Parser,\n base: N.Expression,\n startLoc: Position,\n state: N.ParseSubscriptState,\n computed: boolean,\n optional: boolean,\n ): N.OptionalMemberExpression | N.MemberExpression {\n const node = this.startNodeAt<\n N.OptionalMemberExpression | N.MemberExpression\n >(startLoc);\n node.object = base;\n node.computed = computed;\n if (computed) {\n node.property = this.parseExpression();\n this.expect(tt.bracketR);\n } else if (this.match(tt.privateName)) {\n if (base.type === \"Super\") {\n this.raise(Errors.SuperPrivateField, { at: startLoc });\n }\n this.classScope.usePrivateName(this.state.value, this.state.startLoc);\n node.property = this.parsePrivateName();\n } else {\n node.property = this.parseIdentifier(true);\n }\n\n if (state.optionalChainMember) {\n (node as N.OptionalMemberExpression).optional = optional;\n return this.finishNode(node, \"OptionalMemberExpression\");\n } else {\n return this.finishNode(node, \"MemberExpression\");\n }\n }\n\n // https://github.com/tc39/proposal-bind-operator#syntax\n parseBind(\n this: Parser,\n base: N.Expression,\n startLoc: Position,\n noCalls: boolean | undefined | null,\n state: N.ParseSubscriptState,\n ): N.Expression {\n const node = this.startNodeAt(startLoc);\n node.object = base;\n this.next(); // eat '::'\n node.callee = this.parseNoCallExpr();\n state.stop = true;\n return this.parseSubscripts(\n this.finishNode(node, \"BindExpression\"),\n startLoc,\n noCalls,\n );\n }\n\n // https://tc39.es/ecma262/#prod-CoverCallExpressionAndAsyncArrowHead\n // CoverCallExpressionAndAsyncArrowHead\n // CallExpression[?Yield, ?Await] Arguments[?Yield, ?Await]\n // OptionalChain[?Yield, ?Await] Arguments[?Yield, ?Await]\n parseCoverCallAndAsyncArrowHead(\n this: Parser,\n base: N.Expression,\n startLoc: Position,\n state: N.ParseSubscriptState,\n optional: boolean,\n ): N.Expression {\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n let refExpressionErrors: ExpressionErrors | null = null;\n\n this.state.maybeInArrowParameters = true;\n this.next(); // eat `(`\n\n const node = this.startNodeAt<N.CallExpression | N.OptionalCallExpression>(\n startLoc,\n );\n node.callee = base;\n const { maybeAsyncArrow, optionalChainMember } = state;\n\n if (maybeAsyncArrow) {\n this.expressionScope.enter(newAsyncArrowScope());\n refExpressionErrors = new ExpressionErrors();\n }\n\n if (optionalChainMember) {\n // @ts-expect-error when optionalChainMember is true, node must be an optional call\n node.optional = optional;\n }\n\n if (optional) {\n node.arguments = this.parseCallExpressionArguments(tt.parenR);\n } else {\n node.arguments = this.parseCallExpressionArguments(\n tt.parenR,\n base.type === \"Import\",\n base.type !== \"Super\",\n // @ts-expect-error todo(flow->ts)\n node,\n refExpressionErrors,\n );\n }\n let finishedNode:\n | N.CallExpression\n | N.OptionalCallExpression\n | N.ArrowFunctionExpression = this.finishCallExpression(\n node,\n optionalChainMember,\n );\n\n if (maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) {\n /*:: invariant(refExpressionErrors != null) */\n state.stop = true;\n this.checkDestructuringPrivate(refExpressionErrors);\n this.expressionScope.validateAsPattern();\n this.expressionScope.exit();\n finishedNode = this.parseAsyncArrowFromCallExpression(\n this.startNodeAt<N.ArrowFunctionExpression>(startLoc),\n finishedNode as N.CallExpression,\n );\n } else {\n if (maybeAsyncArrow) {\n this.checkExpressionErrors(refExpressionErrors, true);\n this.expressionScope.exit();\n }\n this.toReferencedArguments(finishedNode);\n }\n\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n\n return finishedNode;\n }\n\n toReferencedArguments(\n node: N.CallExpression | N.OptionalCallExpression,\n isParenthesizedExpr?: boolean,\n ) {\n this.toReferencedListDeep(node.arguments, isParenthesizedExpr);\n }\n\n // MemberExpression [?Yield, ?Await] TemplateLiteral[?Yield, ?Await, +Tagged]\n // CallExpression [?Yield, ?Await] TemplateLiteral[?Yield, ?Await, +Tagged]\n parseTaggedTemplateExpression(\n this: Parser,\n base: N.Expression,\n startLoc: Position,\n state: N.ParseSubscriptState,\n ): N.TaggedTemplateExpression {\n const node = this.startNodeAt<N.TaggedTemplateExpression>(startLoc);\n node.tag = base;\n node.quasi = this.parseTemplate(true);\n if (state.optionalChainMember) {\n this.raise(Errors.OptionalChainingNoTemplate, { at: startLoc });\n }\n return this.finishNode(node, \"TaggedTemplateExpression\");\n }\n\n atPossibleAsyncArrow(base: N.Expression): boolean {\n return (\n base.type === \"Identifier\" &&\n base.name === \"async\" &&\n this.state.lastTokEndLoc.index === base.end &&\n !this.canInsertSemicolon() &&\n // check there are no escape sequences, such as \\u{61}sync\n base.end - base.start === 5 &&\n base.start === this.state.potentialArrowAt\n );\n }\n\n expectImportAttributesPlugin() {\n if (!this.hasPlugin(\"importAssertions\")) {\n this.expectPlugin(\"importAttributes\");\n }\n }\n\n finishCallExpression<T extends N.CallExpression | N.OptionalCallExpression>(\n node: Undone<T>,\n optional: boolean,\n ): T {\n if (node.callee.type === \"Import\") {\n if (node.arguments.length === 2) {\n if (process.env.BABEL_8_BREAKING) {\n this.expectImportAttributesPlugin();\n } else {\n if (!this.hasPlugin(\"moduleAttributes\")) {\n this.expectImportAttributesPlugin();\n }\n }\n }\n if (node.arguments.length === 0 || node.arguments.length > 2) {\n this.raise(Errors.ImportCallArity, {\n at: node,\n maxArgumentCount:\n this.hasPlugin(\"importAttributes\") ||\n this.hasPlugin(\"importAssertions\") ||\n this.hasPlugin(\"moduleAttributes\")\n ? 2\n : 1,\n });\n } else {\n for (const arg of node.arguments) {\n if (arg.type === \"SpreadElement\") {\n this.raise(Errors.ImportCallSpreadArgument, { at: arg });\n }\n }\n }\n }\n return this.finishNode(\n node,\n optional ? \"OptionalCallExpression\" : \"CallExpression\",\n );\n }\n\n parseCallExpressionArguments(\n this: Parser,\n close: TokenType,\n dynamicImport?: boolean,\n allowPlaceholder?: boolean,\n nodeForExtra?: N.Node | null,\n refExpressionErrors?: ExpressionErrors | null,\n ): Array<N.Expression | undefined | null> {\n const elts: N.Expression[] = [];\n let first = true;\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.inFSharpPipelineDirectBody = false;\n\n while (!this.eat(close)) {\n if (first) {\n first = false;\n } else {\n this.expect(tt.comma);\n if (this.match(close)) {\n if (\n dynamicImport &&\n !this.hasPlugin(\"importAttributes\") &&\n !this.hasPlugin(\"importAssertions\") &&\n !this.hasPlugin(\"moduleAttributes\")\n ) {\n this.raise(Errors.ImportCallArgumentTrailingComma, {\n at: this.state.lastTokStartLoc,\n });\n }\n if (nodeForExtra) {\n this.addTrailingCommaExtraToNode(nodeForExtra);\n }\n this.next();\n break;\n }\n }\n\n elts.push(\n this.parseExprListItem(false, refExpressionErrors, allowPlaceholder),\n );\n }\n\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n\n return elts;\n }\n\n shouldParseAsyncArrow(): boolean {\n return this.match(tt.arrow) && !this.canInsertSemicolon();\n }\n\n parseAsyncArrowFromCallExpression(\n this: Parser,\n node: Undone<N.ArrowFunctionExpression>,\n call: N.CallExpression,\n ): N.ArrowFunctionExpression {\n this.resetPreviousNodeTrailingComments(call);\n this.expect(tt.arrow);\n this.parseArrowExpression(\n node,\n call.arguments,\n true,\n call.extra?.trailingCommaLoc,\n );\n // mark inner comments of `async()` as inner comments of `async () =>`\n if (call.innerComments) {\n setInnerComments(node, call.innerComments);\n }\n // mark trailing comments of `async` to be inner comments\n if (call.callee.trailingComments) {\n setInnerComments(node, call.callee.trailingComments);\n }\n return node as N.ArrowFunctionExpression;\n }\n\n // Parse a no-call expression (like argument of `new` or `::` operators).\n // https://tc39.es/ecma262/#prod-MemberExpression\n parseNoCallExpr(this: Parser): N.Expression {\n const startLoc = this.state.startLoc;\n return this.parseSubscripts(this.parseExprAtom(), startLoc, true);\n }\n\n // Parse an atomic expression — either a single token that is an\n // expression, an expression started by a keyword like `function` or\n // `new`, or an expression wrapped in punctuation like `()`, `[]`,\n // or `{}`.\n\n // https://tc39.es/ecma262/#prod-PrimaryExpression\n // https://tc39.es/ecma262/#prod-AsyncArrowFunction\n // PrimaryExpression\n // Super\n // Import\n // AsyncArrowFunction\n\n parseExprAtom(\n this: Parser,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.Expression {\n let node;\n let decorators: N.Decorator[] | null = null;\n\n const { type } = this.state;\n switch (type) {\n case tt._super:\n return this.parseSuper();\n\n case tt._import:\n node = this.startNode<N.MetaProperty | N.Import>();\n this.next();\n\n if (this.match(tt.dot)) {\n return this.parseImportMetaProperty(node as Undone<N.MetaProperty>);\n }\n\n if (!this.match(tt.parenL)) {\n this.raise(Errors.UnsupportedImport, {\n at: this.state.lastTokStartLoc,\n });\n }\n return this.finishNode(node, \"Import\");\n case tt._this:\n node = this.startNode();\n this.next();\n return this.finishNode(node, \"ThisExpression\");\n\n case tt._do: {\n return this.parseDo(this.startNode(), false);\n }\n\n case tt.slash:\n case tt.slashAssign: {\n this.readRegexp();\n return this.parseRegExpLiteral(this.state.value);\n }\n\n case tt.num:\n return this.parseNumericLiteral(this.state.value);\n\n case tt.bigint:\n return this.parseBigIntLiteral(this.state.value);\n\n case tt.decimal:\n return this.parseDecimalLiteral(this.state.value);\n\n case tt.string:\n return this.parseStringLiteral(this.state.value);\n\n case tt._null:\n return this.parseNullLiteral();\n\n case tt._true:\n return this.parseBooleanLiteral(true);\n case tt._false:\n return this.parseBooleanLiteral(false);\n\n case tt.parenL: {\n const canBeArrow = this.state.potentialArrowAt === this.state.start;\n return this.parseParenAndDistinguishExpression(canBeArrow);\n }\n\n case tt.bracketBarL:\n case tt.bracketHashL: {\n return this.parseArrayLike(\n this.state.type === tt.bracketBarL ? tt.bracketBarR : tt.bracketR,\n /* canBePattern */ false,\n /* isTuple */ true,\n );\n }\n case tt.bracketL: {\n return this.parseArrayLike(\n tt.bracketR,\n /* canBePattern */ true,\n /* isTuple */ false,\n refExpressionErrors,\n );\n }\n case tt.braceBarL:\n case tt.braceHashL: {\n return this.parseObjectLike(\n this.state.type === tt.braceBarL ? tt.braceBarR : tt.braceR,\n /* isPattern */ false,\n /* isRecord */ true,\n );\n }\n case tt.braceL: {\n return this.parseObjectLike(\n tt.braceR,\n /* isPattern */ false,\n /* isRecord */ false,\n refExpressionErrors,\n );\n }\n case tt._function:\n return this.parseFunctionOrFunctionSent();\n\n case tt.at:\n decorators = this.parseDecorators();\n // fall through\n case tt._class:\n return this.parseClass(\n this.maybeTakeDecorators(decorators, this.startNode()),\n false,\n );\n\n case tt._new:\n return this.parseNewOrNewTarget();\n\n case tt.templateNonTail:\n case tt.templateTail:\n return this.parseTemplate(false);\n\n // BindExpression[Yield]\n // :: MemberExpression[?Yield]\n case tt.doubleColon: {\n node = this.startNode();\n this.next();\n node.object = null;\n const callee = (node.callee = this.parseNoCallExpr());\n if (callee.type === \"MemberExpression\") {\n return this.finishNode(node, \"BindExpression\");\n } else {\n throw this.raise(Errors.UnsupportedBind, { at: callee });\n }\n }\n\n case tt.privateName: {\n // Standalone private names are only allowed in \"#x in obj\"\n // expressions, and they are directly handled by callers of\n // parseExprOp. If we reach this, the input is always invalid.\n // We can throw a better error message and recover, rather than\n // just throwing \"Unexpected token\" (which is the default\n // behavior of this big switch statement).\n this.raise(Errors.PrivateInExpectedIn, {\n at: this.state.startLoc,\n identifierName: this.state.value,\n });\n return this.parsePrivateName();\n }\n\n case tt.moduloAssign: {\n return this.parseTopicReferenceThenEqualsSign(tt.modulo, \"%\");\n }\n\n case tt.xorAssign: {\n return this.parseTopicReferenceThenEqualsSign(tt.bitwiseXOR, \"^\");\n }\n\n case tt.doubleCaret:\n case tt.doubleAt: {\n return this.parseTopicReference(\"hack\");\n }\n\n case tt.bitwiseXOR:\n case tt.modulo:\n case tt.hash: {\n const pipeProposal = this.getPluginOption(\n \"pipelineOperator\",\n \"proposal\",\n );\n\n if (pipeProposal) {\n return this.parseTopicReference(pipeProposal);\n }\n this.unexpected();\n break;\n }\n\n case tt.lt: {\n const lookaheadCh = this.input.codePointAt(this.nextTokenStart());\n if (\n isIdentifierStart(lookaheadCh) || // Element/Type Parameter <foo>\n lookaheadCh === charCodes.greaterThan // Fragment <>\n ) {\n this.expectOnePlugin([\"jsx\", \"flow\", \"typescript\"]);\n } else {\n this.unexpected();\n }\n break;\n }\n\n default:\n if (tokenIsIdentifier(type)) {\n if (\n this.isContextual(tt._module) &&\n this.lookaheadInLineCharCode() === charCodes.leftCurlyBrace\n ) {\n return this.parseModuleExpression();\n }\n const canBeArrow = this.state.potentialArrowAt === this.state.start;\n const containsEsc = this.state.containsEsc;\n const id = this.parseIdentifier();\n\n if (\n !containsEsc &&\n id.name === \"async\" &&\n !this.canInsertSemicolon()\n ) {\n const { type } = this.state;\n if (type === tt._function) {\n this.resetPreviousNodeTrailingComments(id);\n this.next();\n return this.parseAsyncFunctionExpression(\n this.startNodeAtNode(id),\n );\n } else if (tokenIsIdentifier(type)) {\n // If the next token begins with \"=\", commit to parsing an async\n // arrow function. (Peeking ahead for \"=\" lets us avoid a more\n // expensive full-token lookahead on this common path.)\n if (this.lookaheadCharCode() === charCodes.equalsTo) {\n // although `id` is not used in async arrow unary function,\n // we don't need to reset `async`'s trailing comments because\n // it will be attached to the upcoming async arrow binding identifier\n return this.parseAsyncArrowUnaryFunction(\n this.startNodeAtNode(id),\n );\n } else {\n // Otherwise, treat \"async\" as an identifier and let calling code\n // deal with the current tt.name token.\n return id;\n }\n } else if (type === tt._do) {\n this.resetPreviousNodeTrailingComments(id);\n return this.parseDo(this.startNodeAtNode(id), true);\n }\n }\n\n if (\n canBeArrow &&\n this.match(tt.arrow) &&\n !this.canInsertSemicolon()\n ) {\n this.next();\n return this.parseArrowExpression(\n this.startNodeAtNode(id),\n [id],\n false,\n );\n }\n\n return id;\n } else {\n this.unexpected();\n }\n }\n }\n\n // This helper method should only be called\n // when the parser has reached a potential Hack pipe topic token\n // that is followed by an equals sign.\n // See <https://github.com/js-choi/proposal-hack-pipes>.\n // If we find ^= or %= in an expression position\n // (i.e., the tt.moduloAssign or tt.xorAssign token types), and if the\n // Hack-pipes proposal is active with ^ or % as its topicToken, then the ^ or\n // % could be the topic token (e.g., in x |> ^==y or x |> ^===y), and so we\n // reparse the current token as ^ or %.\n // Otherwise, this throws an unexpected-token error.\n parseTopicReferenceThenEqualsSign(\n topicTokenType: TokenType,\n topicTokenValue: string,\n ): N.Expression {\n const pipeProposal = this.getPluginOption(\"pipelineOperator\", \"proposal\");\n\n if (pipeProposal) {\n // Set the most-recent token to be a topic token\n // given by the tokenType and tokenValue.\n // Now the next readToken() call (in parseTopicReference)\n // will consume that “topic token”.\n this.state.type = topicTokenType;\n this.state.value = topicTokenValue;\n // Rewind the tokenizer to the end of the “topic token”, so that the\n // following token starts at the equals sign after that topic token.\n this.state.pos--;\n this.state.end--;\n // This is safe to do since the preceding character was either ^ or %, and\n // thus not a newline.\n this.state.endLoc = createPositionWithColumnOffset(this.state.endLoc, -1);\n // Now actually consume the topic token.\n return this.parseTopicReference(pipeProposal);\n } else {\n this.unexpected();\n }\n }\n\n // This helper method should only be called\n // when the proposal-pipeline-operator plugin is active,\n // and when the parser has reached a potential Hack pipe topic token.\n // Although a pipe-operator proposal is assumed to be active,\n // its configuration might not match the current token’s type.\n // See <https://github.com/js-choi/proposal-hack-pipes>.\n parseTopicReference(pipeProposal: string): N.Expression {\n const node = this.startNode<N.TopicReference>();\n const startLoc = this.state.startLoc;\n const tokenType = this.state.type;\n\n // Consume the current token.\n this.next();\n\n // If the pipe-operator plugin’s configuration matches the current token’s type,\n // then this will return `node`, will have been finished as a topic reference.\n // Otherwise, this will throw a `PipeTopicUnconfiguredToken` error.\n return this.finishTopicReference(node, startLoc, pipeProposal, tokenType);\n }\n\n // This helper method attempts to finish the given `node`\n // into a topic-reference node for the given `pipeProposal`.\n // See <https://github.com/js-choi/proposal-hack-pipes>.\n //\n // The method assumes that any topic token was consumed before it was called.\n //\n // If the `pipelineOperator` plugin is active,\n // and if the given `tokenType` matches the plugin’s configuration,\n // then this method will return the finished `node`.\n //\n // If the `pipelineOperator` plugin is active,\n // but if the given `tokenType` does not match the plugin’s configuration,\n // then this method will throw a `PipeTopicUnconfiguredToken` error.\n finishTopicReference(\n node: Undone<N.Node>,\n startLoc: Position,\n pipeProposal: string,\n tokenType: TokenType,\n ): N.Expression {\n if (\n this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)\n ) {\n // The token matches the plugin’s configuration.\n // The token is therefore a topic reference.\n\n // Determine the node type for the topic reference\n // that is appropriate for the active pipe-operator proposal.\n const nodeType =\n pipeProposal === \"smart\"\n ? \"PipelinePrimaryTopicReference\"\n : // The proposal must otherwise be \"hack\",\n // as enforced by testTopicReferenceConfiguration.\n \"TopicReference\";\n\n if (!this.topicReferenceIsAllowedInCurrentContext()) {\n this.raise(\n // The topic reference is not allowed in the current context:\n // it is outside of a pipe body.\n // Raise recoverable errors.\n pipeProposal === \"smart\"\n ? Errors.PrimaryTopicNotAllowed\n : // In this case, `pipeProposal === \"hack\"` is true.\n Errors.PipeTopicUnbound,\n { at: startLoc },\n );\n }\n\n // Register the topic reference so that its pipe body knows\n // that its topic was used at least once.\n this.registerTopicReference();\n\n return this.finishNode(node, nodeType);\n } else {\n // The token does not match the plugin’s configuration.\n throw this.raise(Errors.PipeTopicUnconfiguredToken, {\n at: startLoc,\n token: tokenLabelName(tokenType),\n });\n }\n }\n\n // This helper method tests whether the given token type\n // matches the pipelineOperator parser plugin’s configuration.\n // If the active pipe proposal is Hack style,\n // and if the given token is the same as the plugin configuration’s `topicToken`,\n // then this is a valid topic reference.\n // If the active pipe proposal is smart mix,\n // then the topic token must always be `#`.\n // If the active pipe proposal is neither (e.g., \"minimal\" or \"fsharp\"),\n // then an error is thrown.\n testTopicReferenceConfiguration(\n pipeProposal: string,\n startLoc: Position,\n tokenType: TokenType,\n ): boolean {\n switch (pipeProposal) {\n case \"hack\": {\n return this.hasPlugin([\n \"pipelineOperator\",\n {\n // @ts-expect-error token must have a label\n topicToken: tokenLabelName(tokenType),\n },\n ]);\n }\n case \"smart\":\n return tokenType === tt.hash;\n default:\n throw this.raise(Errors.PipeTopicRequiresHackPipes, { at: startLoc });\n }\n }\n\n // async [no LineTerminator here] AsyncArrowBindingIdentifier[?Yield] [no LineTerminator here] => AsyncConciseBody[?In]\n parseAsyncArrowUnaryFunction(\n this: Parser,\n node: Undone<N.ArrowFunctionExpression>,\n ): N.ArrowFunctionExpression {\n // We don't need to push a new ParameterDeclarationScope here since we are sure\n // 1) it is an async arrow, 2) no biding pattern is allowed in params\n this.prodParam.enter(functionFlags(true, this.prodParam.hasYield));\n const params = [this.parseIdentifier()];\n this.prodParam.exit();\n if (this.hasPrecedingLineBreak()) {\n this.raise(Errors.LineTerminatorBeforeArrow, {\n at: this.state.curPosition(),\n });\n }\n this.expect(tt.arrow);\n // let foo = async bar => {};\n return this.parseArrowExpression(node, params, true);\n }\n\n // https://github.com/tc39/proposal-do-expressions\n // https://github.com/tc39/proposal-async-do-expressions\n parseDo(\n this: Parser,\n node: Undone<N.DoExpression>,\n isAsync: boolean,\n ): N.DoExpression {\n this.expectPlugin(\"doExpressions\");\n if (isAsync) {\n this.expectPlugin(\"asyncDoExpressions\");\n }\n node.async = isAsync;\n this.next(); // eat `do`\n const oldLabels = this.state.labels;\n this.state.labels = [];\n if (isAsync) {\n // AsyncDoExpression :\n // async [no LineTerminator here] do Block[~Yield, +Await, ~Return]\n this.prodParam.enter(PARAM_AWAIT);\n node.body = this.parseBlock();\n this.prodParam.exit();\n } else {\n node.body = this.parseBlock();\n }\n\n this.state.labels = oldLabels;\n return this.finishNode(node, \"DoExpression\");\n }\n\n // Parse the `super` keyword\n parseSuper(): N.Super {\n const node = this.startNode<N.Super>();\n this.next(); // eat `super`\n if (\n this.match(tt.parenL) &&\n !this.scope.allowDirectSuper &&\n !this.options.allowSuperOutsideMethod\n ) {\n this.raise(Errors.SuperNotAllowed, { at: node });\n } else if (\n !this.scope.allowSuper &&\n !this.options.allowSuperOutsideMethod\n ) {\n this.raise(Errors.UnexpectedSuper, { at: node });\n }\n\n if (\n !this.match(tt.parenL) &&\n !this.match(tt.bracketL) &&\n !this.match(tt.dot)\n ) {\n this.raise(Errors.UnsupportedSuper, { at: node });\n }\n\n return this.finishNode(node, \"Super\");\n }\n\n parsePrivateName(): N.PrivateName {\n const node = this.startNode<N.PrivateName>();\n const id = this.startNodeAt<N.Identifier>(\n // The position is hardcoded because we merge `#` and name into a single\n // tt.privateName token\n createPositionWithColumnOffset(this.state.startLoc, 1),\n );\n const name = this.state.value;\n this.next(); // eat #name;\n node.id = this.createIdentifier(id, name);\n return this.finishNode(node, \"PrivateName\");\n }\n\n parseFunctionOrFunctionSent(\n this: Parser,\n ): N.FunctionExpression | N.MetaProperty {\n const node = this.startNode<N.FunctionExpression | N.MetaProperty>();\n\n // We do not do parseIdentifier here because when parseFunctionOrFunctionSent\n // is called we already know that the current token is a \"name\" with the value \"function\"\n // This will improve perf a tiny little bit as we do not do validation but more importantly\n // here is that parseIdentifier will remove an item from the expression stack\n // if \"function\" or \"class\" is parsed as identifier (in objects e.g.), which should not happen here.\n this.next(); // eat `function`\n\n if (this.prodParam.hasYield && this.match(tt.dot)) {\n const meta = this.createIdentifier(\n this.startNodeAtNode<N.Identifier>(node),\n \"function\",\n );\n this.next(); // eat `.`\n // https://github.com/tc39/proposal-function.sent#syntax-1\n if (this.match(tt._sent)) {\n this.expectPlugin(\"functionSent\");\n } else if (!this.hasPlugin(\"functionSent\")) {\n // The code wasn't `function.sent` but just `function.`, so a simple error is less confusing.\n this.unexpected();\n }\n return this.parseMetaProperty(\n node as Undone<N.MetaProperty>,\n meta,\n \"sent\",\n );\n }\n return this.parseFunction(node as Undone<N.FunctionExpression>);\n }\n\n parseMetaProperty(\n node: Undone<N.MetaProperty>,\n meta: N.Identifier,\n propertyName: string,\n ): N.MetaProperty {\n node.meta = meta;\n\n const containsEsc = this.state.containsEsc;\n\n node.property = this.parseIdentifier(true);\n\n if (node.property.name !== propertyName || containsEsc) {\n this.raise(Errors.UnsupportedMetaProperty, {\n at: node.property,\n target: meta.name,\n onlyValidPropertyName: propertyName,\n });\n }\n\n return this.finishNode(node, \"MetaProperty\");\n }\n\n // https://tc39.es/ecma262/#prod-ImportMeta\n parseImportMetaProperty(node: Undone<N.MetaProperty>): N.MetaProperty {\n const id = this.createIdentifier(\n this.startNodeAtNode<N.Identifier>(node),\n \"import\",\n );\n this.next(); // eat `.`\n\n if (this.isContextual(tt._meta)) {\n if (!this.inModule) {\n this.raise(Errors.ImportMetaOutsideModule, { at: id });\n }\n this.sawUnambiguousESM = true;\n }\n\n return this.parseMetaProperty(node, id, \"meta\");\n }\n\n parseLiteralAtNode<T extends N.Node>(\n value: any,\n type: T[\"type\"],\n node: any,\n ): T {\n this.addExtra(node, \"rawValue\", value);\n this.addExtra(node, \"raw\", this.input.slice(node.start, this.state.end));\n node.value = value;\n this.next();\n return this.finishNode<T>(node, type);\n }\n\n parseLiteral<T extends N.Node>(value: any, type: T[\"type\"]): T {\n const node = this.startNode();\n return this.parseLiteralAtNode(value, type, node);\n }\n\n parseStringLiteral(value: any) {\n return this.parseLiteral<N.StringLiteral>(value, \"StringLiteral\");\n }\n\n parseNumericLiteral(value: any) {\n return this.parseLiteral<N.NumericLiteral>(value, \"NumericLiteral\");\n }\n\n parseBigIntLiteral(value: any) {\n return this.parseLiteral<N.BigIntLiteral>(value, \"BigIntLiteral\");\n }\n\n parseDecimalLiteral(value: any) {\n return this.parseLiteral<N.DecimalLiteral>(value, \"DecimalLiteral\");\n }\n\n parseRegExpLiteral(value: {\n value: any;\n pattern: string;\n flags: N.RegExpLiteral[\"flags\"];\n }) {\n const node = this.parseLiteral<N.RegExpLiteral>(\n value.value,\n \"RegExpLiteral\",\n );\n node.pattern = value.pattern;\n node.flags = value.flags;\n return node;\n }\n\n parseBooleanLiteral(value: boolean) {\n const node = this.startNode<N.BooleanLiteral>();\n node.value = value;\n this.next();\n return this.finishNode(node, \"BooleanLiteral\");\n }\n\n parseNullLiteral() {\n const node = this.startNode<N.NullLiteral>();\n this.next();\n return this.finishNode(node, \"NullLiteral\");\n }\n\n // https://tc39.es/ecma262/#prod-CoverParenthesizedExpressionAndArrowParameterList\n parseParenAndDistinguishExpression(\n this: Parser,\n canBeArrow: boolean,\n ): N.Expression {\n const startLoc = this.state.startLoc;\n\n let val;\n this.next(); // eat `(`\n this.expressionScope.enter(newArrowHeadScope());\n\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.maybeInArrowParameters = true;\n this.state.inFSharpPipelineDirectBody = false;\n\n const innerStartLoc = this.state.startLoc;\n const exprList: N.Expression[] = [];\n const refExpressionErrors = new ExpressionErrors();\n let first = true;\n let spreadStartLoc;\n let optionalCommaStartLoc;\n\n while (!this.match(tt.parenR)) {\n if (first) {\n first = false;\n } else {\n this.expect(\n tt.comma,\n refExpressionErrors.optionalParametersLoc === null\n ? null\n : refExpressionErrors.optionalParametersLoc,\n );\n if (this.match(tt.parenR)) {\n optionalCommaStartLoc = this.state.startLoc;\n break;\n }\n }\n\n if (this.match(tt.ellipsis)) {\n const spreadNodeStartLoc = this.state.startLoc;\n spreadStartLoc = this.state.startLoc;\n exprList.push(\n this.parseParenItem(this.parseRestBinding(), spreadNodeStartLoc),\n );\n\n if (!this.checkCommaAfterRest(charCodes.rightParenthesis)) {\n break;\n }\n } else {\n exprList.push(\n this.parseMaybeAssignAllowIn(\n refExpressionErrors,\n this.parseParenItem,\n ),\n );\n }\n }\n\n const innerEndLoc = this.state.lastTokEndLoc;\n this.expect(tt.parenR);\n\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n\n let arrowNode = this.startNodeAt<N.ArrowFunctionExpression>(startLoc);\n if (\n canBeArrow &&\n this.shouldParseArrow(exprList) &&\n (arrowNode = this.parseArrow(arrowNode))\n ) {\n this.checkDestructuringPrivate(refExpressionErrors);\n this.expressionScope.validateAsPattern();\n this.expressionScope.exit();\n this.parseArrowExpression(arrowNode, exprList, false);\n // @ts-expect-error todo(flow->ts) improve node types\n return arrowNode;\n }\n this.expressionScope.exit();\n\n if (!exprList.length) {\n this.unexpected(this.state.lastTokStartLoc);\n }\n if (optionalCommaStartLoc) this.unexpected(optionalCommaStartLoc);\n if (spreadStartLoc) this.unexpected(spreadStartLoc);\n this.checkExpressionErrors(refExpressionErrors, true);\n\n this.toReferencedListDeep(exprList, /* isParenthesizedExpr */ true);\n if (exprList.length > 1) {\n val = this.startNodeAt<N.SequenceExpression>(innerStartLoc);\n val.expressions = exprList;\n // finish node at current location so it can pick up comments after `)`\n this.finishNode(val, \"SequenceExpression\");\n this.resetEndLocation(val, innerEndLoc);\n } else {\n val = exprList[0];\n }\n\n return this.wrapParenthesis(\n startLoc,\n // @ts-expect-error todo(flow->ts)\n val,\n );\n }\n\n wrapParenthesis(startLoc: Position, expression: N.Expression): N.Expression {\n if (!this.options.createParenthesizedExpressions) {\n this.addExtra(expression, \"parenthesized\", true);\n this.addExtra(expression, \"parenStart\", startLoc.index);\n\n this.takeSurroundingComments(\n expression,\n startLoc.index,\n this.state.lastTokEndLoc.index,\n );\n\n return expression;\n }\n\n const parenExpression =\n this.startNodeAt<N.ParenthesizedExpression>(startLoc);\n parenExpression.expression = expression;\n return this.finishNode(parenExpression, \"ParenthesizedExpression\");\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- `params` is used in typescript plugin\n shouldParseArrow(params: Array<N.Node>): boolean {\n return !this.canInsertSemicolon();\n }\n\n parseArrow(\n node: Undone<N.ArrowFunctionExpression>,\n ): Undone<N.ArrowFunctionExpression> | undefined {\n if (this.eat(tt.arrow)) {\n return node;\n }\n }\n\n parseParenItem(\n node: N.Expression,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n startLoc: Position,\n ): N.Expression {\n return node;\n }\n\n parseNewOrNewTarget(this: Parser): N.NewExpression | N.MetaProperty {\n const node = this.startNode<N.NewExpression | N.MetaProperty>();\n this.next();\n if (this.match(tt.dot)) {\n // https://tc39.es/ecma262/#prod-NewTarget\n const meta = this.createIdentifier(\n this.startNodeAtNode<N.Identifier>(node),\n \"new\",\n );\n this.next();\n const metaProp = this.parseMetaProperty(\n node as Undone<N.MetaProperty>,\n meta,\n \"target\",\n );\n\n if (\n !this.scope.inNonArrowFunction &&\n !this.scope.inClass &&\n !this.options.allowNewTargetOutsideFunction\n ) {\n this.raise(Errors.UnexpectedNewTarget, { at: metaProp });\n }\n\n return metaProp;\n }\n\n return this.parseNew(node as Undone<N.NewExpression>);\n }\n\n // New's precedence is slightly tricky. It must allow its argument to\n // be a `[]` or dot subscript expression, but not a call — at least,\n // not without wrapping it in parentheses. Thus, it uses the noCalls\n // argument to parseSubscripts to prevent it from consuming the\n // argument list.\n // https://tc39.es/ecma262/#prod-NewExpression\n parseNew(this: Parser, node: Undone<N.NewExpression>): N.NewExpression {\n this.parseNewCallee(node);\n\n if (this.eat(tt.parenL)) {\n const args = this.parseExprList(tt.parenR);\n this.toReferencedList(args);\n // (parseExprList should be all non-null in this case)\n node.arguments = args;\n } else {\n node.arguments = [];\n }\n\n return this.finishNode(node, \"NewExpression\");\n }\n\n parseNewCallee(this: Parser, node: Undone<N.NewExpression>): void {\n node.callee = this.parseNoCallExpr();\n if (node.callee.type === \"Import\") {\n this.raise(Errors.ImportCallNotNewExpression, { at: node.callee });\n }\n }\n\n // Parse template expression.\n\n parseTemplateElement(isTagged: boolean): N.TemplateElement {\n const { start, startLoc, end, value } = this.state;\n const elemStart = start + 1;\n const elem = this.startNodeAt<N.TemplateElement>(\n createPositionWithColumnOffset(startLoc, 1),\n );\n if (value === null) {\n if (!isTagged) {\n this.raise(Errors.InvalidEscapeSequenceTemplate, {\n // FIXME: Adding 1 is probably wrong.\n at: createPositionWithColumnOffset(\n this.state.firstInvalidTemplateEscapePos,\n 1,\n ),\n });\n }\n }\n\n const isTail = this.match(tt.templateTail);\n const endOffset = isTail ? -1 : -2;\n const elemEnd = end + endOffset;\n elem.value = {\n raw: this.input.slice(elemStart, elemEnd).replace(/\\r\\n?/g, \"\\n\"),\n cooked: value === null ? null : value.slice(1, endOffset),\n };\n elem.tail = isTail;\n this.next();\n const finishedNode = this.finishNode(elem, \"TemplateElement\");\n this.resetEndLocation(\n finishedNode,\n createPositionWithColumnOffset(this.state.lastTokEndLoc, endOffset),\n );\n return finishedNode;\n }\n\n // https://tc39.es/ecma262/#prod-TemplateLiteral\n parseTemplate(this: Parser, isTagged: boolean): N.TemplateLiteral {\n const node = this.startNode<N.TemplateLiteral>();\n node.expressions = [];\n let curElt = this.parseTemplateElement(isTagged);\n node.quasis = [curElt];\n while (!curElt.tail) {\n node.expressions.push(this.parseTemplateSubstitution());\n this.readTemplateContinuation();\n node.quasis.push((curElt = this.parseTemplateElement(isTagged)));\n }\n return this.finishNode(node, \"TemplateLiteral\");\n }\n\n // This is overwritten by the TypeScript plugin to parse template types\n parseTemplateSubstitution(this: Parser): N.Expression {\n return this.parseExpression();\n }\n\n // Parse an object literal, binding pattern, or record.\n\n parseObjectLike(\n close: TokenType,\n isPattern: true,\n isRecord?: boolean | null,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ObjectPattern;\n parseObjectLike(\n close: TokenType,\n isPattern: false,\n isRecord?: false | null,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ObjectExpression;\n parseObjectLike(\n close: TokenType,\n isPattern: false,\n isRecord?: true,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.RecordExpression;\n parseObjectLike<T extends N.ObjectPattern | N.ObjectExpression>(\n this: Parser,\n close: TokenType,\n isPattern: boolean,\n isRecord?: boolean | null,\n refExpressionErrors?: ExpressionErrors | null,\n ): T {\n if (isRecord) {\n this.expectPlugin(\"recordAndTuple\");\n }\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.inFSharpPipelineDirectBody = false;\n const propHash: any = Object.create(null);\n let first = true;\n const node = this.startNode<\n N.ObjectExpression | N.ObjectPattern | N.RecordExpression\n >();\n\n node.properties = [];\n this.next();\n\n while (!this.match(close)) {\n if (first) {\n first = false;\n } else {\n this.expect(tt.comma);\n if (this.match(close)) {\n this.addTrailingCommaExtraToNode(\n // @ts-expect-error todo(flow->ts) improve node types\n node,\n );\n break;\n }\n }\n\n let prop;\n if (isPattern) {\n prop = this.parseBindingProperty();\n } else {\n prop = this.parsePropertyDefinition(refExpressionErrors);\n this.checkProto(prop, isRecord, propHash, refExpressionErrors);\n }\n\n if (\n isRecord &&\n !this.isObjectProperty(prop) &&\n prop.type !== \"SpreadElement\"\n ) {\n this.raise(Errors.InvalidRecordProperty, { at: prop });\n }\n\n // @ts-expect-error shorthand may not index prop\n if (prop.shorthand) {\n this.addExtra(prop, \"shorthand\", true);\n }\n\n // @ts-expect-error Fixme: refine typings\n node.properties.push(prop);\n }\n\n this.next();\n\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n let type = \"ObjectExpression\";\n if (isPattern) {\n type = \"ObjectPattern\";\n } else if (isRecord) {\n type = \"RecordExpression\";\n }\n // @ts-expect-error type is well defined\n return this.finishNode(node, type);\n }\n\n addTrailingCommaExtraToNode(node: N.Node): void {\n this.addExtra(node, \"trailingComma\", this.state.lastTokStart);\n this.addExtra(node, \"trailingCommaLoc\", this.state.lastTokStartLoc, false);\n }\n\n // Check grammar production:\n // IdentifierName *_opt PropertyName\n // It is used in `parsePropertyDefinition` to detect AsyncMethod and Accessors\n maybeAsyncOrAccessorProp(prop: Undone<N.ObjectProperty>): boolean {\n return (\n !prop.computed &&\n prop.key.type === \"Identifier\" &&\n (this.isLiteralPropertyName() ||\n this.match(tt.bracketL) ||\n this.match(tt.star))\n );\n }\n\n // https://tc39.es/ecma262/#prod-PropertyDefinition\n parsePropertyDefinition(\n this: Parser,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ObjectMember | N.SpreadElement {\n let decorators = [];\n if (this.match(tt.at)) {\n if (this.hasPlugin(\"decorators\")) {\n this.raise(Errors.UnsupportedPropertyDecorator, {\n at: this.state.startLoc,\n });\n }\n\n // we needn't check if decorators (stage 0) plugin is enabled since it's checked by\n // the call to this.parseDecorator\n while (this.match(tt.at)) {\n decorators.push(this.parseDecorator());\n }\n }\n\n const prop = this.startNode<N.ObjectProperty>();\n let isAsync = false;\n let isAccessor = false;\n let startLoc;\n\n if (this.match(tt.ellipsis)) {\n if (decorators.length) this.unexpected();\n return this.parseSpread();\n }\n\n if (decorators.length) {\n prop.decorators = decorators;\n decorators = [];\n }\n\n prop.method = false;\n\n if (refExpressionErrors) {\n startLoc = this.state.startLoc;\n }\n\n let isGenerator = this.eat(tt.star);\n this.parsePropertyNamePrefixOperator(prop);\n const containsEsc = this.state.containsEsc;\n const key = this.parsePropertyName(prop, refExpressionErrors);\n\n if (!isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) {\n const keyName = key.name;\n // https://tc39.es/ecma262/#prod-AsyncMethod\n // https://tc39.es/ecma262/#prod-AsyncGeneratorMethod\n if (keyName === \"async\" && !this.hasPrecedingLineBreak()) {\n isAsync = true;\n this.resetPreviousNodeTrailingComments(key);\n isGenerator = this.eat(tt.star);\n this.parsePropertyName(prop);\n }\n // get PropertyName[?Yield, ?Await] () { FunctionBody[~Yield, ~Await] }\n // set PropertyName[?Yield, ?Await] ( PropertySetParameterList ) { FunctionBody[~Yield, ~Await] }\n if (keyName === \"get\" || keyName === \"set\") {\n isAccessor = true;\n this.resetPreviousNodeTrailingComments(key);\n prop.kind = keyName;\n if (this.match(tt.star)) {\n isGenerator = true;\n this.raise(Errors.AccessorIsGenerator, {\n at: this.state.curPosition(),\n kind: keyName,\n });\n this.next();\n }\n this.parsePropertyName(prop);\n }\n }\n\n return this.parseObjPropValue(\n prop,\n startLoc,\n isGenerator,\n isAsync,\n false /* isPattern */,\n isAccessor,\n refExpressionErrors,\n );\n }\n\n getGetterSetterExpectedParamCount(\n method: N.ObjectMethod | N.ClassMethod,\n ): number {\n return method.kind === \"get\" ? 0 : 1;\n }\n\n // This exists so we can override within the ESTree plugin\n getObjectOrClassMethodParams(method: N.ObjectMethod | N.ClassMethod) {\n return method.params;\n }\n\n // get methods aren't allowed to have any parameters\n // set methods must have exactly 1 parameter which is not a rest parameter\n checkGetterSetterParams(method: N.ObjectMethod | N.ClassMethod): void {\n const paramCount = this.getGetterSetterExpectedParamCount(method);\n const params = this.getObjectOrClassMethodParams(method);\n\n if (params.length !== paramCount) {\n this.raise(\n method.kind === \"get\" ? Errors.BadGetterArity : Errors.BadSetterArity,\n { at: method },\n );\n }\n\n if (\n method.kind === \"set\" &&\n params[params.length - 1]?.type === \"RestElement\"\n ) {\n this.raise(Errors.BadSetterRestParameter, { at: method });\n }\n }\n\n // https://tc39.es/ecma262/#prod-MethodDefinition\n parseObjectMethod(\n this: Parser,\n prop: Undone<N.ObjectMethod>,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n ): N.ObjectMethod | undefined | null {\n if (isAccessor) {\n // isAccessor implies isAsync: false, isPattern: false, isGenerator: false\n const finishedProp = this.parseMethod(\n prop,\n // This _should_ be false, but with error recovery, we allow it to be\n // set for informational purposes\n isGenerator,\n /* isAsync */ false,\n /* isConstructor */ false,\n false,\n \"ObjectMethod\",\n );\n this.checkGetterSetterParams(finishedProp);\n return finishedProp;\n }\n\n if (isAsync || isGenerator || this.match(tt.parenL)) {\n if (isPattern) this.unexpected();\n prop.kind = \"method\";\n prop.method = true;\n return this.parseMethod(\n prop,\n isGenerator,\n isAsync,\n /* isConstructor */ false,\n false,\n \"ObjectMethod\",\n );\n }\n }\n\n // if `isPattern` is true, parse https://tc39.es/ecma262/#prod-BindingProperty\n // else https://tc39.es/ecma262/#prod-PropertyDefinition\n parseObjectProperty(\n this: Parser,\n prop: Undone<N.ObjectProperty>,\n startLoc: Position | undefined | null,\n isPattern: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ObjectProperty | undefined | null {\n prop.shorthand = false;\n\n if (this.eat(tt.colon)) {\n prop.value = isPattern\n ? this.parseMaybeDefault(this.state.startLoc)\n : this.parseMaybeAssignAllowIn(refExpressionErrors);\n\n return this.finishNode(prop, \"ObjectProperty\");\n }\n\n if (!prop.computed && prop.key.type === \"Identifier\") {\n // PropertyDefinition:\n // IdentifierReference\n // CoverInitializedName\n // Note: `{ eval } = {}` will be checked in `checkLVal` later.\n this.checkReservedWord(prop.key.name, prop.key.loc.start, true, false);\n\n if (isPattern) {\n prop.value = this.parseMaybeDefault(\n startLoc,\n cloneIdentifier(prop.key),\n );\n } else if (this.match(tt.eq)) {\n const shorthandAssignLoc = this.state.startLoc;\n if (refExpressionErrors != null) {\n if (refExpressionErrors.shorthandAssignLoc === null) {\n refExpressionErrors.shorthandAssignLoc = shorthandAssignLoc;\n }\n } else {\n this.raise(Errors.InvalidCoverInitializedName, {\n at: shorthandAssignLoc,\n });\n }\n prop.value = this.parseMaybeDefault(\n startLoc,\n cloneIdentifier(prop.key),\n );\n } else {\n prop.value = cloneIdentifier(prop.key);\n }\n prop.shorthand = true;\n\n return this.finishNode(prop, \"ObjectProperty\");\n }\n }\n\n parseObjPropValue(\n this: Parser,\n prop: Undone<N.ObjectMethod | N.ObjectProperty>,\n startLoc: Position | undefined | null,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ObjectMethod | N.ObjectProperty {\n const node =\n this.parseObjectMethod(\n prop as Undone<N.ObjectMethod>,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n ) ||\n this.parseObjectProperty(\n prop as Undone<N.ObjectProperty>,\n startLoc,\n isPattern,\n refExpressionErrors,\n );\n\n if (!node) this.unexpected();\n\n return node;\n }\n\n // https://tc39.es/ecma262/#prod-PropertyName\n // when refExpressionErrors presents, it will parse private name\n // and record the position of the first private name\n parsePropertyName(\n this: Parser,\n prop:\n | Undone<N.ObjectOrClassMember | N.ClassMember>\n | N.TsNamedTypeElementBase,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.Expression | N.Identifier {\n if (this.eat(tt.bracketL)) {\n (prop as Undone<N.ObjectOrClassMember>).computed = true;\n prop.key = this.parseMaybeAssignAllowIn();\n this.expect(tt.bracketR);\n } else {\n // We check if it's valid for it to be a private name when we push it.\n const { type, value } = this.state;\n let key;\n // most un-computed property names are identifiers\n if (tokenIsKeywordOrIdentifier(type)) {\n key = this.parseIdentifier(true);\n } else {\n switch (type) {\n case tt.num:\n key = this.parseNumericLiteral(value);\n break;\n case tt.string:\n key = this.parseStringLiteral(value);\n break;\n case tt.bigint:\n key = this.parseBigIntLiteral(value);\n break;\n case tt.decimal:\n key = this.parseDecimalLiteral(value);\n break;\n case tt.privateName: {\n // the class private key has been handled in parseClassElementName\n const privateKeyLoc = this.state.startLoc;\n if (refExpressionErrors != null) {\n if (refExpressionErrors.privateKeyLoc === null) {\n refExpressionErrors.privateKeyLoc = privateKeyLoc;\n }\n } else {\n this.raise(Errors.UnexpectedPrivateField, {\n at: privateKeyLoc,\n });\n }\n key = this.parsePrivateName();\n break;\n }\n default:\n this.unexpected();\n }\n }\n (prop as any).key = key;\n if (type !== tt.privateName) {\n // ClassPrivateProperty is never computed, so we don't assign in that case.\n prop.computed = false;\n }\n }\n\n return prop.key;\n }\n\n // Initialize empty function node.\n\n initFunction(node: N.BodilessFunctionOrMethodBase, isAsync: boolean): void {\n node.id = null;\n node.generator = false;\n node.async = isAsync;\n }\n\n // Parse object or class method.\n\n parseMethod<T extends N.ObjectMethod | N.ClassMethod | N.ClassPrivateMethod>(\n this: Parser,\n node: Undone<T>,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowDirectSuper: boolean,\n type: T[\"type\"],\n inClassScope: boolean = false,\n ): T {\n this.initFunction(node, isAsync);\n node.generator = isGenerator;\n this.scope.enter(\n SCOPE_FUNCTION |\n SCOPE_SUPER |\n (inClassScope ? SCOPE_CLASS : 0) |\n (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0),\n );\n this.prodParam.enter(functionFlags(isAsync, node.generator));\n this.parseFunctionParams(node, isConstructor);\n const finishedNode = this.parseFunctionBodyAndFinish(node, type, true);\n this.prodParam.exit();\n this.scope.exit();\n\n return finishedNode;\n }\n\n // parse an array literal or tuple literal\n // https://tc39.es/ecma262/#prod-ArrayLiteral\n // https://tc39.es/proposal-record-tuple/#prod-TupleLiteral\n parseArrayLike(\n this: Parser,\n close: TokenType,\n canBePattern: boolean,\n isTuple: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ArrayExpression | N.TupleExpression {\n if (isTuple) {\n this.expectPlugin(\"recordAndTuple\");\n }\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.inFSharpPipelineDirectBody = false;\n const node = this.startNode<N.ArrayExpression | N.TupleExpression>();\n this.next();\n node.elements = this.parseExprList(\n close,\n /* allowEmpty */ !isTuple,\n refExpressionErrors,\n // @ts-expect-error todo(flow->ts)\n node,\n );\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n return this.finishNode(\n node,\n isTuple ? \"TupleExpression\" : \"ArrayExpression\",\n );\n }\n\n // Parse arrow function expression.\n // If the parameters are provided, they will be converted to an\n // assignable list.\n parseArrowExpression(\n this: Parser,\n node: Undone<N.ArrowFunctionExpression>,\n params: N.Expression[] | undefined | null,\n isAsync: boolean,\n trailingCommaLoc?: Position | null,\n ): N.ArrowFunctionExpression {\n this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);\n let flags = functionFlags(isAsync, false);\n // ConciseBody[In] :\n // [lookahead ≠ {] ExpressionBody[?In, ~Await]\n // { FunctionBody[~Yield, ~Await] }\n if (!this.match(tt.braceL) && this.prodParam.hasIn) {\n flags |= PARAM_IN;\n }\n this.prodParam.enter(flags);\n this.initFunction(node, isAsync);\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n\n if (params) {\n this.state.maybeInArrowParameters = true;\n this.setArrowFunctionParameters(node, params, trailingCommaLoc);\n }\n this.state.maybeInArrowParameters = false;\n this.parseFunctionBody(node, true);\n\n this.prodParam.exit();\n this.scope.exit();\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n\n return this.finishNode(node, \"ArrowFunctionExpression\");\n }\n\n setArrowFunctionParameters(\n node: Undone<N.ArrowFunctionExpression>,\n params: N.Expression[],\n trailingCommaLoc?: Position | null,\n ): void {\n this.toAssignableList(params, trailingCommaLoc, false);\n node.params = params as (N.Pattern | N.TSParameterProperty)[];\n }\n\n parseFunctionBodyAndFinish<\n T extends\n | N.Function\n | N.TSDeclareMethod\n | N.TSDeclareFunction\n | N.ClassPrivateMethod,\n >(node: Undone<T>, type: T[\"type\"], isMethod: boolean = false): T {\n // @ts-expect-error (node is not bodiless if we get here)\n this.parseFunctionBody(node, false, isMethod);\n return this.finishNode(node, type);\n }\n\n // Parse function body and check parameters.\n parseFunctionBody(\n this: Parser,\n node: Undone<N.Function>,\n allowExpression?: boolean | null,\n isMethod: boolean = false,\n ): void {\n const isExpression = allowExpression && !this.match(tt.braceL);\n this.expressionScope.enter(newExpressionScope());\n\n if (isExpression) {\n // https://tc39.es/ecma262/#prod-ExpressionBody\n (node as Undone<N.ArrowFunctionExpression>).body =\n this.parseMaybeAssign();\n this.checkParams(node, false, allowExpression, false);\n } else {\n const oldStrict = this.state.strict;\n // Start a new scope with regard to labels\n // flag (restore them to their old value afterwards).\n const oldLabels = this.state.labels;\n this.state.labels = [];\n\n // FunctionBody[Yield, Await]:\n // StatementList[?Yield, ?Await, +Return] opt\n this.prodParam.enter(this.prodParam.currentFlags() | PARAM_RETURN);\n node.body = this.parseBlock(\n true,\n false,\n // Strict mode function checks after we parse the statements in the function body.\n (hasStrictModeDirective: boolean) => {\n const nonSimple = !this.isSimpleParamList(node.params);\n\n if (hasStrictModeDirective && nonSimple) {\n // This logic is here to align the error location with the ESTree plugin.\n this.raise(Errors.IllegalLanguageModeDirective, {\n at:\n // @ts-expect-error kind may not index node\n (node.kind === \"method\" || node.kind === \"constructor\") &&\n // @ts-expect-error key may not index node\n !!node.key\n ? // @ts-expect-error node.key has been guarded\n node.key.loc.end\n : node,\n });\n }\n\n const strictModeChanged = !oldStrict && this.state.strict;\n\n // Add the params to varDeclaredNames to ensure that an error is thrown\n // if a let/const declaration in the function clashes with one of the params.\n this.checkParams(\n node,\n !this.state.strict && !allowExpression && !isMethod && !nonSimple,\n allowExpression,\n strictModeChanged,\n );\n\n // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'\n if (this.state.strict && node.id) {\n this.checkIdentifier(node.id, BIND_OUTSIDE, strictModeChanged);\n }\n },\n );\n this.prodParam.exit();\n this.state.labels = oldLabels;\n }\n this.expressionScope.exit();\n }\n\n isSimpleParameter(node: N.Pattern | N.TSParameterProperty) {\n return node.type === \"Identifier\";\n }\n\n isSimpleParamList(\n params: ReadonlyArray<N.Pattern | N.TSParameterProperty>,\n ): boolean {\n for (let i = 0, len = params.length; i < len; i++) {\n if (!this.isSimpleParameter(params[i])) return false;\n }\n return true;\n }\n\n checkParams(\n node: Undone<N.Function>,\n allowDuplicates: boolean,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n isArrowFunction?: boolean | null,\n strictModeChanged: boolean = true,\n ): void {\n const checkClashes = !allowDuplicates && new Set<string>();\n // We create a fake node with the \"ephemeral\" type `FormalParameters`[1]\n // since we just store an array of parameters. Perhaps someday we can have\n // something like class FormalParameters extends Array { ... }, which would\n // also be helpful when traversing this node.\n //\n // 1. https://tc39.es/ecma262/#prod-FormalParameters\n const formalParameters = { type: \"FormalParameters\" } as const;\n for (const param of node.params) {\n this.checkLVal(param, {\n in: formalParameters,\n binding: BIND_VAR,\n checkClashes,\n strictModeChanged,\n });\n }\n }\n\n // Parses a comma-separated list of expressions, and returns them as\n // an array. `close` is the token type that ends the list, and\n // `allowEmpty` can be turned on to allow subsequent commas with\n // nothing in between them to be parsed as `null` (which is needed\n // for array literals).\n\n parseExprList(\n this: Parser,\n close: TokenType,\n allowEmpty?: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n nodeForExtra?: N.Node | null,\n ): (N.Expression | null)[] {\n const elts: (N.Expression | null)[] = [];\n let first = true;\n\n while (!this.eat(close)) {\n if (first) {\n first = false;\n } else {\n this.expect(tt.comma);\n if (this.match(close)) {\n if (nodeForExtra) {\n this.addTrailingCommaExtraToNode(nodeForExtra);\n }\n this.next();\n break;\n }\n }\n\n elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors));\n }\n return elts;\n }\n\n parseExprListItem(\n this: Parser,\n allowEmpty?: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n allowPlaceholder?: boolean | null,\n ): N.Expression | null;\n parseExprListItem(\n this: Parser,\n allowEmpty?: false,\n refExpressionErrors?: ExpressionErrors | null,\n allowPlaceholder?: boolean | null,\n ): N.Expression;\n parseExprListItem(\n this: Parser,\n allowEmpty?: boolean | null,\n refExpressionErrors?: ExpressionErrors | null,\n allowPlaceholder?: boolean | null,\n ): N.Expression | null {\n let elt;\n if (this.match(tt.comma)) {\n if (!allowEmpty) {\n this.raise(Errors.UnexpectedToken, {\n at: this.state.curPosition(),\n unexpected: \",\",\n });\n }\n elt = null;\n } else if (this.match(tt.ellipsis)) {\n const spreadNodeStartLoc = this.state.startLoc;\n\n elt = this.parseParenItem(\n this.parseSpread(refExpressionErrors),\n spreadNodeStartLoc,\n );\n } else if (this.match(tt.question)) {\n this.expectPlugin(\"partialApplication\");\n if (!allowPlaceholder) {\n this.raise(Errors.UnexpectedArgumentPlaceholder, {\n at: this.state.startLoc,\n });\n }\n const node = this.startNode();\n this.next();\n elt = this.finishNode(node, \"ArgumentPlaceholder\");\n } else {\n elt = this.parseMaybeAssignAllowIn(\n refExpressionErrors,\n this.parseParenItem,\n );\n }\n return elt;\n }\n\n // Parse the next token as an identifier. If `liberal` is true (used\n // when parsing properties), it will also convert keywords into\n // identifiers.\n // This shouldn't be used to parse the keywords of meta properties, since they\n // are not identifiers and cannot contain escape sequences.\n\n parseIdentifier(liberal?: boolean): N.Identifier {\n const node = this.startNode<N.Identifier>();\n const name = this.parseIdentifierName(liberal);\n\n return this.createIdentifier(node, name);\n }\n\n createIdentifier(\n node: Omit<N.Identifier, \"type\">,\n name: string,\n ): N.Identifier {\n node.name = name;\n node.loc.identifierName = name;\n\n return this.finishNode(node, \"Identifier\");\n }\n\n parseIdentifierName(liberal?: boolean): string {\n let name: string;\n\n const { startLoc, type } = this.state;\n\n if (tokenIsKeywordOrIdentifier(type)) {\n name = this.state.value;\n } else {\n this.unexpected();\n }\n\n const tokenIsKeyword = tokenKeywordOrIdentifierIsKeyword(type);\n\n if (liberal) {\n // If the current token is not used as a keyword, set its type to \"tt.name\".\n // This will prevent this.next() from throwing about unexpected escapes.\n if (tokenIsKeyword) {\n this.replaceToken(tt.name);\n }\n } else {\n this.checkReservedWord(name, startLoc, tokenIsKeyword, false);\n }\n\n this.next();\n\n return name;\n }\n\n checkReservedWord(\n word: string,\n startLoc: Position,\n checkKeywords: boolean,\n isBinding: boolean,\n ): void {\n // Every JavaScript reserved word is 10 characters or less.\n if (word.length > 10) {\n return;\n }\n // Most identifiers are not reservedWord-like, they don't need special\n // treatments afterward, which very likely ends up throwing errors\n if (!canBeReservedWord(word)) {\n return;\n }\n\n if (checkKeywords && isKeyword(word)) {\n this.raise(Errors.UnexpectedKeyword, {\n at: startLoc,\n keyword: word,\n });\n return;\n }\n\n const reservedTest = !this.state.strict\n ? isReservedWord\n : isBinding\n ? isStrictBindReservedWord\n : isStrictReservedWord;\n\n if (reservedTest(word, this.inModule)) {\n this.raise(Errors.UnexpectedReservedWord, {\n at: startLoc,\n reservedWord: word,\n });\n return;\n } else if (word === \"yield\") {\n if (this.prodParam.hasYield) {\n this.raise(Errors.YieldBindingIdentifier, { at: startLoc });\n return;\n }\n } else if (word === \"await\") {\n if (this.prodParam.hasAwait) {\n this.raise(Errors.AwaitBindingIdentifier, { at: startLoc });\n return;\n }\n\n if (this.scope.inStaticBlock) {\n this.raise(Errors.AwaitBindingIdentifierInStaticBlock, {\n at: startLoc,\n });\n return;\n }\n\n this.expressionScope.recordAsyncArrowParametersError({ at: startLoc });\n } else if (word === \"arguments\") {\n if (this.scope.inClassAndNotInNonArrowFunction) {\n this.raise(Errors.ArgumentsInClass, { at: startLoc });\n return;\n }\n }\n }\n\n isAwaitAllowed(): boolean {\n if (this.prodParam.hasAwait) return true;\n if (this.options.allowAwaitOutsideFunction && !this.scope.inFunction) {\n return true;\n }\n return false;\n }\n\n // Parses await expression inside async function.\n\n parseAwait(this: Parser, startLoc: Position): N.AwaitExpression {\n const node = this.startNodeAt<N.AwaitExpression>(startLoc);\n\n this.expressionScope.recordParameterInitializerError(\n Errors.AwaitExpressionFormalParameter,\n {\n // @ts-expect-error todo(flow->ts)\n at: node,\n },\n );\n\n if (this.eat(tt.star)) {\n this.raise(Errors.ObsoleteAwaitStar, { at: node });\n }\n\n if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) {\n if (this.isAmbiguousAwait()) {\n this.ambiguousScriptDifferentAst = true;\n } else {\n this.sawUnambiguousESM = true;\n }\n }\n\n if (!this.state.soloAwait) {\n node.argument = this.parseMaybeUnary(null, true);\n }\n\n return this.finishNode(node, \"AwaitExpression\");\n }\n\n isAmbiguousAwait(): boolean {\n if (this.hasPrecedingLineBreak()) return true;\n const { type } = this.state;\n return (\n // All the following expressions are ambiguous:\n // await + 0, await - 0, await ( 0 ), await [ 0 ], await / 0 /u, await ``, await of []\n type === tt.plusMin ||\n type === tt.parenL ||\n type === tt.bracketL ||\n tokenIsTemplate(type) ||\n (type === tt._of && !this.state.containsEsc) ||\n // Sometimes the tokenizer generates tt.slash for regexps, and this is\n // handler by parseExprAtom\n type === tt.regexp ||\n type === tt.slash ||\n // This code could be parsed both as a modulo operator or as an intrinsic:\n // await %x(0)\n (this.hasPlugin(\"v8intrinsic\") && type === tt.modulo)\n );\n }\n\n // Parses yield expression inside generator.\n\n parseYield(this: Parser): N.YieldExpression {\n const node = this.startNode<N.YieldExpression>();\n\n this.expressionScope.recordParameterInitializerError(\n Errors.YieldInParameter,\n {\n // @ts-expect-error todo(flow->ts)\n at: node,\n },\n );\n\n this.next();\n let delegating = false;\n let argument: N.Expression | null = null;\n if (!this.hasPrecedingLineBreak()) {\n delegating = this.eat(tt.star);\n switch (this.state.type) {\n case tt.semi:\n case tt.eof:\n case tt.braceR:\n case tt.parenR:\n case tt.bracketR:\n case tt.braceBarR:\n case tt.colon:\n case tt.comma:\n // The above is the complete set of tokens that can\n // follow an AssignmentExpression, and none of them\n // can start an AssignmentExpression\n if (!delegating) break;\n /* fallthrough */\n default:\n argument = this.parseMaybeAssign();\n }\n }\n node.delegate = delegating;\n node.argument = argument;\n return this.finishNode(node, \"YieldExpression\");\n }\n\n // Validates a pipeline (for any of the pipeline Babylon plugins) at the point\n // of the infix operator `|>`.\n\n checkPipelineAtInfixOperator(left: N.Expression, leftStartLoc: Position) {\n if (this.hasPlugin([\"pipelineOperator\", { proposal: \"smart\" }])) {\n if (left.type === \"SequenceExpression\") {\n // Ensure that the pipeline head is not a comma-delimited\n // sequence expression.\n this.raise(Errors.PipelineHeadSequenceExpression, {\n at: leftStartLoc,\n });\n }\n }\n }\n\n parseSmartPipelineBodyInStyle(childExpr: N.Expression, startLoc: Position) {\n if (this.isSimpleReference(childExpr)) {\n const bodyNode = this.startNodeAt<N.PipelineBareFunction>(startLoc);\n bodyNode.callee = childExpr;\n return this.finishNode(bodyNode, \"PipelineBareFunction\");\n } else {\n const bodyNode = this.startNodeAt<N.PipelineTopicExpression>(startLoc);\n this.checkSmartPipeTopicBodyEarlyErrors(startLoc);\n bodyNode.expression = childExpr;\n return this.finishNode(bodyNode, \"PipelineTopicExpression\");\n }\n }\n\n isSimpleReference(expression: N.Expression): boolean {\n switch (expression.type) {\n case \"MemberExpression\":\n return (\n !expression.computed && this.isSimpleReference(expression.object)\n );\n case \"Identifier\":\n return true;\n default:\n return false;\n }\n }\n\n // This helper method is to be called immediately\n // after a topic-style smart-mix pipe body is parsed.\n // The `startLoc` is the starting position of the pipe body.\n\n checkSmartPipeTopicBodyEarlyErrors(startLoc: Position): void {\n // If the following token is invalidly `=>`, then throw a human-friendly error\n // instead of something like 'Unexpected token, expected \";\"'.\n // For example, `x => x |> y => #` (assuming `#` is the topic reference)\n // groups into `x => (x |> y) => #`,\n // and `(x |> y) => #` is an invalid arrow function.\n // This is because smart-mix `|>` has tighter precedence than `=>`.\n if (this.match(tt.arrow)) {\n throw this.raise(Errors.PipelineBodyNoArrow, { at: this.state.startLoc });\n }\n\n // A topic-style smart-mix pipe body must use the topic reference at least once.\n if (!this.topicReferenceWasUsedInCurrentContext()) {\n this.raise(Errors.PipelineTopicUnused, { at: startLoc });\n }\n }\n\n // Enable topic references from outer contexts within Hack-style pipe bodies.\n // The function modifies the parser's topic-context state to enable or disable\n // the use of topic references.\n // The function then calls a callback, then resets the parser\n // to the old topic-context state that it had before the function was called.\n\n withTopicBindingContext<T>(callback: () => T): T {\n const outerContextTopicState = this.state.topicContext;\n this.state.topicContext = {\n // Enable the use of the primary topic reference.\n maxNumOfResolvableTopics: 1,\n // Hide the use of any topic references from outer contexts.\n maxTopicIndex: null,\n };\n\n try {\n return callback();\n } finally {\n this.state.topicContext = outerContextTopicState;\n }\n }\n\n // This helper method is used only with the deprecated smart-mix pipe proposal.\n // Disables topic references from outer contexts within syntax constructs\n // such as the bodies of iteration statements.\n // The function modifies the parser's topic-context state to enable or disable\n // the use of topic references with the smartPipelines plugin. They then run a\n // callback, then they reset the parser to the old topic-context state that it\n // had before the function was called.\n\n withSmartMixTopicForbiddingContext<T>(callback: () => T): T {\n if (this.hasPlugin([\"pipelineOperator\", { proposal: \"smart\" }])) {\n // Reset the parser’s topic context only if the smart-mix pipe proposal is active.\n const outerContextTopicState = this.state.topicContext;\n this.state.topicContext = {\n // Disable the use of the primary topic reference.\n maxNumOfResolvableTopics: 0,\n // Hide the use of any topic references from outer contexts.\n maxTopicIndex: null,\n };\n\n try {\n return callback();\n } finally {\n this.state.topicContext = outerContextTopicState;\n }\n } else {\n // If the pipe proposal is \"minimal\", \"fsharp\", or \"hack\",\n // or if no pipe proposal is active,\n // then the callback result is returned\n // without touching any extra parser state.\n return callback();\n }\n }\n\n withSoloAwaitPermittingContext<T>(callback: () => T): T {\n const outerContextSoloAwaitState = this.state.soloAwait;\n this.state.soloAwait = true;\n\n try {\n return callback();\n } finally {\n this.state.soloAwait = outerContextSoloAwaitState;\n }\n }\n\n allowInAnd<T>(callback: () => T): T {\n const flags = this.prodParam.currentFlags();\n const prodParamToSet = PARAM_IN & ~flags;\n if (prodParamToSet) {\n this.prodParam.enter(flags | PARAM_IN);\n try {\n return callback();\n } finally {\n this.prodParam.exit();\n }\n }\n return callback();\n }\n\n disallowInAnd<T>(callback: () => T): T {\n const flags = this.prodParam.currentFlags();\n const prodParamToClear = PARAM_IN & flags;\n if (prodParamToClear) {\n this.prodParam.enter(flags & ~PARAM_IN);\n try {\n return callback();\n } finally {\n this.prodParam.exit();\n }\n }\n return callback();\n }\n\n // Register the use of a topic reference within the current\n // topic-binding context.\n registerTopicReference(): void {\n this.state.topicContext.maxTopicIndex = 0;\n }\n\n topicReferenceIsAllowedInCurrentContext(): boolean {\n return this.state.topicContext.maxNumOfResolvableTopics >= 1;\n }\n\n topicReferenceWasUsedInCurrentContext(): boolean {\n return (\n this.state.topicContext.maxTopicIndex != null &&\n this.state.topicContext.maxTopicIndex >= 0\n );\n }\n\n parseFSharpPipelineBody(this: Parser, prec: number): N.Expression {\n const startLoc = this.state.startLoc;\n\n this.state.potentialArrowAt = this.state.start;\n const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;\n this.state.inFSharpPipelineDirectBody = true;\n\n const ret = this.parseExprOp(\n this.parseMaybeUnaryOrPrivate(),\n startLoc,\n prec,\n );\n\n this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;\n\n return ret;\n }\n\n // https://github.com/tc39/proposal-js-module-blocks\n parseModuleExpression(this: Parser): N.ModuleExpression {\n this.expectPlugin(\"moduleBlocks\");\n const node = this.startNode<N.ModuleExpression>();\n this.next(); // eat \"module\"\n if (!this.match(tt.braceL)) {\n this.unexpected(null, tt.braceL);\n }\n // start program node immediately after `{`\n const program = this.startNodeAt<N.Program>(this.state.endLoc);\n this.next(); // eat `{`\n\n const revertScopes = this.initializeScopes(/** inModule */ true);\n this.enterInitialScopes();\n\n try {\n node.body = this.parseProgram(program, tt.braceR, \"module\");\n } finally {\n revertScopes();\n }\n return this.finishNode<N.ModuleExpression>(node, \"ModuleExpression\");\n }\n\n // Used in Flow plugin\n parsePropertyNamePrefixOperator(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n prop: Undone<N.ObjectOr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;IACjC,MAAM5D,IAAI,GAAG,IAAI,CAACoG,SAAS,CAAqB,CAAC;IACjD,IAAI,CAACpE,IAAI,CAAC,CAAC;IACX,IAAI,CAAC,IAAI,CAAC9C,KAAK,EAAU,CAAC,EAAE;MAC1B,IAAI,CAACC,UAAU,CAAC,IAAI,GAAW,CAAC;IAClC;IAEA,MAAMge,OAAO,GAAG,IAAI,CAACld,WAAW,CAAY,IAAI,CAACX,KAAK,CAAC8O,MAAM,CAAC;IAC9D,IAAI,CAACpM,IAAI,CAAC,CAAC;IAEX,MAAMob,YAAY,GAAG,IAAI,CAACC,gBAAgB,CAAiB,IAAI,CAAC;IAChE,IAAI,CAACte,kBAAkB,CAAC,CAAC;IAEzB,IAAI;MACFiB,IAAI,CAACmF,IAAI,GAAG,IAAI,CAACmY,YAAY,CAACH,OAAO,KAAa,QAAQ,CAAC;IAC7D,CAAC,SAAS;MACRC,YAAY,CAAC,CAAC;IAChB;IACA,OAAO,IAAI,CAAC9c,UAAU,CAAqBN,IAAI,EAAE,kBAAkB,CAAC;EACtE;EAGAuV,+BAA+BA,CAE7BhY,IAAmD,EAC7C,CAAC;AACX;AAACggB,OAAA,CAAAC,OAAA,GAAApgB,gBAAA"} lib/parser/index.js 0000644 00000002222 15120211212 0010234 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _options = require("../options"); var _statement = require("./statement"); var _scope = require("../util/scope"); class Parser extends _statement.default { constructor(options, input) { options = (0, _options.getOptions)(options); super(options, input); this.options = options; this.initializeScopes(); this.plugins = pluginsMap(this.options.plugins); this.filename = options.sourceFilename; } getScopeHandler() { return _scope.default; } parse() { this.enterInitialScopes(); const file = this.startNode(); const program = this.startNode(); this.nextToken(); file.errors = null; this.parseTopLevel(file, program); file.errors = this.state.errors; return file; } } exports.default = Parser; function pluginsMap(plugins) { const pluginMap = new Map(); for (const plugin of plugins) { const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}]; if (!pluginMap.has(name)) pluginMap.set(name, options || {}); } return pluginMap; } //# sourceMappingURL=index.js.map lib/parser/index.js.map 0000644 00000006631 15120211212 0011020 0 ustar 00 {"version":3,"names":["_options","require","_statement","_scope","Parser","StatementParser","constructor","options","input","getOptions","initializeScopes","plugins","pluginsMap","filename","sourceFilename","getScopeHandler","ScopeHandler","parse","enterInitialScopes","file","startNode","program","nextToken","errors","parseTopLevel","state","exports","default","pluginMap","Map","plugin","name","Array","isArray","has","set"],"sources":["../../src/parser/index.ts"],"sourcesContent":["import type { Options } from \"../options\";\nimport type * as N from \"../types\";\nimport type { PluginList } from \"../plugin-utils\";\nimport { getOptions } from \"../options\";\nimport StatementParser from \"./statement\";\nimport ScopeHandler from \"../util/scope\";\n\nexport type PluginsMap = Map<\n string,\n {\n [x: string]: any;\n }\n>;\n\nexport default class Parser extends StatementParser {\n // Forward-declaration so typescript plugin can override jsx plugin\n // todo(flow->ts) - this probably can be removed\n // abstract jsxParseOpeningElementAfterName(\n // node: N.JSXOpeningElement,\n // ): N.JSXOpeningElement;\n\n constructor(options: Options | undefined | null, input: string) {\n options = getOptions(options);\n super(options, input);\n\n this.options = options;\n this.initializeScopes();\n this.plugins = pluginsMap(this.options.plugins);\n this.filename = options.sourceFilename;\n }\n\n // This can be overwritten, for example, by the TypeScript plugin.\n getScopeHandler(): {\n new (...args: any): ScopeHandler;\n } {\n return ScopeHandler;\n }\n\n parse(): N.File {\n this.enterInitialScopes();\n const file = this.startNode() as N.File;\n const program = this.startNode() as N.Program;\n this.nextToken();\n file.errors = null;\n this.parseTopLevel(file, program);\n file.errors = this.state.errors;\n return file;\n }\n}\n\nfunction pluginsMap(plugins: PluginList): PluginsMap {\n const pluginMap: PluginsMap = new Map();\n for (const plugin of plugins) {\n const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}];\n if (!pluginMap.has(name)) pluginMap.set(name, options || {});\n }\n return pluginMap;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,U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SAAS,CAACM,GAAG,CAACH,IAAI,CAAC,EAAEH,SAAS,CAACO,GAAG,CAACJ,IAAI,EAAExB,OAAO,IAAI,CAAC,CAAC,CAAC;EAC9D;EACA,OAAOqB,SAAS;AAClB"} lib/parser/lval.js 0000644 00000033312 15120211212 0010067 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.ParseBindingListFlags = void 0; var _types = require("../tokenizer/types"); var _identifier = require("../util/identifier"); var _node = require("./node"); var _scopeflags = require("../util/scopeflags"); var _parseError = require("../parse-error"); const getOwn = (object, key) => Object.hasOwnProperty.call(object, key) && object[key]; const unwrapParenthesizedExpression = node => { return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node; }; var ParseBindingListFlags = { ALLOW_EMPTY: 1, IS_FUNCTION_PARAMS: 2, IS_CONSTRUCTOR_PARAMS: 4 }; exports.ParseBindingListFlags = ParseBindingListFlags; class LValParser extends _node.NodeUtils { toAssignable(node, isLHS = false) { var _node$extra, _node$extra3; let parenthesized = undefined; if (node.type === "ParenthesizedExpression" || (_node$extra = node.extra) != null && _node$extra.parenthesized) { parenthesized = unwrapParenthesizedExpression(node); if (isLHS) { if (parenthesized.type === "Identifier") { this.expressionScope.recordArrowParameterBindingError(_parseError.Errors.InvalidParenthesizedAssignment, { at: node }); } else if (parenthesized.type !== "MemberExpression") { this.raise(_parseError.Errors.InvalidParenthesizedAssignment, { at: node }); } } else { this.raise(_parseError.Errors.InvalidParenthesizedAssignment, { at: node }); } } switch (node.type) { case "Identifier": case "ObjectPattern": case "ArrayPattern": case "AssignmentPattern": case "RestElement": break; case "ObjectExpression": node.type = "ObjectPattern"; for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) { var _node$extra2; const prop = node.properties[i]; const isLast = i === last; this.toAssignableObjectExpressionProp(prop, isLast, isLHS); if (isLast && prop.type === "RestElement" && (_node$extra2 = node.extra) != null && _node$extra2.trailingCommaLoc) { this.raise(_parseError.Errors.RestTrailingComma, { at: node.extra.trailingCommaLoc }); } } break; case "ObjectProperty": { const { key, value } = node; if (this.isPrivateName(key)) { this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start); } this.toAssignable(value, isLHS); break; } case "SpreadElement": { throw new Error("Internal @babel/parser error (this is a bug, please report it)." + " SpreadElement should be converted by .toAssignable's caller."); } case "ArrayExpression": node.type = "ArrayPattern"; this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingCommaLoc, isLHS); break; case "AssignmentExpression": if (node.operator !== "=") { this.raise(_parseError.Errors.MissingEqInAssignment, { at: node.left.loc.end }); } node.type = "AssignmentPattern"; delete node.operator; this.toAssignable(node.left, isLHS); break; case "ParenthesizedExpression": this.toAssignable(parenthesized, isLHS); break; default: } } toAssignableObjectExpressionProp(prop, isLast, isLHS) { if (prop.type === "ObjectMethod") { this.raise(prop.kind === "get" || prop.kind === "set" ? _parseError.Errors.PatternHasAccessor : _parseError.Errors.PatternHasMethod, { at: prop.key }); } else if (prop.type === "SpreadElement") { prop.type = "RestElement"; const arg = prop.argument; this.checkToRestConversion(arg, false); this.toAssignable(arg, isLHS); if (!isLast) { this.raise(_parseError.Errors.RestTrailingComma, { at: prop }); } } else { this.toAssignable(prop, isLHS); } } toAssignableList(exprList, trailingCommaLoc, isLHS) { const end = exprList.length - 1; for (let i = 0; i <= end; i++) { const elt = exprList[i]; if (!elt) continue; if (elt.type === "SpreadElement") { elt.type = "RestElement"; const arg = elt.argument; this.checkToRestConversion(arg, true); this.toAssignable(arg, isLHS); } else { this.toAssignable(elt, isLHS); } if (elt.type === "RestElement") { if (i < end) { this.raise(_parseError.Errors.RestTrailingComma, { at: elt }); } else if (trailingCommaLoc) { this.raise(_parseError.Errors.RestTrailingComma, { at: trailingCommaLoc }); } } } } isAssignable(node, isBinding) { switch (node.type) { case "Identifier": case "ObjectPattern": case "ArrayPattern": case "AssignmentPattern": case "RestElement": return true; case "ObjectExpression": { const last = node.properties.length - 1; return node.properties.every((prop, i) => { return prop.type !== "ObjectMethod" && (i === last || prop.type !== "SpreadElement") && this.isAssignable(prop); }); } case "ObjectProperty": return this.isAssignable(node.value); case "SpreadElement": return this.isAssignable(node.argument); case "ArrayExpression": return node.elements.every(element => element === null || this.isAssignable(element)); case "AssignmentExpression": return node.operator === "="; case "ParenthesizedExpression": return this.isAssignable(node.expression); case "MemberExpression": case "OptionalMemberExpression": return !isBinding; default: return false; } } toReferencedList(exprList, isParenthesizedExpr) { return exprList; } toReferencedListDeep(exprList, isParenthesizedExpr) { this.toReferencedList(exprList, isParenthesizedExpr); for (const expr of exprList) { if ((expr == null ? void 0 : expr.type) === "ArrayExpression") { this.toReferencedListDeep(expr.elements); } } } parseSpread(refExpressionErrors) { const node = this.startNode(); this.next(); node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined); return this.finishNode(node, "SpreadElement"); } parseRestBinding() { const node = this.startNode(); this.next(); node.argument = this.parseBindingAtom(); return this.finishNode(node, "RestElement"); } parseBindingAtom() { switch (this.state.type) { case 0: { const node = this.startNode(); this.next(); node.elements = this.parseBindingList(3, 93, ParseBindingListFlags.ALLOW_EMPTY); return this.finishNode(node, "ArrayPattern"); } case 5: return this.parseObjectLike(8, true); } return this.parseIdentifier(); } parseBindingList(close, closeCharCode, flags) { const allowEmpty = flags & ParseBindingListFlags.ALLOW_EMPTY; const elts = []; let first = true; while (!this.eat(close)) { if (first) { first = false; } else { this.expect(12); } if (allowEmpty && this.match(12)) { elts.push(null); } else if (this.eat(close)) { break; } else if (this.match(21)) { elts.push(this.parseAssignableListItemTypes(this.parseRestBinding(), flags)); if (!this.checkCommaAfterRest(closeCharCode)) { this.expect(close); break; } } else { const decorators = []; if (this.match(26) && this.hasPlugin("decorators")) { this.raise(_parseError.Errors.UnsupportedParameterDecorator, { at: this.state.startLoc }); } while (this.match(26)) { decorators.push(this.parseDecorator()); } elts.push(this.parseAssignableListItem(flags, decorators)); } } return elts; } parseBindingRestProperty(prop) { this.next(); prop.argument = this.parseIdentifier(); this.checkCommaAfterRest(125); return this.finishNode(prop, "RestElement"); } parseBindingProperty() { const prop = this.startNode(); const { type, startLoc } = this.state; if (type === 21) { return this.parseBindingRestProperty(prop); } else if (type === 136) { this.expectPlugin("destructuringPrivate", startLoc); this.classScope.usePrivateName(this.state.value, startLoc); prop.key = this.parsePrivateName(); } else { this.parsePropertyName(prop); } prop.method = false; return this.parseObjPropValue(prop, startLoc, false, false, true, false); } parseAssignableListItem(flags, decorators) { const left = this.parseMaybeDefault(); this.parseAssignableListItemTypes(left, flags); const elt = this.parseMaybeDefault(left.loc.start, left); if (decorators.length) { left.decorators = decorators; } return elt; } parseAssignableListItemTypes(param, flags) { return param; } parseMaybeDefault(startLoc, left) { var _startLoc, _left; (_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc; left = (_left = left) != null ? _left : this.parseBindingAtom(); if (!this.eat(29)) return left; const node = this.startNodeAt(startLoc); node.left = left; node.right = this.parseMaybeAssignAllowIn(); return this.finishNode(node, "AssignmentPattern"); } isValidLVal(type, isUnparenthesizedInAssign, binding) { return getOwn({ AssignmentPattern: "left", RestElement: "argument", ObjectProperty: "value", ParenthesizedExpression: "expression", ArrayPattern: "elements", ObjectPattern: "properties" }, type); } checkLVal(expression, { in: ancestor, binding = _scopeflags.BIND_NONE, checkClashes = false, strictModeChanged = false, hasParenthesizedAncestor = false }) { var _expression$extra; const type = expression.type; if (this.isObjectMethod(expression)) return; if (type === "MemberExpression") { if (binding !== _scopeflags.BIND_NONE) { this.raise(_parseError.Errors.InvalidPropertyBindingPattern, { at: expression }); } return; } if (type === "Identifier") { this.checkIdentifier(expression, binding, strictModeChanged); const { name } = expression; if (checkClashes) { if (checkClashes.has(name)) { this.raise(_parseError.Errors.ParamDupe, { at: expression }); } else { checkClashes.add(name); } } return; } const validity = this.isValidLVal(type, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding); if (validity === true) return; if (validity === false) { const ParseErrorClass = binding === _scopeflags.BIND_NONE ? _parseError.Errors.InvalidLhs : _parseError.Errors.InvalidLhsBinding; this.raise(ParseErrorClass, { at: expression, ancestor }); return; } const [key, isParenthesizedExpression] = Array.isArray(validity) ? validity : [validity, type === "ParenthesizedExpression"]; const nextAncestor = type === "ArrayPattern" || type === "ObjectPattern" || type === "ParenthesizedExpression" ? { type } : ancestor; for (const child of [].concat(expression[key])) { if (child) { this.checkLVal(child, { in: nextAncestor, binding, checkClashes, strictModeChanged, hasParenthesizedAncestor: isParenthesizedExpression }); } } } checkIdentifier(at, bindingType, strictModeChanged = false) { if (this.state.strict && (strictModeChanged ? (0, _identifier.isStrictBindReservedWord)(at.name, this.inModule) : (0, _identifier.isStrictBindOnlyReservedWord)(at.name))) { if (bindingType === _scopeflags.BIND_NONE) { this.raise(_parseError.Errors.StrictEvalArguments, { at, referenceName: at.name }); } else { this.raise(_parseError.Errors.StrictEvalArgumentsBinding, { at, bindingName: at.name }); } } if (bindingType & _scopeflags.BIND_FLAGS_NO_LET_IN_LEXICAL && at.name === "let") { this.raise(_parseError.Errors.LetInLexicalBinding, { at }); } if (!(bindingType & _scopeflags.BIND_NONE)) { this.declareNameFromIdentifier(at, bindingType); } } declareNameFromIdentifier(identifier, binding) { this.scope.declareName(identifier.name, binding, identifier.loc.start); } checkToRestConversion(node, allowPattern) { switch (node.type) { case "ParenthesizedExpression": this.checkToRestConversion(node.expression, allowPattern); break; case "Identifier": case "MemberExpression": break; case "ArrayExpression": case "ObjectExpression": if (allowPattern) break; default: this.raise(_parseError.Errors.InvalidRestAssignmentPattern, { at: node }); } } checkCommaAfterRest(close) { if (!this.match(12)) { return false; } this.raise(this.lookaheadCharCode() === close ? _parseError.Errors.RestTrailingComma : _parseError.Errors.ElementAfterRest, { at: this.state.startLoc }); return true; } } exports.default = LValParser; //# sourceMappingURL=lval.js.map lib/parser/lval.js.map 0000644 00000116500 15120211212 0010644 0 ustar 00 {"version":3,"names":["_types","require","_identifier","_node","_scopeflags","_parseError","getOwn","object","key","Object","hasOwnProperty","call","unwrapParenthesizedExpression","node","type","expression","ParseBindingListFlags","ALLOW_EMPTY","IS_FUNCTION_PARAMS","IS_CONSTRUCTOR_PARAMS","exports","LValParser","NodeUtils","toAssignable","isLHS","_node$extra","_node$extra3","parenthesized","undefined","extra","expressionScope","recordArrowParameterBindingError","Errors","InvalidParenthesizedAssignment","at","raise","i","length","properties","last","_node$extra2","prop","isLast","toAssignableObjectExpressionProp","trailingCommaLoc","RestTrailingComma","value","isPrivateName","classScope","usePrivateName","getPrivateNameSV","loc","start","Error","toAssignableList","elements","operator","MissingEqInAssignment","left","end","kind","PatternHasAccessor","PatternHasMethod","arg","argument","checkToRestConversion","exprList","elt","isAssignable","isBinding","every","element","toReferencedList","isParenthesizedExpr","toReferencedListDeep","expr","parseSpread","refExpressionErrors","startNode","next","parseMaybeAssignAllowIn","finishNode","parseRestBinding","parseBindingAtom","state","parseBindingList","parseObjectLike","parseIdentifier","close","closeCharCode","flags","allowEmpty","elts","first","eat","expect","match","push","parseAssignableListItemTypes","checkCommaAfterRest","decorators","hasPlugin","UnsupportedParameterDecorator","startLoc","parseDecorator","parseAssignableListItem","parseBindingRestProperty","parseBindingProperty","expectPlugin","parsePrivateName","parsePropertyName","method","parseObjPropValue","parseMaybeDefault","param","_startLoc","_left","startNodeAt","right","isValidLVal","isUnparenthesizedInAssign","binding","AssignmentPattern","RestElement","ObjectProperty","ParenthesizedExpression","ArrayPattern","ObjectPattern","checkLVal","in","ancestor","BIND_NONE","checkClashes","strictModeChanged","hasParenthesizedAncestor","_expression$extra","isObjectMethod","InvalidPropertyBindingPattern","checkIdentifier","name","has","ParamDupe","add","validity","ParseErrorClass","InvalidLhs","InvalidLhsBinding","isParenthesizedExpression","Array","isArray","nextAncestor","child","concat","bindingType","strict","isStrictBindReservedWord","inModule","isStrictBindOnlyReservedWord","StrictEvalArguments","referenceName","StrictEvalArgumentsBinding","bindingName","BIND_FLAGS_NO_LET_IN_LEXICAL","LetInLexicalBinding","declareNameFromIdentifier","identifier","scope","declareName","allowPattern","InvalidRestAssignmentPattern","lookaheadCharCode","ElementAfterRest","default"],"sources":["../../src/parser/lval.ts"],"sourcesContent":["import * as charCodes from \"charcodes\";\nimport { tt, type TokenType } from \"../tokenizer/types\";\nimport type {\n AssignmentPattern,\n TSParameterProperty,\n Decorator,\n Expression,\n Identifier,\n Node,\n Pattern,\n RestElement,\n SpreadElement,\n ObjectOrClassMember,\n ClassMember,\n ObjectMember,\n TsNamedTypeElementBase,\n PrivateName,\n ObjectExpression,\n ObjectPattern,\n ArrayExpression,\n ArrayPattern,\n} from \"../types\";\nimport type { Pos, Position } from \"../util/location\";\nimport {\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n} from \"../util/identifier\";\nimport { NodeUtils, type Undone } from \"./node\";\nimport {\n type BindingTypes,\n BIND_NONE,\n BIND_FLAGS_NO_LET_IN_LEXICAL,\n} from \"../util/scopeflags\";\nimport type { ExpressionErrors } from \"./util\";\nimport { Errors, type LValAncestor } from \"../parse-error\";\nimport type Parser from \"./index\";\n\nconst getOwn = <T extends {}>(object: T, key: keyof T) =>\n Object.hasOwnProperty.call(object, key) && object[key];\n\nconst unwrapParenthesizedExpression = (node: Node): Node => {\n return node.type === \"ParenthesizedExpression\"\n ? unwrapParenthesizedExpression(node.expression)\n : node;\n};\n\nexport const enum ParseBindingListFlags {\n ALLOW_EMPTY = 1 << 0,\n IS_FUNCTION_PARAMS = 1 << 1,\n IS_CONSTRUCTOR_PARAMS = 1 << 2,\n}\n\nexport default abstract class LValParser extends NodeUtils {\n // Forward-declaration: defined in expression.js\n abstract parseIdentifier(liberal?: boolean): Identifier;\n abstract parseMaybeAssign(\n refExpressionErrors?: ExpressionErrors | null,\n afterLeftParse?: Function,\n refNeedsArrowPos?: Pos | null,\n ): Expression;\n\n abstract parseMaybeAssignAllowIn(\n refExpressionErrors?: ExpressionErrors | null,\n afterLeftParse?: Function,\n refNeedsArrowPos?: Pos | null,\n ): Expression;\n\n abstract parseObjectLike<T extends ObjectPattern | ObjectExpression>(\n close: TokenType,\n isPattern: boolean,\n isRecord?: boolean,\n refExpressionErrors?: ExpressionErrors,\n ): T;\n abstract parseObjPropValue(\n prop: any,\n startLoc: Position | null,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): void;\n abstract parsePropertyName(\n prop: ObjectOrClassMember | ClassMember | TsNamedTypeElementBase,\n ): Expression | Identifier;\n abstract parsePrivateName(): PrivateName;\n // Forward-declaration: defined in statement.js\n abstract parseDecorator(): Decorator;\n\n /**\n * Convert existing expression atom to assignable pattern\n * if possible. Also checks invalid destructuring targets:\n *\n * - Parenthesized Destructuring patterns\n * - RestElement is not the last element\n * - Missing `=` in assignment pattern\n *\n * NOTE: There is a corresponding \"isAssignable\" method.\n * When this one is updated, please check if also that one needs to be updated.\n *\n * @param node The expression atom\n * @param isLHS Whether we are parsing a LeftHandSideExpression.\n * If isLHS is `true`, the following cases are allowed: `[(a)] = [0]`, `[(a.b)] = [0]`\n * If isLHS is `false`, we are in an arrow function parameters list.\n */\n toAssignable(node: Node, isLHS: boolean = false): void {\n let parenthesized = undefined;\n if (node.type === \"ParenthesizedExpression\" || node.extra?.parenthesized) {\n parenthesized = unwrapParenthesizedExpression(node);\n if (isLHS) {\n // an LHS can be reinterpreted to a binding pattern but not vice versa.\n // therefore a parenthesized identifier is ambiguous until we are sure it is an assignment expression\n // i.e. `([(a) = []] = []) => {}`\n // see also `recordArrowParameterBindingError` signature in packages/babel-parser/src/util/expression-scope.js\n if (parenthesized.type === \"Identifier\") {\n this.expressionScope.recordArrowParameterBindingError(\n Errors.InvalidParenthesizedAssignment,\n { at: node },\n );\n } else if (parenthesized.type !== \"MemberExpression\") {\n // A parenthesized member expression can be in LHS but not in pattern.\n // If the LHS is later interpreted as a pattern, `checkLVal` will throw for member expression binding\n // i.e. `([(a.b) = []] = []) => {}`\n this.raise(Errors.InvalidParenthesizedAssignment, { at: node });\n }\n } else {\n this.raise(Errors.InvalidParenthesizedAssignment, { at: node });\n }\n }\n\n switch (node.type) {\n case \"Identifier\":\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"AssignmentPattern\":\n case \"RestElement\":\n break;\n\n case \"ObjectExpression\":\n node.type = \"ObjectPattern\";\n for (\n let i = 0, length = node.properties.length, last = length - 1;\n i < length;\n i++\n ) {\n const prop = node.properties[i];\n const isLast = i === last;\n this.toAssignableObjectExpressionProp(prop, isLast, isLHS);\n\n if (\n isLast &&\n prop.type === \"RestElement\" &&\n node.extra?.trailingCommaLoc\n ) {\n this.raise(Errors.RestTrailingComma, {\n at: node.extra.trailingCommaLoc,\n });\n }\n }\n break;\n\n case \"ObjectProperty\": {\n const { key, value } = node;\n if (this.isPrivateName(key)) {\n this.classScope.usePrivateName(\n this.getPrivateNameSV(key),\n key.loc.start,\n );\n }\n this.toAssignable(value, isLHS);\n break;\n }\n\n case \"SpreadElement\": {\n throw new Error(\n \"Internal @babel/parser error (this is a bug, please report it).\" +\n \" SpreadElement should be converted by .toAssignable's caller.\",\n );\n }\n\n case \"ArrayExpression\":\n node.type = \"ArrayPattern\";\n this.toAssignableList(\n node.elements,\n node.extra?.trailingCommaLoc,\n isLHS,\n );\n break;\n\n case \"AssignmentExpression\":\n if (node.operator !== \"=\") {\n this.raise(Errors.MissingEqInAssignment, { at: node.left.loc.end });\n }\n\n node.type = \"AssignmentPattern\";\n delete node.operator;\n this.toAssignable(node.left, isLHS);\n break;\n\n case \"ParenthesizedExpression\":\n /*::invariant (parenthesized !== undefined) */\n this.toAssignable(parenthesized, isLHS);\n break;\n\n default:\n // We don't know how to deal with this node. It will\n // be reported by a later call to checkLVal\n }\n }\n\n toAssignableObjectExpressionProp(\n prop: Node,\n isLast: boolean,\n isLHS: boolean,\n ) {\n if (prop.type === \"ObjectMethod\") {\n this.raise(\n prop.kind === \"get\" || prop.kind === \"set\"\n ? Errors.PatternHasAccessor\n : Errors.PatternHasMethod,\n { at: prop.key },\n );\n } else if (prop.type === \"SpreadElement\") {\n prop.type = \"RestElement\";\n const arg = prop.argument;\n this.checkToRestConversion(arg, /* allowPattern */ false);\n this.toAssignable(arg, isLHS);\n\n if (!isLast) {\n this.raise(Errors.RestTrailingComma, { at: prop });\n }\n } else {\n this.toAssignable(prop, isLHS);\n }\n }\n\n // Convert list of expression atoms to binding list.\n\n toAssignableList(\n exprList: Expression[],\n trailingCommaLoc: Position | undefined | null,\n isLHS: boolean,\n ): void {\n const end = exprList.length - 1;\n\n for (let i = 0; i <= end; i++) {\n const elt = exprList[i];\n if (!elt) continue;\n\n if (elt.type === \"SpreadElement\") {\n elt.type = \"RestElement\";\n const arg = elt.argument;\n this.checkToRestConversion(arg, /* allowPattern */ true);\n this.toAssignable(arg, isLHS);\n } else {\n this.toAssignable(elt, isLHS);\n }\n\n if (elt.type === \"RestElement\") {\n if (i < end) {\n this.raise(Errors.RestTrailingComma, { at: elt });\n } else if (trailingCommaLoc) {\n this.raise(Errors.RestTrailingComma, { at: trailingCommaLoc });\n }\n }\n }\n }\n\n isAssignable(node: Node, isBinding?: boolean): boolean {\n switch (node.type) {\n case \"Identifier\":\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"AssignmentPattern\":\n case \"RestElement\":\n return true;\n\n case \"ObjectExpression\": {\n const last = node.properties.length - 1;\n return (node.properties as ObjectExpression[\"properties\"]).every(\n (prop, i) => {\n return (\n prop.type !== \"ObjectMethod\" &&\n (i === last || prop.type !== \"SpreadElement\") &&\n this.isAssignable(prop)\n );\n },\n );\n }\n\n case \"ObjectProperty\":\n return this.isAssignable(node.value);\n\n case \"SpreadElement\":\n return this.isAssignable(node.argument);\n\n case \"ArrayExpression\":\n return (node as ArrayExpression).elements.every(\n element => element === null || this.isAssignable(element),\n );\n\n case \"AssignmentExpression\":\n return node.operator === \"=\";\n\n case \"ParenthesizedExpression\":\n return this.isAssignable(node.expression);\n\n case \"MemberExpression\":\n case \"OptionalMemberExpression\":\n return !isBinding;\n\n default:\n return false;\n }\n }\n\n // Convert list of expression atoms to a list of\n\n toReferencedList(\n exprList: ReadonlyArray<Expression | undefined | null>,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n isParenthesizedExpr?: boolean,\n ): ReadonlyArray<Expression | undefined | null> {\n return exprList;\n }\n\n toReferencedListDeep(\n exprList: ReadonlyArray<Expression | undefined | null>,\n isParenthesizedExpr?: boolean,\n ): void {\n this.toReferencedList(exprList, isParenthesizedExpr);\n\n for (const expr of exprList) {\n if (expr?.type === \"ArrayExpression\") {\n this.toReferencedListDeep(expr.elements);\n }\n }\n }\n\n // Parses spread element.\n\n parseSpread(\n this: Parser,\n refExpressionErrors?: ExpressionErrors | null,\n ): SpreadElement {\n const node = this.startNode<SpreadElement>();\n this.next();\n node.argument = this.parseMaybeAssignAllowIn(\n refExpressionErrors,\n undefined,\n );\n return this.finishNode(node, \"SpreadElement\");\n }\n\n // https://tc39.es/ecma262/#prod-BindingRestProperty\n // https://tc39.es/ecma262/#prod-BindingRestElement\n parseRestBinding(this: Parser): RestElement {\n const node = this.startNode<RestElement>();\n this.next(); // eat `...`\n node.argument = this.parseBindingAtom();\n return this.finishNode(node, \"RestElement\");\n }\n\n // Parses lvalue (assignable) atom.\n parseBindingAtom(this: Parser): Pattern {\n // https://tc39.es/ecma262/#prod-BindingPattern\n switch (this.state.type) {\n case tt.bracketL: {\n const node = this.startNode<ArrayPattern>();\n this.next();\n // @ts-expect-error: Fixme: TSParameterProperty can not be assigned to node.elements\n node.elements = this.parseBindingList(\n tt.bracketR,\n charCodes.rightSquareBracket,\n ParseBindingListFlags.ALLOW_EMPTY,\n );\n return this.finishNode(node, \"ArrayPattern\");\n }\n\n case tt.braceL:\n return this.parseObjectLike(tt.braceR, true);\n }\n\n // https://tc39.es/ecma262/#prod-BindingIdentifier\n return this.parseIdentifier();\n }\n\n // https://tc39.es/ecma262/#prod-BindingElementList\n parseBindingList(\n this: Parser,\n close: TokenType,\n closeCharCode: (typeof charCodes)[keyof typeof charCodes],\n flags: ParseBindingListFlags,\n ): Array<Pattern | TSParameterProperty> {\n const allowEmpty = flags & ParseBindingListFlags.ALLOW_EMPTY;\n\n const elts: Array<Pattern | TSParameterProperty> = [];\n let first = true;\n while (!this.eat(close)) {\n if (first) {\n first = false;\n } else {\n this.expect(tt.comma);\n }\n if (allowEmpty && this.match(tt.comma)) {\n elts.push(null);\n } else if (this.eat(close)) {\n break;\n } else if (this.match(tt.ellipsis)) {\n elts.push(\n this.parseAssignableListItemTypes(this.parseRestBinding(), flags),\n );\n if (!this.checkCommaAfterRest(closeCharCode)) {\n this.expect(close);\n break;\n }\n } else {\n const decorators = [];\n if (this.match(tt.at) && this.hasPlugin(\"decorators\")) {\n this.raise(Errors.UnsupportedParameterDecorator, {\n at: this.state.startLoc,\n });\n }\n // invariant: hasPlugin(\"decorators-legacy\")\n while (this.match(tt.at)) {\n decorators.push(this.parseDecorator());\n }\n elts.push(this.parseAssignableListItem(flags, decorators));\n }\n }\n return elts;\n }\n\n // https://tc39.es/ecma262/#prod-BindingRestProperty\n parseBindingRestProperty(\n this: Parser,\n prop: Undone<RestElement>,\n ): RestElement {\n this.next(); // eat '...'\n // Don't use parseRestBinding() as we only allow Identifier here.\n prop.argument = this.parseIdentifier();\n this.checkCommaAfterRest(charCodes.rightCurlyBrace);\n return this.finishNode(prop, \"RestElement\");\n }\n\n // https://tc39.es/ecma262/#prod-BindingProperty\n parseBindingProperty(this: Parser): ObjectMember | RestElement {\n const prop = this.startNode<ObjectMember | RestElement>();\n const { type, startLoc } = this.state;\n if (type === tt.ellipsis) {\n return this.parseBindingRestProperty(prop as Undone<RestElement>);\n } else if (type === tt.privateName) {\n this.expectPlugin(\"destructuringPrivate\", startLoc);\n this.classScope.usePrivateName(this.state.value, startLoc);\n (prop as Undone<ObjectMember>).key = this.parsePrivateName();\n } else {\n this.parsePropertyName(prop as Undone<ObjectMember>);\n }\n (prop as Undone<ObjectMember>).method = false;\n return this.parseObjPropValue(\n prop as Undone<ObjectMember>,\n startLoc,\n false /* isGenerator */,\n false /* isAsync */,\n true /* isPattern */,\n false /* isAccessor */,\n );\n }\n\n parseAssignableListItem(\n this: Parser,\n flags: ParseBindingListFlags,\n decorators: Decorator[],\n ): Pattern | TSParameterProperty {\n const left = this.parseMaybeDefault();\n this.parseAssignableListItemTypes(left, flags);\n const elt = this.parseMaybeDefault(left.loc.start, left);\n if (decorators.length) {\n left.decorators = decorators;\n }\n return elt;\n }\n\n // Used by flow/typescript plugin to add type annotations to binding elements\n parseAssignableListItemTypes(\n param: Pattern,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n flags: ParseBindingListFlags,\n ): Pattern {\n return param;\n }\n\n // Parses assignment pattern around given atom if possible.\n // https://tc39.es/ecma262/#prod-BindingElement\n parseMaybeDefault(\n this: Parser,\n startLoc?: Position | null,\n left?: Pattern | null,\n ): Pattern {\n startLoc ??= this.state.startLoc;\n left = left ?? this.parseBindingAtom();\n if (!this.eat(tt.eq)) return left;\n\n const node = this.startNodeAt<AssignmentPattern>(startLoc);\n node.left = left;\n node.right = this.parseMaybeAssignAllowIn();\n return this.finishNode(node, \"AssignmentPattern\");\n }\n /**\n * Return information use in determining whether a Node of a given type is an LVal,\n * possibly given certain additional context information.\n *\n * Subclasser notes: This method has kind of a lot of mixed, but related,\n * responsibilities. If we can definitively determine with the information\n * provided that this either *is* or *isn't* a valid `LVal`, then the return\n * value is easy: just return `true` or `false`. However, if it is a valid\n * LVal *ancestor*, and thus its descendants must be subsequently visited to\n * continue the \"investigation\", then this method should return the relevant\n * child key as a `string`. In some special cases, you additionally want to\n * convey that this node should be treated as if it were parenthesized. In\n * that case, a tuple of [key: string, parenthesized: boolean] is returned.\n * The `string`-only return option is actually just a shorthand for:\n * `[key: string, parenthesized: false]`.\n *\n * @param type A Node `type` string\n * @param isUnparenthesizedInAssign\n * Whether the node in question is unparenthesized and its parent\n * is either an assignment pattern or an assignment expression.\n * @param binding\n * The binding operation that is being considered for this potential\n * LVal.\n * @returns `true` or `false` if we can immediately determine whether the node\n * type in question can be treated as an `LVal`.\n * A `string` key to traverse if we must check this child.\n * A `[string, boolean]` tuple if we need to check this child and\n * treat is as parenthesized.\n */\n isValidLVal(\n type: string,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n isUnparenthesizedInAssign: boolean,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n binding: BindingTypes,\n ): string | boolean {\n return getOwn(\n {\n AssignmentPattern: \"left\",\n RestElement: \"argument\",\n ObjectProperty: \"value\",\n ParenthesizedExpression: \"expression\",\n ArrayPattern: \"elements\",\n ObjectPattern: \"properties\",\n },\n // @ts-expect-error refine string to enum\n type,\n );\n }\n\n /**\n * Verify that a target expression is an lval (something that can be assigned to).\n *\n * @param expression The expression in question to check.\n * @param options A set of options described below.\n * @param options.in\n * The relevant ancestor to provide context information for the error\n * if the check fails.\n * @param options.binding\n * The desired binding type. If the given expression is an identifier\n * and `binding` is not `BIND_NONE`, `checkLVal` will register binding\n * to the parser scope See also `src/util/scopeflags.js`\n * @param options.checkClashes\n * An optional string set to check if an identifier name is included.\n * `checkLVal` will add checked identifier name to `checkClashes` It is\n * used in tracking duplicates in function parameter lists. If it is\n * false, `checkLVal` will skip duplicate checks\n * @param options.strictModeChanged\n * Whether an identifier has been parsed in a sloppy context but should\n * be reinterpreted as strict-mode. e.g. `(arguments) => { \"use strict \"}`\n * @param options.hasParenthesizedAncestor\n * This is only used internally during recursive calls, and you should\n * not have to set it yourself.\n */\n\n checkLVal(\n expression: Expression | ObjectMember | RestElement,\n {\n in: ancestor,\n binding = BIND_NONE,\n checkClashes = false,\n strictModeChanged = false,\n hasParenthesizedAncestor = false,\n }: {\n in: LValAncestor;\n binding?: BindingTypes;\n checkClashes?: Set<string> | false;\n strictModeChanged?: boolean;\n hasParenthesizedAncestor?: boolean;\n },\n ): void {\n const type = expression.type;\n\n // If we find here an ObjectMethod, it's because this was originally\n // an ObjectExpression which has then been converted.\n // toAssignable already reported this error with a nicer message.\n if (this.isObjectMethod(expression)) return;\n\n if (type === \"MemberExpression\") {\n if (binding !== BIND_NONE) {\n this.raise(Errors.InvalidPropertyBindingPattern, { at: expression });\n }\n return;\n }\n\n if (type === \"Identifier\") {\n this.checkIdentifier(\n expression as Identifier,\n binding,\n strictModeChanged,\n );\n\n const { name } = expression as Identifier;\n\n if (checkClashes) {\n if (checkClashes.has(name)) {\n this.raise(Errors.ParamDupe, { at: expression });\n } else {\n checkClashes.add(name);\n }\n }\n\n return;\n }\n\n const validity = this.isValidLVal(\n type,\n !(hasParenthesizedAncestor || expression.extra?.parenthesized) &&\n ancestor.type === \"AssignmentExpression\",\n binding,\n );\n\n if (validity === true) return;\n if (validity === false) {\n const ParseErrorClass =\n binding === BIND_NONE ? Errors.InvalidLhs : Errors.InvalidLhsBinding;\n\n this.raise(ParseErrorClass, { at: expression, ancestor });\n return;\n }\n\n const [key, isParenthesizedExpression] = Array.isArray(validity)\n ? validity\n : [validity, type === \"ParenthesizedExpression\"];\n const nextAncestor =\n type === \"ArrayPattern\" ||\n type === \"ObjectPattern\" ||\n type === \"ParenthesizedExpression\"\n ? ({ type } as const)\n : ancestor;\n\n // @ts-expect-error key may not index expression.\n for (const child of [].concat(expression[key])) {\n if (child) {\n this.checkLVal(child, {\n in: nextAncestor,\n binding,\n checkClashes,\n strictModeChanged,\n hasParenthesizedAncestor: isParenthesizedExpression,\n });\n }\n }\n }\n\n checkIdentifier(\n at: Identifier,\n bindingType: BindingTypes,\n strictModeChanged: boolean = false,\n ) {\n if (\n this.state.strict &&\n (strictModeChanged\n ? isStrictBindReservedWord(at.name, this.inModule)\n : isStrictBindOnlyReservedWord(at.name))\n ) {\n if (bindingType === BIND_NONE) {\n this.raise(Errors.StrictEvalArguments, { at, referenceName: at.name });\n } else {\n this.raise(Errors.StrictEvalArgumentsBinding, {\n at,\n bindingName: at.name,\n });\n }\n }\n\n if (bindingType & BIND_FLAGS_NO_LET_IN_LEXICAL && at.name === \"let\") {\n this.raise(Errors.LetInLexicalBinding, { at });\n }\n\n if (!(bindingType & BIND_NONE)) {\n this.declareNameFromIdentifier(at, bindingType);\n }\n }\n\n declareNameFromIdentifier(identifier: Identifier, binding: BindingTypes) {\n this.scope.declareName(identifier.name, binding, identifier.loc.start);\n }\n\n checkToRestConversion(node: Node, allowPattern: boolean): void {\n switch (node.type) {\n case \"ParenthesizedExpression\":\n this.checkToRestConversion(node.expression, allowPattern);\n break;\n case \"Identifier\":\n case \"MemberExpression\":\n break;\n case \"ArrayExpression\":\n case \"ObjectExpression\":\n if (allowPattern) break;\n /* falls through */\n default:\n this.raise(Errors.InvalidRestAssignmentPattern, { at: node });\n }\n }\n\n checkCommaAfterRest(\n close: (typeof charCodes)[keyof typeof charCodes],\n ): boolean {\n if (!this.match(tt.comma)) {\n return false;\n }\n\n this.raise(\n this.lookaheadCharCode() === close\n ? Errors.RestTrailingComma\n : Errors.ElementAfterRest,\n { at: this.state.startLoc },\n );\n\n return true;\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAsBA,IAAAC,WAAA,GAAAD,OAAA;AAIA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAMA,IAAAI,WAAA,GAAAJ,OAAA;AAGA,MAAMK,MAAM,GAAGA,CAAeC,MAAS,EAAEC,GAAY,KACnDC,MAAM,CAACC,cAAc,CAACC,IAAI,CAACJ,MAAM,EAAEC,GAAG,CAAC,IAAID,MAAM,CAACC,GAAG,CAAC;AAExD,MAAMI,6BAA6B,GAAIC,IAAU,IAAW;EAC1D,OAAOA,IAAI,CAACC,IAAI,KAAK,yBAAyB,GAC1CF,6BAA6B,CAACC,IAAI,CAACE,UAAU,CAAC,GAC9CF,IAAI;AACV,CAAC;AAAC,IAEgBG,qBAAqB;EAAAC,WAAA;EAAAC,kBAAA;EAAAC,qBAAA;AAAA;AAAAC,OAAA,CAAAJ,qBAAA,GAAAA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;IAED,OAAO,IAAI;EACb;AACF;AAACnF,OAAA,CAAAwJ,OAAA,GAAAvJ,UAAA"} lib/parser/node.js 0000644 00000006475 15120211212 0010070 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NodeUtils = void 0; exports.cloneIdentifier = cloneIdentifier; exports.cloneStringLiteral = cloneStringLiteral; var _util = require("./util"); var _location = require("../util/location"); class Node { constructor(parser, pos, loc) { this.type = ""; this.start = pos; this.end = 0; this.loc = new _location.SourceLocation(loc); if (parser != null && parser.options.ranges) this.range = [pos, 0]; if (parser != null && parser.filename) this.loc.filename = parser.filename; } } const NodePrototype = Node.prototype; { NodePrototype.__clone = function () { const newNode = new Node(undefined, this.start, this.loc.start); const keys = Object.keys(this); for (let i = 0, length = keys.length; i < length; i++) { const key = keys[i]; if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") { newNode[key] = this[key]; } } return newNode; }; } function clonePlaceholder(node) { return cloneIdentifier(node); } function cloneIdentifier(node) { const { type, start, end, loc, range, extra, name } = node; const cloned = Object.create(NodePrototype); cloned.type = type; cloned.start = start; cloned.end = end; cloned.loc = loc; cloned.range = range; cloned.extra = extra; cloned.name = name; if (type === "Placeholder") { cloned.expectedNode = node.expectedNode; } return cloned; } function cloneStringLiteral(node) { const { type, start, end, loc, range, extra } = node; if (type === "Placeholder") { return clonePlaceholder(node); } const cloned = Object.create(NodePrototype); cloned.type = type; cloned.start = start; cloned.end = end; cloned.loc = loc; cloned.range = range; if (node.raw !== undefined) { cloned.raw = node.raw; } else { cloned.extra = extra; } cloned.value = node.value; return cloned; } class NodeUtils extends _util.default { startNode() { return new Node(this, this.state.start, this.state.startLoc); } startNodeAt(loc) { return new Node(this, loc.index, loc); } startNodeAtNode(type) { return this.startNodeAt(type.loc.start); } finishNode(node, type) { return this.finishNodeAt(node, type, this.state.lastTokEndLoc); } finishNodeAt(node, type, endLoc) { if (process.env.NODE_ENV !== "production" && node.end > 0) { throw new Error("Do not call finishNode*() twice on the same node." + " Instead use resetEndLocation() or change type directly."); } node.type = type; node.end = endLoc.index; node.loc.end = endLoc; if (this.options.ranges) node.range[1] = endLoc.index; if (this.options.attachComment) this.processComment(node); return node; } resetStartLocation(node, startLoc) { node.start = startLoc.index; node.loc.start = startLoc; if (this.options.ranges) node.range[0] = startLoc.index; } resetEndLocation(node, endLoc = this.state.lastTokEndLoc) { node.end = endLoc.index; node.loc.end = endLoc; if (this.options.ranges) node.range[1] = endLoc.index; } resetStartLocationFromNode(node, locationNode) { this.resetStartLocation(node, locationNode.loc.start); } } exports.NodeUtils = NodeUtils; //# sourceMappingURL=node.js.map lib/parser/node.js.map 0000644 00000023554 15120211212 0010641 0 ustar 00 {"version":3,"names":["_util","require","_location","Node","constructor","parser","pos","loc","type","start","end","SourceLocation","options","ranges","range","filename","NodePrototype","prototype","__clone","newNode","undefined","keys","Object","i","length","key","clonePlaceholder","node","cloneIdentifier","extra","name","cloned","create","expectedNode","cloneStringLiteral","raw","value","NodeUtils","UtilParser","startNode","state","startLoc","startNodeAt","index","startNodeAtNode","finishNode","finishNodeAt","lastTokEndLoc","endLoc","process","env","NODE_ENV","Error","attachComment","processComment","resetStartLocation","resetEndLocation","resetStartLocationFromNode","locationNode","exports"],"sources":["../../src/parser/node.ts"],"sourcesContent":["import type Parser from \"./index\";\nimport UtilParser from \"./util\";\nimport { SourceLocation, type Position } from \"../util/location\";\nimport type { Comment, Node as NodeType, NodeBase } from \"../types\";\n\n// Start an AST node, attaching a start offset.\n\nclass Node implements NodeBase {\n constructor(parser: Parser, pos: number, loc: Position) {\n this.start = pos;\n this.end = 0;\n this.loc = new SourceLocation(loc);\n if (parser?.options.ranges) this.range = [pos, 0];\n if (parser?.filename) this.loc.filename = parser.filename;\n }\n\n type: string = \"\";\n declare start: number;\n declare end: number;\n declare loc: SourceLocation;\n declare range: [number, number];\n declare leadingComments: Array<Comment>;\n declare trailingComments: Array<Comment>;\n declare innerComments: Array<Comment>;\n declare extra: {\n [key: string]: any;\n };\n}\nconst NodePrototype = Node.prototype;\n\nif (!process.env.BABEL_8_BREAKING) {\n // @ts-expect-error __clone is not defined in Node prototype\n NodePrototype.__clone = function (): Node {\n const newNode = new Node(undefined, this.start, this.loc.start);\n const keys = Object.keys(this) as (keyof Node)[];\n for (let i = 0, length = keys.length; i < length; i++) {\n const key = keys[i];\n // Do not clone comments that are already attached to the node\n if (\n key !== \"leadingComments\" &&\n key !== \"trailingComments\" &&\n key !== \"innerComments\"\n ) {\n // @ts-expect-error cloning this to newNode\n newNode[key] = this[key];\n }\n }\n\n return newNode;\n };\n}\n\nfunction clonePlaceholder(node: any): any {\n return cloneIdentifier(node);\n}\n\nexport function cloneIdentifier(node: any): any {\n // We don't need to clone `typeAnnotations` and `optional`: because\n // cloneIdentifier is only used in object shorthand and named import/export.\n // Neither of them allow type annotations after the identifier or optional identifier\n const { type, start, end, loc, range, extra, name } = node;\n const cloned = Object.create(NodePrototype);\n cloned.type = type;\n cloned.start = start;\n cloned.end = end;\n cloned.loc = loc;\n cloned.range = range;\n cloned.extra = extra;\n cloned.name = name;\n if (type === \"Placeholder\") {\n cloned.expectedNode = node.expectedNode;\n }\n return cloned;\n}\n\nexport function cloneStringLiteral(node: any): any {\n const { type, start, end, loc, range, extra } = node;\n if (type === \"Placeholder\") {\n return clonePlaceholder(node);\n }\n const cloned = Object.create(NodePrototype);\n cloned.type = type;\n cloned.start = start;\n cloned.end = end;\n cloned.loc = loc;\n cloned.range = range;\n if (node.raw !== undefined) {\n // estree set node.raw instead of node.extra\n cloned.raw = node.raw;\n } else {\n cloned.extra = extra;\n }\n cloned.value = node.value;\n return cloned;\n}\n\nexport type Undone<T extends NodeType> = Omit<T, \"type\">;\n\nexport abstract class NodeUtils extends UtilParser {\n startNode<T extends NodeType>(): Undone<T> {\n // @ts-expect-error cast Node as Undone<T>\n return new Node(this, this.state.start, this.state.startLoc);\n }\n\n startNodeAt<T extends NodeType>(loc: Position): Undone<T> {\n // @ts-expect-error cast Node as Undone<T>\n return new Node(this, loc.index, loc);\n }\n\n /** Start a new node with a previous node's location. */\n startNodeAtNode<T extends NodeType>(type: Undone<NodeType>): Undone<T> {\n return this.startNodeAt(type.loc.start);\n }\n\n // Finish an AST node, adding `type` and `end` properties.\n\n finishNode<T extends NodeType>(node: Undone<T>, type: T[\"type\"]): T {\n return this.finishNodeAt(node, type, this.state.lastTokEndLoc);\n }\n\n // Finish node at given position\n\n finishNodeAt<T extends NodeType>(\n node: Omit<T, \"type\">,\n type: T[\"type\"],\n endLoc: Position,\n ): T {\n if (process.env.NODE_ENV !== \"production\" && node.end > 0) {\n throw new Error(\n \"Do not call finishNode*() twice on the same node.\" +\n \" Instead use resetEndLocation() or change type directly.\",\n );\n }\n // @ts-expect-error migrate to Babel types AST typings\n node.type = type;\n // @ts-expect-error migrate to Babel types AST typings\n node.end = endLoc.index;\n node.loc.end = endLoc;\n if (this.options.ranges) node.range[1] = endLoc.index;\n if (this.options.attachComment) this.processComment(node as T);\n return node as T;\n }\n\n resetStartLocation(node: NodeBase, startLoc: Position): void {\n node.start = startLoc.index;\n node.loc.start = startLoc;\n if (this.options.ranges) node.range[0] = startLoc.index;\n }\n\n resetEndLocation(\n node: NodeBase,\n endLoc: Position = this.state.lastTokEndLoc,\n ): void {\n node.end = endLoc.index;\n node.loc.end = endLoc;\n if (this.options.ranges) node.range[1] = endLoc.index;\n }\n\n /**\n * Reset the start location of node to the start location of locationNode\n */\n resetStartLocationFromNode(node: NodeBase, locationNode: NodeBase): void {\n this.resetStartLocation(node, locationNode.loc.start);\n }\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,MAAME,IAAI,CAAqB;EAC7BC,WAAWA,CAACC,MAAc,EAAEC,GAAW,EAAEC,GAAa,EAAE;IAAA,KAQxDC,IAAI,GAAW,EAAE;IAPf,IAAI,CAACC,KAAK,GAAGH,GAAG;IAChB,IAAI,CAACI,GAAG,GAAG,CAAC;I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ClB,KAAK,GAAGgC,QAAQ,CAACE,KAAK;IAC3BhB,IAAI,CAACpB,GAAG,CAACE,KAAK,GAAGgC,QAAQ;IACzB,IAAI,IAAI,CAAC7B,OAAO,CAACC,MAAM,EAAEc,IAAI,CAACb,KAAK,CAAC,CAAC,CAAC,GAAG2B,QAAQ,CAACE,KAAK;EACzD;EAEAa,gBAAgBA,CACd7B,IAAc,EACdqB,MAAgB,GAAG,IAAI,CAACR,KAAK,CAACO,aAAa,EACrC;IACNpB,IAAI,CAACjB,GAAG,GAAGsC,MAAM,CAACL,KAAK;IACvBhB,IAAI,CAACpB,GAAG,CAACG,GAAG,GAAGsC,MAAM;IACrB,IAAI,IAAI,CAACpC,OAAO,CAACC,MAAM,EAAEc,IAAI,CAACb,KAAK,CAAC,CAAC,CAAC,GAAGkC,MAAM,CAACL,KAAK;EACvD;EAKAc,0BAA0BA,CAAC9B,IAAc,EAAE+B,YAAsB,EAAQ;IACvE,IAAI,CAACH,kBAAkB,CAAC5B,IAAI,EAAE+B,YAAY,CAACnD,GAAG,CAACE,KAAK,CAAC;EACvD;AACF;AAACkD,OAAA,CAAAtB,SAAA,GAAAA,SAAA"} lib/parser/statement.js 0000644 00000215056 15120211212 0011144 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.ParseStatementFlag = exports.ParseFunctionFlag = void 0; var _types = require("../tokenizer/types"); var _expression = require("./expression"); var _parseError = require("../parse-error"); var _identifier = require("../util/identifier"); var _scopeflags = require("../util/scopeflags"); var _util = require("./util"); var _productionParameter = require("../util/production-parameter"); var _expressionScope = require("../util/expression-scope"); var _tokenizer = require("../tokenizer"); var _location = require("../util/location"); var _node = require("./node"); var _lval = require("./lval"); const loopLabel = { kind: "loop" }, switchLabel = { kind: "switch" }; var ParseFunctionFlag = { Expression: 0, Declaration: 1, HangingDeclaration: 2, NullableId: 4, Async: 8 }; exports.ParseFunctionFlag = ParseFunctionFlag; var ParseStatementFlag = { StatementOnly: 0, AllowImportExport: 1, AllowDeclaration: 2, AllowFunctionDeclaration: 4, AllowLabeledFunction: 8 }; exports.ParseStatementFlag = ParseStatementFlag; const loneSurrogate = /[\uD800-\uDFFF]/u; const keywordRelationalOperator = /in(?:stanceof)?/y; function babel7CompatTokens(tokens, input) { for (let i = 0; i < tokens.length; i++) { const token = tokens[i]; const { type } = token; if (typeof type === "number") { { if (type === 136) { const { loc, start, value, end } = token; const hashEndPos = start + 1; const hashEndLoc = (0, _location.createPositionWithColumnOffset)(loc.start, 1); tokens.splice(i, 1, new _tokenizer.Token({ type: (0, _types.getExportedToken)(27), value: "#", start: start, end: hashEndPos, startLoc: loc.start, endLoc: hashEndLoc }), new _tokenizer.Token({ type: (0, _types.getExportedToken)(130), value: value, start: hashEndPos, end: end, startLoc: hashEndLoc, endLoc: loc.end })); i++; continue; } if ((0, _types.tokenIsTemplate)(type)) { const { loc, start, value, end } = token; const backquoteEnd = start + 1; const backquoteEndLoc = (0, _location.createPositionWithColumnOffset)(loc.start, 1); let startToken; if (input.charCodeAt(start) === 96) { startToken = new _tokenizer.Token({ type: (0, _types.getExportedToken)(22), value: "`", start: start, end: backquoteEnd, startLoc: loc.start, endLoc: backquoteEndLoc }); } else { startToken = new _tokenizer.Token({ type: (0, _types.getExportedToken)(8), value: "}", start: start, end: backquoteEnd, startLoc: loc.start, endLoc: backquoteEndLoc }); } let templateValue, templateElementEnd, templateElementEndLoc, endToken; if (type === 24) { templateElementEnd = end - 1; templateElementEndLoc = (0, _location.createPositionWithColumnOffset)(loc.end, -1); templateValue = value === null ? null : value.slice(1, -1); endToken = new _tokenizer.Token({ type: (0, _types.getExportedToken)(22), value: "`", start: templateElementEnd, end: end, startLoc: templateElementEndLoc, endLoc: loc.end }); } else { templateElementEnd = end - 2; templateElementEndLoc = (0, _location.createPositionWithColumnOffset)(loc.end, -2); templateValue = value === null ? null : value.slice(1, -2); endToken = new _tokenizer.Token({ type: (0, _types.getExportedToken)(23), value: "${", start: templateElementEnd, end: end, startLoc: templateElementEndLoc, endLoc: loc.end }); } tokens.splice(i, 1, startToken, new _tokenizer.Token({ type: (0, _types.getExportedToken)(20), value: templateValue, start: backquoteEnd, end: templateElementEnd, startLoc: backquoteEndLoc, endLoc: templateElementEndLoc }), endToken); i += 2; continue; } } token.type = (0, _types.getExportedToken)(type); } } return tokens; } class StatementParser extends _expression.default { parseTopLevel(file, program) { file.program = this.parseProgram(program); file.comments = this.state.comments; if (this.options.tokens) { file.tokens = babel7CompatTokens(this.tokens, this.input); } return this.finishNode(file, "File"); } parseProgram(program, end = 137, sourceType = this.options.sourceType) { program.sourceType = sourceType; program.interpreter = this.parseInterpreterDirective(); this.parseBlockBody(program, true, true, end); if (this.inModule && !this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) { for (const [localName, at] of Array.from(this.scope.undefinedExports)) { this.raise(_parseError.Errors.ModuleExportUndefined, { at, localName }); } } let finishedProgram; if (end === 137) { finishedProgram = this.finishNode(program, "Program"); } else { finishedProgram = this.finishNodeAt(program, "Program", (0, _location.createPositionWithColumnOffset)(this.state.startLoc, -1)); } return finishedProgram; } stmtToDirective(stmt) { const directive = stmt; directive.type = "Directive"; directive.value = directive.expression; delete directive.expression; const directiveLiteral = directive.value; const expressionValue = directiveLiteral.value; const raw = this.input.slice(directiveLiteral.start, directiveLiteral.end); const val = directiveLiteral.value = raw.slice(1, -1); this.addExtra(directiveLiteral, "raw", raw); this.addExtra(directiveLiteral, "rawValue", val); this.addExtra(directiveLiteral, "expressionValue", expressionValue); directiveLiteral.type = "DirectiveLiteral"; return directive; } parseInterpreterDirective() { if (!this.match(28)) { return null; } const node = this.startNode(); node.value = this.state.value; this.next(); return this.finishNode(node, "InterpreterDirective"); } isLet() { if (!this.isContextual(99)) { return false; } return this.hasFollowingBindingAtom(); } chStartsBindingIdentifier(ch, pos) { if ((0, _identifier.isIdentifierStart)(ch)) { keywordRelationalOperator.lastIndex = pos; if (keywordRelationalOperator.test(this.input)) { const endCh = this.codePointAtPos(keywordRelationalOperator.lastIndex); if (!(0, _identifier.isIdentifierChar)(endCh) && endCh !== 92) { return false; } } return true; } else if (ch === 92) { return true; } else { return false; } } chStartsBindingPattern(ch) { return ch === 91 || ch === 123; } hasFollowingBindingAtom() { const next = this.nextTokenStart(); const nextCh = this.codePointAtPos(next); return this.chStartsBindingPattern(nextCh) || this.chStartsBindingIdentifier(nextCh, next); } hasInLineFollowingBindingIdentifier() { const next = this.nextTokenInLineStart(); const nextCh = this.codePointAtPos(next); return this.chStartsBindingIdentifier(nextCh, next); } startsUsingForOf() { const { type, containsEsc } = this.lookahead(); if (type === 101 && !containsEsc) { return false; } else if ((0, _types.tokenIsIdentifier)(type) && !this.hasFollowingLineBreak()) { this.expectPlugin("explicitResourceManagement"); return true; } } startsAwaitUsing() { let next = this.nextTokenInLineStart(); if (this.isUnparsedContextual(next, "using")) { next = this.nextTokenInLineStartSince(next + 5); const nextCh = this.codePointAtPos(next); if (this.chStartsBindingIdentifier(nextCh, next)) { this.expectPlugin("explicitResourceManagement"); return true; } } return false; } parseModuleItem() { return this.parseStatementLike(ParseStatementFlag.AllowImportExport | ParseStatementFlag.AllowDeclaration | ParseStatementFlag.AllowFunctionDeclaration | ParseStatementFlag.AllowLabeledFunction); } parseStatementListItem() { return this.parseStatementLike(ParseStatementFlag.AllowDeclaration | ParseStatementFlag.AllowFunctionDeclaration | (!this.options.annexB || this.state.strict ? 0 : ParseStatementFlag.AllowLabeledFunction)); } parseStatementOrSloppyAnnexBFunctionDeclaration(allowLabeledFunction = false) { let flags = ParseStatementFlag.StatementOnly; if (this.options.annexB && !this.state.strict) { flags |= ParseStatementFlag.AllowFunctionDeclaration; if (allowLabeledFunction) { flags |= ParseStatementFlag.AllowLabeledFunction; } } return this.parseStatementLike(flags); } parseStatement() { return this.parseStatementLike(ParseStatementFlag.StatementOnly); } parseStatementLike(flags) { let decorators = null; if (this.match(26)) { decorators = this.parseDecorators(true); } return this.parseStatementContent(flags, decorators); } parseStatementContent(flags, decorators) { const starttype = this.state.type; const node = this.startNode(); const allowDeclaration = !!(flags & ParseStatementFlag.AllowDeclaration); const allowFunctionDeclaration = !!(flags & ParseStatementFlag.AllowFunctionDeclaration); const topLevel = flags & ParseStatementFlag.AllowImportExport; switch (starttype) { case 60: return this.parseBreakContinueStatement(node, true); case 63: return this.parseBreakContinueStatement(node, false); case 64: return this.parseDebuggerStatement(node); case 90: return this.parseDoWhileStatement(node); case 91: return this.parseForStatement(node); case 68: if (this.lookaheadCharCode() === 46) break; if (!allowFunctionDeclaration) { this.raise(this.state.strict ? _parseError.Errors.StrictFunction : this.options.annexB ? _parseError.Errors.SloppyFunctionAnnexB : _parseError.Errors.SloppyFunction, { at: this.state.startLoc }); } return this.parseFunctionStatement(node, false, !allowDeclaration && allowFunctionDeclaration); case 80: if (!allowDeclaration) this.unexpected(); return this.parseClass(this.maybeTakeDecorators(decorators, node), true); case 69: return this.parseIfStatement(node); case 70: return this.parseReturnStatement(node); case 71: return this.parseSwitchStatement(node); case 72: return this.parseThrowStatement(node); case 73: return this.parseTryStatement(node); case 96: if (!this.state.containsEsc && this.startsAwaitUsing()) { if (!this.isAwaitAllowed()) { this.raise(_parseError.Errors.AwaitUsingNotInAsyncContext, { at: node }); } else if (!allowDeclaration) { this.raise(_parseError.Errors.UnexpectedLexicalDeclaration, { at: node }); } this.next(); return this.parseVarStatement(node, "await using"); } break; case 105: if (this.state.containsEsc || !this.hasInLineFollowingBindingIdentifier()) { break; } this.expectPlugin("explicitResourceManagement"); if (!this.scope.inModule && this.scope.inTopLevel) { this.raise(_parseError.Errors.UnexpectedUsingDeclaration, { at: this.state.startLoc }); } else if (!allowDeclaration) { this.raise(_parseError.Errors.UnexpectedLexicalDeclaration, { at: this.state.startLoc }); } return this.parseVarStatement(node, "using"); case 99: { if (this.state.containsEsc) { break; } const next = this.nextTokenStart(); const nextCh = this.codePointAtPos(next); if (nextCh !== 91) { if (!allowDeclaration && this.hasFollowingLineBreak()) break; if (!this.chStartsBindingIdentifier(nextCh, next) && nextCh !== 123) { break; } } } case 75: { if (!allowDeclaration) { this.raise(_parseError.Errors.UnexpectedLexicalDeclaration, { at: this.state.startLoc }); } } case 74: { const kind = this.state.value; return this.parseVarStatement(node, kind); } case 92: return this.parseWhileStatement(node); case 76: return this.parseWithStatement(node); case 5: return this.parseBlock(); case 13: return this.parseEmptyStatement(node); case 83: { const nextTokenCharCode = this.lookaheadCharCode(); if (nextTokenCharCode === 40 || nextTokenCharCode === 46) { break; } } case 82: { if (!this.options.allowImportExportEverywhere && !topLevel) { this.raise(_parseError.Errors.UnexpectedImportExport, { at: this.state.startLoc }); } this.next(); let result; if (starttype === 83) { result = this.parseImport(node); if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) { this.sawUnambiguousESM = true; } } else { result = this.parseExport(node, decorators); if (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") { this.sawUnambiguousESM = true; } } this.assertModuleNodeAllowed(result); return result; } default: { if (this.isAsyncFunction()) { if (!allowDeclaration) { this.raise(_parseError.Errors.AsyncFunctionInSingleStatementContext, { at: this.state.startLoc }); } this.next(); return this.parseFunctionStatement(node, true, !allowDeclaration && allowFunctionDeclaration); } } } const maybeName = this.state.value; const expr = this.parseExpression(); if ((0, _types.tokenIsIdentifier)(starttype) && expr.type === "Identifier" && this.eat(14)) { return this.parseLabeledStatement(node, maybeName, expr, flags); } else { return this.parseExpressionStatement(node, expr, decorators); } } assertModuleNodeAllowed(node) { if (!this.options.allowImportExportEverywhere && !this.inModule) { this.raise(_parseError.Errors.ImportOutsideModule, { at: node }); } } decoratorsEnabledBeforeExport() { if (this.hasPlugin("decorators-legacy")) return true; return this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") !== false; } maybeTakeDecorators(maybeDecorators, classNode, exportNode) { if (maybeDecorators) { if (classNode.decorators && classNode.decorators.length > 0) { if (typeof this.getPluginOption("decorators", "decoratorsBeforeExport") !== "boolean") { this.raise(_parseError.Errors.DecoratorsBeforeAfterExport, { at: classNode.decorators[0] }); } classNode.decorators.unshift(...maybeDecorators); } else { classNode.decorators = maybeDecorators; } this.resetStartLocationFromNode(classNode, maybeDecorators[0]); if (exportNode) this.resetStartLocationFromNode(exportNode, classNode); } return classNode; } canHaveLeadingDecorator() { return this.match(80); } parseDecorators(allowExport) { const decorators = []; do { decorators.push(this.parseDecorator()); } while (this.match(26)); if (this.match(82)) { if (!allowExport) { this.unexpected(); } if (!this.decoratorsEnabledBeforeExport()) { this.raise(_parseError.Errors.DecoratorExportClass, { at: this.state.startLoc }); } } else if (!this.canHaveLeadingDecorator()) { throw this.raise(_parseError.Errors.UnexpectedLeadingDecorator, { at: this.state.startLoc }); } return decorators; } parseDecorator() { this.expectOnePlugin(["decorators", "decorators-legacy"]); const node = this.startNode(); this.next(); if (this.hasPlugin("decorators")) { const startLoc = this.state.startLoc; let expr; if (this.match(10)) { const startLoc = this.state.startLoc; this.next(); expr = this.parseExpression(); this.expect(11); expr = this.wrapParenthesis(startLoc, expr); const paramsStartLoc = this.state.startLoc; node.expression = this.parseMaybeDecoratorArguments(expr); if (this.getPluginOption("decorators", "allowCallParenthesized") === false && node.expression !== expr) { this.raise(_parseError.Errors.DecoratorArgumentsOutsideParentheses, { at: paramsStartLoc }); } } else { expr = this.parseIdentifier(false); while (this.eat(16)) { const node = this.startNodeAt(startLoc); node.object = expr; if (this.match(136)) { this.classScope.usePrivateName(this.state.value, this.state.startLoc); node.property = this.parsePrivateName(); } else { node.property = this.parseIdentifier(true); } node.computed = false; expr = this.finishNode(node, "MemberExpression"); } node.expression = this.parseMaybeDecoratorArguments(expr); } } else { node.expression = this.parseExprSubscripts(); } return this.finishNode(node, "Decorator"); } parseMaybeDecoratorArguments(expr) { if (this.eat(10)) { const node = this.startNodeAtNode(expr); node.callee = expr; node.arguments = this.parseCallExpressionArguments(11, false); this.toReferencedList(node.arguments); return this.finishNode(node, "CallExpression"); } return expr; } parseBreakContinueStatement(node, isBreak) { this.next(); if (this.isLineTerminator()) { node.label = null; } else { node.label = this.parseIdentifier(); this.semicolon(); } this.verifyBreakContinue(node, isBreak); return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); } verifyBreakContinue(node, isBreak) { let i; for (i = 0; i < this.state.labels.length; ++i) { const lab = this.state.labels[i]; if (node.label == null || lab.name === node.label.name) { if (lab.kind != null && (isBreak || lab.kind === "loop")) break; if (node.label && isBreak) break; } } if (i === this.state.labels.length) { const type = isBreak ? "BreakStatement" : "ContinueStatement"; this.raise(_parseError.Errors.IllegalBreakContinue, { at: node, type }); } } parseDebuggerStatement(node) { this.next(); this.semicolon(); return this.finishNode(node, "DebuggerStatement"); } parseHeaderExpression() { this.expect(10); const val = this.parseExpression(); this.expect(11); return val; } parseDoWhileStatement(node) { this.next(); this.state.labels.push(loopLabel); node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); this.state.labels.pop(); this.expect(92); node.test = this.parseHeaderExpression(); this.eat(13); return this.finishNode(node, "DoWhileStatement"); } parseForStatement(node) { this.next(); this.state.labels.push(loopLabel); let awaitAt = null; if (this.isAwaitAllowed() && this.eatContextual(96)) { awaitAt = this.state.lastTokStartLoc; } this.scope.enter(_scopeflags.SCOPE_OTHER); this.expect(10); if (this.match(13)) { if (awaitAt !== null) { this.unexpected(awaitAt); } return this.parseFor(node, null); } const startsWithLet = this.isContextual(99); { const startsWithAwaitUsing = this.isContextual(96) && this.startsAwaitUsing(); const starsWithUsingDeclaration = startsWithAwaitUsing || this.isContextual(105) && this.startsUsingForOf(); const isLetOrUsing = startsWithLet && this.hasFollowingBindingAtom() || starsWithUsingDeclaration; if (this.match(74) || this.match(75) || isLetOrUsing) { const initNode = this.startNode(); let kind; if (startsWithAwaitUsing) { kind = "await using"; if (!this.isAwaitAllowed()) { this.raise(_parseError.Errors.AwaitUsingNotInAsyncContext, { at: this.state.startLoc }); } this.next(); } else { kind = this.state.value; } this.next(); this.parseVar(initNode, true, kind); const init = this.finishNode(initNode, "VariableDeclaration"); const isForIn = this.match(58); if (isForIn && starsWithUsingDeclaration) { this.raise(_parseError.Errors.ForInUsing, { at: init }); } if ((isForIn || this.isContextual(101)) && init.declarations.length === 1) { return this.parseForIn(node, init, awaitAt); } if (awaitAt !== null) { this.unexpected(awaitAt); } return this.parseFor(node, init); } } const startsWithAsync = this.isContextual(95); const refExpressionErrors = new _util.ExpressionErrors(); const init = this.parseExpression(true, refExpressionErrors); const isForOf = this.isContextual(101); if (isForOf) { if (startsWithLet) { this.raise(_parseError.Errors.ForOfLet, { at: init }); } if (awaitAt === null && startsWithAsync && init.type === "Identifier") { this.raise(_parseError.Errors.ForOfAsync, { at: init }); } } if (isForOf || this.match(58)) { this.checkDestructuringPrivate(refExpressionErrors); this.toAssignable(init, true); const type = isForOf ? "ForOfStatement" : "ForInStatement"; this.checkLVal(init, { in: { type } }); return this.parseForIn(node, init, awaitAt); } else { this.checkExpressionErrors(refExpressionErrors, true); } if (awaitAt !== null) { this.unexpected(awaitAt); } return this.parseFor(node, init); } parseFunctionStatement(node, isAsync, isHangingDeclaration) { this.next(); return this.parseFunction(node, ParseFunctionFlag.Declaration | (isHangingDeclaration ? ParseFunctionFlag.HangingDeclaration : 0) | (isAsync ? ParseFunctionFlag.Async : 0)); } parseIfStatement(node) { this.next(); node.test = this.parseHeaderExpression(); node.consequent = this.parseStatementOrSloppyAnnexBFunctionDeclaration(); node.alternate = this.eat(66) ? this.parseStatementOrSloppyAnnexBFunctionDeclaration() : null; return this.finishNode(node, "IfStatement"); } parseReturnStatement(node) { if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) { this.raise(_parseError.Errors.IllegalReturn, { at: this.state.startLoc }); } this.next(); if (this.isLineTerminator()) { node.argument = null; } else { node.argument = this.parseExpression(); this.semicolon(); } return this.finishNode(node, "ReturnStatement"); } parseSwitchStatement(node) { this.next(); node.discriminant = this.parseHeaderExpression(); const cases = node.cases = []; this.expect(5); this.state.labels.push(switchLabel); this.scope.enter(_scopeflags.SCOPE_OTHER); let cur; for (let sawDefault; !this.match(8);) { if (this.match(61) || this.match(65)) { const isCase = this.match(61); if (cur) this.finishNode(cur, "SwitchCase"); cases.push(cur = this.startNode()); cur.consequent = []; this.next(); if (isCase) { cur.test = this.parseExpression(); } else { if (sawDefault) { this.raise(_parseError.Errors.MultipleDefaultsInSwitch, { at: this.state.lastTokStartLoc }); } sawDefault = true; cur.test = null; } this.expect(14); } else { if (cur) { cur.consequent.push(this.parseStatementListItem()); } else { this.unexpected(); } } } this.scope.exit(); if (cur) this.finishNode(cur, "SwitchCase"); this.next(); this.state.labels.pop(); return this.finishNode(node, "SwitchStatement"); } parseThrowStatement(node) { this.next(); if (this.hasPrecedingLineBreak()) { this.raise(_parseError.Errors.NewlineAfterThrow, { at: this.state.lastTokEndLoc }); } node.argument = this.parseExpression(); this.semicolon(); return this.finishNode(node, "ThrowStatement"); } parseCatchClauseParam() { const param = this.parseBindingAtom(); this.scope.enter(this.options.annexB && param.type === "Identifier" ? _scopeflags.SCOPE_SIMPLE_CATCH : 0); this.checkLVal(param, { in: { type: "CatchClause" }, binding: _scopeflags.BIND_CATCH_PARAM }); return param; } parseTryStatement(node) { this.next(); node.block = this.parseBlock(); node.handler = null; if (this.match(62)) { const clause = this.startNode(); this.next(); if (this.match(10)) { this.expect(10); clause.param = this.parseCatchClauseParam(); this.expect(11); } else { clause.param = null; this.scope.enter(_scopeflags.SCOPE_OTHER); } clause.body = this.withSmartMixTopicForbiddingContext(() => this.parseBlock(false, false)); this.scope.exit(); node.handler = this.finishNode(clause, "CatchClause"); } node.finalizer = this.eat(67) ? this.parseBlock() : null; if (!node.handler && !node.finalizer) { this.raise(_parseError.Errors.NoCatchOrFinally, { at: node }); } return this.finishNode(node, "TryStatement"); } parseVarStatement(node, kind, allowMissingInitializer = false) { this.next(); this.parseVar(node, false, kind, allowMissingInitializer); this.semicolon(); return this.finishNode(node, "VariableDeclaration"); } parseWhileStatement(node) { this.next(); node.test = this.parseHeaderExpression(); this.state.labels.push(loopLabel); node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); this.state.labels.pop(); return this.finishNode(node, "WhileStatement"); } parseWithStatement(node) { if (this.state.strict) { this.raise(_parseError.Errors.StrictWith, { at: this.state.startLoc }); } this.next(); node.object = this.parseHeaderExpression(); node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); return this.finishNode(node, "WithStatement"); } parseEmptyStatement(node) { this.next(); return this.finishNode(node, "EmptyStatement"); } parseLabeledStatement(node, maybeName, expr, flags) { for (const label of this.state.labels) { if (label.name === maybeName) { this.raise(_parseError.Errors.LabelRedeclaration, { at: expr, labelName: maybeName }); } } const kind = (0, _types.tokenIsLoop)(this.state.type) ? "loop" : this.match(71) ? "switch" : null; for (let i = this.state.labels.length - 1; i >= 0; i--) { const label = this.state.labels[i]; if (label.statementStart === node.start) { label.statementStart = this.state.start; label.kind = kind; } else { break; } } this.state.labels.push({ name: maybeName, kind: kind, statementStart: this.state.start }); node.body = flags & ParseStatementFlag.AllowLabeledFunction ? this.parseStatementOrSloppyAnnexBFunctionDeclaration(true) : this.parseStatement(); this.state.labels.pop(); node.label = expr; return this.finishNode(node, "LabeledStatement"); } parseExpressionStatement(node, expr, decorators) { node.expression = expr; this.semicolon(); return this.finishNode(node, "ExpressionStatement"); } parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) { const node = this.startNode(); if (allowDirectives) { this.state.strictErrors.clear(); } this.expect(5); if (createNewLexicalScope) { this.scope.enter(_scopeflags.SCOPE_OTHER); } this.parseBlockBody(node, allowDirectives, false, 8, afterBlockParse); if (createNewLexicalScope) { this.scope.exit(); } return this.finishNode(node, "BlockStatement"); } isValidDirective(stmt) { return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized; } parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) { const body = node.body = []; const directives = node.directives = []; this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse); } parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) { const oldStrict = this.state.strict; let hasStrictModeDirective = false; let parsedNonDirective = false; while (!this.match(end)) { const stmt = topLevel ? this.parseModuleItem() : this.parseStatementListItem(); if (directives && !parsedNonDirective) { if (this.isValidDirective(stmt)) { const directive = this.stmtToDirective(stmt); directives.push(directive); if (!hasStrictModeDirective && directive.value.value === "use strict") { hasStrictModeDirective = true; this.setStrict(true); } continue; } parsedNonDirective = true; this.state.strictErrors.clear(); } body.push(stmt); } if (afterBlockParse) { afterBlockParse.call(this, hasStrictModeDirective); } if (!oldStrict) { this.setStrict(false); } this.next(); } parseFor(node, init) { node.init = init; this.semicolon(false); node.test = this.match(13) ? null : this.parseExpression(); this.semicolon(false); node.update = this.match(11) ? null : this.parseExpression(); this.expect(11); node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); this.scope.exit(); this.state.labels.pop(); return this.finishNode(node, "ForStatement"); } parseForIn(node, init, awaitAt) { const isForIn = this.match(58); this.next(); if (isForIn) { if (awaitAt !== null) this.unexpected(awaitAt); } else { node.await = awaitAt !== null; } if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || !this.options.annexB || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) { this.raise(_parseError.Errors.ForInOfLoopInitializer, { at: init, type: isForIn ? "ForInStatement" : "ForOfStatement" }); } if (init.type === "AssignmentPattern") { this.raise(_parseError.Errors.InvalidLhs, { at: init, ancestor: { type: "ForStatement" } }); } node.left = init; node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn(); this.expect(11); node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); this.scope.exit(); this.state.labels.pop(); return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement"); } parseVar(node, isFor, kind, allowMissingInitializer = false) { const declarations = node.declarations = []; node.kind = kind; for (;;) { const decl = this.startNode(); this.parseVarId(decl, kind); decl.init = !this.eat(29) ? null : isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn(); if (decl.init === null && !allowMissingInitializer) { if (decl.id.type !== "Identifier" && !(isFor && (this.match(58) || this.isContextual(101)))) { this.raise(_parseError.Errors.DeclarationMissingInitializer, { at: this.state.lastTokEndLoc, kind: "destructuring" }); } else if (kind === "const" && !(this.match(58) || this.isContextual(101))) { this.raise(_parseError.Errors.DeclarationMissingInitializer, { at: this.state.lastTokEndLoc, kind: "const" }); } } declarations.push(this.finishNode(decl, "VariableDeclarator")); if (!this.eat(12)) break; } return node; } parseVarId(decl, kind) { const id = this.parseBindingAtom(); this.checkLVal(id, { in: { type: "VariableDeclarator" }, binding: kind === "var" ? _scopeflags.BIND_VAR : _scopeflags.BIND_LEXICAL }); decl.id = id; } parseAsyncFunctionExpression(node) { return this.parseFunction(node, ParseFunctionFlag.Async); } parseFunction(node, flags = ParseFunctionFlag.Expression) { const hangingDeclaration = flags & ParseFunctionFlag.HangingDeclaration; const isDeclaration = !!(flags & ParseFunctionFlag.Declaration); const requireId = isDeclaration && !(flags & ParseFunctionFlag.NullableId); const isAsync = !!(flags & ParseFunctionFlag.Async); this.initFunction(node, isAsync); if (this.match(55)) { if (hangingDeclaration) { this.raise(_parseError.Errors.GeneratorInSingleStatementContext, { at: this.state.startLoc }); } this.next(); node.generator = true; } if (isDeclaration) { node.id = this.parseFunctionId(requireId); } const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; this.state.maybeInArrowParameters = false; this.scope.enter(_scopeflags.SCOPE_FUNCTION); this.prodParam.enter((0, _productionParameter.functionFlags)(isAsync, node.generator)); if (!isDeclaration) { node.id = this.parseFunctionId(); } this.parseFunctionParams(node, false); this.withSmartMixTopicForbiddingContext(() => { this.parseFunctionBodyAndFinish(node, isDeclaration ? "FunctionDeclaration" : "FunctionExpression"); }); this.prodParam.exit(); this.scope.exit(); if (isDeclaration && !hangingDeclaration) { this.registerFunctionStatementId(node); } this.state.maybeInArrowParameters = oldMaybeInArrowParameters; return node; } parseFunctionId(requireId) { return requireId || (0, _types.tokenIsIdentifier)(this.state.type) ? this.parseIdentifier() : null; } parseFunctionParams(node, isConstructor) { this.expect(10); this.expressionScope.enter((0, _expressionScope.newParameterDeclarationScope)()); node.params = this.parseBindingList(11, 41, _lval.ParseBindingListFlags.IS_FUNCTION_PARAMS | (isConstructor ? _lval.ParseBindingListFlags.IS_CONSTRUCTOR_PARAMS : 0)); this.expressionScope.exit(); } registerFunctionStatementId(node) { if (!node.id) return; this.scope.declareName(node.id.name, !this.options.annexB || this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? _scopeflags.BIND_VAR : _scopeflags.BIND_LEXICAL : _scopeflags.BIND_FUNCTION, node.id.loc.start); } parseClass(node, isStatement, optionalId) { this.next(); const oldStrict = this.state.strict; this.state.strict = true; this.parseClassId(node, isStatement, optionalId); this.parseClassSuper(node); node.body = this.parseClassBody(!!node.superClass, oldStrict); return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); } isClassProperty() { return this.match(29) || this.match(13) || this.match(8); } isClassMethod() { return this.match(10); } isNonstaticConstructor(method) { return !method.computed && !method.static && (method.key.name === "constructor" || method.key.value === "constructor"); } parseClassBody(hadSuperClass, oldStrict) { this.classScope.enter(); const state = { hadConstructor: false, hadSuperClass }; let decorators = []; const classBody = this.startNode(); classBody.body = []; this.expect(5); this.withSmartMixTopicForbiddingContext(() => { while (!this.match(8)) { if (this.eat(13)) { if (decorators.length > 0) { throw this.raise(_parseError.Errors.DecoratorSemicolon, { at: this.state.lastTokEndLoc }); } continue; } if (this.match(26)) { decorators.push(this.parseDecorator()); continue; } const member = this.startNode(); if (decorators.length) { member.decorators = decorators; this.resetStartLocationFromNode(member, decorators[0]); decorators = []; } this.parseClassMember(classBody, member, state); if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) { this.raise(_parseError.Errors.DecoratorConstructor, { at: member }); } } }); this.state.strict = oldStrict; this.next(); if (decorators.length) { throw this.raise(_parseError.Errors.TrailingDecorator, { at: this.state.startLoc }); } this.classScope.exit(); return this.finishNode(classBody, "ClassBody"); } parseClassMemberFromModifier(classBody, member) { const key = this.parseIdentifier(true); if (this.isClassMethod()) { const method = member; method.kind = "method"; method.computed = false; method.key = key; method.static = false; this.pushClassMethod(classBody, method, false, false, false, false); return true; } else if (this.isClassProperty()) { const prop = member; prop.computed = false; prop.key = key; prop.static = false; classBody.body.push(this.parseClassProperty(prop)); return true; } this.resetPreviousNodeTrailingComments(key); return false; } parseClassMember(classBody, member, state) { const isStatic = this.isContextual(104); if (isStatic) { if (this.parseClassMemberFromModifier(classBody, member)) { return; } if (this.eat(5)) { this.parseClassStaticBlock(classBody, member); return; } } this.parseClassMemberWithIsStatic(classBody, member, state, isStatic); } parseClassMemberWithIsStatic(classBody, member, state, isStatic) { const publicMethod = member; const privateMethod = member; const publicProp = member; const privateProp = member; const accessorProp = member; const method = publicMethod; const publicMember = publicMethod; member.static = isStatic; this.parsePropertyNamePrefixOperator(member); if (this.eat(55)) { method.kind = "method"; const isPrivateName = this.match(136); this.parseClassElementName(method); if (isPrivateName) { this.pushClassPrivateMethod(classBody, privateMethod, true, false); return; } if (this.isNonstaticConstructor(publicMethod)) { this.raise(_parseError.Errors.ConstructorIsGenerator, { at: publicMethod.key }); } this.pushClassMethod(classBody, publicMethod, true, false, false, false); return; } const isContextual = (0, _types.tokenIsIdentifier)(this.state.type) && !this.state.containsEsc; const isPrivate = this.match(136); const key = this.parseClassElementName(member); const maybeQuestionTokenStartLoc = this.state.startLoc; this.parsePostMemberNameModifiers(publicMember); if (this.isClassMethod()) { method.kind = "method"; if (isPrivate) { this.pushClassPrivateMethod(classBody, privateMethod, false, false); return; } const isConstructor = this.isNonstaticConstructor(publicMethod); let allowsDirectSuper = false; if (isConstructor) { publicMethod.kind = "constructor"; if (state.hadConstructor && !this.hasPlugin("typescript")) { this.raise(_parseError.Errors.DuplicateConstructor, { at: key }); } if (isConstructor && this.hasPlugin("typescript") && member.override) { this.raise(_parseError.Errors.OverrideOnConstructor, { at: key }); } state.hadConstructor = true; allowsDirectSuper = state.hadSuperClass; } this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper); } else if (this.isClassProperty()) { if (isPrivate) { this.pushClassPrivateProperty(classBody, privateProp); } else { this.pushClassProperty(classBody, publicProp); } } else if (isContextual && key.name === "async" && !this.isLineTerminator()) { this.resetPreviousNodeTrailingComments(key); const isGenerator = this.eat(55); if (publicMember.optional) { this.unexpected(maybeQuestionTokenStartLoc); } method.kind = "method"; const isPrivate = this.match(136); this.parseClassElementName(method); this.parsePostMemberNameModifiers(publicMember); if (isPrivate) { this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true); } else { if (this.isNonstaticConstructor(publicMethod)) { this.raise(_parseError.Errors.ConstructorIsAsync, { at: publicMethod.key }); } this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false); } } else if (isContextual && (key.name === "get" || key.name === "set") && !(this.match(55) && this.isLineTerminator())) { this.resetPreviousNodeTrailingComments(key); method.kind = key.name; const isPrivate = this.match(136); this.parseClassElementName(publicMethod); if (isPrivate) { this.pushClassPrivateMethod(classBody, privateMethod, false, false); } else { if (this.isNonstaticConstructor(publicMethod)) { this.raise(_parseError.Errors.ConstructorIsAccessor, { at: publicMethod.key }); } this.pushClassMethod(classBody, publicMethod, false, false, false, false); } this.checkGetterSetterParams(publicMethod); } else if (isContextual && key.name === "accessor" && !this.isLineTerminator()) { this.expectPlugin("decoratorAutoAccessors"); this.resetPreviousNodeTrailingComments(key); const isPrivate = this.match(136); this.parseClassElementName(publicProp); this.pushClassAccessorProperty(classBody, accessorProp, isPrivate); } else if (this.isLineTerminator()) { if (isPrivate) { this.pushClassPrivateProperty(classBody, privateProp); } else { this.pushClassProperty(classBody, publicProp); } } else { this.unexpected(); } } parseClassElementName(member) { const { type, value } = this.state; if ((type === 130 || type === 131) && member.static && value === "prototype") { this.raise(_parseError.Errors.StaticPrototype, { at: this.state.startLoc }); } if (type === 136) { if (value === "constructor") { this.raise(_parseError.Errors.ConstructorClassPrivateField, { at: this.state.startLoc }); } const key = this.parsePrivateName(); member.key = key; return key; } return this.parsePropertyName(member); } parseClassStaticBlock(classBody, member) { var _member$decorators; this.scope.enter(_scopeflags.SCOPE_CLASS | _scopeflags.SCOPE_STATIC_BLOCK | _scopeflags.SCOPE_SUPER); const oldLabels = this.state.labels; this.state.labels = []; this.prodParam.enter(_productionParameter.PARAM); const body = member.body = []; this.parseBlockOrModuleBlockBody(body, undefined, false, 8); this.prodParam.exit(); this.scope.exit(); this.state.labels = oldLabels; classBody.body.push(this.finishNode(member, "StaticBlock")); if ((_member$decorators = member.decorators) != null && _member$decorators.length) { this.raise(_parseError.Errors.DecoratorStaticBlock, { at: member }); } } pushClassProperty(classBody, prop) { if (!prop.computed && (prop.key.name === "constructor" || prop.key.value === "constructor")) { this.raise(_parseError.Errors.ConstructorClassField, { at: prop.key }); } classBody.body.push(this.parseClassProperty(prop)); } pushClassPrivateProperty(classBody, prop) { const node = this.parseClassPrivateProperty(prop); classBody.body.push(node); this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), _scopeflags.CLASS_ELEMENT_OTHER, node.key.loc.start); } pushClassAccessorProperty(classBody, prop, isPrivate) { if (!isPrivate && !prop.computed) { const key = prop.key; if (key.name === "constructor" || key.value === "constructor") { this.raise(_parseError.Errors.ConstructorClassField, { at: key }); } } const node = this.parseClassAccessorProperty(prop); classBody.body.push(node); if (isPrivate) { this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), _scopeflags.CLASS_ELEMENT_OTHER, node.key.loc.start); } } pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true)); } pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true); classBody.body.push(node); const kind = node.kind === "get" ? node.static ? _scopeflags.CLASS_ELEMENT_STATIC_GETTER : _scopeflags.CLASS_ELEMENT_INSTANCE_GETTER : node.kind === "set" ? node.static ? _scopeflags.CLASS_ELEMENT_STATIC_SETTER : _scopeflags.CLASS_ELEMENT_INSTANCE_SETTER : _scopeflags.CLASS_ELEMENT_OTHER; this.declareClassPrivateMethodInScope(node, kind); } declareClassPrivateMethodInScope(node, kind) { this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.loc.start); } parsePostMemberNameModifiers(methodOrProp) {} parseClassPrivateProperty(node) { this.parseInitializer(node); this.semicolon(); return this.finishNode(node, "ClassPrivateProperty"); } parseClassProperty(node) { this.parseInitializer(node); this.semicolon(); return this.finishNode(node, "ClassProperty"); } parseClassAccessorProperty(node) { this.parseInitializer(node); this.semicolon(); return this.finishNode(node, "ClassAccessorProperty"); } parseInitializer(node) { this.scope.enter(_scopeflags.SCOPE_CLASS | _scopeflags.SCOPE_SUPER); this.expressionScope.enter((0, _expressionScope.newExpressionScope)()); this.prodParam.enter(_productionParameter.PARAM); node.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null; this.expressionScope.exit(); this.prodParam.exit(); this.scope.exit(); } parseClassId(node, isStatement, optionalId, bindingType = _scopeflags.BIND_CLASS) { if ((0, _types.tokenIsIdentifier)(this.state.type)) { node.id = this.parseIdentifier(); if (isStatement) { this.declareNameFromIdentifier(node.id, bindingType); } } else { if (optionalId || !isStatement) { node.id = null; } else { throw this.raise(_parseError.Errors.MissingClassName, { at: this.state.startLoc }); } } } parseClassSuper(node) { node.superClass = this.eat(81) ? this.parseExprSubscripts() : null; } parseExport(node, decorators) { const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, true); const hasDefault = this.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier); const parseAfterDefault = !hasDefault || this.eat(12); const hasStar = parseAfterDefault && this.eatExportStar(node); const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node); const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(12)); const isFromRequired = hasDefault || hasStar; if (hasStar && !hasNamespace) { if (hasDefault) this.unexpected(); if (decorators) { throw this.raise(_parseError.Errors.UnsupportedDecoratorExport, { at: node }); } this.parseExportFrom(node, true); return this.finishNode(node, "ExportAllDeclaration"); } const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node); if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers) { this.unexpected(null, 5); } if (hasNamespace && parseAfterNamespace) { this.unexpected(null, 97); } let hasDeclaration; if (isFromRequired || hasSpecifiers) { hasDeclaration = false; if (decorators) { throw this.raise(_parseError.Errors.UnsupportedDecoratorExport, { at: node }); } this.parseExportFrom(node, isFromRequired); } else { hasDeclaration = this.maybeParseExportDeclaration(node); } if (isFromRequired || hasSpecifiers || hasDeclaration) { var _node2$declaration; const node2 = node; this.checkExport(node2, true, false, !!node2.source); if (((_node2$declaration = node2.declaration) == null ? void 0 : _node2$declaration.type) === "ClassDeclaration") { this.maybeTakeDecorators(decorators, node2.declaration, node2); } else if (decorators) { throw this.raise(_parseError.Errors.UnsupportedDecoratorExport, { at: node }); } return this.finishNode(node2, "ExportNamedDeclaration"); } if (this.eat(65)) { const node2 = node; const decl = this.parseExportDefaultExpression(); node2.declaration = decl; if (decl.type === "ClassDeclaration") { this.maybeTakeDecorators(decorators, decl, node2); } else if (decorators) { throw this.raise(_parseError.Errors.UnsupportedDecoratorExport, { at: node }); } this.checkExport(node2, true, true); return this.finishNode(node2, "ExportDefaultDeclaration"); } this.unexpected(null, 5); } eatExportStar(node) { return this.eat(55); } maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) { if (maybeDefaultIdentifier || this.isExportDefaultSpecifier()) { this.expectPlugin("exportDefaultFrom", maybeDefaultIdentifier == null ? void 0 : maybeDefaultIdentifier.loc.start); const id = maybeDefaultIdentifier || this.parseIdentifier(true); const specifier = this.startNodeAtNode(id); specifier.exported = id; node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; return true; } return false; } maybeParseExportNamespaceSpecifier(node) { if (this.isContextual(93)) { if (!node.specifiers) node.specifiers = []; const specifier = this.startNodeAt(this.state.lastTokStartLoc); this.next(); specifier.exported = this.parseModuleExportName(); node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier")); return true; } return false; } maybeParseExportNamedSpecifiers(node) { if (this.match(5)) { if (!node.specifiers) node.specifiers = []; const isTypeExport = node.exportKind === "type"; node.specifiers.push(...this.parseExportSpecifiers(isTypeExport)); node.source = null; node.declaration = null; if (this.hasPlugin("importAssertions")) { node.assertions = []; } return true; } return false; } maybeParseExportDeclaration(node) { if (this.shouldParseExportDeclaration()) { node.specifiers = []; node.source = null; if (this.hasPlugin("importAssertions")) { node.assertions = []; } node.declaration = this.parseExportDeclaration(node); return true; } return false; } isAsyncFunction() { if (!this.isContextual(95)) return false; const next = this.nextTokenInLineStart(); return this.isUnparsedContextual(next, "function"); } parseExportDefaultExpression() { const expr = this.startNode(); if (this.match(68)) { this.next(); return this.parseFunction(expr, ParseFunctionFlag.Declaration | ParseFunctionFlag.NullableId); } else if (this.isAsyncFunction()) { this.next(); this.next(); return this.parseFunction(expr, ParseFunctionFlag.Declaration | ParseFunctionFlag.NullableId | ParseFunctionFlag.Async); } if (this.match(80)) { return this.parseClass(expr, true, true); } if (this.match(26)) { if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") === true) { this.raise(_parseError.Errors.DecoratorBeforeExport, { at: this.state.startLoc }); } return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true); } if (this.match(75) || this.match(74) || this.isLet()) { throw this.raise(_parseError.Errors.UnsupportedDefaultExport, { at: this.state.startLoc }); } const res = this.parseMaybeAssignAllowIn(); this.semicolon(); return res; } parseExportDeclaration(node) { if (this.match(80)) { const node = this.parseClass(this.startNode(), true, false); return node; } return this.parseStatementListItem(); } isExportDefaultSpecifier() { const { type } = this.state; if ((0, _types.tokenIsIdentifier)(type)) { if (type === 95 && !this.state.containsEsc || type === 99) { return false; } if ((type === 128 || type === 127) && !this.state.containsEsc) { const { type: nextType } = this.lookahead(); if ((0, _types.tokenIsIdentifier)(nextType) && nextType !== 97 || nextType === 5) { this.expectOnePlugin(["flow", "typescript"]); return false; } } } else if (!this.match(65)) { return false; } const next = this.nextTokenStart(); const hasFrom = this.isUnparsedContextual(next, "from"); if (this.input.charCodeAt(next) === 44 || (0, _types.tokenIsIdentifier)(this.state.type) && hasFrom) { return true; } if (this.match(65) && hasFrom) { const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4)); return nextAfterFrom === 34 || nextAfterFrom === 39; } return false; } parseExportFrom(node, expect) { if (this.eatContextual(97)) { node.source = this.parseImportSource(); this.checkExport(node); this.maybeParseImportAttributes(node); this.checkJSONModuleImport(node); } else if (expect) { this.unexpected(); } this.semicolon(); } shouldParseExportDeclaration() { const { type } = this.state; if (type === 26) { this.expectOnePlugin(["decorators", "decorators-legacy"]); if (this.hasPlugin("decorators")) { if (this.getPluginOption("decorators", "decoratorsBeforeExport") === true) { this.raise(_parseError.Errors.DecoratorBeforeExport, { at: this.state.startLoc }); } return true; } } return type === 74 || type === 75 || type === 68 || type === 80 || this.isLet() || this.isAsyncFunction(); } checkExport(node, checkNames, isDefault, isFrom) { if (checkNames) { if (isDefault) { this.checkDuplicateExports(node, "default"); if (this.hasPlugin("exportDefaultFrom")) { var _declaration$extra; const declaration = node.declaration; if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) { this.raise(_parseError.Errors.ExportDefaultFromAsIdentifier, { at: declaration }); } } } else if (node.specifiers && node.specifiers.length) { for (const specifier of node.specifiers) { const { exported } = specifier; const exportName = exported.type === "Identifier" ? exported.name : exported.value; this.checkDuplicateExports(specifier, exportName); if (!isFrom && specifier.local) { const { local } = specifier; if (local.type !== "Identifier") { this.raise(_parseError.Errors.ExportBindingIsString, { at: specifier, localName: local.value, exportName }); } else { this.checkReservedWord(local.name, local.loc.start, true, false); this.scope.checkLocalExport(local); } } } } else if (node.declaration) { if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") { const id = node.declaration.id; if (!id) throw new Error("Assertion failure"); this.checkDuplicateExports(node, id.name); } else if (node.declaration.type === "VariableDeclaration") { for (const declaration of node.declaration.declarations) { this.checkDeclaration(declaration.id); } } } } } checkDeclaration(node) { if (node.type === "Identifier") { this.checkDuplicateExports(node, node.name); } else if (node.type === "ObjectPattern") { for (const prop of node.properties) { this.checkDeclaration(prop); } } else if (node.type === "ArrayPattern") { for (const elem of node.elements) { if (elem) { this.checkDeclaration(elem); } } } else if (node.type === "ObjectProperty") { this.checkDeclaration(node.value); } else if (node.type === "RestElement") { this.checkDeclaration(node.argument); } else if (node.type === "AssignmentPattern") { this.checkDeclaration(node.left); } } checkDuplicateExports(node, exportName) { if (this.exportedIdentifiers.has(exportName)) { if (exportName === "default") { this.raise(_parseError.Errors.DuplicateDefaultExport, { at: node }); } else { this.raise(_parseError.Errors.DuplicateExport, { at: node, exportName }); } } this.exportedIdentifiers.add(exportName); } parseExportSpecifiers(isInTypeExport) { const nodes = []; let first = true; this.expect(5); while (!this.eat(8)) { if (first) { first = false; } else { this.expect(12); if (this.eat(8)) break; } const isMaybeTypeOnly = this.isContextual(128); const isString = this.match(131); const node = this.startNode(); node.local = this.parseModuleExportName(); nodes.push(this.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly)); } return nodes; } parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) { if (this.eatContextual(93)) { node.exported = this.parseModuleExportName(); } else if (isString) { node.exported = (0, _node.cloneStringLiteral)(node.local); } else if (!node.exported) { node.exported = (0, _node.cloneIdentifier)(node.local); } return this.finishNode(node, "ExportSpecifier"); } parseModuleExportName() { if (this.match(131)) { const result = this.parseStringLiteral(this.state.value); const surrogate = result.value.match(loneSurrogate); if (surrogate) { this.raise(_parseError.Errors.ModuleExportNameHasLoneSurrogate, { at: result, surrogateCharCode: surrogate[0].charCodeAt(0) }); } return result; } return this.parseIdentifier(true); } isJSONModuleImport(node) { if (node.assertions != null) { return node.assertions.some(({ key, value }) => { return value.value === "json" && (key.type === "Identifier" ? key.name === "type" : key.value === "type"); }); } return false; } checkImportReflection(node) { if (node.module) { var _node$assertions; if (node.specifiers.length !== 1 || node.specifiers[0].type !== "ImportDefaultSpecifier") { this.raise(_parseError.Errors.ImportReflectionNotBinding, { at: node.specifiers[0].loc.start }); } if (((_node$assertions = node.assertions) == null ? void 0 : _node$assertions.length) > 0) { this.raise(_parseError.Errors.ImportReflectionHasAssertion, { at: node.specifiers[0].loc.start }); } } } checkJSONModuleImport(node) { if (this.isJSONModuleImport(node) && node.type !== "ExportAllDeclaration") { const { specifiers } = node; if (specifiers != null) { const nonDefaultNamedSpecifier = specifiers.find(specifier => { let imported; if (specifier.type === "ExportSpecifier") { imported = specifier.local; } else if (specifier.type === "ImportSpecifier") { imported = specifier.imported; } if (imported !== undefined) { return imported.type === "Identifier" ? imported.name !== "default" : imported.value !== "default"; } }); if (nonDefaultNamedSpecifier !== undefined) { this.raise(_parseError.Errors.ImportJSONBindingNotDefault, { at: nonDefaultNamedSpecifier.loc.start }); } } } } isPotentialImportPhase(isExport) { return !isExport && this.isContextual(125); } applyImportPhase(node, isExport, phase, loc) { if (isExport) { ; return; } if (phase === "module") { this.expectPlugin("importReflection", loc); node.module = true; } else if (this.hasPlugin("importReflection")) { node.module = false; } } parseMaybeImportPhase(node, isExport) { if (!this.isPotentialImportPhase(isExport)) { this.applyImportPhase(node, isExport, null); return null; } const phaseIdentifier = this.parseIdentifier(true); const { type } = this.state; const isImportPhase = (0, _types.tokenIsKeywordOrIdentifier)(type) ? type !== 97 || this.lookaheadCharCode() === 102 : type !== 12; if (isImportPhase) { this.resetPreviousIdentifierLeadingComments(phaseIdentifier); this.applyImportPhase(node, isExport, phaseIdentifier.name, phaseIdentifier.loc.start); return null; } else { this.applyImportPhase(node, isExport, null); return phaseIdentifier; } } isPrecedingIdImportPhase(phase) { const { type } = this.state; return (0, _types.tokenIsIdentifier)(type) ? type !== 97 || this.lookaheadCharCode() === 102 : type !== 12; } parseImport(node) { if (this.match(131)) { return this.parseImportSourceAndAttributes(node); } return this.parseImportSpecifiersAndAfter(node, this.parseMaybeImportPhase(node, false)); } parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier) { node.specifiers = []; const hasDefault = this.maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier); const parseNext = !hasDefault || this.eat(12); const hasStar = parseNext && this.maybeParseStarImportSpecifier(node); if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node); this.expectContextual(97); return this.parseImportSourceAndAttributes(node); } parseImportSourceAndAttributes(node) { var _node$specifiers; (_node$specifiers = node.specifiers) != null ? _node$specifiers : node.specifiers = []; node.source = this.parseImportSource(); this.maybeParseImportAttributes(node); this.checkImportReflection(node); this.checkJSONModuleImport(node); this.semicolon(); return this.finishNode(node, "ImportDeclaration"); } parseImportSource() { if (!this.match(131)) this.unexpected(); return this.parseExprAtom(); } parseImportSpecifierLocal(node, specifier, type) { specifier.local = this.parseIdentifier(); node.specifiers.push(this.finishImportSpecifier(specifier, type)); } finishImportSpecifier(specifier, type, bindingType = _scopeflags.BIND_LEXICAL) { this.checkLVal(specifier.local, { in: { type }, binding: bindingType }); return this.finishNode(specifier, type); } parseImportAttributes() { this.expect(5); const attrs = []; const attrNames = new Set(); do { if (this.match(8)) { break; } const node = this.startNode(); const keyName = this.state.value; if (attrNames.has(keyName)) { this.raise(_parseError.Errors.ModuleAttributesWithDuplicateKeys, { at: this.state.startLoc, key: keyName }); } attrNames.add(keyName); if (this.match(131)) { node.key = this.parseStringLiteral(keyName); } else { node.key = this.parseIdentifier(true); } this.expect(14); if (!this.match(131)) { throw this.raise(_parseError.Errors.ModuleAttributeInvalidValue, { at: this.state.startLoc }); } node.value = this.parseStringLiteral(this.state.value); attrs.push(this.finishNode(node, "ImportAttribute")); } while (this.eat(12)); this.expect(8); return attrs; } parseModuleAttributes() { const attrs = []; const attributes = new Set(); do { const node = this.startNode(); node.key = this.parseIdentifier(true); if (node.key.name !== "type") { this.raise(_parseError.Errors.ModuleAttributeDifferentFromType, { at: node.key }); } if (attributes.has(node.key.name)) { this.raise(_parseError.Errors.ModuleAttributesWithDuplicateKeys, { at: node.key, key: node.key.name }); } attributes.add(node.key.name); this.expect(14); if (!this.match(131)) { throw this.raise(_parseError.Errors.ModuleAttributeInvalidValue, { at: this.state.startLoc }); } node.value = this.parseStringLiteral(this.state.value); attrs.push(this.finishNode(node, "ImportAttribute")); } while (this.eat(12)); return attrs; } maybeParseImportAttributes(node) { let attributes; let useWith = false; if (this.match(76)) { if (this.hasPrecedingLineBreak() && this.lookaheadCharCode() === 40) { return; } this.next(); { if (this.hasPlugin("moduleAttributes")) { attributes = this.parseModuleAttributes(); } else { this.expectImportAttributesPlugin(); attributes = this.parseImportAttributes(); } } useWith = true; } else if (this.isContextual(94) && !this.hasPrecedingLineBreak()) { if (this.hasPlugin("importAttributes")) { if (this.getPluginOption("importAttributes", "deprecatedAssertSyntax") !== true) { this.raise(_parseError.Errors.ImportAttributesUseAssert, { at: this.state.startLoc }); } this.addExtra(node, "deprecatedAssertSyntax", true); } else { this.expectOnePlugin(["importAttributes", "importAssertions"]); } this.next(); attributes = this.parseImportAttributes(); } else if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) { attributes = []; } else { if (this.hasPlugin("moduleAttributes")) { attributes = []; } else return; } if (!useWith && this.hasPlugin("importAssertions")) { node.assertions = attributes; } else { node.attributes = attributes; } } maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier) { if (maybeDefaultIdentifier) { const specifier = this.startNodeAtNode(maybeDefaultIdentifier); specifier.local = maybeDefaultIdentifier; node.specifiers.push(this.finishImportSpecifier(specifier, "ImportDefaultSpecifier")); return true; } else if ((0, _types.tokenIsKeywordOrIdentifier)(this.state.type)) { this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier"); return true; } return false; } maybeParseStarImportSpecifier(node) { if (this.match(55)) { const specifier = this.startNode(); this.next(); this.expectContextual(93); this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier"); return true; } return false; } parseNamedImportSpecifiers(node) { let first = true; this.expect(5); while (!this.eat(8)) { if (first) { first = false; } else { if (this.eat(14)) { throw this.raise(_parseError.Errors.DestructureNamedImport, { at: this.state.startLoc }); } this.expect(12); if (this.eat(8)) break; } const specifier = this.startNode(); const importedIsString = this.match(131); const isMaybeTypeOnly = this.isContextual(128); specifier.imported = this.parseModuleExportName(); const importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node.importKind === "type" || node.importKind === "typeof", isMaybeTypeOnly, undefined); node.specifiers.push(importSpecifier); } } parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { if (this.eatContextual(93)) { specifier.local = this.parseIdentifier(); } else { const { imported } = specifier; if (importedIsString) { throw this.raise(_parseError.Errors.ImportBindingIsString, { at: specifier, importName: imported.value }); } this.checkReservedWord(imported.name, specifier.loc.start, true, true); if (!specifier.local) { specifier.local = (0, _node.cloneIdentifier)(imported); } } return this.finishImportSpecifier(specifier, "ImportSpecifier", bindingType); } isThisParam(param) { return param.type === "Identifier" && param.name === "this"; } } exports.default = StatementParser; //# sourceMappingURL=statement.js.map lib/parser/statement.js.map 0000644 00000573437 15120211212 0011732 0 ustar 00 {"version":3,"names":["_types","require","_expression","_parseError","_identifier","_scopeflags","_util","_productionParameter","_expressionScope","_tokenizer","_location","_node","_lval","loopLabel","kind","switchLabel","ParseFunctionFlag","Expression","Declaration","HangingDeclaration","NullableId","Async","exports","ParseStatementFlag","StatementOnly","AllowImportExport","AllowDeclaration","AllowFunctionDeclaration","AllowLabeledFunction","loneSurrogate","keywordRelationalOperator","babel7CompatTokens","tokens","input","i","length","token","type","loc","start","value","end","hashEndPos","hashEndLoc","createPositionWithColumnOffset","splice","Token","getExportedToken","startLoc","endLoc","tokenIsTemplate","backquoteEnd","backquoteEndLoc","startToken","charCodeAt","templateValue","templateElementEnd","templateElementEndLoc","endToken","slice","StatementParser","ExpressionParser","parseTopLevel","file","program","parseProgram","comments","state","options","finishNode","sourceType","interpreter","parseInterpreterDirective","parseBlockBody","inModule","allowUndeclaredExports","scope","undefinedExports","size","localName","at","Array","from","raise","Errors","ModuleExportUndefined","finishedProgram","finishNodeAt","stmtToDirective","stmt","directive","expression","directiveLiteral","expressionValue","raw","val","addExtra","match","node","startNode","next","isLet","isContextual","hasFollowingBindingAtom","chStartsBindingIdentifier","ch","pos","isIdentifierStart","lastIndex","test","endCh","codePointAtPos","isIdentifierChar","chStartsBindingPattern","nextTokenStart","nextCh","hasInLineFollowingBindingIdentifier","nextTokenInLineStart","startsUsingForOf","containsEsc","lookahead","tokenIsIdentifier","hasFollowingLineBreak","expectPlugin","startsAwaitUsing","isUnparsedContextual","nextTokenInLineStartSince","parseModuleItem","parseStatementLike","parseStatementListItem","annexB","strict","parseStatementOrSloppyAnnexBFunctionDeclaration","allowLabeledFunction","flags","parseStatement","decorators","parseDecorators","parseStatementContent","starttype","allowDeclaration","allowFunctionDeclaration","topLevel","parseBreakContinueStatement","parseDebuggerStatement","parseDoWhileStatement","parseForStatement","lookaheadCharCode","StrictFunction","SloppyFunctionAnnexB","SloppyFunction","parseFunctionStatement","unexpected","parseClass","maybeTakeDecorators","parseIfStatement","parseReturnStatement","parseSwitchStatement","parseThrowStatement","parseTryStatement","isAwaitAllowed","AwaitUsingNotInAsyncContext","UnexpectedLexicalDeclaration","parseVarStatement","inTopLevel","UnexpectedUsingDeclaration","parseWhileStatement","parseWithStatement","parseBlock","parseEmptyStatement","nextTokenCharCode","allowImportExportEverywhere","UnexpectedImportExport","result","parseImport","importKind","sawUnambiguousESM","parseExport","exportKind","assertModuleNodeAllowed","isAsyncFunction","AsyncFunctionInSingleStatementContext","maybeName","expr","parseExpression","eat","parseLabeledStatement","parseExpressionStatement","ImportOutsideModule","decoratorsEnabledBeforeExport","hasPlugin","getPluginOption","maybeDecorators","classNode","exportNode","DecoratorsBeforeAfterExport","unshift","resetStartLocationFromNode","canHaveLeadingDecorator","allowExport","push","parseDecorator","DecoratorExportClass","UnexpectedLeadingDecorator","expectOnePlugin","expect","wrapParenthesis","paramsStartLoc","parseMaybeDecoratorArguments","DecoratorArgumentsOutsideParentheses","parseIdentifier","startNodeAt","object","classScope","usePrivateName","property","parsePrivateName","computed","parseExprSubscripts","startNodeAtNode","callee","arguments","parseCallExpressionArguments","toReferencedList","isBreak","isLineTerminator","label","semicolon","verifyBreakContinue","labels","lab","name","IllegalBreakContinue","parseHeaderExpression","body","withSmartMixTopicForbiddingContext","pop","awaitAt","eatContextual","lastTokStartLoc","enter","SCOPE_OTHER","parseFor","startsWithLet","startsWithAwaitUsing","starsWithUsingDeclaration","isLetOrUsing","initNode","parseVar","init","isForIn","ForInUsing","declarations","parseForIn","startsWithAsync","refExpressionErrors","ExpressionErrors","isForOf","ForOfLet","ForOfAsync","checkDestructuringPrivate","toAssignable","checkLVal","in","checkExpressionErrors","isAsync","isHangingDeclaration","parseFunction","consequent","alternate","prodParam","hasReturn","allowReturnOutsideFunction","IllegalReturn","argument","discriminant","cases","cur","sawDefault","isCase","MultipleDefaultsInSwitch","exit","hasPrecedingLineBreak","NewlineAfterThrow","lastTokEndLoc","parseCatchClauseParam","param","parseBindingAtom","SCOPE_SIMPLE_CATCH","binding","BIND_CATCH_PARAM","block","handler","clause","finalizer","NoCatchOrFinally","allowMissingInitializer","StrictWith","LabelRedeclaration","labelName","tokenIsLoop","statementStart","allowDirectives","createNewLexicalScope","afterBlockParse","strictErrors","clear","isValidDirective","extra","parenthesized","directives","parseBlockOrModuleBlockBody","undefined","oldStrict","hasStrictModeDirective","parsedNonDirective","setStrict","call","update","await","id","ForInOfLoopInitializer","InvalidLhs","ancestor","left","right","parseMaybeAssignAllowIn","isFor","decl","parseVarId","parseMaybeAssignDisallowIn","DeclarationMissingInitializer","BIND_VAR","BIND_LEXICAL","parseAsyncFunctionExpression","hangingDeclaration","isDeclaration","requireId","initFunction","GeneratorInSingleStatementContext","generator","parseFunctionId","oldMaybeInArrowParameters","maybeInArrowParameters","SCOPE_FUNCTION","functionFlags","parseFunctionParams","parseFunctionBodyAndFinish","registerFunctionStatementId","isConstructor","expressionScope","newParameterDeclarationScope","params","parseBindingList","ParseBindingListFlags","IS_FUNCTION_PARAMS","IS_CONSTRUCTOR_PARAMS","declareName","async","treatFunctionsAsVar","BIND_FUNCTION","isStatement","optionalId","parseClassId","parseClassSuper","parseClassBody","superClass","isClassProperty","isClassMethod","isNonstaticConstructor","method","static","key","hadSuperClass","hadConstructor","classBody","DecoratorSemicolon","member","parseClassMember","DecoratorConstructor","TrailingDecorator","parseClassMemberFromModifier","pushClassMethod","prop","parseClassProperty","resetPreviousNodeTrailingComments","isStatic","parseClassStaticBlock","parseClassMemberWithIsStatic","publicMethod","privateMethod","publicProp","privateProp","accessorProp","publicMember","parsePropertyNamePrefixOperator","isPrivateName","parseClassElementName","pushClassPrivateMethod","ConstructorIsGenerator","isPrivate","maybeQuestionTokenStartLoc","parsePostMemberNameModifiers","allowsDirectSuper","DuplicateConstructor","override","OverrideOnConstructor","pushClassPrivateProperty","pushClassProperty","isGenerator","optional","ConstructorIsAsync","ConstructorIsAccessor","checkGetterSetterParams","pushClassAccessorProperty","StaticPrototype","ConstructorClassPrivateField","parsePropertyName","_member$decorators","SCOPE_CLASS","SCOPE_STATIC_BLOCK","SCOPE_SUPER","oldLabels","PARAM","DecoratorStaticBlock","ConstructorClassField","parseClassPrivateProperty","declarePrivateName","getPrivateNameSV","CLASS_ELEMENT_OTHER","parseClassAccessorProperty","parseMethod","CLASS_ELEMENT_STATIC_GETTER","CLASS_ELEMENT_INSTANCE_GETTER","CLASS_ELEMENT_STATIC_SETTER","CLASS_ELEMENT_INSTANCE_SETTER","declareClassPrivateMethodInScope","methodOrProp","parseInitializer","newExpressionScope","bindingType","BIND_CLASS","declareNameFromIdentifier","MissingClassName","maybeDefaultIdentifier","parseMaybeImportPhase","hasDefault","maybeParseExportDefaultSpecifier","parseAfterDefault","hasStar","eatExportStar","hasNamespace","maybeParseExportNamespaceSpecifier","parseAfterNamespace","isFromRequired","UnsupportedDecoratorExport","parseExportFrom","hasSpecifiers","maybeParseExportNamedSpecifiers","hasDeclaration","maybeParseExportDeclaration","_node2$declaration","node2","checkExport","source","declaration","parseExportDefaultExpression","isExportDefaultSpecifier","specifier","exported","specifiers","parseModuleExportName","isTypeExport","parseExportSpecifiers","assertions","shouldParseExportDeclaration","parseExportDeclaration","DecoratorBeforeExport","UnsupportedDefaultExport","res","nextType","hasFrom","nextAfterFrom","nextTokenStartSince","parseImportSource","maybeParseImportAttributes","checkJSONModuleImport","checkNames","isDefault","isFrom","checkDuplicateExports","_declaration$extra","ExportDefaultFromAsIdentifier","exportName","local","ExportBindingIsString","checkReservedWord","checkLocalExport","Error","checkDeclaration","properties","elem","elements","exportedIdentifiers","has","DuplicateDefaultExport","DuplicateExport","add","isInTypeExport","nodes","first","isMaybeTypeOnly","isString","parseExportSpecifier","cloneStringLiteral","cloneIdentifier","parseStringLiteral","surrogate","ModuleExportNameHasLoneSurrogate","surrogateCharCode","isJSONModuleImport","some","checkImportReflection","module","_node$assertions","ImportReflectionNotBinding","ImportReflectionHasAssertion","nonDefaultNamedSpecifier","find","imported","ImportJSONBindingNotDefault","isPotentialImportPhase","isExport","applyImportPhase","phase","phaseIdentifier","isImportPhase","tokenIsKeywordOrIdentifier","resetPreviousIdentifierLeadingComments","isPrecedingIdImportPhase","parseImportSourceAndAttributes","parseImportSpecifiersAndAfter","maybeParseDefaultImportSpecifier","parseNext","maybeParseStarImportSpecifier","parseNamedImportSpecifiers","expectContextual","_node$specifiers","parseExprAtom","parseImportSpecifierLocal","finishImportSpecifier","parseImportAttributes","attrs","attrNames","Set","keyName","ModuleAttributesWithDuplicateKeys","ModuleAttributeInvalidValue","parseModuleAttributes","attributes","ModuleAttributeDifferentFromType","useWith","expectImportAttributesPlugin","ImportAttributesUseAssert","DestructureNamedImport","importedIsString","importSpecifier","parseImportSpecifier","isInTypeOnlyImport","ImportBindingIsString","importName","isThisParam","default"],"sources":["../../src/parser/statement.ts"],"sourcesContent":["import type * as N from \"../types\";\nimport {\n tokenIsIdentifier,\n tokenIsKeywordOrIdentifier,\n tokenIsLoop,\n tokenIsTemplate,\n tt,\n type TokenType,\n getExportedToken,\n} from \"../tokenizer/types\";\nimport ExpressionParser from \"./expression\";\nimport { Errors } from \"../parse-error\";\nimport { isIdentifierChar, isIdentifierStart } from \"../util/identifier\";\nimport * as charCodes from \"charcodes\";\nimport {\n BIND_CLASS,\n BIND_LEXICAL,\n BIND_VAR,\n BIND_FUNCTION,\n SCOPE_CLASS,\n SCOPE_FUNCTION,\n SCOPE_OTHER,\n SCOPE_SIMPLE_CATCH,\n SCOPE_STATIC_BLOCK,\n SCOPE_SUPER,\n CLASS_ELEMENT_OTHER,\n CLASS_ELEMENT_INSTANCE_GETTER,\n CLASS_ELEMENT_INSTANCE_SETTER,\n CLASS_ELEMENT_STATIC_GETTER,\n CLASS_ELEMENT_STATIC_SETTER,\n type BindingTypes,\n BIND_CATCH_PARAM,\n} from \"../util/scopeflags\";\nimport { ExpressionErrors } from \"./util\";\nimport { PARAM, functionFlags } from \"../util/production-parameter\";\nimport {\n newExpressionScope,\n newParameterDeclarationScope,\n} from \"../util/expression-scope\";\nimport type { SourceType } from \"../options\";\nimport { Token } from \"../tokenizer\";\nimport type { Position } from \"../util/location\";\nimport { createPositionWithColumnOffset } from \"../util/location\";\nimport { cloneStringLiteral, cloneIdentifier, type Undone } from \"./node\";\nimport type Parser from \"./index\";\nimport { ParseBindingListFlags } from \"./lval\";\n\nconst loopLabel = { kind: \"loop\" } as const,\n switchLabel = { kind: \"switch\" } as const;\n\nexport const enum ParseFunctionFlag {\n Expression = 0b0000,\n Declaration = 0b0001,\n HangingDeclaration = 0b0010,\n NullableId = 0b0100,\n Async = 0b1000,\n}\n\nexport const enum ParseStatementFlag {\n StatementOnly = 0b0000,\n AllowImportExport = 0b0001,\n AllowDeclaration = 0b0010,\n AllowFunctionDeclaration = 0b0100,\n AllowLabeledFunction = 0b1000,\n}\n\nconst loneSurrogate = /[\\uD800-\\uDFFF]/u;\n\nconst keywordRelationalOperator = /in(?:stanceof)?/y;\n\n/**\n * Convert tokens for backward Babel 7 compat.\n * tt.privateName => tt.hash + tt.name\n * tt.templateTail => tt.backquote/tt.braceR + tt.template + tt.backquote\n * tt.templateNonTail => tt.backquote/tt.braceR + tt.template + tt.dollarBraceL\n * For performance reasons this routine mutates `tokens`, it is okay\n * here since we execute `parseTopLevel` once for every file.\n */\nfunction babel7CompatTokens(tokens: (Token | N.Comment)[], input: string) {\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n const { type } = token;\n if (typeof type === \"number\") {\n if (!process.env.BABEL_8_BREAKING) {\n if (type === tt.privateName) {\n const { loc, start, value, end } = token;\n const hashEndPos = start + 1;\n const hashEndLoc = createPositionWithColumnOffset(loc.start, 1);\n tokens.splice(\n i,\n 1,\n new Token({\n // @ts-expect-error: hacky way to create token\n type: getExportedToken(tt.hash),\n value: \"#\",\n start: start,\n end: hashEndPos,\n startLoc: loc.start,\n endLoc: hashEndLoc,\n }),\n new Token({\n // @ts-expect-error: hacky way to create token\n type: getExportedToken(tt.name),\n value: value,\n start: hashEndPos,\n end: end,\n startLoc: hashEndLoc,\n endLoc: loc.end,\n }),\n );\n i++;\n continue;\n }\n\n if (tokenIsTemplate(type)) {\n const { loc, start, value, end } = token;\n const backquoteEnd = start + 1;\n const backquoteEndLoc = createPositionWithColumnOffset(loc.start, 1);\n let startToken;\n if (input.charCodeAt(start) === charCodes.graveAccent) {\n startToken = new Token({\n // @ts-expect-error: hacky way to create token\n type: getExportedToken(tt.backQuote),\n value: \"`\",\n start: start,\n end: backquoteEnd,\n startLoc: loc.start,\n endLoc: backquoteEndLoc,\n });\n } else {\n startToken = new Token({\n // @ts-expect-error: hacky way to create token\n type: getExportedToken(tt.braceR),\n value: \"}\",\n start: start,\n end: backquoteEnd,\n startLoc: loc.start,\n endLoc: backquoteEndLoc,\n });\n }\n let templateValue,\n templateElementEnd,\n templateElementEndLoc,\n endToken;\n if (type === tt.templateTail) {\n // ends with '`'\n templateElementEnd = end - 1;\n templateElementEndLoc = createPositionWithColumnOffset(loc.end, -1);\n templateValue = value === null ? null : value.slice(1, -1);\n endToken = new Token({\n // @ts-expect-error: hacky way to create token\n type: getExportedToken(tt.backQuote),\n value: \"`\",\n start: templateElementEnd,\n end: end,\n startLoc: templateElementEndLoc,\n endLoc: loc.end,\n });\n } else {\n // ends with `${`\n templateElementEnd = end - 2;\n templateElementEndLoc = createPositionWithColumnOffset(loc.end, -2);\n templateValue = value === null ? null : value.slice(1, -2);\n endToken = new Token({\n // @ts-expect-error: hacky way to create token\n type: getExportedToken(tt.dollarBraceL),\n value: \"${\",\n start: templateElementEnd,\n end: end,\n startLoc: templateElementEndLoc,\n endLoc: loc.end,\n });\n }\n tokens.splice(\n i,\n 1,\n startToken,\n new Token({\n // @ts-expect-error: hacky way to create token\n type: getExportedToken(tt.template),\n value: templateValue,\n start: backquoteEnd,\n end: templateElementEnd,\n startLoc: backquoteEndLoc,\n endLoc: templateElementEndLoc,\n }),\n endToken,\n );\n i += 2;\n continue;\n }\n }\n // @ts-expect-error: we manipulate `token` for performance reasons\n token.type = getExportedToken(type);\n }\n }\n return tokens;\n}\nexport default abstract class StatementParser extends ExpressionParser {\n // ### Statement parsing\n\n // Parse a program. Initializes the parser, reads any number of\n // statements, and wraps them in a Program node. Optionally takes a\n // `program` argument. If present, the statements will be appended\n // to its body instead of creating a new node.\n\n parseTopLevel(this: Parser, file: N.File, program: N.Program): N.File {\n file.program = this.parseProgram(program);\n file.comments = this.state.comments;\n\n if (this.options.tokens) {\n file.tokens = babel7CompatTokens(this.tokens, this.input);\n }\n\n return this.finishNode(file, \"File\");\n }\n\n parseProgram(\n this: Parser,\n program: Undone<N.Program>,\n end: TokenType = tt.eof,\n sourceType: SourceType = this.options.sourceType,\n ): N.Program {\n program.sourceType = sourceType;\n program.interpreter = this.parseInterpreterDirective();\n this.parseBlockBody(program, true, true, end);\n if (\n this.inModule &&\n !this.options.allowUndeclaredExports &&\n this.scope.undefinedExports.size > 0\n ) {\n for (const [localName, at] of Array.from(this.scope.undefinedExports)) {\n this.raise(Errors.ModuleExportUndefined, { at, localName });\n }\n }\n let finishedProgram: N.Program;\n if (end === tt.eof) {\n // finish at eof for top level program\n finishedProgram = this.finishNode(program, \"Program\");\n } else {\n // finish immediately before the end token\n finishedProgram = this.finishNodeAt(\n program,\n \"Program\",\n createPositionWithColumnOffset(this.state.startLoc, -1),\n );\n }\n return finishedProgram;\n }\n\n /**\n * cast a Statement to a Directive. This method mutates input statement.\n */\n stmtToDirective(stmt: N.Statement): N.Directive {\n const directive = stmt as any;\n directive.type = \"Directive\";\n directive.value = directive.expression;\n delete directive.expression;\n\n const directiveLiteral = directive.value;\n const expressionValue = directiveLiteral.value;\n const raw = this.input.slice(directiveLiteral.start, directiveLiteral.end);\n const val = (directiveLiteral.value = raw.slice(1, -1)); // remove quotes\n\n this.addExtra(directiveLiteral, \"raw\", raw);\n this.addExtra(directiveLiteral, \"rawValue\", val);\n this.addExtra(directiveLiteral, \"expressionValue\", expressionValue);\n\n directiveLiteral.type = \"DirectiveLiteral\";\n\n return directive;\n }\n\n parseInterpreterDirective(): N.InterpreterDirective | null {\n if (!this.match(tt.interpreterDirective)) {\n return null;\n }\n\n const node = this.startNode<N.InterpreterDirective>();\n node.value = this.state.value;\n this.next();\n return this.finishNode(node, \"InterpreterDirective\");\n }\n\n isLet(): boolean {\n if (!this.isContextual(tt._let)) {\n return false;\n }\n return this.hasFollowingBindingAtom();\n }\n\n chStartsBindingIdentifier(ch: number, pos: number) {\n if (isIdentifierStart(ch)) {\n keywordRelationalOperator.lastIndex = pos;\n if (keywordRelationalOperator.test(this.input)) {\n // We have seen `in` or `instanceof` so far, now check if the identifier\n // ends here\n const endCh = this.codePointAtPos(keywordRelationalOperator.lastIndex);\n if (!isIdentifierChar(endCh) && endCh !== charCodes.backslash) {\n return false;\n }\n }\n return true;\n } else if (ch === charCodes.backslash) {\n return true;\n } else {\n return false;\n }\n }\n\n chStartsBindingPattern(ch: number) {\n return (\n ch === charCodes.leftSquareBracket || ch === charCodes.leftCurlyBrace\n );\n }\n\n /**\n * Assuming we have seen a contextual `let` and declaration is allowed, check if it\n * starts a variable declaration so that it should be interpreted as a keyword.\n */\n hasFollowingBindingAtom(): boolean {\n const next = this.nextTokenStart();\n const nextCh = this.codePointAtPos(next);\n return (\n this.chStartsBindingPattern(nextCh) ||\n this.chStartsBindingIdentifier(nextCh, next)\n );\n }\n\n /**\n * Assuming we have seen a contextual `using` and declaration is allowed, check if it\n * starts a variable declaration in the same line so that it should be interpreted as\n * a keyword.\n */\n hasInLineFollowingBindingIdentifier(): boolean {\n const next = this.nextTokenInLineStart();\n const nextCh = this.codePointAtPos(next);\n return this.chStartsBindingIdentifier(nextCh, next);\n }\n\n startsUsingForOf(): boolean {\n const { type, containsEsc } = this.lookahead();\n if (type === tt._of && !containsEsc) {\n // `using of` must start a for-lhs-of statement\n return false;\n } else if (tokenIsIdentifier(type) && !this.hasFollowingLineBreak()) {\n this.expectPlugin(\"explicitResourceManagement\");\n return true;\n }\n }\n\n startsAwaitUsing(): boolean {\n let next = this.nextTokenInLineStart();\n if (this.isUnparsedContextual(next, \"using\")) {\n next = this.nextTokenInLineStartSince(next + 5);\n const nextCh = this.codePointAtPos(next);\n if (this.chStartsBindingIdentifier(nextCh, next)) {\n this.expectPlugin(\"explicitResourceManagement\");\n return true;\n }\n }\n return false;\n }\n\n // https://tc39.es/ecma262/#prod-ModuleItem\n parseModuleItem(this: Parser) {\n return this.parseStatementLike(\n ParseStatementFlag.AllowImportExport |\n ParseStatementFlag.AllowDeclaration |\n ParseStatementFlag.AllowFunctionDeclaration |\n // This function is actually also used to parse StatementItems,\n // which with Annex B enabled allows labeled functions.\n ParseStatementFlag.AllowLabeledFunction,\n );\n }\n\n // https://tc39.es/ecma262/#prod-StatementListItem\n parseStatementListItem(this: Parser) {\n return this.parseStatementLike(\n ParseStatementFlag.AllowDeclaration |\n ParseStatementFlag.AllowFunctionDeclaration |\n (!this.options.annexB || this.state.strict\n ? 0\n : ParseStatementFlag.AllowLabeledFunction),\n );\n }\n\n parseStatementOrSloppyAnnexBFunctionDeclaration(\n this: Parser,\n allowLabeledFunction: boolean = false,\n ) {\n let flags: ParseStatementFlag = ParseStatementFlag.StatementOnly;\n if (this.options.annexB && !this.state.strict) {\n flags |= ParseStatementFlag.AllowFunctionDeclaration;\n if (allowLabeledFunction) {\n flags |= ParseStatementFlag.AllowLabeledFunction;\n }\n }\n return this.parseStatementLike(flags);\n }\n\n // Parse a single statement.\n //\n // If expecting a statement and finding a slash operator, parse a\n // regular expression literal. This is to handle cases like\n // `if (foo) /blah/.exec(foo)`, where looking at the previous token\n // does not help.\n // https://tc39.es/ecma262/#prod-Statement\n parseStatement(this: Parser) {\n return this.parseStatementLike(ParseStatementFlag.StatementOnly);\n }\n\n // ImportDeclaration and ExportDeclaration are also handled here so we can throw recoverable errors\n // when they are not at the top level\n parseStatementLike(\n this: Parser,\n flags: ParseStatementFlag,\n ):\n | N.Statement\n | N.Declaration\n | N.ImportDeclaration\n | N.ExportDefaultDeclaration\n | N.ExportNamedDeclaration\n | N.ExportAllDeclaration {\n let decorators: N.Decorator[] | null = null;\n\n if (this.match(tt.at)) {\n decorators = this.parseDecorators(true);\n }\n return this.parseStatementContent(flags, decorators);\n }\n\n parseStatementContent(\n this: Parser,\n flags: ParseStatementFlag,\n decorators?: N.Decorator[] | null,\n ): N.Statement {\n const starttype = this.state.type;\n const node = this.startNode();\n const allowDeclaration = !!(flags & ParseStatementFlag.AllowDeclaration);\n const allowFunctionDeclaration = !!(\n flags & ParseStatementFlag.AllowFunctionDeclaration\n );\n const topLevel = flags & ParseStatementFlag.AllowImportExport;\n\n // Most types of statements are recognized by the keyword they\n // start with. Many are trivial to parse, some require a bit of\n // complexity.\n\n switch (starttype) {\n case tt._break:\n return this.parseBreakContinueStatement(node, /* isBreak */ true);\n case tt._continue:\n return this.parseBreakContinueStatement(node, /* isBreak */ false);\n case tt._debugger:\n return this.parseDebuggerStatement(node as Undone<N.DebuggerStatement>);\n case tt._do:\n return this.parseDoWhileStatement(node as Undone<N.DoWhileStatement>);\n case tt._for:\n return this.parseForStatement(node as Undone<N.ForStatement>);\n case tt._function:\n if (this.lookaheadCharCode() === charCodes.dot) break;\n if (!allowFunctionDeclaration) {\n this.raise(\n this.state.strict\n ? Errors.StrictFunction\n : this.options.annexB\n ? Errors.SloppyFunctionAnnexB\n : Errors.SloppyFunction,\n { at: this.state.startLoc },\n );\n }\n return this.parseFunctionStatement(\n node as Undone<N.FunctionDeclaration>,\n false,\n !allowDeclaration && allowFunctionDeclaration,\n );\n case tt._class:\n if (!allowDeclaration) this.unexpected();\n return this.parseClass(\n this.maybeTakeDecorators(\n decorators,\n node as Undone<N.ClassDeclaration>,\n ),\n true,\n );\n\n case tt._if:\n return this.parseIfStatement(node as Undone<N.IfStatement>);\n case tt._return:\n return this.parseReturnStatement(node as Undone<N.ReturnStatement>);\n case tt._switch:\n return this.parseSwitchStatement(node as Undone<N.SwitchStatement>);\n case tt._throw:\n return this.parseThrowStatement(node as Undone<N.ThrowStatement>);\n case tt._try:\n return this.parseTryStatement(node as Undone<N.TryStatement>);\n\n case tt._await:\n // [+Await] await [no LineTerminator here] using [no LineTerminator here] BindingList[+Using]\n if (!this.state.containsEsc && this.startsAwaitUsing()) {\n if (!this.isAwaitAllowed()) {\n this.raise(Errors.AwaitUsingNotInAsyncContext, { at: node });\n } else if (!allowDeclaration) {\n this.raise(Errors.UnexpectedLexicalDeclaration, {\n at: node,\n });\n }\n this.next(); // eat 'await'\n return this.parseVarStatement(\n node as Undone<N.VariableDeclaration>,\n \"await using\",\n );\n }\n break;\n case tt._using:\n // using [no LineTerminator here] BindingList[+Using]\n if (\n this.state.containsEsc ||\n !this.hasInLineFollowingBindingIdentifier()\n ) {\n break;\n }\n this.expectPlugin(\"explicitResourceManagement\");\n if (!this.scope.inModule && this.scope.inTopLevel) {\n this.raise(Errors.UnexpectedUsingDeclaration, {\n at: this.state.startLoc,\n });\n } else if (!allowDeclaration) {\n this.raise(Errors.UnexpectedLexicalDeclaration, {\n at: this.state.startLoc,\n });\n }\n return this.parseVarStatement(\n node as Undone<N.VariableDeclaration>,\n \"using\",\n );\n case tt._let: {\n if (this.state.containsEsc) {\n break;\n }\n // `let [` is an explicit negative lookahead for\n // ExpressionStatement, so special-case it first.\n const next = this.nextTokenStart();\n const nextCh = this.codePointAtPos(next);\n if (nextCh !== charCodes.leftSquareBracket) {\n if (!allowDeclaration && this.hasFollowingLineBreak()) break;\n if (\n !this.chStartsBindingIdentifier(nextCh, next) &&\n nextCh !== charCodes.leftCurlyBrace\n ) {\n break;\n }\n }\n }\n // fall through\n case tt._const: {\n if (!allowDeclaration) {\n this.raise(Errors.UnexpectedLexicalDeclaration, {\n at: this.state.startLoc,\n });\n }\n }\n // fall through\n case tt._var: {\n const kind = this.state.value;\n return this.parseVarStatement(\n node as Undone<N.VariableDeclaration>,\n kind,\n );\n }\n case tt._while:\n return this.parseWhileStatement(node as Undone<N.WhileStatement>);\n case tt._with:\n return this.parseWithStatement(node as Undone<N.WithStatement>);\n case tt.braceL:\n return this.parseBlock();\n case tt.semi:\n return this.parseEmptyStatement(node as Undone<N.EmptyStatement>);\n case tt._import: {\n const nextTokenCharCode = this.lookaheadCharCode();\n if (\n nextTokenCharCode === charCodes.leftParenthesis || // import()\n nextTokenCharCode === charCodes.dot // import.meta\n ) {\n break;\n }\n }\n // fall through\n case tt._export: {\n if (!this.options.allowImportExportEverywhere && !topLevel) {\n this.raise(Errors.UnexpectedImportExport, {\n at: this.state.startLoc,\n });\n }\n\n this.next(); // eat `import`/`export`\n\n let result;\n if (starttype === tt._import) {\n result = this.parseImport(node as Undone<N.ImportDeclaration>);\n\n if (\n result.type === \"ImportDeclaration\" &&\n (!result.importKind || result.importKind === \"value\")\n ) {\n this.sawUnambiguousESM = true;\n }\n } else {\n result = this.parseExport(\n node as Undone<\n | N.ExportAllDeclaration\n | N.ExportDefaultDeclaration\n | N.ExportDefaultDeclaration\n >,\n decorators,\n );\n\n if (\n (result.type === \"ExportNamedDeclaration\" &&\n (!result.exportKind || result.exportKind === \"value\")) ||\n (result.type === \"ExportAllDeclaration\" &&\n (!result.exportKind || result.exportKind === \"value\")) ||\n result.type === \"ExportDefaultDeclaration\"\n ) {\n this.sawUnambiguousESM = true;\n }\n }\n\n this.assertModuleNodeAllowed(result);\n\n return result;\n }\n\n default: {\n if (this.isAsyncFunction()) {\n if (!allowDeclaration) {\n this.raise(Errors.AsyncFunctionInSingleStatementContext, {\n at: this.state.startLoc,\n });\n }\n this.next(); // eat 'async'\n return this.parseFunctionStatement(\n node as Undone<N.FunctionDeclaration>,\n true,\n !allowDeclaration && allowFunctionDeclaration,\n );\n }\n }\n }\n\n // If the statement does not start with a statement keyword or a\n // brace, it's an ExpressionStatement or LabeledStatement. We\n // simply start parsing an expression, and afterwards, if the\n // next token is a colon and the expression was a simple\n // Identifier node, we switch to interpreting it as a label.\n const maybeName = this.state.value;\n const expr = this.parseExpression();\n\n if (\n tokenIsIdentifier(starttype) &&\n expr.type === \"Identifier\" &&\n this.eat(tt.colon)\n ) {\n return this.parseLabeledStatement(\n node as Undone<N.LabeledStatement>,\n maybeName,\n // @ts-expect-error migrate to Babel types\n expr,\n flags,\n );\n } else {\n return this.parseExpressionStatement(\n node as Undone<N.ExpressionStatement>,\n expr,\n decorators,\n );\n }\n }\n\n assertModuleNodeAllowed(node: N.Node): void {\n if (!this.options.allowImportExportEverywhere && !this.inModule) {\n this.raise(Errors.ImportOutsideModule, { at: node });\n }\n }\n\n decoratorsEnabledBeforeExport(): boolean {\n if (this.hasPlugin(\"decorators-legacy\")) return true;\n return (\n this.hasPlugin(\"decorators\") &&\n this.getPluginOption(\"decorators\", \"decoratorsBeforeExport\") !== false\n );\n }\n\n // Attach the decorators to the given class.\n // NOTE: This method changes the .start location of the class, and thus\n // can affect comment attachment. Calling it before or after finalizing\n // the class node (and thus finalizing its comments) changes how comments\n // before the `class` keyword or before the final .start location of the\n // class are attached.\n maybeTakeDecorators<T extends Undone<N.Class>>(\n maybeDecorators: N.Decorator[] | null,\n classNode: T,\n exportNode?: Undone<N.ExportDefaultDeclaration | N.ExportNamedDeclaration>,\n ): T {\n if (maybeDecorators) {\n if (classNode.decorators && classNode.decorators.length > 0) {\n // Note: decorators attachment is only attempred multiple times\n // when the class is part of an export declaration.\n if (\n typeof this.getPluginOption(\n \"decorators\",\n \"decoratorsBeforeExport\",\n ) !== \"boolean\"\n ) {\n // If `decoratorsBeforeExport` was set to `true` or `false`, we\n // already threw an error about decorators not being in a valid\n // position.\n this.raise(Errors.DecoratorsBeforeAfterExport, {\n at: classNode.decorators[0],\n });\n }\n classNode.decorators.unshift(...maybeDecorators);\n } else {\n classNode.decorators = maybeDecorators;\n }\n this.resetStartLocationFromNode(classNode, maybeDecorators[0]);\n if (exportNode) this.resetStartLocationFromNode(exportNode, classNode);\n }\n return classNode;\n }\n\n canHaveLeadingDecorator(): boolean {\n return this.match(tt._class);\n }\n\n parseDecorators(this: Parser, allowExport?: boolean): N.Decorator[] {\n const decorators = [];\n do {\n decorators.push(this.parseDecorator());\n } while (this.match(tt.at));\n\n if (this.match(tt._export)) {\n if (!allowExport) {\n this.unexpected();\n }\n\n if (!this.decoratorsEnabledBeforeExport()) {\n this.raise(Errors.DecoratorExportClass, { at: this.state.startLoc });\n }\n } else if (!this.canHaveLeadingDecorator()) {\n throw this.raise(Errors.UnexpectedLeadingDecorator, {\n at: this.state.startLoc,\n });\n }\n\n return decorators;\n }\n\n parseDecorator(this: Parser): N.Decorator {\n this.expectOnePlugin([\"decorators\", \"decorators-legacy\"]);\n\n const node = this.startNode<N.Decorator>();\n this.next();\n\n if (this.hasPlugin(\"decorators\")) {\n const startLoc = this.state.startLoc;\n let expr: N.Expression;\n\n if (this.match(tt.parenL)) {\n const startLoc = this.state.startLoc;\n this.next(); // eat '('\n expr = this.parseExpression();\n this.expect(tt.parenR);\n expr = this.wrapParenthesis(startLoc, expr);\n\n const paramsStartLoc = this.state.startLoc;\n node.expression = this.parseMaybeDecoratorArguments(expr);\n if (\n this.getPluginOption(\"decorators\", \"allowCallParenthesized\") ===\n false &&\n node.expression !== expr\n ) {\n this.raise(Errors.DecoratorArgumentsOutsideParentheses, {\n at: paramsStartLoc,\n });\n }\n } else {\n expr = this.parseIdentifier(false);\n\n while (this.eat(tt.dot)) {\n const node = this.startNodeAt(startLoc);\n node.object = expr;\n if (this.match(tt.privateName)) {\n this.classScope.usePrivateName(\n this.state.value,\n this.state.startLoc,\n );\n node.property = this.parsePrivateName();\n } else {\n node.property = this.parseIdentifier(true);\n }\n node.computed = false;\n expr = this.finishNode(node, \"MemberExpression\");\n }\n\n node.expression = this.parseMaybeDecoratorArguments(expr);\n }\n } else {\n node.expression = this.parseExprSubscripts();\n }\n return this.finishNode(node, \"Decorator\");\n }\n\n parseMaybeDecoratorArguments(this: Parser, expr: N.Expression): N.Expression {\n if (this.eat(tt.parenL)) {\n const node = this.startNodeAtNode(expr);\n node.callee = expr;\n node.arguments = this.parseCallExpressionArguments(tt.parenR, false);\n this.toReferencedList(node.arguments);\n return this.finishNode(node, \"CallExpression\");\n }\n\n return expr;\n }\n\n parseBreakContinueStatement(\n node: Undone<N.Node>,\n isBreak: true,\n ): N.BreakStatement;\n parseBreakContinueStatement(\n node: Undone<N.Node>,\n isBreak: false,\n ): N.ContinueStatement;\n parseBreakContinueStatement(\n node: Undone<N.BreakStatement | N.ContinueStatement>,\n isBreak: boolean,\n ): N.BreakStatement | N.ContinueStatement {\n this.next();\n\n if (this.isLineTerminator()) {\n node.label = null;\n } else {\n node.label = this.parseIdentifier();\n this.semicolon();\n }\n\n this.verifyBreakContinue(node, isBreak);\n\n return this.finishNode(\n node,\n isBreak ? \"BreakStatement\" : \"ContinueStatement\",\n );\n }\n\n verifyBreakContinue(\n node: Undone<N.BreakStatement | N.ContinueStatement>,\n isBreak: boolean,\n ) {\n let i;\n for (i = 0; i < this.state.labels.length; ++i) {\n const lab = this.state.labels[i];\n if (node.label == null || lab.name === node.label.name) {\n if (lab.kind != null && (isBreak || lab.kind === \"loop\")) break;\n if (node.label && isBreak) break;\n }\n }\n if (i === this.state.labels.length) {\n const type = isBreak ? \"BreakStatement\" : \"ContinueStatement\";\n this.raise(Errors.IllegalBreakContinue, { at: node, type });\n }\n }\n\n parseDebuggerStatement(\n node: Undone<N.DebuggerStatement>,\n ): N.DebuggerStatement {\n this.next();\n this.semicolon();\n return this.finishNode(node, \"DebuggerStatement\");\n }\n\n parseHeaderExpression(this: Parser): N.Expression {\n this.expect(tt.parenL);\n const val = this.parseExpression();\n this.expect(tt.parenR);\n return val;\n }\n\n // https://tc39.es/ecma262/#prod-DoWhileStatement\n parseDoWhileStatement(\n this: Parser,\n node: Undone<N.DoWhileStatement>,\n ): N.DoWhileStatement {\n this.next();\n this.state.labels.push(loopLabel);\n\n // Parse the loop body's body.\n node.body =\n // For the smartPipelines plugin: Disable topic references from outer\n // contexts within the loop body. They are permitted in test expressions,\n // outside of the loop body.\n this.withSmartMixTopicForbiddingContext(() =>\n // Parse the loop body's body.\n this.parseStatement(),\n );\n\n this.state.labels.pop();\n\n this.expect(tt._while);\n node.test = this.parseHeaderExpression();\n this.eat(tt.semi);\n return this.finishNode(node, \"DoWhileStatement\");\n }\n\n // Disambiguating between a `for` and a `for`/`in` or `for`/`of`\n // loop is non-trivial. Basically, we have to parse the init `var`\n // statement or expression, disallowing the `in` operator (see\n // the second parameter to `parseExpression`), and then check\n // whether the next token is `in` or `of`. When there is no init\n // part (semicolon immediately after the opening parenthesis), it\n // is a regular `for` loop.\n\n parseForStatement(\n this: Parser,\n node: Undone<N.ForStatement | N.ForInOf>,\n ): N.ForLike {\n this.next();\n this.state.labels.push(loopLabel);\n\n let awaitAt = null;\n\n if (this.isAwaitAllowed() && this.eatContextual(tt._await)) {\n awaitAt = this.state.lastTokStartLoc;\n }\n this.scope.enter(SCOPE_OTHER);\n this.expect(tt.parenL);\n\n if (this.match(tt.semi)) {\n if (awaitAt !== null) {\n this.unexpected(awaitAt);\n }\n return this.parseFor(node as Undone<N.ForStatement>, null);\n }\n\n const startsWithLet = this.isContextual(tt._let);\n {\n const startsWithAwaitUsing =\n this.isContextual(tt._await) && this.startsAwaitUsing();\n const starsWithUsingDeclaration =\n startsWithAwaitUsing ||\n (this.isContextual(tt._using) && this.startsUsingForOf());\n const isLetOrUsing =\n (startsWithLet && this.hasFollowingBindingAtom()) ||\n starsWithUsingDeclaration;\n\n if (this.match(tt._var) || this.match(tt._const) || isLetOrUsing) {\n const initNode = this.startNode<N.VariableDeclaration>();\n let kind;\n if (startsWithAwaitUsing) {\n kind = \"await using\";\n if (!this.isAwaitAllowed()) {\n this.raise(Errors.AwaitUsingNotInAsyncContext, {\n at: this.state.startLoc,\n });\n }\n this.next(); // eat 'await'\n } else {\n kind = this.state.value;\n }\n this.next();\n this.parseVar(initNode, true, kind);\n const init = this.finishNode(initNode, \"VariableDeclaration\");\n\n const isForIn = this.match(tt._in);\n if (isForIn && starsWithUsingDeclaration) {\n this.raise(Errors.ForInUsing, { at: init });\n }\n if (\n (isForIn || this.isContextual(tt._of)) &&\n init.declarations.length === 1\n ) {\n return this.parseForIn(node as Undone<N.ForInOf>, init, awaitAt);\n }\n if (awaitAt !== null) {\n this.unexpected(awaitAt);\n }\n return this.parseFor(node as Undone<N.ForStatement>, init);\n }\n }\n\n // Check whether the first token is possibly a contextual keyword, so that\n // we can forbid `for (async of` if this turns out to be a for-of loop.\n const startsWithAsync = this.isContextual(tt._async);\n\n const refExpressionErrors = new ExpressionErrors();\n const init = this.parseExpression(true, refExpressionErrors);\n const isForOf = this.isContextual(tt._of);\n if (isForOf) {\n // Check for leading tokens that are forbidden in for-of loops:\n if (startsWithLet) {\n this.raise(Errors.ForOfLet, { at: init });\n }\n\n if (\n // `for await (async of []);` is allowed.\n awaitAt === null &&\n startsWithAsync &&\n init.type === \"Identifier\"\n ) {\n // This catches the case where the `async` in `for (async of` was\n // parsed as an identifier. If it was parsed as the start of an async\n // arrow function (e.g. `for (async of => {} of []);`), the LVal check\n // further down will raise a more appropriate error.\n this.raise(Errors.ForOfAsync, { at: init });\n }\n }\n if (isForOf || this.match(tt._in)) {\n this.checkDestructuringPrivate(refExpressionErrors);\n this.toAssignable(init, /* isLHS */ true);\n const type = isForOf ? \"ForOfStatement\" : \"ForInStatement\";\n this.checkLVal(init, { in: { type } });\n return this.parseForIn(\n node as Undone<N.ForInStatement | N.ForOfStatement>,\n // @ts-expect-error init has been transformed to an assignable\n init,\n awaitAt,\n );\n } else {\n this.checkExpressionErrors(refExpressionErrors, true);\n }\n if (awaitAt !== null) {\n this.unexpected(awaitAt);\n }\n return this.parseFor(node as Undone<N.ForStatement>, init);\n }\n\n // https://tc39.es/ecma262/#prod-HoistableDeclaration\n parseFunctionStatement(\n this: Parser,\n node: Undone<N.FunctionDeclaration>,\n isAsync: boolean,\n isHangingDeclaration: boolean,\n ): N.FunctionDeclaration {\n this.next(); // eat 'function'\n return this.parseFunction(\n node,\n ParseFunctionFlag.Declaration |\n (isHangingDeclaration ? ParseFunctionFlag.HangingDeclaration : 0) |\n (isAsync ? ParseFunctionFlag.Async : 0),\n );\n }\n\n // https://tc39.es/ecma262/#prod-IfStatement\n parseIfStatement(this: Parser, node: Undone<N.IfStatement>) {\n this.next();\n node.test = this.parseHeaderExpression();\n // Annex B.3.3\n // https://tc39.es/ecma262/#sec-functiondeclarations-in-ifstatement-statement-clauses\n node.consequent = this.parseStatementOrSloppyAnnexBFunctionDeclaration();\n node.alternate = this.eat(tt._else)\n ? this.parseStatementOrSloppyAnnexBFunctionDeclaration()\n : null;\n return this.finishNode(node, \"IfStatement\");\n }\n\n parseReturnStatement(this: Parser, node: Undone<N.ReturnStatement>) {\n if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) {\n this.raise(Errors.IllegalReturn, { at: this.state.startLoc });\n }\n\n this.next();\n\n // In `return` (and `break`/`continue`), the keywords with\n // optional arguments, we eagerly look for a semicolon or the\n // possibility to insert one.\n\n if (this.isLineTerminator()) {\n node.argument = null;\n } else {\n node.argument = this.parseExpression();\n this.semicolon();\n }\n\n return this.finishNode(node, \"ReturnStatement\");\n }\n\n // https://tc39.es/ecma262/#prod-SwitchStatement\n parseSwitchStatement(this: Parser, node: Undone<N.SwitchStatement>) {\n this.next();\n node.discriminant = this.parseHeaderExpression();\n const cases: N.SwitchStatement[\"cases\"] = (node.cases = []);\n this.expect(tt.braceL);\n this.state.labels.push(switchLabel);\n this.scope.enter(SCOPE_OTHER);\n\n // Statements under must be grouped (by label) in SwitchCase\n // nodes. `cur` is used to keep the node that we are currently\n // adding statements to.\n\n let cur;\n for (let sawDefault; !this.match(tt.braceR); ) {\n if (this.match(tt._case) || this.match(tt._default)) {\n const isCase = this.match(tt._case);\n if (cur) this.finishNode(cur, \"SwitchCase\");\n // @ts-expect-error Fixme\n cases.push((cur = this.startNode()));\n cur.consequent = [];\n this.next();\n if (isCase) {\n cur.test = this.parseExpression();\n } else {\n if (sawDefault) {\n this.raise(Errors.MultipleDefaultsInSwitch, {\n at: this.state.lastTokStartLoc,\n });\n }\n sawDefault = true;\n cur.test = null;\n }\n this.expect(tt.colon);\n } else {\n if (cur) {\n cur.consequent.push(this.parseStatementListItem());\n } else {\n this.unexpected();\n }\n }\n }\n this.scope.exit();\n if (cur) this.finishNode(cur, \"SwitchCase\");\n this.next(); // Closing brace\n this.state.labels.pop();\n return this.finishNode(node, \"SwitchStatement\");\n }\n\n parseThrowStatement(this: Parser, node: Undone<N.ThrowStatement>) {\n this.next();\n if (this.hasPrecedingLineBreak()) {\n this.raise(Errors.NewlineAfterThrow, { at: this.state.lastTokEndLoc });\n }\n node.argument = this.parseExpression();\n this.semicolon();\n return this.finishNode(node, \"ThrowStatement\");\n }\n\n parseCatchClauseParam(this: Parser): N.Pattern {\n const param = this.parseBindingAtom();\n\n this.scope.enter(\n this.options.annexB && param.type === \"Identifier\"\n ? SCOPE_SIMPLE_CATCH\n : 0,\n );\n this.checkLVal(param, {\n in: { type: \"CatchClause\" },\n binding: BIND_CATCH_PARAM,\n });\n\n return param;\n }\n\n parseTryStatement(\n this: Parser,\n node: Undone<N.TryStatement>,\n ): N.TryStatement {\n this.next();\n\n node.block = this.parseBlock();\n node.handler = null;\n\n if (this.match(tt._catch)) {\n const clause = this.startNode<N.CatchClause>();\n this.next();\n if (this.match(tt.parenL)) {\n this.expect(tt.parenL);\n clause.param = this.parseCatchClauseParam();\n this.expect(tt.parenR);\n } else {\n clause.param = null;\n this.scope.enter(SCOPE_OTHER);\n }\n\n // Parse the catch clause's body.\n clause.body =\n // For the smartPipelines plugin: Disable topic references from outer\n // contexts within the catch clause's body.\n this.withSmartMixTopicForbiddingContext(() =>\n // Parse the catch clause's body.\n this.parseBlock(false, false),\n );\n\n this.scope.exit();\n node.handler = this.finishNode(clause, \"CatchClause\");\n }\n\n node.finalizer = this.eat(tt._finally) ? this.parseBlock() : null;\n\n if (!node.handler && !node.finalizer) {\n this.raise(Errors.NoCatchOrFinally, { at: node });\n }\n\n return this.finishNode(node, \"TryStatement\");\n }\n\n // https://tc39.es/ecma262/#prod-VariableStatement\n // https://tc39.es/ecma262/#prod-LexicalDeclaration\n parseVarStatement(\n this: Parser,\n node: Undone<N.VariableDeclaration>,\n kind: \"var\" | \"let\" | \"const\" | \"using\" | \"await using\",\n allowMissingInitializer: boolean = false,\n ): N.VariableDeclaration {\n this.next();\n this.parseVar(node, false, kind, allowMissingInitializer);\n this.semicolon();\n return this.finishNode(node, \"VariableDeclaration\");\n }\n\n // https://tc39.es/ecma262/#prod-WhileStatement\n parseWhileStatement(\n this: Parser,\n node: Undone<N.WhileStatement>,\n ): N.WhileStatement {\n this.next();\n node.test = this.parseHeaderExpression();\n this.state.labels.push(loopLabel);\n\n // Parse the loop body.\n node.body =\n // For the smartPipelines plugin:\n // Disable topic references from outer contexts within the loop body.\n // They are permitted in test expressions, outside of the loop body.\n this.withSmartMixTopicForbiddingContext(() =>\n // Parse loop body.\n this.parseStatement(),\n );\n\n this.state.labels.pop();\n\n return this.finishNode(node, \"WhileStatement\");\n }\n\n parseWithStatement(\n this: Parser,\n node: Undone<N.WithStatement>,\n ): N.WithStatement {\n if (this.state.strict) {\n this.raise(Errors.StrictWith, { at: this.state.startLoc });\n }\n this.next();\n node.object = this.parseHeaderExpression();\n\n // Parse the statement body.\n node.body =\n // For the smartPipelines plugin:\n // Disable topic references from outer contexts within the with statement's body.\n // They are permitted in function default-parameter expressions, which are\n // part of the outer context, outside of the with statement's body.\n this.withSmartMixTopicForbiddingContext(() =>\n // Parse the statement body.\n this.parseStatement(),\n );\n\n return this.finishNode(node, \"WithStatement\");\n }\n\n parseEmptyStatement(node: Undone<N.EmptyStatement>): N.EmptyStatement {\n this.next();\n return this.finishNode(node, \"EmptyStatement\");\n }\n\n // https://tc39.es/ecma262/#prod-LabelledStatement\n parseLabeledStatement(\n this: Parser,\n node: Undone<N.LabeledStatement>,\n maybeName: string,\n expr: N.Identifier,\n flags: ParseStatementFlag,\n ): N.LabeledStatement {\n for (const label of this.state.labels) {\n if (label.name === maybeName) {\n this.raise(Errors.LabelRedeclaration, {\n at: expr,\n labelName: maybeName,\n });\n }\n }\n\n const kind = tokenIsLoop(this.state.type)\n ? \"loop\"\n : this.match(tt._switch)\n ? \"switch\"\n : null;\n for (let i = this.state.labels.length - 1; i >= 0; i--) {\n const label = this.state.labels[i];\n if (label.statementStart === node.start) {\n label.statementStart = this.state.start;\n label.kind = kind;\n } else {\n break;\n }\n }\n\n this.state.labels.push({\n name: maybeName,\n kind: kind,\n statementStart: this.state.start,\n });\n // https://tc39.es/ecma262/#prod-LabelledItem\n node.body =\n flags & ParseStatementFlag.AllowLabeledFunction\n ? this.parseStatementOrSloppyAnnexBFunctionDeclaration(true)\n : this.parseStatement();\n\n this.state.labels.pop();\n node.label = expr;\n return this.finishNode(node, \"LabeledStatement\");\n }\n\n parseExpressionStatement(\n node: Undone<N.ExpressionStatement>,\n expr: N.Expression,\n /* eslint-disable-next-line @typescript-eslint/no-unused-vars -- used in TypeScript parser */\n decorators: N.Decorator[] | null,\n ) {\n node.expression = expr;\n this.semicolon();\n return this.finishNode(node, \"ExpressionStatement\");\n }\n\n // Parse a semicolon-enclosed block of statements, handling `\"use\n // strict\"` declarations when `allowDirectives` is true (used for\n // function bodies).\n\n parseBlock(\n this: Parser,\n allowDirectives: boolean = false,\n createNewLexicalScope: boolean = true,\n afterBlockParse?: (hasStrictModeDirective: boolean) => void,\n ): N.BlockStatement {\n const node = this.startNode<N.BlockStatement>();\n if (allowDirectives) {\n this.state.strictErrors.clear();\n }\n this.expect(tt.braceL);\n if (createNewLexicalScope) {\n this.scope.enter(SCOPE_OTHER);\n }\n this.parseBlockBody(\n node,\n allowDirectives,\n false,\n tt.braceR,\n afterBlockParse,\n );\n if (createNewLexicalScope) {\n this.scope.exit();\n }\n return this.finishNode(node, \"BlockStatement\");\n }\n\n isValidDirective(stmt: N.Statement): boolean {\n return (\n stmt.type === \"ExpressionStatement\" &&\n stmt.expression.type === \"StringLiteral\" &&\n !stmt.expression.extra.parenthesized\n );\n }\n\n parseBlockBody(\n this: Parser,\n node: Undone<N.BlockStatementLike>,\n allowDirectives: boolean | undefined | null,\n topLevel: boolean,\n end: TokenType,\n afterBlockParse?: (hasStrictModeDirective: boolean) => void,\n ): void {\n const body: N.BlockStatementLike[\"body\"] = (node.body = []);\n const directives: N.BlockStatementLike[\"directives\"] = (node.directives =\n []);\n this.parseBlockOrModuleBlockBody(\n body,\n allowDirectives ? directives : undefined,\n topLevel,\n end,\n afterBlockParse,\n );\n }\n\n // Undefined directives means that directives are not allowed.\n // https://tc39.es/ecma262/#prod-Block\n // https://tc39.es/ecma262/#prod-ModuleBody\n parseBlockOrModuleBlockBody(\n this: Parser,\n body: N.Statement[],\n directives: N.Directive[] | undefined | null,\n topLevel: boolean,\n end: TokenType,\n afterBlockParse?: (hasStrictModeDirective: boolean) => void,\n ): void {\n const oldStrict = this.state.strict;\n let hasStrictModeDirective = false;\n let parsedNonDirective = false;\n\n while (!this.match(end)) {\n const stmt = topLevel\n ? this.parseModuleItem()\n : this.parseStatementListItem();\n\n if (directives && !parsedNonDirective) {\n if (this.isValidDirective(stmt)) {\n const directive = this.stmtToDirective(stmt);\n directives.push(directive);\n\n if (\n !hasStrictModeDirective &&\n directive.value.value === \"use strict\"\n ) {\n hasStrictModeDirective = true;\n this.setStrict(true);\n }\n\n continue;\n }\n parsedNonDirective = true;\n // clear strict errors since the strict mode will not change within the block\n this.state.strictErrors.clear();\n }\n body.push(stmt);\n }\n\n if (afterBlockParse) {\n afterBlockParse.call(this, hasStrictModeDirective);\n }\n\n if (!oldStrict) {\n this.setStrict(false);\n }\n\n this.next();\n }\n\n // Parse a regular `for` loop. The disambiguation code in\n // `parseStatement` will already have parsed the init statement or\n // expression.\n\n parseFor(\n this: Parser,\n node: Undone<N.ForStatement>,\n init?: N.VariableDeclaration | N.Expression | null,\n ): N.ForStatement {\n node.init = init;\n this.semicolon(/* allowAsi */ false);\n node.test = this.match(tt.semi) ? null : this.parseExpression();\n this.semicolon(/* allowAsi */ false);\n node.update = this.match(tt.parenR) ? null : this.parseExpression();\n this.expect(tt.parenR);\n\n // Parse the loop body.\n node.body =\n // For the smartPipelines plugin: Disable topic references from outer\n // contexts within the loop body. They are permitted in test expressions,\n // outside of the loop body.\n this.withSmartMixTopicForbiddingContext(() =>\n // Parse the loop body.\n this.parseStatement(),\n );\n\n this.scope.exit();\n this.state.labels.pop();\n\n return this.finishNode(node, \"ForStatement\");\n }\n\n // Parse a `for`/`in` and `for`/`of` loop, which are almost\n // same from parser's perspective.\n\n parseForIn(\n this: Parser,\n node: Undone<N.ForInOf>,\n init: N.VariableDeclaration | N.AssignmentPattern,\n awaitAt?: Position | null,\n ): N.ForInOf {\n const isForIn = this.match(tt._in);\n this.next();\n\n if (isForIn) {\n if (awaitAt !== null) this.unexpected(awaitAt);\n } else {\n node.await = awaitAt !== null;\n }\n\n if (\n init.type === \"VariableDeclaration\" &&\n init.declarations[0].init != null &&\n (!isForIn ||\n !this.options.annexB ||\n this.state.strict ||\n init.kind !== \"var\" ||\n init.declarations[0].id.type !== \"Identifier\")\n ) {\n this.raise(Errors.ForInOfLoopInitializer, {\n at: init,\n type: isForIn ? \"ForInStatement\" : \"ForOfStatement\",\n });\n }\n\n if (init.type === \"AssignmentPattern\") {\n this.raise(Errors.InvalidLhs, {\n at: init,\n ancestor: { type: \"ForStatement\" },\n });\n }\n\n node.left = init;\n node.right = isForIn\n ? this.parseExpression()\n : this.parseMaybeAssignAllowIn();\n this.expect(tt.parenR);\n\n // Parse the loop body.\n node.body =\n // For the smartPipelines plugin:\n // Disable topic references from outer contexts within the loop body.\n // They are permitted in test expressions, outside of the loop body.\n this.withSmartMixTopicForbiddingContext(() =>\n // Parse loop body.\n this.parseStatement(),\n );\n\n this.scope.exit();\n this.state.labels.pop();\n\n return this.finishNode(node, isForIn ? \"ForInStatement\" : \"ForOfStatement\");\n }\n\n // Parse a list of variable declarations.\n\n parseVar(\n this: Parser,\n node: Undone<N.VariableDeclaration>,\n isFor: boolean,\n kind: \"var\" | \"let\" | \"const\" | \"using\" | \"await using\",\n allowMissingInitializer: boolean = false,\n ): Undone<N.VariableDeclaration> {\n const declarations: N.VariableDeclarator[] = (node.declarations = []);\n node.kind = kind;\n for (;;) {\n const decl = this.startNode<N.VariableDeclarator>();\n this.parseVarId(decl, kind);\n decl.init = !this.eat(tt.eq)\n ? null\n : isFor\n ? this.parseMaybeAssignDisallowIn()\n : this.parseMaybeAssignAllowIn();\n\n if (decl.init === null && !allowMissingInitializer) {\n if (\n decl.id.type !== \"Identifier\" &&\n !(isFor && (this.match(tt._in) || this.isContextual(tt._of)))\n ) {\n this.raise(Errors.DeclarationMissingInitializer, {\n at: this.state.lastTokEndLoc,\n kind: \"destructuring\",\n });\n } else if (\n kind === \"const\" &&\n !(this.match(tt._in) || this.isContextual(tt._of))\n ) {\n this.raise(Errors.DeclarationMissingInitializer, {\n at: this.state.lastTokEndLoc,\n kind: \"const\",\n });\n }\n }\n declarations.push(this.finishNode(decl, \"VariableDeclarator\"));\n if (!this.eat(tt.comma)) break;\n }\n return node;\n }\n\n parseVarId(\n this: Parser,\n decl: Undone<N.VariableDeclarator>,\n kind: \"var\" | \"let\" | \"const\" | \"using\" | \"await using\",\n ): void {\n const id = this.parseBindingAtom();\n this.checkLVal(id, {\n in: { type: \"VariableDeclarator\" },\n binding: kind === \"var\" ? BIND_VAR : BIND_LEXICAL,\n });\n decl.id = id;\n }\n\n // https://tc39.es/ecma262/#prod-AsyncFunctionExpression\n parseAsyncFunctionExpression(\n this: Parser,\n node: Undone<N.FunctionExpression>,\n ): N.FunctionExpression {\n return this.parseFunction(node, ParseFunctionFlag.Async);\n }\n\n // Parse a function declaration or expression (depending on the\n // ParseFunctionFlag.Declaration flag).\n\n parseFunction<T extends N.NormalFunction>(\n this: Parser,\n node: Undone<T>,\n flags: ParseFunctionFlag = ParseFunctionFlag.Expression,\n ): T {\n const hangingDeclaration = flags & ParseFunctionFlag.HangingDeclaration;\n const isDeclaration = !!(flags & ParseFunctionFlag.Declaration);\n const requireId = isDeclaration && !(flags & ParseFunctionFlag.NullableId);\n const isAsync = !!(flags & ParseFunctionFlag.Async);\n\n this.initFunction(node, isAsync);\n\n if (this.match(tt.star)) {\n if (hangingDeclaration) {\n this.raise(Errors.GeneratorInSingleStatementContext, {\n at: this.state.startLoc,\n });\n }\n this.next(); // eat *\n node.generator = true;\n }\n\n if (isDeclaration) {\n node.id = this.parseFunctionId(requireId);\n }\n\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n this.state.maybeInArrowParameters = false;\n this.scope.enter(SCOPE_FUNCTION);\n this.prodParam.enter(functionFlags(isAsync, node.generator));\n\n if (!isDeclaration) {\n node.id = this.parseFunctionId();\n }\n\n this.parseFunctionParams(node, /* isConstructor */ false);\n\n // For the smartPipelines plugin: Disable topic references from outer\n // contexts within the function body. They are permitted in function\n // default-parameter expressions, outside of the function body.\n this.withSmartMixTopicForbiddingContext(() => {\n // Parse the function body.\n this.parseFunctionBodyAndFinish(\n node,\n isDeclaration ? \"FunctionDeclaration\" : \"FunctionExpression\",\n );\n });\n\n this.prodParam.exit();\n this.scope.exit();\n\n if (isDeclaration && !hangingDeclaration) {\n // We need to register this _after_ parsing the function body\n // because of TypeScript body-less function declarations,\n // which shouldn't be added to the scope.\n this.registerFunctionStatementId(node as T);\n }\n\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n return node as T;\n }\n\n parseFunctionId(requireId?: boolean): N.Identifier | undefined | null {\n return requireId || tokenIsIdentifier(this.state.type)\n ? this.parseIdentifier()\n : null;\n }\n\n parseFunctionParams(\n this: Parser,\n node: Undone<N.Function>,\n isConstructor?: boolean,\n ): void {\n this.expect(tt.parenL);\n this.expressionScope.enter(newParameterDeclarationScope());\n node.params = this.parseBindingList(\n tt.parenR,\n charCodes.rightParenthesis,\n ParseBindingListFlags.IS_FUNCTION_PARAMS |\n (isConstructor ? ParseBindingListFlags.IS_CONSTRUCTOR_PARAMS : 0),\n );\n\n this.expressionScope.exit();\n }\n\n registerFunctionStatementId(node: N.Function): void {\n if (!node.id) return;\n\n // If it is a regular function declaration in sloppy mode, then it is\n // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding\n // mode depends on properties of the current scope (see\n // treatFunctionsAsVar).\n this.scope.declareName(\n node.id.name,\n !this.options.annexB || this.state.strict || node.generator || node.async\n ? this.scope.treatFunctionsAsVar\n ? BIND_VAR\n : BIND_LEXICAL\n : BIND_FUNCTION,\n node.id.loc.start,\n );\n }\n\n // Parse a class declaration or literal (depending on the\n // `isStatement` parameter).\n\n parseClass<T extends N.Class>(\n this: Parser,\n node: Undone<T>,\n isStatement: /* T === ClassDeclaration */ boolean,\n optionalId?: boolean,\n ): T {\n this.next(); // 'class'\n\n // A class definition is always strict mode code.\n const oldStrict = this.state.strict;\n this.state.strict = true;\n\n this.parseClassId(node, isStatement, optionalId);\n this.parseClassSuper(node);\n // this.state.strict is restored in parseClassBody\n node.body = this.parseClassBody(!!node.superClass, oldStrict);\n\n return this.finishNode(\n node,\n isStatement ? \"ClassDeclaration\" : \"ClassExpression\",\n );\n }\n\n isClassProperty(): boolean {\n return this.match(tt.eq) || this.match(tt.semi) || this.match(tt.braceR);\n }\n\n isClassMethod(): boolean {\n return this.match(tt.parenL);\n }\n\n isNonstaticConstructor(method: N.ClassMethod | N.ClassProperty): boolean {\n return (\n !method.computed &&\n !method.static &&\n (method.key.name === \"constructor\" || // Identifier\n method.key.value === \"constructor\") // String literal\n );\n }\n\n // https://tc39.es/ecma262/#prod-ClassBody\n parseClassBody(\n this: Parser,\n hadSuperClass: boolean,\n oldStrict: boolean,\n ): N.ClassBody {\n this.classScope.enter();\n\n const state: N.ParseClassMemberState = {\n hadConstructor: false,\n hadSuperClass,\n };\n let decorators: N.Decorator[] = [];\n const classBody = this.startNode<N.ClassBody>();\n classBody.body = [];\n\n this.expect(tt.braceL);\n\n // For the smartPipelines plugin: Disable topic references from outer\n // contexts within the class body.\n this.withSmartMixTopicForbiddingContext(() => {\n // Parse the contents within the braces.\n while (!this.match(tt.braceR)) {\n if (this.eat(tt.semi)) {\n if (decorators.length > 0) {\n throw this.raise(Errors.DecoratorSemicolon, {\n at: this.state.lastTokEndLoc,\n });\n }\n continue;\n }\n\n if (this.match(tt.at)) {\n decorators.push(this.parseDecorator());\n continue;\n }\n\n const member = this.startNode<N.ClassMember>();\n\n // steal the decorators if there are any\n if (decorators.length) {\n // @ts-expect-error Fixme\n member.decorators = decorators;\n this.resetStartLocationFromNode(member, decorators[0]);\n decorators = [];\n }\n\n this.parseClassMember(classBody, member, state);\n\n if (\n // @ts-expect-error Fixme\n member.kind === \"constructor\" &&\n // @ts-expect-error Fixme\n member.decorators &&\n // @ts-expect-error Fixme\n member.decorators.length > 0\n ) {\n this.raise(Errors.DecoratorConstructor, { at: member });\n }\n }\n });\n\n this.state.strict = oldStrict;\n\n this.next(); // eat `}`\n\n if (decorators.length) {\n throw this.raise(Errors.TrailingDecorator, { at: this.state.startLoc });\n }\n\n this.classScope.exit();\n\n return this.finishNode(classBody, \"ClassBody\");\n }\n\n // returns true if the current identifier is a method/field name,\n // false if it is a modifier\n parseClassMemberFromModifier(\n this: Parser,\n classBody: Undone<N.ClassBody>,\n member: Undone<N.ClassMember>,\n ): boolean {\n const key = this.parseIdentifier(true); // eats the modifier\n\n if (this.isClassMethod()) {\n const method: N.ClassMethod = member as any;\n\n // a method named like the modifier\n method.kind = \"method\";\n method.computed = false;\n method.key = key;\n method.static = false;\n this.pushClassMethod(\n classBody,\n method,\n false,\n false,\n /* isConstructor */ false,\n false,\n );\n return true;\n } else if (this.isClassProperty()) {\n const prop: N.ClassProperty = member as any;\n\n // a property named like the modifier\n prop.computed = false;\n prop.key = key;\n prop.static = false;\n classBody.body.push(this.parseClassProperty(prop));\n return true;\n }\n this.resetPreviousNodeTrailingComments(key);\n return false;\n }\n\n parseClassMember(\n this: Parser,\n classBody: Undone<N.ClassBody>,\n member: Undone<N.ClassMember>,\n state: N.ParseClassMemberState,\n ): void {\n const isStatic = this.isContextual(tt._static);\n\n if (isStatic) {\n if (this.parseClassMemberFromModifier(classBody, member)) {\n // a class element named 'static'\n return;\n }\n if (this.eat(tt.braceL)) {\n this.parseClassStaticBlock(classBody, member as any as N.StaticBlock);\n return;\n }\n }\n\n this.parseClassMemberWithIsStatic(classBody, member, state, isStatic);\n }\n\n parseClassMemberWithIsStatic(\n this: Parser,\n classBody: Undone<N.ClassBody>,\n member: Undone<N.ClassMember>,\n state: N.ParseClassMemberState,\n isStatic: boolean,\n ) {\n const publicMethod = member as N.ClassMethod;\n const privateMethod = member as N.ClassPrivateMethod;\n const publicProp = member as N.ClassProperty;\n const privateProp = member as N.ClassPrivateProperty;\n const accessorProp = member as N.ClassAccessorProperty;\n\n const method: typeof publicMethod | typeof privateMethod = publicMethod;\n const publicMember: typeof publicMethod | typeof publicProp = publicMethod;\n\n member.static = isStatic;\n this.parsePropertyNamePrefixOperator(member);\n\n if (this.eat(tt.star)) {\n // a generator\n method.kind = \"method\";\n const isPrivateName = this.match(tt.privateName);\n this.parseClassElementName(method);\n\n if (isPrivateName) {\n // Private generator method\n this.pushClassPrivateMethod(classBody, privateMethod, true, false);\n return;\n }\n\n if (this.isNonstaticConstructor(publicMethod)) {\n this.raise(Errors.ConstructorIsGenerator, {\n at: publicMethod.key,\n });\n }\n\n this.pushClassMethod(\n classBody,\n publicMethod,\n true,\n false,\n /* isConstructor */ false,\n false,\n );\n\n return;\n }\n\n const isContextual =\n tokenIsIdentifier(this.state.type) && !this.state.containsEsc;\n const isPrivate = this.match(tt.privateName);\n const key = this.parseClassElementName(member);\n const maybeQuestionTokenStartLoc = this.state.startLoc;\n\n this.parsePostMemberNameModifiers(publicMember);\n\n if (this.isClassMethod()) {\n method.kind = \"method\";\n\n if (isPrivate) {\n this.pushClassPrivateMethod(classBody, privateMethod, false, false);\n return;\n }\n\n // a normal method\n const isConstructor = this.isNonstaticConstructor(publicMethod);\n let allowsDirectSuper = false;\n if (isConstructor) {\n publicMethod.kind = \"constructor\";\n\n // TypeScript allows multiple overloaded constructor declarations.\n if (state.hadConstructor && !this.hasPlugin(\"typescript\")) {\n this.raise(Errors.DuplicateConstructor, { at: key });\n }\n if (isConstructor && this.hasPlugin(\"typescript\") && member.override) {\n this.raise(Errors.OverrideOnConstructor, { at: key });\n }\n state.hadConstructor = true;\n allowsDirectSuper = state.hadSuperClass;\n }\n\n this.pushClassMethod(\n classBody,\n publicMethod,\n false,\n false,\n isConstructor,\n allowsDirectSuper,\n );\n } else if (this.isClassProperty()) {\n if (isPrivate) {\n this.pushClassPrivateProperty(classBody, privateProp);\n } else {\n this.pushClassProperty(classBody, publicProp);\n }\n } else if (\n isContextual &&\n key.name === \"async\" &&\n !this.isLineTerminator()\n ) {\n // an async method\n this.resetPreviousNodeTrailingComments(key);\n const isGenerator = this.eat(tt.star);\n\n if (publicMember.optional) {\n this.unexpected(maybeQuestionTokenStartLoc);\n }\n\n method.kind = \"method\";\n // The so-called parsed name would have been \"async\": get the real name.\n const isPrivate = this.match(tt.privateName);\n this.parseClassElementName(method);\n this.parsePostMemberNameModifiers(publicMember);\n\n if (isPrivate) {\n // private async method\n this.pushClassPrivateMethod(\n classBody,\n privateMethod,\n isGenerator,\n true,\n );\n } else {\n if (this.isNonstaticConstructor(publicMethod)) {\n this.raise(Errors.ConstructorIsAsync, { at: publicMethod.key });\n }\n\n this.pushClassMethod(\n classBody,\n publicMethod,\n isGenerator,\n true,\n /* isConstructor */ false,\n false,\n );\n }\n } else if (\n isContextual &&\n (key.name === \"get\" || key.name === \"set\") &&\n !(this.match(tt.star) && this.isLineTerminator())\n ) {\n // `get\\n*` is an uninitialized property named 'get' followed by a generator.\n // a getter or setter\n this.resetPreviousNodeTrailingComments(key);\n method.kind = key.name;\n // The so-called parsed name would have been \"get/set\": get the real name.\n const isPrivate = this.match(tt.privateName);\n this.parseClassElementName(publicMethod);\n\n if (isPrivate) {\n // private getter/setter\n this.pushClassPrivateMethod(classBody, privateMethod, false, false);\n } else {\n if (this.isNonstaticConstructor(publicMethod)) {\n this.raise(Errors.ConstructorIsAccessor, { at: publicMethod.key });\n }\n this.pushClassMethod(\n classBody,\n publicMethod,\n false,\n false,\n /* isConstructor */ false,\n false,\n );\n }\n\n this.checkGetterSetterParams(publicMethod);\n } else if (\n isContextual &&\n key.name === \"accessor\" &&\n !this.isLineTerminator()\n ) {\n this.expectPlugin(\"decoratorAutoAccessors\");\n this.resetPreviousNodeTrailingComments(key);\n\n // The so-called parsed name would have been \"accessor\": get the real name.\n const isPrivate = this.match(tt.privateName);\n this.parseClassElementName(publicProp);\n this.pushClassAccessorProperty(classBody, accessorProp, isPrivate);\n } else if (this.isLineTerminator()) {\n // an uninitialized class property (due to ASI, since we don't otherwise recognize the next token)\n if (isPrivate) {\n this.pushClassPrivateProperty(classBody, privateProp);\n } else {\n this.pushClassProperty(classBody, publicProp);\n }\n } else {\n this.unexpected();\n }\n }\n\n // https://tc39.es/ecma262/#prod-ClassElementName\n parseClassElementName(\n this: Parser,\n member: Undone<N.ClassMember>,\n ): N.Expression | N.Identifier {\n const { type, value } = this.state;\n if (\n (type === tt.name || type === tt.string) &&\n member.static &&\n value === \"prototype\"\n ) {\n this.raise(Errors.StaticPrototype, { at: this.state.startLoc });\n }\n\n if (type === tt.privateName) {\n if (value === \"constructor\") {\n this.raise(Errors.ConstructorClassPrivateField, {\n at: this.state.startLoc,\n });\n }\n const key = this.parsePrivateName();\n member.key = key;\n return key;\n }\n\n return this.parsePropertyName(member);\n }\n\n parseClassStaticBlock(\n this: Parser,\n classBody: Undone<N.ClassBody>,\n member: Undone<\n N.StaticBlock & {\n decorators?: Array<N.Decorator>;\n }\n >,\n ) {\n // Start a new lexical scope\n this.scope.enter(SCOPE_CLASS | SCOPE_STATIC_BLOCK | SCOPE_SUPER);\n // Start a new scope with regard to loop labels\n const oldLabels = this.state.labels;\n this.state.labels = [];\n // ClassStaticBlockStatementList:\n // StatementList[~Yield, ~Await, ~Return] opt\n this.prodParam.enter(PARAM);\n const body: N.Node[] = (member.body = []);\n this.parseBlockOrModuleBlockBody(body, undefined, false, tt.braceR);\n this.prodParam.exit();\n this.scope.exit();\n this.state.labels = oldLabels;\n classBody.body.push(this.finishNode<N.StaticBlock>(member, \"StaticBlock\"));\n if (member.decorators?.length) {\n this.raise(Errors.DecoratorStaticBlock, { at: member });\n }\n }\n\n pushClassProperty(\n this: Parser,\n classBody: Undone<N.ClassBody>,\n prop: N.ClassProperty,\n ) {\n if (\n !prop.computed &&\n (prop.key.name === \"constructor\" || prop.key.value === \"constructor\")\n ) {\n // Non-computed field, which is either an identifier named \"constructor\"\n // or a string literal named \"constructor\"\n this.raise(Errors.ConstructorClassField, { at: prop.key });\n }\n\n classBody.body.push(this.parseClassProperty(prop));\n }\n\n pushClassPrivateProperty(\n this: Parser,\n classBody: Undone<N.ClassBody>,\n prop: Undone<N.ClassPrivateProperty>,\n ) {\n const node = this.parseClassPrivateProperty(prop);\n classBody.body.push(node);\n\n this.classScope.declarePrivateName(\n this.getPrivateNameSV(node.key),\n CLASS_ELEMENT_OTHER,\n node.key.loc.start,\n );\n }\n\n pushClassAccessorProperty(\n this: Parser,\n classBody: Undone<N.ClassBody>,\n prop: N.ClassAccessorProperty,\n isPrivate: boolean,\n ) {\n if (!isPrivate && !prop.computed) {\n // Not private, so not node is not a PrivateName and we can safely cast\n const key = prop.key as N.Expression;\n\n if (key.name === \"constructor\" || key.value === \"constructor\") {\n // Non-computed field, which is either an identifier named \"constructor\"\n // or a string literal named \"constructor\"\n this.raise(Errors.ConstructorClassField, { at: key });\n }\n }\n\n const node = this.parseClassAccessorProperty(prop);\n classBody.body.push(node);\n\n if (isPrivate) {\n this.classScope.declarePrivateName(\n this.getPrivateNameSV(node.key),\n CLASS_ELEMENT_OTHER,\n node.key.loc.start,\n );\n }\n }\n\n pushClassMethod(\n this: Parser,\n classBody: Undone<N.ClassBody>,\n method: Undone<N.ClassMethod>,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n classBody.body.push(\n this.parseMethod(\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n \"ClassMethod\",\n true,\n ),\n );\n }\n\n pushClassPrivateMethod(\n this: Parser,\n classBody: Undone<N.ClassBody>,\n method: Undone<N.ClassPrivateMethod>,\n isGenerator: boolean,\n isAsync: boolean,\n ): void {\n const node = this.parseMethod(\n method,\n isGenerator,\n isAsync,\n /* isConstructor */ false,\n false,\n \"ClassPrivateMethod\",\n true,\n );\n classBody.body.push(node);\n\n const kind =\n node.kind === \"get\"\n ? node.static\n ? CLASS_ELEMENT_STATIC_GETTER\n : CLASS_ELEMENT_INSTANCE_GETTER\n : node.kind === \"set\"\n ? node.static\n ? CLASS_ELEMENT_STATIC_SETTER\n : CLASS_ELEMENT_INSTANCE_SETTER\n : CLASS_ELEMENT_OTHER;\n this.declareClassPrivateMethodInScope(node, kind);\n }\n\n declareClassPrivateMethodInScope(\n node: Undone<\n N.ClassPrivateMethod | N.EstreeMethodDefinition | N.TSDeclareMethod\n >,\n kind: number,\n ) {\n this.classScope.declarePrivateName(\n this.getPrivateNameSV(node.key),\n kind,\n node.key.loc.start,\n );\n }\n\n // Overridden in typescript.js\n parsePostMemberNameModifiers(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n methodOrProp: Undone<N.ClassMethod | N.ClassProperty>,\n ): void {}\n\n // https://tc39.es/ecma262/#prod-FieldDefinition\n parseClassPrivateProperty(\n this: Parser,\n node: Undone<N.ClassPrivateProperty>,\n ): N.ClassPrivateProperty {\n this.parseInitializer(node);\n this.semicolon();\n return this.finishNode(node, \"ClassPrivateProperty\");\n }\n\n // https://tc39.es/ecma262/#prod-FieldDefinition\n parseClassProperty(this: Parser, node: N.ClassProperty): N.ClassProperty {\n this.parseInitializer(node);\n this.semicolon();\n return this.finishNode(node, \"ClassProperty\");\n }\n\n parseClassAccessorProperty(\n this: Parser,\n node: N.ClassAccessorProperty,\n ): N.ClassAccessorProperty {\n this.parseInitializer(node);\n this.semicolon();\n return this.finishNode(node, \"ClassAccessorProperty\");\n }\n\n // https://tc39.es/ecma262/#prod-Initializer\n parseInitializer(\n this: Parser,\n node: Undone<\n N.ClassProperty | N.ClassPrivateProperty | N.ClassAccessorProperty\n >,\n ): void {\n this.scope.enter(SCOPE_CLASS | SCOPE_SUPER);\n this.expressionScope.enter(newExpressionScope());\n this.prodParam.enter(PARAM);\n node.value = this.eat(tt.eq) ? this.parseMaybeAssignAllowIn() : null;\n this.expressionScope.exit();\n this.prodParam.exit();\n this.scope.exit();\n }\n\n parseClassId(\n node: Undone<N.Class>,\n isStatement: boolean,\n optionalId?: boolean | null,\n bindingType: BindingTypes = BIND_CLASS,\n ): void {\n if (tokenIsIdentifier(this.state.type)) {\n node.id = this.parseIdentifier();\n if (isStatement) {\n this.declareNameFromIdentifier(node.id, bindingType);\n }\n } else {\n if (optionalId || !isStatement) {\n node.id = null;\n } else {\n throw this.raise(Errors.MissingClassName, { at: this.state.startLoc });\n }\n }\n }\n\n // https://tc39.es/ecma262/#prod-ClassHeritage\n parseClassSuper(this: Parser, node: Undone<N.Class>): void {\n node.superClass = this.eat(tt._extends) ? this.parseExprSubscripts() : null;\n }\n\n // Parses module export declaration.\n // https://tc39.es/ecma262/#prod-ExportDeclaration\n\n parseExport(\n this: Parser,\n node: Undone<\n | N.ExportDefaultDeclaration\n | N.ExportAllDeclaration\n | N.ExportNamedDeclaration\n >,\n decorators: N.Decorator[] | null,\n ): N.AnyExport {\n const maybeDefaultIdentifier = this.parseMaybeImportPhase(\n node,\n /* isExport */ true,\n );\n const hasDefault = this.maybeParseExportDefaultSpecifier(\n node,\n maybeDefaultIdentifier,\n );\n const parseAfterDefault = !hasDefault || this.eat(tt.comma);\n const hasStar =\n parseAfterDefault &&\n this.eatExportStar(\n // @ts-expect-error todo(flow->ts)\n node,\n );\n const hasNamespace =\n hasStar &&\n this.maybeParseExportNamespaceSpecifier(\n // @ts-expect-error todo(flow->ts)\n node,\n );\n const parseAfterNamespace =\n parseAfterDefault && (!hasNamespace || this.eat(tt.comma));\n const isFromRequired = hasDefault || hasStar;\n\n if (hasStar && !hasNamespace) {\n if (hasDefault) this.unexpected();\n if (decorators) {\n throw this.raise(Errors.UnsupportedDecoratorExport, { at: node });\n }\n this.parseExportFrom(node as Undone<N.ExportNamedDeclaration>, true);\n\n return this.finishNode(node, \"ExportAllDeclaration\");\n }\n\n const hasSpecifiers = this.maybeParseExportNamedSpecifiers(\n // @ts-expect-error todo(flow->ts)\n node,\n );\n\n if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers) {\n this.unexpected(null, tt.braceL);\n }\n\n if (hasNamespace && parseAfterNamespace) {\n this.unexpected(null, tt._from);\n }\n\n let hasDeclaration;\n if (isFromRequired || hasSpecifiers) {\n hasDeclaration = false;\n if (decorators) {\n throw this.raise(Errors.UnsupportedDecoratorExport, { at: node });\n }\n this.parseExportFrom(\n node as Undone<N.ExportNamedDeclaration>,\n isFromRequired,\n );\n } else {\n hasDeclaration = this.maybeParseExportDeclaration(\n node as Undone<N.ExportNamedDeclaration>,\n );\n }\n\n if (isFromRequired || hasSpecifiers || hasDeclaration) {\n const node2 = node as Undone<N.ExportNamedDeclaration>;\n this.checkExport(node2, true, false, !!node2.source);\n if (node2.declaration?.type === \"ClassDeclaration\") {\n this.maybeTakeDecorators(decorators, node2.declaration, node2);\n } else if (decorators) {\n throw this.raise(Errors.UnsupportedDecoratorExport, { at: node });\n }\n return this.finishNode(node2, \"ExportNamedDeclaration\");\n }\n\n if (this.eat(tt._default)) {\n const node2 = node as Undone<N.ExportDefaultDeclaration>;\n // export default ...\n const decl = this.parseExportDefaultExpression();\n node2.declaration = decl;\n\n if (decl.type === \"ClassDeclaration\") {\n this.maybeTakeDecorators(decorators, decl as N.ClassDeclaration, node2);\n } else if (decorators) {\n throw this.raise(Errors.UnsupportedDecoratorExport, { at: node });\n }\n\n this.checkExport(node2, true, true);\n\n return this.finishNode(node2, \"ExportDefaultDeclaration\");\n }\n\n this.unexpected(null, tt.braceL);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n eatExportStar(node: N.Node): boolean {\n return this.eat(tt.star);\n }\n\n maybeParseExportDefaultSpecifier(\n node: Undone<\n | N.ExportDefaultDeclaration\n | N.ExportAllDeclaration\n | N.ExportNamedDeclaration\n >,\n maybeDefaultIdentifier: N.Identifier | null,\n ): node is Undone<N.ExportNamedDeclaration> {\n if (maybeDefaultIdentifier || this.isExportDefaultSpecifier()) {\n // export defaultObj ...\n this.expectPlugin(\"exportDefaultFrom\", maybeDefaultIdentifier?.loc.start);\n const id = maybeDefaultIdentifier || this.parseIdentifier(true);\n const specifier = this.startNodeAtNode<N.ExportDefaultSpecifier>(id);\n specifier.exported = id;\n (node as Undone<N.ExportNamedDeclaration>).specifiers = [\n this.finishNode(specifier, \"ExportDefaultSpecifier\"),\n ];\n return true;\n }\n return false;\n }\n\n maybeParseExportNamespaceSpecifier(node: N.Node): boolean {\n if (this.isContextual(tt._as)) {\n if (!node.specifiers) node.specifiers = [];\n\n const specifier = this.startNodeAt(this.state.lastTokStartLoc);\n\n this.next();\n\n specifier.exported = this.parseModuleExportName();\n node.specifiers.push(\n this.finishNode(specifier, \"ExportNamespaceSpecifier\"),\n );\n return true;\n }\n return false;\n }\n\n maybeParseExportNamedSpecifiers(node: N.Node): boolean {\n if (this.match(tt.braceL)) {\n if (!node.specifiers) node.specifiers = [];\n const isTypeExport = node.exportKind === \"type\";\n node.specifiers.push(...this.parseExportSpecifiers(isTypeExport));\n\n node.source = null;\n node.declaration = null;\n if (this.hasPlugin(\"importAssertions\")) {\n node.assertions = [];\n }\n\n return true;\n }\n return false;\n }\n\n maybeParseExportDeclaration(\n this: Parser,\n node: Undone<N.ExportNamedDeclaration>,\n ): boolean {\n if (this.shouldParseExportDeclaration()) {\n node.specifiers = [];\n node.source = null;\n if (this.hasPlugin(\"importAssertions\")) {\n node.assertions = [];\n }\n node.declaration = this.parseExportDeclaration(node);\n return true;\n }\n return false;\n }\n\n isAsyncFunction(): boolean {\n if (!this.isContextual(tt._async)) return false;\n const next = this.nextTokenInLineStart();\n return this.isUnparsedContextual(next, \"function\");\n }\n\n parseExportDefaultExpression(this: Parser): N.Expression | N.Declaration {\n const expr = this.startNode();\n\n if (this.match(tt._function)) {\n this.next();\n return this.parseFunction(\n expr as Undone<N.FunctionDeclaration>,\n ParseFunctionFlag.Declaration | ParseFunctionFlag.NullableId,\n );\n } else if (this.isAsyncFunction()) {\n this.next(); // eat 'async'\n this.next(); // eat 'function'\n return this.parseFunction(\n expr as Undone<N.FunctionDeclaration>,\n ParseFunctionFlag.Declaration |\n ParseFunctionFlag.NullableId |\n ParseFunctionFlag.Async,\n );\n }\n\n if (this.match(tt._class)) {\n return this.parseClass(expr as Undone<N.ClassExpression>, true, true);\n }\n\n if (this.match(tt.at)) {\n if (\n this.hasPlugin(\"decorators\") &&\n this.getPluginOption(\"decorators\", \"decoratorsBeforeExport\") === true\n ) {\n this.raise(Errors.DecoratorBeforeExport, { at: this.state.startLoc });\n }\n return this.parseClass(\n this.maybeTakeDecorators(\n this.parseDecorators(false),\n this.startNode<N.ClassDeclaration>(),\n ),\n true,\n true,\n );\n }\n\n if (this.match(tt._const) || this.match(tt._var) || this.isLet()) {\n throw this.raise(Errors.UnsupportedDefaultExport, {\n at: this.state.startLoc,\n });\n }\n\n const res = this.parseMaybeAssignAllowIn();\n this.semicolon();\n return res;\n }\n\n // https://tc39.es/ecma262/#prod-ExportDeclaration\n parseExportDeclaration(\n this: Parser,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n node: Undone<N.ExportNamedDeclaration>,\n ): N.Declaration | undefined | null {\n if (this.match(tt._class)) {\n const node = this.parseClass(\n this.startNode<N.ClassDeclaration>(),\n true,\n false,\n );\n return node;\n }\n return this.parseStatementListItem() as N.Declaration;\n }\n\n isExportDefaultSpecifier(): boolean {\n const { type } = this.state;\n if (tokenIsIdentifier(type)) {\n if ((type === tt._async && !this.state.containsEsc) || type === tt._let) {\n return false;\n }\n if (\n (type === tt._type || type === tt._interface) &&\n !this.state.containsEsc\n ) {\n const { type: nextType } = this.lookahead();\n // If we see any variable name other than `from` after `type` keyword,\n // we consider it as flow/typescript type exports\n // note that this approach may fail on some pedantic cases\n // export type from = number\n if (\n (tokenIsIdentifier(nextType) && nextType !== tt._from) ||\n nextType === tt.braceL\n ) {\n this.expectOnePlugin([\"flow\", \"typescript\"]);\n return false;\n }\n }\n } else if (!this.match(tt._default)) {\n return false;\n }\n\n const next = this.nextTokenStart();\n const hasFrom = this.isUnparsedContextual(next, \"from\");\n if (\n this.input.charCodeAt(next) === charCodes.comma ||\n (tokenIsIdentifier(this.state.type) && hasFrom)\n ) {\n return true;\n }\n // lookahead again when `export default from` is seen\n if (this.match(tt._default) && hasFrom) {\n const nextAfterFrom = this.input.charCodeAt(\n this.nextTokenStartSince(next + 4),\n );\n return (\n nextAfterFrom === charCodes.quotationMark ||\n nextAfterFrom === charCodes.apostrophe\n );\n }\n return false;\n }\n\n parseExportFrom(\n this: Parser,\n node: Undone<N.ExportNamedDeclaration>,\n expect?: boolean,\n ): void {\n if (this.eatContextual(tt._from)) {\n node.source = this.parseImportSource();\n this.checkExport(node);\n this.maybeParseImportAttributes(node);\n this.checkJSONModuleImport(node);\n } else if (expect) {\n this.unexpected();\n }\n\n this.semicolon();\n }\n\n shouldParseExportDeclaration(): boolean {\n const { type } = this.state;\n if (type === tt.at) {\n this.expectOnePlugin([\"decorators\", \"decorators-legacy\"]);\n if (this.hasPlugin(\"decorators\")) {\n if (\n this.getPluginOption(\"decorators\", \"decoratorsBeforeExport\") === true\n ) {\n this.raise(Errors.DecoratorBeforeExport, {\n at: this.state.startLoc,\n });\n }\n\n return true;\n }\n }\n\n return (\n type === tt._var ||\n type === tt._const ||\n type === tt._function ||\n type === tt._class ||\n this.isLet() ||\n this.isAsyncFunction()\n );\n }\n\n checkExport(\n node: Undone<N.ExportNamedDeclaration | N.ExportDefaultDeclaration>,\n checkNames?: boolean,\n isDefault?: boolean,\n isFrom?: boolean,\n ): void {\n if (checkNames) {\n // Check for duplicate exports\n if (isDefault) {\n // Default exports\n this.checkDuplicateExports(node, \"default\");\n if (this.hasPlugin(\"exportDefaultFrom\")) {\n const declaration = (node as any as N.ExportDefaultDeclaration)\n .declaration;\n if (\n declaration.type === \"Identifier\" &&\n declaration.name === \"from\" &&\n declaration.end - declaration.start === 4 && // does not contain escape\n !declaration.extra?.parenthesized\n ) {\n this.raise(Errors.ExportDefaultFromAsIdentifier, {\n at: declaration,\n });\n }\n }\n // @ts-expect-error node.specifiers may not exist\n } else if (node.specifiers && node.specifiers.length) {\n // Named exports\n // @ts-expect-error node.specifiers may not exist\n for (const specifier of node.specifiers) {\n const { exported } = specifier;\n const exportName =\n exported.type === \"Identifier\" ? exported.name : exported.value;\n this.checkDuplicateExports(specifier, exportName);\n if (!isFrom && specifier.local) {\n const { local } = specifier;\n if (local.type !== \"Identifier\") {\n this.raise(Errors.ExportBindingIsString, {\n at: specifier,\n localName: local.value,\n exportName,\n });\n } else {\n // check for keywords used as local names\n this.checkReservedWord(local.name, local.loc.start, true, false);\n // check if export is defined\n this.scope.checkLocalExport(local);\n }\n }\n }\n } else if (node.declaration) {\n // Exported declarations\n if (\n node.declaration.type === \"FunctionDeclaration\" ||\n node.declaration.type === \"ClassDeclaration\"\n ) {\n const id = node.declaration.id;\n if (!id) throw new Error(\"Assertion failure\");\n\n this.checkDuplicateExports(node, id.name);\n } else if (node.declaration.type === \"VariableDeclaration\") {\n for (const declaration of node.declaration.declarations) {\n this.checkDeclaration(declaration.id);\n }\n }\n }\n }\n }\n\n checkDeclaration(node: N.Pattern | N.ObjectProperty): void {\n if (node.type === \"Identifier\") {\n this.checkDuplicateExports(node, node.name);\n } else if (node.type === \"ObjectPattern\") {\n for (const prop of node.properties) {\n this.checkDeclaration(prop);\n }\n } else if (node.type === \"ArrayPattern\") {\n for (const elem of node.elements) {\n if (elem) {\n this.checkDeclaration(elem);\n }\n }\n } else if (node.type === \"ObjectProperty\") {\n // @ts-expect-error migrate to Babel types\n this.checkDeclaration(node.value);\n } else if (node.type === \"RestElement\") {\n this.checkDeclaration(node.argument);\n } else if (node.type === \"AssignmentPattern\") {\n this.checkDeclaration(node.left);\n }\n }\n\n checkDuplicateExports(\n node: Undone<\n | N.Identifier\n | N.StringLiteral\n | N.ExportNamedDeclaration\n | N.ExportSpecifier\n | N.ExportDefaultSpecifier\n >,\n exportName: string,\n ): void {\n if (this.exportedIdentifiers.has(exportName)) {\n if (exportName === \"default\") {\n this.raise(Errors.DuplicateDefaultExport, { at: node });\n } else {\n this.raise(Errors.DuplicateExport, { at: node, exportName });\n }\n }\n this.exportedIdentifiers.add(exportName);\n }\n\n // Parses a comma-separated list of module exports.\n\n parseExportSpecifiers(isInTypeExport: boolean): Array<N.ExportSpecifier> {\n const nodes = [];\n let first = true;\n\n // export { x, y as z } [from '...']\n this.expect(tt.braceL);\n\n while (!this.eat(tt.braceR)) {\n if (first) {\n first = false;\n } else {\n this.expect(tt.comma);\n if (this.eat(tt.braceR)) break;\n }\n const isMaybeTypeOnly = this.isContextual(tt._type);\n const isString = this.match(tt.string);\n const node = this.startNode();\n node.local = this.parseModuleExportName();\n nodes.push(\n this.parseExportSpecifier(\n node,\n isString,\n isInTypeExport,\n isMaybeTypeOnly,\n ),\n );\n }\n\n return nodes;\n }\n\n parseExportSpecifier(\n node: any,\n isString: boolean,\n /* eslint-disable @typescript-eslint/no-unused-vars -- used in TypeScript parser */\n isInTypeExport: boolean,\n isMaybeTypeOnly: boolean,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ): N.ExportSpecifier {\n if (this.eatContextual(tt._as)) {\n node.exported = this.parseModuleExportName();\n } else if (isString) {\n node.exported = cloneStringLiteral(node.local);\n } else if (!node.exported) {\n node.exported = cloneIdentifier(node.local);\n }\n return this.finishNode<N.ExportSpecifier>(node, \"ExportSpecifier\");\n }\n\n // https://tc39.es/ecma262/#prod-ModuleExportName\n parseModuleExportName(): N.StringLiteral | N.Identifier {\n if (this.match(tt.string)) {\n const result = this.parseStringLiteral(this.state.value);\n const surrogate = result.value.match(loneSurrogate);\n if (surrogate) {\n this.raise(Errors.ModuleExportNameHasLoneSurrogate, {\n at: result,\n surrogateCharCode: surrogate[0].charCodeAt(0),\n });\n }\n return result;\n }\n return this.parseIdentifier(true);\n }\n\n isJSONModuleImport(\n node: Undone<\n N.ExportAllDeclaration | N.ExportNamedDeclaration | N.ImportDeclaration\n >,\n ): boolean {\n if (node.assertions != null) {\n return node.assertions.some(({ key, value }) => {\n return (\n value.value === \"json\" &&\n (key.type === \"Identifier\"\n ? key.name === \"type\"\n : key.value === \"type\")\n );\n });\n }\n return false;\n }\n\n checkImportReflection(node: Undone<N.ImportDeclaration>) {\n if (node.module) {\n if (\n node.specifiers.length !== 1 ||\n node.specifiers[0].type !== \"ImportDefaultSpecifier\"\n ) {\n this.raise(Errors.ImportReflectionNotBinding, {\n at: node.specifiers[0].loc.start,\n });\n }\n if (node.assertions?.length > 0) {\n this.raise(Errors.ImportReflectionHasAssertion, {\n at: node.specifiers[0].loc.start,\n });\n }\n }\n }\n\n checkJSONModuleImport(\n node: Undone<\n N.ExportAllDeclaration | N.ExportNamedDeclaration | N.ImportDeclaration\n >,\n ) {\n // @ts-expect-error Fixme: node.type must be undefined because they are undone\n if (this.isJSONModuleImport(node) && node.type !== \"ExportAllDeclaration\") {\n // @ts-expect-error specifiers may not index node\n const { specifiers } = node;\n if (specifiers != null) {\n // @ts-expect-error refine specifier types\n const nonDefaultNamedSpecifier = specifiers.find(specifier => {\n let imported;\n if (specifier.type === \"ExportSpecifier\") {\n imported = specifier.local;\n } else if (specifier.type === \"ImportSpecifier\") {\n imported = specifier.imported;\n }\n if (imported !== undefined) {\n return imported.type === \"Identifier\"\n ? imported.name !== \"default\"\n : imported.value !== \"default\";\n }\n });\n if (nonDefaultNamedSpecifier !== undefined) {\n this.raise(Errors.ImportJSONBindingNotDefault, {\n at: nonDefaultNamedSpecifier.loc.start,\n });\n }\n }\n }\n }\n\n isPotentialImportPhase(isExport: boolean): boolean {\n return !isExport && this.isContextual(tt._module);\n }\n\n applyImportPhase(\n node: Undone<N.ImportDeclaration | N.ExportNamedDeclaration>,\n isExport: boolean,\n phase: string | null,\n loc?: Position,\n ): void {\n if (isExport) {\n if (!process.env.IS_PUBLISH) {\n if (phase === \"module\") {\n throw new Error(\n \"Assertion failure: export declarations do not support the 'module' phase.\",\n );\n }\n }\n return;\n }\n if (phase === \"module\") {\n this.expectPlugin(\"importReflection\", loc);\n (node as N.ImportDeclaration).module = true;\n } else if (this.hasPlugin(\"importReflection\")) {\n (node as N.ImportDeclaration).module = false;\n }\n }\n\n /*\n * Parse `module` in `import module x fro \"x\"`, disambiguating\n * `import module from \"x\"` and `import module from from \"x\"`.\n *\n * This function might return an identifier representing the `module`\n * if it eats `module` and then discovers that it was the default import\n * binding and not the import reflection.\n *\n * This function is also used to parse `import type` and `import typeof`\n * in the TS and Flow plugins.\n *\n * Note: the proposal has been updated to use `source` instead of `module`,\n * but it has not been implemented yet.\n */\n parseMaybeImportPhase(\n node: Undone<N.ImportDeclaration | N.TsImportEqualsDeclaration>,\n isExport: boolean,\n ): N.Identifier | null {\n if (!this.isPotentialImportPhase(isExport)) {\n this.applyImportPhase(\n node as Undone<N.ImportDeclaration>,\n isExport,\n null,\n );\n return null;\n }\n\n const phaseIdentifier = this.parseIdentifier(true);\n\n const { type } = this.state;\n const isImportPhase = tokenIsKeywordOrIdentifier(type)\n ? // OK: import <phase> x from \"foo\";\n // OK: import <phase> from from \"foo\";\n // NO: import <phase> from \"foo\";\n // NO: import <phase> from 'foo';\n // With the module declarations proposals, we will need further disambiguation\n // for `import module from from;`.\n type !== tt._from || this.lookaheadCharCode() === charCodes.lowercaseF\n : // OK: import <phase> { x } from \"foo\";\n // OK: import <phase> x from \"foo\";\n // OK: import <phase> * as T from \"foo\";\n // NO: import <phase> from \"foo\";\n // OK: import <phase> \"foo\";\n // The last one is invalid, we will continue parsing and throw\n // an error later\n type !== tt.comma;\n\n if (isImportPhase) {\n this.resetPreviousIdentifierLeadingComments(phaseIdentifier);\n this.applyImportPhase(\n node as Undone<N.ImportDeclaration>,\n isExport,\n phaseIdentifier.name,\n phaseIdentifier.loc.start,\n );\n return null;\n } else {\n this.applyImportPhase(\n node as Undone<N.ImportDeclaration>,\n isExport,\n null,\n );\n // `<phase>` is a default binding, return it to the main import declaration parser\n return phaseIdentifier;\n }\n }\n\n isPrecedingIdImportPhase(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n phase: string,\n ) {\n const { type } = this.state;\n return tokenIsIdentifier(type)\n ? // OK: import <phase> x from \"foo\";\n // OK: import <phase> from from \"foo\";\n // NO: import <phase> from \"foo\";\n // NO: import <phase> from 'foo';\n // With the module declarations proposals, we will need further disambiguation\n // for `import module from from;`.\n type !== tt._from || this.lookaheadCharCode() === charCodes.lowercaseF\n : // OK: import <phase> { x } from \"foo\";\n // OK: import <phase> x from \"foo\";\n // OK: import <phase> * as T from \"foo\";\n // NO: import <phase> from \"foo\";\n // OK: import <phase> \"foo\";\n // The last one is invalid, we will continue parsing and throw\n // an error later\n type !== tt.comma;\n }\n\n // Parses import declaration.\n // https://tc39.es/ecma262/#prod-ImportDeclaration\n\n parseImport(this: Parser, node: Undone<N.ImportDeclaration>): N.AnyImport {\n if (this.match(tt.string)) {\n // import '...'\n return this.parseImportSourceAndAttributes(node);\n }\n\n return this.parseImportSpecifiersAndAfter(\n node,\n this.parseMaybeImportPhase(node, /* isExport */ false),\n );\n }\n\n parseImportSpecifiersAndAfter(\n this: Parser,\n node: Undone<N.ImportDeclaration>,\n maybeDefaultIdentifier: N.Identifier | null,\n ): N.AnyImport {\n node.specifiers = [];\n\n // check if we have a default import like\n // import React from \"react\";\n const hasDefault = this.maybeParseDefaultImportSpecifier(\n node,\n maybeDefaultIdentifier,\n );\n /* we are checking if we do not have a default import, then it is obvious that we need named imports\n * import { get } from \"axios\";\n * but if we do have a default import\n * we need to check if we have a comma after that and\n * that is where this `|| this.eat` condition comes into play\n */\n const parseNext = !hasDefault || this.eat(tt.comma);\n // if we do have to parse the next set of specifiers, we first check for star imports\n // import React, * from \"react\";\n const hasStar = parseNext && this.maybeParseStarImportSpecifier(node);\n // now we check if we need to parse the next imports\n // but only if they are not importing * (everything)\n if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node);\n this.expectContextual(tt._from);\n\n return this.parseImportSourceAndAttributes(node);\n }\n\n parseImportSourceAndAttributes(\n this: Parser,\n node: Undone<N.ImportDeclaration>,\n ): N.AnyImport {\n node.specifiers ??= [];\n node.source = this.parseImportSource();\n this.maybeParseImportAttributes(node);\n this.checkImportReflection(node);\n this.checkJSONModuleImport(node);\n\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n\n parseImportSource(this: Parser): N.StringLiteral {\n if (!this.match(tt.string)) this.unexpected();\n return this.parseExprAtom() as N.StringLiteral;\n }\n\n parseImportSpecifierLocal<\n T extends\n | N.ImportSpecifier\n | N.ImportDefaultSpecifier\n | N.ImportNamespaceSpecifier,\n >(\n node: Undone<N.ImportDeclaration>,\n specifier: Undone<T>,\n type: T[\"type\"],\n ): void {\n specifier.local = this.parseIdentifier();\n node.specifiers.push(this.finishImportSpecifier(specifier, type));\n }\n\n finishImportSpecifier<\n T extends\n | N.ImportSpecifier\n | N.ImportDefaultSpecifier\n | N.ImportNamespaceSpecifier,\n >(specifier: Undone<T>, type: T[\"type\"], bindingType = BIND_LEXICAL) {\n this.checkLVal(specifier.local, {\n in: { type },\n binding: bindingType,\n });\n return this.finishNode(specifier, type);\n }\n\n /**\n * parse assert entries\n *\n * @see {@link https://tc39.es/proposal-import-attributes/#prod-WithEntries WithEntries}\n */\n parseImportAttributes(): N.ImportAttribute[] {\n this.expect(tt.braceL);\n\n const attrs = [];\n const attrNames = new Set();\n\n do {\n if (this.match(tt.braceR)) {\n break;\n }\n\n const node = this.startNode<N.ImportAttribute>();\n\n // parse AssertionKey : IdentifierName, StringLiteral\n const keyName = this.state.value;\n // check if we already have an entry for an attribute\n // if a duplicate entry is found, throw an error\n // for now this logic will come into play only when someone declares `type` twice\n if (attrNames.has(keyName)) {\n this.raise(Errors.ModuleAttributesWithDuplicateKeys, {\n at: this.state.startLoc,\n key: keyName,\n });\n }\n attrNames.add(keyName);\n if (this.match(tt.string)) {\n node.key = this.parseStringLiteral(keyName);\n } else {\n node.key = this.parseIdentifier(true);\n }\n this.expect(tt.colon);\n\n if (!this.match(tt.string)) {\n throw this.raise(Errors.ModuleAttributeInvalidValue, {\n at: this.state.startLoc,\n });\n }\n node.value = this.parseStringLiteral(this.state.value);\n attrs.push(this.finishNode(node, \"ImportAttribute\"));\n } while (this.eat(tt.comma));\n\n this.expect(tt.braceR);\n\n return attrs;\n }\n\n /**\n * parse module attributes\n * @deprecated It will be removed in Babel 8\n */\n parseModuleAttributes() {\n const attrs: N.ImportAttribute[] = [];\n const attributes = new Set();\n do {\n const node = this.startNode<N.ImportAttribute>();\n node.key = this.parseIdentifier(true);\n\n if (node.key.name !== \"type\") {\n this.raise(Errors.ModuleAttributeDifferentFromType, {\n at: node.key,\n });\n }\n\n if (attributes.has(node.key.name)) {\n this.raise(Errors.ModuleAttributesWithDuplicateKeys, {\n at: node.key,\n key: node.key.name,\n });\n }\n attributes.add(node.key.name);\n this.expect(tt.colon);\n if (!this.match(tt.string)) {\n throw this.raise(Errors.ModuleAttributeInvalidValue, {\n at: this.state.startLoc,\n });\n }\n node.value = this.parseStringLiteral(this.state.value);\n attrs.push(this.finishNode(node, \"ImportAttribute\"));\n } while (this.eat(tt.comma));\n\n return attrs;\n }\n\n maybeParseImportAttributes(\n node: Undone<N.ImportDeclaration | N.ExportNamedDeclaration>,\n ) {\n let attributes: N.ImportAttribute[];\n let useWith = false;\n\n // https://tc39.es/proposal-import-attributes/#prod-WithClause\n if (this.match(tt._with)) {\n if (\n this.hasPrecedingLineBreak() &&\n this.lookaheadCharCode() === charCodes.leftParenthesis\n ) {\n // This will be parsed as a with statement, and we will throw a\n // better error about it not being supported in strict mode.\n return;\n }\n\n this.next(); // eat `with`\n\n if (!process.env.BABEL_8_BREAKING) {\n if (this.hasPlugin(\"moduleAttributes\")) {\n attributes = this.parseModuleAttributes();\n } else {\n this.expectImportAttributesPlugin();\n attributes = this.parseImportAttributes();\n }\n } else {\n this.expectImportAttributesPlugin();\n attributes = this.parseImportAttributes();\n }\n useWith = true;\n } else if (this.isContextual(tt._assert) && !this.hasPrecedingLineBreak()) {\n if (this.hasPlugin(\"importAttributes\")) {\n if (\n this.getPluginOption(\"importAttributes\", \"deprecatedAssertSyntax\") !==\n true\n ) {\n this.raise(Errors.ImportAttributesUseAssert, {\n at: this.state.startLoc,\n });\n }\n this.addExtra(node, \"deprecatedAssertSyntax\", true);\n } else {\n this.expectOnePlugin([\"importAttributes\", \"importAssertions\"]);\n }\n this.next(); // eat `assert`\n attributes = this.parseImportAttributes();\n } else if (\n this.hasPlugin(\"importAttributes\") ||\n this.hasPlugin(\"importAssertions\")\n ) {\n attributes = [];\n } else if (!process.env.BABEL_8_BREAKING) {\n if (this.hasPlugin(\"moduleAttributes\")) {\n attributes = [];\n } else return;\n } else return;\n\n if (!useWith && this.hasPlugin(\"importAssertions\")) {\n node.assertions = attributes;\n } else {\n node.attributes = attributes;\n }\n }\n\n maybeParseDefaultImportSpecifier(\n node: Undone<N.ImportDeclaration>,\n maybeDefaultIdentifier: N.Identifier | null,\n ): boolean {\n // import defaultObj, { x, y as z } from '...'\n if (maybeDefaultIdentifier) {\n const specifier = this.startNodeAtNode<N.ImportDefaultSpecifier>(\n maybeDefaultIdentifier,\n );\n specifier.local = maybeDefaultIdentifier;\n node.specifiers.push(\n this.finishImportSpecifier(specifier, \"ImportDefaultSpecifier\"),\n );\n return true;\n } else if (\n // We allow keywords, and parseImportSpecifierLocal will report a recoverable error\n tokenIsKeywordOrIdentifier(this.state.type)\n ) {\n this.parseImportSpecifierLocal(\n node,\n this.startNode<N.ImportDefaultSpecifier>(),\n \"ImportDefaultSpecifier\",\n );\n return true;\n }\n return false;\n }\n\n maybeParseStarImportSpecifier(node: Undone<N.ImportDeclaration>): boolean {\n if (this.match(tt.star)) {\n const specifier = this.startNode<N.ImportNamespaceSpecifier>();\n this.next();\n this.expectContextual(tt._as);\n\n this.parseImportSpecifierLocal(\n node,\n specifier,\n \"ImportNamespaceSpecifier\",\n );\n return true;\n }\n return false;\n }\n\n parseNamedImportSpecifiers(node: Undone<N.ImportDeclaration>) {\n let first = true;\n this.expect(tt.braceL);\n while (!this.eat(tt.braceR)) {\n if (first) {\n first = false;\n } else {\n // Detect an attempt to deep destructure\n if (this.eat(tt.colon)) {\n throw this.raise(Errors.DestructureNamedImport, {\n at: this.state.startLoc,\n });\n }\n\n this.expect(tt.comma);\n if (this.eat(tt.braceR)) break;\n }\n\n const specifier = this.startNode<N.ImportSpecifier>();\n const importedIsString = this.match(tt.string);\n const isMaybeTypeOnly = this.isContextual(tt._type);\n specifier.imported = this.parseModuleExportName();\n const importSpecifier = this.parseImportSpecifier(\n specifier,\n importedIsString,\n node.importKind === \"type\" || node.importKind === \"typeof\",\n isMaybeTypeOnly,\n undefined,\n );\n node.specifiers.push(importSpecifier);\n }\n }\n\n // https://tc39.es/ecma262/#prod-ImportSpecifier\n parseImportSpecifier(\n specifier: Undone<N.ImportSpecifier>,\n importedIsString: boolean,\n /* eslint-disable @typescript-eslint/no-unused-vars -- used in TypeScript and Flow parser */\n isInTypeOnlyImport: boolean,\n isMaybeTypeOnly: boolean,\n bindingType: BindingTypes | undefined,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ): N.ImportSpecifier {\n if (this.eatContextual(tt._as)) {\n specifier.local = this.parseIdentifier();\n } else {\n const { imported } = specifier;\n if (importedIsString) {\n throw this.raise(Errors.ImportBindingIsString, {\n at: specifier,\n importName: (imported as N.StringLiteral).value,\n });\n }\n this.checkReservedWord(\n (imported as N.Identifier).name,\n specifier.loc.start,\n true,\n true,\n );\n if (!specifier.local) {\n specifier.local = cloneIdentifier(imported);\n }\n }\n return this.finishImportSpecifier(\n specifier,\n \"ImportSpecifier\",\n bindingType,\n );\n }\n\n // This is used in flow and typescript plugin\n // Determine whether a parameter is a this param\n isThisParam(\n param: N.Pattern | N.Identifier | N.TSParameterProperty,\n ): boolean {\n return param.type === \"Identifier\" && param.name === \"this\";\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AASA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AAmBA,IAAAK,KAA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AO,CAAC,EAAE;MAC9BsO,SAAS,CAAC0B,KAAK,GAAG,IAAI,CAAC5R,eAAe,CAAC,CAAC;IAC1C,CAAC,MAAM;MACL,MAAM;QAAE+T;MAAS,CAAC,GAAG7D,SAAS;MAC9B,IAAIiG,gBAAgB,EAAE;QACpB,MAAM,IAAI,CAACle,KAAK,CAACC,kBAAM,CAACqe,qBAAqB,EAAE;UAC7Cze,EAAE,EAAEoY,SAAS;UACbsG,UAAU,EAAGzC,QAAQ,CAAqBze;QAC5C,CAAC,CAAC;MACJ;MACA,IAAI,CAACwc,iBAAiB,CACnBiC,QAAQ,CAAkB1S,IAAI,EAC/B6O,SAAS,CAAC9a,GAAG,CAACC,KAAK,EACnB,IAAI,EACJ,IACF,CAAC;MACD,IAAI,CAAC6a,SAAS,CAAC0B,KAAK,EAAE;QACpB1B,SAAS,CAAC0B,KAAK,GAAG,IAAAqB,qBAAe,EAACc,QAAQ,CAAC;MAC7C;IACF;IACA,OAAO,IAAI,CAACqB,qBAAqB,CAC/BlF,SAAS,EACT,iBAAiB,EACjB5B,WACF,CAAC;EACH;EAIAmI,WAAWA,CACT7R,KAAuD,EAC9C;IACT,OAAOA,KAAK,CAACzP,IAAI,KAAK,YAAY,IAAIyP,KAAK,CAACvD,IAAI,KAAK,MAAM;EAC7D;AACF;AAACjN,OAAA,CAAAsiB,OAAA,GAAAhgB,eAAA"} lib/parser/util.js 0000644 00000015706 15120211212 0010115 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.ExpressionErrors = void 0; var _types = require("../tokenizer/types"); var _tokenizer = require("../tokenizer"); var _whitespace = require("../util/whitespace"); var _identifier = require("../util/identifier"); var _classScope = require("../util/class-scope"); var _expressionScope = require("../util/expression-scope"); var _scopeflags = require("../util/scopeflags"); var _productionParameter = require("../util/production-parameter"); var _parseError = require("../parse-error"); class UtilParser extends _tokenizer.default { addExtra(node, key, value, enumerable = true) { if (!node) return; const extra = node.extra = node.extra || {}; if (enumerable) { extra[key] = value; } else { Object.defineProperty(extra, key, { enumerable, value }); } } isContextual(token) { return this.state.type === token && !this.state.containsEsc; } isUnparsedContextual(nameStart, name) { const nameEnd = nameStart + name.length; if (this.input.slice(nameStart, nameEnd) === name) { const nextCh = this.input.charCodeAt(nameEnd); return !((0, _identifier.isIdentifierChar)(nextCh) || (nextCh & 0xfc00) === 0xd800); } return false; } isLookaheadContextual(name) { const next = this.nextTokenStart(); return this.isUnparsedContextual(next, name); } eatContextual(token) { if (this.isContextual(token)) { this.next(); return true; } return false; } expectContextual(token, toParseError) { if (!this.eatContextual(token)) { if (toParseError != null) { throw this.raise(toParseError, { at: this.state.startLoc }); } this.unexpected(null, token); } } canInsertSemicolon() { return this.match(137) || this.match(8) || this.hasPrecedingLineBreak(); } hasPrecedingLineBreak() { return _whitespace.lineBreak.test(this.input.slice(this.state.lastTokEndLoc.index, this.state.start)); } hasFollowingLineBreak() { _whitespace.skipWhiteSpaceToLineBreak.lastIndex = this.state.end; return _whitespace.skipWhiteSpaceToLineBreak.test(this.input); } isLineTerminator() { return this.eat(13) || this.canInsertSemicolon(); } semicolon(allowAsi = true) { if (allowAsi ? this.isLineTerminator() : this.eat(13)) return; this.raise(_parseError.Errors.MissingSemicolon, { at: this.state.lastTokEndLoc }); } expect(type, loc) { this.eat(type) || this.unexpected(loc, type); } tryParse(fn, oldState = this.state.clone()) { const abortSignal = { node: null }; try { const node = fn((node = null) => { abortSignal.node = node; throw abortSignal; }); if (this.state.errors.length > oldState.errors.length) { const failState = this.state; this.state = oldState; this.state.tokensLength = failState.tokensLength; return { node, error: failState.errors[oldState.errors.length], thrown: false, aborted: false, failState }; } return { node, error: null, thrown: false, aborted: false, failState: null }; } catch (error) { const failState = this.state; this.state = oldState; if (error instanceof SyntaxError) { return { node: null, error, thrown: true, aborted: false, failState }; } if (error === abortSignal) { return { node: abortSignal.node, error: null, thrown: false, aborted: true, failState }; } throw error; } } checkExpressionErrors(refExpressionErrors, andThrow) { if (!refExpressionErrors) return false; const { shorthandAssignLoc, doubleProtoLoc, privateKeyLoc, optionalParametersLoc } = refExpressionErrors; const hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc; if (!andThrow) { return hasErrors; } if (shorthandAssignLoc != null) { this.raise(_parseError.Errors.InvalidCoverInitializedName, { at: shorthandAssignLoc }); } if (doubleProtoLoc != null) { this.raise(_parseError.Errors.DuplicateProto, { at: doubleProtoLoc }); } if (privateKeyLoc != null) { this.raise(_parseError.Errors.UnexpectedPrivateField, { at: privateKeyLoc }); } if (optionalParametersLoc != null) { this.unexpected(optionalParametersLoc); } } isLiteralPropertyName() { return (0, _types.tokenIsLiteralPropertyName)(this.state.type); } isPrivateName(node) { return node.type === "PrivateName"; } getPrivateNameSV(node) { return node.id.name; } hasPropertyAsPrivateName(node) { return (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") && this.isPrivateName(node.property); } isObjectProperty(node) { return node.type === "ObjectProperty"; } isObjectMethod(node) { return node.type === "ObjectMethod"; } initializeScopes(inModule = this.options.sourceType === "module") { const oldLabels = this.state.labels; this.state.labels = []; const oldExportedIdentifiers = this.exportedIdentifiers; this.exportedIdentifiers = new Set(); const oldInModule = this.inModule; this.inModule = inModule; const oldScope = this.scope; const ScopeHandler = this.getScopeHandler(); this.scope = new ScopeHandler(this, inModule); const oldProdParam = this.prodParam; this.prodParam = new _productionParameter.default(); const oldClassScope = this.classScope; this.classScope = new _classScope.default(this); const oldExpressionScope = this.expressionScope; this.expressionScope = new _expressionScope.default(this); return () => { this.state.labels = oldLabels; this.exportedIdentifiers = oldExportedIdentifiers; this.inModule = oldInModule; this.scope = oldScope; this.prodParam = oldProdParam; this.classScope = oldClassScope; this.expressionScope = oldExpressionScope; }; } enterInitialScopes() { let paramFlags = _productionParameter.PARAM; if (this.inModule) { paramFlags |= _productionParameter.PARAM_AWAIT; } this.scope.enter(_scopeflags.SCOPE_PROGRAM); this.prodParam.enter(paramFlags); } checkDestructuringPrivate(refExpressionErrors) { const { privateKeyLoc } = refExpressionErrors; if (privateKeyLoc !== null) { this.expectPlugin("destructuringPrivate", privateKeyLoc); } } } exports.default = UtilParser; class ExpressionErrors { constructor() { this.shorthandAssignLoc = null; this.doubleProtoLoc = null; this.privateKeyLoc = null; this.optionalParametersLoc = null; } } exports.ExpressionErrors = ExpressionErrors; //# sourceMappingURL=util.js.map lib/parser/util.js.map 0000644 00000046707 15120211212 0010676 0 ustar 00 {"version":3,"names":["_types","require","_tokenizer","_whitespace","_identifier","_classScope","_expressionScope","_scopeflags","_productionParameter","_parseError","UtilParser","Tokenizer","addExtra","node","key","value","enumerable","extra","Object","defineProperty","isContextual","token","state","type","containsEsc","isUnparsedContextual","nameStart","name","nameEnd","length","input","slice","nextCh","charCodeAt","isIdentifierChar","isLookaheadContextual","next","nextTokenStart","eatContextual","expectContextual","toParseError","raise","at","startLoc","unexpected","canInsertSemicolon","match","hasPrecedingLineBreak","lineBreak","test","lastTokEndLoc","index","start","hasFollowingLineBreak","skipWhiteSpaceToLineBreak","lastIndex","end","isLineTerminator","eat","semicolon","allowAsi","Errors","MissingSemicolon","expect","loc","tryParse","fn","oldState","clone","abortSignal","errors","failState","tokensLength","error","thrown","aborted","SyntaxError","checkExpressionErrors","refExpressionErrors","andThrow","shorthandAssignLoc","doubleProtoLoc","privateKeyLoc","optionalParametersLoc","hasErrors","InvalidCoverInitializedName","DuplicateProto","UnexpectedPrivateField","isLiteralPropertyName","tokenIsLiteralPropertyName","isPrivateName","getPrivateNameSV","id","hasPropertyAsPrivateName","property","isObjectProperty","isObjectMethod","initializeScopes","inModule","options","sourceType","oldLabels","labels","oldExportedIdentifiers","exportedIdentifiers","Set","oldInModule","oldScope","scope","ScopeHandler","getScopeHandler","oldProdParam","prodParam","ProductionParameterHandler","oldClassScope","classScope","ClassScopeHandler","oldExpressionScope","expressionScope","ExpressionScopeHandler","enterInitialScopes","paramFlags","PARAM","PARAM_AWAIT","enter","SCOPE_PROGRAM","checkDestructuringPrivate","expectPlugin","exports","default","ExpressionErrors","constructor"],"sources":["../../src/parser/util.ts"],"sourcesContent":["import type { Position } from \"../util/location\";\nimport {\n tokenIsLiteralPropertyName,\n tt,\n type TokenType,\n} from \"../tokenizer/types\";\nimport Tokenizer from \"../tokenizer\";\nimport type State from \"../tokenizer/state\";\nimport type { EstreePropertyDefinition, Node, ObjectProperty } from \"../types\";\nimport { lineBreak, skipWhiteSpaceToLineBreak } from \"../util/whitespace\";\nimport { isIdentifierChar } from \"../util/identifier\";\nimport ClassScopeHandler from \"../util/class-scope\";\nimport ExpressionScopeHandler from \"../util/expression-scope\";\nimport { SCOPE_PROGRAM } from \"../util/scopeflags\";\nimport ProductionParameterHandler, {\n PARAM_AWAIT,\n PARAM,\n} from \"../util/production-parameter\";\nimport {\n Errors,\n type ParseError,\n type ParseErrorConstructor,\n} from \"../parse-error\";\nimport type Parser from \".\";\n\nimport type ScopeHandler from \"../util/scope\";\n\ntype TryParse<Node, Error, Thrown, Aborted, FailState> = {\n node: Node;\n error: Error;\n thrown: Thrown;\n aborted: Aborted;\n failState: FailState;\n};\n\n// ## Parser utilities\n\nexport default abstract class UtilParser extends Tokenizer {\n // Forward-declaration: defined in parser/index.js\n abstract getScopeHandler(): { new (...args: any): ScopeHandler };\n\n addExtra(\n node: Partial<Node>,\n key: string,\n value: any,\n enumerable: boolean = true,\n ): void {\n if (!node) return;\n\n const extra = (node.extra = node.extra || {});\n if (enumerable) {\n extra[key] = value;\n } else {\n Object.defineProperty(extra, key, { enumerable, value });\n }\n }\n\n // Tests whether parsed token is a contextual keyword.\n\n isContextual(token: TokenType): boolean {\n return this.state.type === token && !this.state.containsEsc;\n }\n\n isUnparsedContextual(nameStart: number, name: string): boolean {\n const nameEnd = nameStart + name.length;\n if (this.input.slice(nameStart, nameEnd) === name) {\n const nextCh = this.input.charCodeAt(nameEnd);\n return !(\n isIdentifierChar(nextCh) ||\n // check if `nextCh is between 0xd800 - 0xdbff,\n // if `nextCh` is NaN, `NaN & 0xfc00` is 0, the function\n // returns true\n (nextCh & 0xfc00) === 0xd800\n );\n }\n return false;\n }\n\n isLookaheadContextual(name: string): boolean {\n const next = this.nextTokenStart();\n return this.isUnparsedContextual(next, name);\n }\n\n // Consumes contextual keyword if possible.\n\n eatContextual(token: TokenType): boolean {\n if (this.isContextual(token)) {\n this.next();\n return true;\n }\n return false;\n }\n\n // Asserts that following token is given contextual keyword.\n\n expectContextual(\n token: TokenType,\n toParseError?: ParseErrorConstructor<any>,\n ): void {\n if (!this.eatContextual(token)) {\n if (toParseError != null) {\n throw this.raise(toParseError, { at: this.state.startLoc });\n }\n this.unexpected(null, token);\n }\n }\n\n // Test whether a semicolon can be inserted at the current position.\n\n canInsertSemicolon(): boolean {\n return (\n this.match(tt.eof) ||\n this.match(tt.braceR) ||\n this.hasPrecedingLineBreak()\n );\n }\n\n hasPrecedingLineBreak(): boolean {\n return lineBreak.test(\n this.input.slice(this.state.lastTokEndLoc.index, this.state.start),\n );\n }\n\n hasFollowingLineBreak(): boolean {\n skipWhiteSpaceToLineBreak.lastIndex = this.state.end;\n return skipWhiteSpaceToLineBreak.test(this.input);\n }\n\n isLineTerminator(): boolean {\n return this.eat(tt.semi) || this.canInsertSemicolon();\n }\n\n // Consume a semicolon, or, failing that, see if we are allowed to\n // pretend that there is a semicolon at this position.\n\n semicolon(allowAsi: boolean = true): void {\n if (allowAsi ? this.isLineTerminator() : this.eat(tt.semi)) return;\n this.raise(Errors.MissingSemicolon, { at: this.state.lastTokEndLoc });\n }\n\n // Expect a token of a given type. If found, consume it, otherwise,\n // raise an unexpected token error at given pos.\n\n expect(type: TokenType, loc?: Position | null): void {\n this.eat(type) || this.unexpected(loc, type);\n }\n\n // tryParse will clone parser state.\n // It is expensive and should be used with cautions\n tryParse<T extends Node | ReadonlyArray<Node>>(\n fn: (abort: (node?: T) => never) => T,\n oldState: State = this.state.clone(),\n ):\n | TryParse<T, null, false, false, null>\n | TryParse<T | null, ParseError<any>, boolean, false, State>\n | TryParse<T | null, null, false, true, State> {\n const abortSignal: {\n node: T | null;\n } = { node: null };\n try {\n const node = fn((node = null) => {\n abortSignal.node = node;\n throw abortSignal;\n });\n if (this.state.errors.length > oldState.errors.length) {\n const failState = this.state;\n this.state = oldState;\n // tokensLength should be preserved during error recovery mode\n // since the parser does not halt and will instead parse the\n // remaining tokens\n this.state.tokensLength = failState.tokensLength;\n return {\n node,\n error: failState.errors[oldState.errors.length],\n thrown: false,\n aborted: false,\n failState,\n };\n }\n\n return {\n node,\n error: null,\n thrown: false,\n aborted: false,\n failState: null,\n };\n } catch (error) {\n const failState = this.state;\n this.state = oldState;\n if (error instanceof SyntaxError) {\n // @ts-expect-error casting general syntax error to parse error\n return { node: null, error, thrown: true, aborted: false, failState };\n }\n if (error === abortSignal) {\n return {\n node: abortSignal.node,\n error: null,\n thrown: false,\n aborted: true,\n failState,\n };\n }\n\n throw error;\n }\n }\n\n checkExpressionErrors(\n refExpressionErrors: ExpressionErrors | undefined | null,\n andThrow: boolean,\n ) {\n if (!refExpressionErrors) return false;\n const {\n shorthandAssignLoc,\n doubleProtoLoc,\n privateKeyLoc,\n optionalParametersLoc,\n } = refExpressionErrors;\n\n const hasErrors =\n !!shorthandAssignLoc ||\n !!doubleProtoLoc ||\n !!optionalParametersLoc ||\n !!privateKeyLoc;\n\n if (!andThrow) {\n return hasErrors;\n }\n\n if (shorthandAssignLoc != null) {\n this.raise(Errors.InvalidCoverInitializedName, {\n at: shorthandAssignLoc,\n });\n }\n\n if (doubleProtoLoc != null) {\n this.raise(Errors.DuplicateProto, { at: doubleProtoLoc });\n }\n\n if (privateKeyLoc != null) {\n this.raise(Errors.UnexpectedPrivateField, { at: privateKeyLoc });\n }\n\n if (optionalParametersLoc != null) {\n this.unexpected(optionalParametersLoc);\n }\n }\n\n /**\n * Test if current token is a literal property name\n * https://tc39.es/ecma262/#prod-LiteralPropertyName\n * LiteralPropertyName:\n * IdentifierName\n * StringLiteral\n * NumericLiteral\n * BigIntLiteral\n */\n isLiteralPropertyName(): boolean {\n return tokenIsLiteralPropertyName(this.state.type);\n }\n\n /**\n * Test if given node is a PrivateName\n * will be overridden in ESTree plugin\n */\n isPrivateName(node: Node): boolean {\n return node.type === \"PrivateName\";\n }\n\n /**\n * Return the string value of a given private name\n * WITHOUT `#`\n * @see {@link https://tc39.es/ecma262/#sec-static-semantics-stringvalue}\n */\n getPrivateNameSV(node: Node): string {\n return node.id.name;\n }\n\n /**\n * Return whether the given node is a member/optional chain that\n * contains a private name as its property\n * It is overridden in ESTree plugin\n */\n hasPropertyAsPrivateName(node: Node): boolean {\n return (\n (node.type === \"MemberExpression\" ||\n node.type === \"OptionalMemberExpression\") &&\n this.isPrivateName(node.property)\n );\n }\n\n isObjectProperty(\n node: Node,\n ): node is ObjectProperty | EstreePropertyDefinition {\n return node.type === \"ObjectProperty\";\n }\n\n isObjectMethod(node: Node): boolean {\n return node.type === \"ObjectMethod\";\n }\n\n initializeScopes(\n this: Parser,\n inModule: boolean = this.options.sourceType === \"module\",\n ): () => void {\n // Initialize state\n const oldLabels = this.state.labels;\n this.state.labels = [];\n\n const oldExportedIdentifiers = this.exportedIdentifiers;\n this.exportedIdentifiers = new Set();\n\n // initialize scopes\n const oldInModule = this.inModule;\n this.inModule = inModule;\n\n const oldScope = this.scope;\n const ScopeHandler = this.getScopeHandler();\n this.scope = new ScopeHandler(this, inModule);\n\n const oldProdParam = this.prodParam;\n this.prodParam = new ProductionParameterHandler();\n\n const oldClassScope = this.classScope;\n this.classScope = new ClassScopeHandler(this);\n\n const oldExpressionScope = this.expressionScope;\n this.expressionScope = new ExpressionScopeHandler(this);\n\n return () => {\n // Revert state\n this.state.labels = oldLabels;\n this.exportedIdentifiers = oldExportedIdentifiers;\n\n // Revert scopes\n this.inModule = oldInModule;\n this.scope = oldScope;\n this.prodParam = oldProdParam;\n this.classScope = oldClassScope;\n this.expressionScope = oldExpressionScope;\n };\n }\n\n enterInitialScopes() {\n let paramFlags = PARAM;\n if (this.inModule) {\n paramFlags |= PARAM_AWAIT;\n }\n this.scope.enter(SCOPE_PROGRAM);\n this.prodParam.enter(paramFlags);\n }\n\n checkDestructuringPrivate(refExpressionErrors: ExpressionErrors) {\n const { privateKeyLoc } = refExpressionErrors;\n if (privateKeyLoc !== null) {\n this.expectPlugin(\"destructuringPrivate\", privateKeyLoc);\n }\n }\n}\n\n/**\n * The ExpressionErrors is a context struct used to track ambiguous patterns\n * When we are sure the parsed pattern is a RHS, which means it is not a pattern,\n * we will throw on this position on invalid assign syntax, otherwise it will be reset to -1\n *\n * Types of ExpressionErrors:\n *\n * - **shorthandAssignLoc**: track initializer `=` position\n * - **doubleProtoLoc**: track the duplicate `__proto__` key position\n * - **privateKey**: track private key `#p` position\n * - **optionalParametersLoc**: track the optional parameter (`?`).\n * It's only used by typescript and flow plugins\n */\nexport class ExpressionErrors {\n shorthandAssignLoc: Position | undefined | null = null;\n doubleProtoLoc: Position | undefined | null = null;\n privateKeyLoc: Position | undefined | null = null;\n optionalParametersLoc: Position | undefined | null = null;\n}\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AAGA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,oBAAA,GAAAP,OAAA;AAIA,IAAAQ,WAAA,GAAAR,OAAA;AAmBe,MAAeS,UAAU,SAASC,kBAAS,CAAC;EAIzDC,QAAQA,CACNC,IAAmB,EACnBC,GAAW,EACXC,KAAU,EACVC,UAAmB,GAAG,IAAI,EACpB;IACN,IAAI,CAACH,IAAI,EAAE;IAEX,MAAMI,KAAK,GAAIJ,IAAI,CAACI,KAAK,GAAGJ,IAAI,CAACI,KAAK,IAAI,CAAC,CAAE;IAC7C,IAAID,UAAU,EAAE;MACdC,KAAK,CAACH,GA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 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getPluginOption = getPluginOption; exports.hasPlugin = hasPlugin; exports.mixinPlugins = exports.mixinPluginNames = void 0; exports.validatePlugins = validatePlugins; var _estree = require("./plugins/estree"); var _flow = require("./plugins/flow"); var _jsx = require("./plugins/jsx"); var _typescript = require("./plugins/typescript"); var _placeholders = require("./plugins/placeholders"); var _v8intrinsic = require("./plugins/v8intrinsic"); function hasPlugin(plugins, expectedConfig) { const [expectedName, expectedOptions] = typeof expectedConfig === "string" ? [expectedConfig, {}] : expectedConfig; const expectedKeys = Object.keys(expectedOptions); const expectedOptionsIsEmpty = expectedKeys.length === 0; return plugins.some(p => { if (typeof p === "string") { return expectedOptionsIsEmpty && p === expectedName; } else { const [pluginName, pluginOptions] = p; if (pluginName !== expectedName) { return false; } for (const key of expectedKeys) { if (pluginOptions[key] !== expectedOptions[key]) { return false; } } return true; } }); } function getPluginOption(plugins, name, option) { const plugin = plugins.find(plugin => { if (Array.isArray(plugin)) { return plugin[0] === name; } else { return plugin === name; } }); if (plugin && Array.isArray(plugin) && plugin.length > 1) { return plugin[1][option]; } return null; } const PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack", "smart"]; const TOPIC_TOKENS = ["^^", "@@", "^", "%", "#"]; const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"]; function validatePlugins(plugins) { if (hasPlugin(plugins, "decorators")) { if (hasPlugin(plugins, "decorators-legacy")) { throw new Error("Cannot use the decorators and decorators-legacy plugin together"); } const decoratorsBeforeExport = getPluginOption(plugins, "decorators", "decoratorsBeforeExport"); if (decoratorsBeforeExport != null && typeof decoratorsBeforeExport !== "boolean") { throw new Error("'decoratorsBeforeExport' must be a boolean, if specified."); } const allowCallParenthesized = getPluginOption(plugins, "decorators", "allowCallParenthesized"); if (allowCallParenthesized != null && typeof allowCallParenthesized !== "boolean") { throw new Error("'allowCallParenthesized' must be a boolean."); } } if (hasPlugin(plugins, "flow") && hasPlugin(plugins, "typescript")) { throw new Error("Cannot combine flow and typescript plugins."); } if (hasPlugin(plugins, "placeholders") && hasPlugin(plugins, "v8intrinsic")) { throw new Error("Cannot combine placeholders and v8intrinsic plugins."); } if (hasPlugin(plugins, "pipelineOperator")) { const proposal = getPluginOption(plugins, "pipelineOperator", "proposal"); if (!PIPELINE_PROPOSALS.includes(proposal)) { const proposalList = PIPELINE_PROPOSALS.map(p => `"${p}"`).join(", "); throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${proposalList}.`); } const tupleSyntaxIsHash = hasPlugin(plugins, ["recordAndTuple", { syntaxType: "hash" }]); if (proposal === "hack") { if (hasPlugin(plugins, "placeholders")) { throw new Error("Cannot combine placeholders plugin and Hack-style pipes."); } if (hasPlugin(plugins, "v8intrinsic")) { throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes."); } const topicToken = getPluginOption(plugins, "pipelineOperator", "topicToken"); if (!TOPIC_TOKENS.includes(topicToken)) { const tokenList = TOPIC_TOKENS.map(t => `"${t}"`).join(", "); throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${tokenList}.`); } if (topicToken === "#" && tupleSyntaxIsHash) { throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "hack", topicToken: "#" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.'); } } else if (proposal === "smart" && tupleSyntaxIsHash) { throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "smart" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.'); } } if (hasPlugin(plugins, "moduleAttributes")) { { if (hasPlugin(plugins, "importAssertions") || hasPlugin(plugins, "importAttributes")) { throw new Error("Cannot combine importAssertions, importAttributes and moduleAttributes plugins."); } const moduleAttributesVersionPluginOption = getPluginOption(plugins, "moduleAttributes", "version"); if (moduleAttributesVersionPluginOption !== "may-2020") { throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'."); } } } if (hasPlugin(plugins, "importAssertions") && hasPlugin(plugins, "importAttributes")) { throw new Error("Cannot combine importAssertions and importAttributes plugins."); } if (hasPlugin(plugins, "recordAndTuple") && getPluginOption(plugins, "recordAndTuple", "syntaxType") != null && !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(getPluginOption(plugins, "recordAndTuple", "syntaxType"))) { throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", ")); } if (hasPlugin(plugins, "asyncDoExpressions") && !hasPlugin(plugins, "doExpressions")) { const error = new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins."); error.missingPlugins = "doExpressions"; throw error; } } const mixinPlugins = { estree: _estree.default, jsx: _jsx.default, flow: _flow.default, typescript: _typescript.default, v8intrinsic: _v8intrinsic.default, placeholders: _placeholders.default }; exports.mixinPlugins = mixinPlugins; const mixinPluginNames = Object.keys(mixinPlugins); exports.mixinPluginNames = mixinPluginNames; //# sourceMappingURL=plugin-utils.js.map lib/plugin-utils.js.map 0000644 00000033330 15120211212 0011045 0 ustar 00 {"version":3,"names":["_estree","require","_flow","_jsx","_typescript","_placeholders","_v8intrinsic","hasPlugin","plugins","expectedConfig","expectedName","expectedOptions","expectedKeys","Object","keys","expectedOptionsIsEmpty","length","some","p","pluginName","pluginOptions","key","getPluginOption","name","option","plugin","find","Array","isArray","PIPELINE_PROPOSALS","TOPIC_TOKENS","RECORD_AND_TUPLE_SYNTAX_TYPES","validatePlugins","Error","decoratorsBeforeExport","allowCallParenthesized","proposal","includes","proposalList","map","join","tupleSyntaxIsHash","syntaxType","topicToken","tokenList","t","moduleAttributesVersionPluginOption","error","missingPlugins","mixinPlugins","estree","jsx","flow","typescript","v8intrinsic","placeholders","exports","mixinPluginNames"],"sources":["../src/plugin-utils.ts"],"sourcesContent":["import type Parser from \"./parser\";\nimport type {\n ParserPluginWithOptions,\n PluginConfig,\n PluginOptions,\n} from \"./typings\";\n\nexport type Plugin = PluginConfig;\n\nexport type PluginList = PluginConfig[];\n\nexport type MixinPlugin = (superClass: { new (...args: any): Parser }) => {\n new (...args: any): Parser;\n};\n\n// This function’s second parameter accepts either a string (plugin name) or an\n// array pair (plugin name and options object). If an options object is given,\n// then each value is non-recursively checked for identity with the actual\n// option value of each plugin in the first argument (which is an array of\n// plugin names or array pairs).\nexport function hasPlugin(\n plugins: PluginList,\n expectedConfig: PluginConfig,\n): boolean {\n // The expectedOptions object is by default an empty object if the given\n // expectedConfig argument does not give an options object (i.e., if it is a\n // string).\n const [expectedName, expectedOptions] =\n typeof expectedConfig === \"string\" ? [expectedConfig, {}] : expectedConfig;\n\n const expectedKeys = Object.keys(expectedOptions);\n\n const expectedOptionsIsEmpty = expectedKeys.length === 0;\n\n return plugins.some(p => {\n if (typeof p === \"string\") {\n return expectedOptionsIsEmpty && p === expectedName;\n } else {\n const [pluginName, pluginOptions] = p;\n if (pluginName !== expectedName) {\n return false;\n }\n for (const key of expectedKeys) {\n // @ts-expect-error key may not exist in plugin options\n if (pluginOptions[key] !== expectedOptions[key]) {\n return false;\n }\n }\n return true;\n }\n });\n}\n\nexport function getPluginOption<\n PluginName extends ParserPluginWithOptions[0],\n OptionName extends keyof PluginOptions<PluginName>,\n>(plugins: PluginList, name: PluginName, option: OptionName) {\n const plugin = plugins.find(plugin => {\n if (Array.isArray(plugin)) {\n return plugin[0] === name;\n } else {\n return plugin === name;\n }\n });\n\n if (plugin && Array.isArray(plugin) && plugin.length > 1) {\n return (plugin[1] as PluginOptions<PluginName>)[option];\n }\n\n return null;\n}\n\nconst PIPELINE_PROPOSALS = [\"minimal\", \"fsharp\", \"hack\", \"smart\"];\nconst TOPIC_TOKENS = [\"^^\", \"@@\", \"^\", \"%\", \"#\"];\nconst RECORD_AND_TUPLE_SYNTAX_TYPES = [\"hash\", \"bar\"];\n\nexport function validatePlugins(plugins: PluginList) {\n if (hasPlugin(plugins, \"decorators\")) {\n if (hasPlugin(plugins, \"decorators-legacy\")) {\n throw new Error(\n \"Cannot use the decorators and decorators-legacy plugin together\",\n );\n }\n\n const decoratorsBeforeExport = getPluginOption(\n plugins,\n \"decorators\",\n \"decoratorsBeforeExport\",\n );\n if (\n decoratorsBeforeExport != null &&\n typeof decoratorsBeforeExport !== \"boolean\"\n ) {\n throw new Error(\n \"'decoratorsBeforeExport' must be a boolean, if specified.\",\n );\n }\n\n const allowCallParenthesized = getPluginOption(\n plugins,\n \"decorators\",\n \"allowCallParenthesized\",\n );\n if (\n allowCallParenthesized != null &&\n typeof allowCallParenthesized !== \"boolean\"\n ) {\n throw new Error(\"'allowCallParenthesized' must be a boolean.\");\n }\n }\n\n if (hasPlugin(plugins, \"flow\") && hasPlugin(plugins, \"typescript\")) {\n throw new Error(\"Cannot combine flow and typescript plugins.\");\n }\n\n if (hasPlugin(plugins, \"placeholders\") && hasPlugin(plugins, \"v8intrinsic\")) {\n throw new Error(\"Cannot combine placeholders and v8intrinsic plugins.\");\n }\n\n if (hasPlugin(plugins, \"pipelineOperator\")) {\n const proposal = getPluginOption(plugins, \"pipelineOperator\", \"proposal\");\n\n if (!PIPELINE_PROPOSALS.includes(proposal)) {\n const proposalList = PIPELINE_PROPOSALS.map(p => `\"${p}\"`).join(\", \");\n throw new Error(\n `\"pipelineOperator\" requires \"proposal\" option whose value must be one of: ${proposalList}.`,\n );\n }\n\n const tupleSyntaxIsHash = hasPlugin(plugins, [\n \"recordAndTuple\",\n { syntaxType: \"hash\" },\n ]);\n\n if (proposal === \"hack\") {\n if (hasPlugin(plugins, \"placeholders\")) {\n throw new Error(\n \"Cannot combine placeholders plugin and Hack-style pipes.\",\n );\n }\n\n if (hasPlugin(plugins, \"v8intrinsic\")) {\n throw new Error(\n \"Cannot combine v8intrinsic plugin and Hack-style pipes.\",\n );\n }\n\n const topicToken = getPluginOption(\n plugins,\n \"pipelineOperator\",\n \"topicToken\",\n );\n\n if (!TOPIC_TOKENS.includes(topicToken)) {\n const tokenList = TOPIC_TOKENS.map(t => `\"${t}\"`).join(\", \");\n\n throw new Error(\n `\"pipelineOperator\" in \"proposal\": \"hack\" mode also requires a \"topicToken\" option whose value must be one of: ${tokenList}.`,\n );\n }\n\n if (topicToken === \"#\" && tupleSyntaxIsHash) {\n throw new Error(\n 'Plugin conflict between `[\"pipelineOperator\", { proposal: \"hack\", topicToken: \"#\" }]` and `[\"recordAndtuple\", { syntaxType: \"hash\"}]`.',\n );\n }\n } else if (proposal === \"smart\" && tupleSyntaxIsHash) {\n throw new Error(\n 'Plugin conflict between `[\"pipelineOperator\", { proposal: \"smart\" }]` and `[\"recordAndtuple\", { syntaxType: \"hash\"}]`.',\n );\n }\n }\n\n if (hasPlugin(plugins, \"moduleAttributes\")) {\n if (process.env.BABEL_8_BREAKING) {\n throw new Error(\n \"`moduleAttributes` has been removed in Babel 8, please use `importAttributes` parser plugin, or `@babel/plugin-syntax-import-attributes`.\",\n );\n } else {\n if (\n hasPlugin(plugins, \"importAssertions\") ||\n hasPlugin(plugins, \"importAttributes\")\n ) {\n throw new Error(\n \"Cannot combine importAssertions, importAttributes and moduleAttributes plugins.\",\n );\n }\n const moduleAttributesVersionPluginOption = getPluginOption(\n plugins,\n \"moduleAttributes\",\n \"version\",\n );\n if (moduleAttributesVersionPluginOption !== \"may-2020\") {\n throw new Error(\n \"The 'moduleAttributes' plugin requires a 'version' option,\" +\n \" representing the last proposal update. Currently, the\" +\n \" only supported value is 'may-2020'.\",\n );\n }\n }\n }\n if (\n hasPlugin(plugins, \"importAssertions\") &&\n hasPlugin(plugins, \"importAttributes\")\n ) {\n throw new Error(\n \"Cannot combine importAssertions and importAttributes plugins.\",\n );\n }\n\n if (\n hasPlugin(plugins, \"recordAndTuple\") &&\n getPluginOption(plugins, \"recordAndTuple\", \"syntaxType\") != null &&\n !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(\n getPluginOption(plugins, \"recordAndTuple\", \"syntaxType\"),\n )\n ) {\n throw new Error(\n \"The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: \" +\n RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(\", \"),\n );\n }\n\n if (\n hasPlugin(plugins, \"asyncDoExpressions\") &&\n !hasPlugin(plugins, \"doExpressions\")\n ) {\n const error = new Error(\n \"'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.\",\n );\n // @ts-expect-error so @babel/core can provide better error message\n error.missingPlugins = \"doExpressions\";\n throw error;\n }\n}\n\n// These plugins are defined using a mixin which extends the parser class.\n\nimport estree from \"./plugins/estree\";\nimport flow from \"./plugins/flow\";\nimport jsx from \"./plugins/jsx\";\nimport typescript from \"./plugins/typescript\";\nimport placeholders from \"./plugins/placeholders\";\nimport v8intrinsic from \"./plugins/v8intrinsic\";\n\n// NOTE: order is important. estree must come first; placeholders must come last.\nexport const mixinPlugins = {\n estree,\n jsx,\n flow,\n typescript,\n v8intrinsic,\n placeholders,\n};\n\nexport const mixinPluginNames = Object.keys(mixinPlugins) as ReadonlyArray<\n \"estree\" | \"jsx\" | \"flow\" | \"typescript\" | \"v8intrinsic\" | \"placeholders\"\n>;\n"],"mappings":";;;;;;;;;AA8OA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AA/NO,SAASM,SAASA,CACvBC,OAAmB,EACnBC,cAA4B,EACnB;EAIT,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,GACnC,OAAOF,cAAc,KAAK,QAAQ,GAAG,CAACA,cAAc,EAAE,CAAC,CAAC,CAAC,GAAGA,cAAc;EAE5E,MAAMG,YAAY,GAAGC,MAAM,CAACC,IAAI,CAACH,eAAe,CAAC;EAEjD,MAAMI,sBAAsB,GAAGH,YAAY,CAACI,MAAM,KAAK,CAAC;EAExD,OAAOR,OAAO,CAACS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 0000644 00000025052 15120211212 0010607 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _parseError = require("../parse-error"); const { defineProperty } = Object; const toUnenumerable = (object, key) => defineProperty(object, key, { enumerable: false, value: object[key] }); function toESTreeLocation(node) { node.loc.start && toUnenumerable(node.loc.start, "index"); node.loc.end && toUnenumerable(node.loc.end, "index"); return node; } var _default = superClass => class ESTreeParserMixin extends superClass { parse() { const file = toESTreeLocation(super.parse()); if (this.options.tokens) { file.tokens = file.tokens.map(toESTreeLocation); } return file; } parseRegExpLiteral({ pattern, flags }) { let regex = null; try { regex = new RegExp(pattern, flags); } catch (e) {} const node = this.estreeParseLiteral(regex); node.regex = { pattern, flags }; return node; } parseBigIntLiteral(value) { let bigInt; try { bigInt = BigInt(value); } catch (_unused) { bigInt = null; } const node = this.estreeParseLiteral(bigInt); node.bigint = String(node.value || value); return node; } parseDecimalLiteral(value) { const decimal = null; const node = this.estreeParseLiteral(decimal); node.decimal = String(node.value || value); return node; } estreeParseLiteral(value) { return this.parseLiteral(value, "Literal"); } parseStringLiteral(value) { return this.estreeParseLiteral(value); } parseNumericLiteral(value) { return this.estreeParseLiteral(value); } parseNullLiteral() { return this.estreeParseLiteral(null); } parseBooleanLiteral(value) { return this.estreeParseLiteral(value); } directiveToStmt(directive) { const expression = directive.value; delete directive.value; expression.type = "Literal"; expression.raw = expression.extra.raw; expression.value = expression.extra.expressionValue; const stmt = directive; stmt.type = "ExpressionStatement"; stmt.expression = expression; stmt.directive = expression.extra.rawValue; delete expression.extra; return stmt; } initFunction(node, isAsync) { super.initFunction(node, isAsync); node.expression = false; } checkDeclaration(node) { if (node != null && this.isObjectProperty(node)) { this.checkDeclaration(node.value); } else { super.checkDeclaration(node); } } getObjectOrClassMethodParams(method) { return method.value.params; } isValidDirective(stmt) { var _stmt$expression$extr; return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized); } parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) { super.parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse); const directiveStatements = node.directives.map(d => this.directiveToStmt(d)); node.body = directiveStatements.concat(node.body); delete node.directives; } pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true); if (method.typeParameters) { method.value.typeParameters = method.typeParameters; delete method.typeParameters; } classBody.body.push(method); } parsePrivateName() { const node = super.parsePrivateName(); { if (!this.getPluginOption("estree", "classFeatures")) { return node; } } return this.convertPrivateNameToPrivateIdentifier(node); } convertPrivateNameToPrivateIdentifier(node) { const name = super.getPrivateNameSV(node); node = node; delete node.id; node.name = name; node.type = "PrivateIdentifier"; return node; } isPrivateName(node) { { if (!this.getPluginOption("estree", "classFeatures")) { return super.isPrivateName(node); } } return node.type === "PrivateIdentifier"; } getPrivateNameSV(node) { { if (!this.getPluginOption("estree", "classFeatures")) { return super.getPrivateNameSV(node); } } return node.name; } parseLiteral(value, type) { const node = super.parseLiteral(value, type); node.raw = node.extra.raw; delete node.extra; return node; } parseFunctionBody(node, allowExpression, isMethod = false) { super.parseFunctionBody(node, allowExpression, isMethod); node.expression = node.body.type !== "BlockStatement"; } parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { let funcNode = this.startNode(); funcNode.kind = node.kind; funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); funcNode.type = "FunctionExpression"; delete funcNode.kind; node.value = funcNode; if (type === "ClassPrivateMethod") { node.computed = false; } return this.finishNode(node, "MethodDefinition"); } parseClassProperty(...args) { const propertyNode = super.parseClassProperty(...args); { if (!this.getPluginOption("estree", "classFeatures")) { return propertyNode; } } propertyNode.type = "PropertyDefinition"; return propertyNode; } parseClassPrivateProperty(...args) { const propertyNode = super.parseClassPrivateProperty(...args); { if (!this.getPluginOption("estree", "classFeatures")) { return propertyNode; } } propertyNode.type = "PropertyDefinition"; propertyNode.computed = false; return propertyNode; } parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor); if (node) { node.type = "Property"; if (node.kind === "method") { node.kind = "init"; } node.shorthand = false; } return node; } parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) { const node = super.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors); if (node) { node.kind = "init"; node.type = "Property"; } return node; } isValidLVal(type, isUnparenthesizedInAssign, binding) { return type === "Property" ? "value" : super.isValidLVal(type, isUnparenthesizedInAssign, binding); } isAssignable(node, isBinding) { if (node != null && this.isObjectProperty(node)) { return this.isAssignable(node.value, isBinding); } return super.isAssignable(node, isBinding); } toAssignable(node, isLHS = false) { if (node != null && this.isObjectProperty(node)) { const { key, value } = node; if (this.isPrivateName(key)) { this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start); } this.toAssignable(value, isLHS); } else { super.toAssignable(node, isLHS); } } toAssignableObjectExpressionProp(prop, isLast, isLHS) { if (prop.kind === "get" || prop.kind === "set") { this.raise(_parseError.Errors.PatternHasAccessor, { at: prop.key }); } else if (prop.method) { this.raise(_parseError.Errors.PatternHasMethod, { at: prop.key }); } else { super.toAssignableObjectExpressionProp(prop, isLast, isLHS); } } finishCallExpression(unfinished, optional) { const node = super.finishCallExpression(unfinished, optional); if (node.callee.type === "Import") { node.type = "ImportExpression"; node.source = node.arguments[0]; if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) { var _node$arguments$; node.attributes = (_node$arguments$ = node.arguments[1]) != null ? _node$arguments$ : null; } delete node.arguments; delete node.callee; } return node; } toReferencedArguments(node) { if (node.type === "ImportExpression") { return; } super.toReferencedArguments(node); } parseExport(unfinished, decorators) { const exportStartLoc = this.state.lastTokStartLoc; const node = super.parseExport(unfinished, decorators); switch (node.type) { case "ExportAllDeclaration": node.exported = null; break; case "ExportNamedDeclaration": if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") { node.type = "ExportAllDeclaration"; node.exported = node.specifiers[0].exported; delete node.specifiers; } case "ExportDefaultDeclaration": { var _declaration$decorato; const { declaration } = node; if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && ((_declaration$decorato = declaration.decorators) == null ? void 0 : _declaration$decorato.length) > 0 && declaration.start === node.start) { this.resetStartLocation(node, exportStartLoc); } } break; } return node; } parseSubscript(base, startLoc, noCalls, state) { const node = super.parseSubscript(base, startLoc, noCalls, state); if (state.optionalChainMember) { if (node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression") { node.type = node.type.substring(8); } if (state.stop) { const chain = this.startNodeAtNode(node); chain.expression = node; return this.finishNode(chain, "ChainExpression"); } } else if (node.type === "MemberExpression" || node.type === "CallExpression") { node.optional = false; } return node; } hasPropertyAsPrivateName(node) { if (node.type === "ChainExpression") { node = node.expression; } return super.hasPropertyAsPrivateName(node); } isObjectProperty(node) { return node.type === "Property" && node.kind === "init" && !node.method; } isObjectMethod(node) { return node.method || node.kind === "get" || node.kind === "set"; } finishNodeAt(node, type, endLoc) { return toESTreeLocation(super.finishNodeAt(node, type, endLoc)); } resetStartLocation(node, startLoc) { super.resetStartLocation(node, startLoc); toESTreeLocation(node); } resetEndLocation(node, endLoc = this.state.lastTokEndLoc) { super.resetEndLocation(node, endLoc); toESTreeLocation(node); } }; exports.default = _default; //# sourceMappingURL=estree.js.map lib/plugins/estree.js.map 0000644 00000076651 15120211212 0011376 0 ustar 00 {"version":3,"names":["_parseError","require","defineProperty","Object","toUnenumerable","object","key","enumerable","value","toESTreeLocation","node","loc","start","end","_default","superClass","ESTreeParserMixin","parse","file","options","tokens","map","parseRegExpLiteral","pattern","flags","regex","RegExp","e","estreeParseLiteral","parseBigIntLiteral","bigInt","BigInt","_unused","bigint","String","parseDecimalLiteral","decimal","parseLiteral","parseStringLiteral","parseNumericLiteral","parseNullLiteral","parseBooleanLiteral","directiveToStmt","directive","expression","type","raw","extra","expressionValue","stmt","rawValue","initFunction","isAsync","checkDeclaration","isObjectProperty","getObjectOrClassMethodParams","method","params","isValidDirective","_stmt$expression$extr","parenthesized","parseBlockBody","allowDirectives","topLevel","afterBlockParse","directiveStatements","directives","d","body","concat","pushClassMethod","classBody","isGenerator","isConstructor","allowsDirectSuper","parseMethod","typeParameters","push","parsePrivateName","getPluginOption","convertPrivateNameToPrivateIdentifier","name","getPrivateNameSV","id","isPrivateName","parseFunctionBody","allowExpression","isMethod","allowDirectSuper","inClassScope","funcNode","startNode","kind","computed","finishNode","parseClassProperty","args","propertyNode","parseClassPrivateProperty","parseObjectMethod","prop","isPattern","isAccessor","shorthand","parseObjectProperty","startLoc","refExpressionErrors","isValidLVal","isUnparenthesizedInAssign","binding","isAssignable","isBinding","toAssignable","isLHS","classScope","usePrivateName","toAssignableObjectExpressionProp","isLast","raise","Errors","PatternHasAccessor","at","PatternHasMethod","finishCallExpression","unfinished","optional","callee","source","arguments","hasPlugin","_node$arguments$","attributes","toReferencedArguments","parseExport","decorators","exportStartLoc","state","lastTokStartLoc","exported","specifiers","length","_declaration$decorato","declaration","resetStartLocation","parseSubscript","base","noCalls","optionalChainMember","substring","stop","chain","startNodeAtNode","hasPropertyAsPrivateName","isObjectMethod","finishNodeAt","endLoc","resetEndLocation","lastTokEndLoc","exports","default"],"sources":["../../src/plugins/estree.ts"],"sourcesContent":["import type { TokenType } from \"../tokenizer/types\";\nimport type Parser from \"../parser\";\nimport type { ExpressionErrors } from \"../parser/util\";\nimport type * as N from \"../types\";\nimport type { Node as NodeType, NodeBase, File } from \"../types\";\nimport type { Position } from \"../util/location\";\nimport { Errors } from \"../parse-error\";\nimport type { Undone } from \"../parser/node\";\nimport type { BindingTypes } from \"../util/scopeflags\";\n\nconst { defineProperty } = Object;\nconst toUnenumerable = (object: any, key: string) =>\n defineProperty(object, key, { enumerable: false, value: object[key] });\n\nfunction toESTreeLocation(node: any) {\n node.loc.start && toUnenumerable(node.loc.start, \"index\");\n node.loc.end && toUnenumerable(node.loc.end, \"index\");\n\n return node;\n}\n\nexport default (superClass: typeof Parser) =>\n class ESTreeParserMixin extends superClass implements Parser {\n parse(): File {\n const file = toESTreeLocation(super.parse());\n\n if (this.options.tokens) {\n file.tokens = file.tokens.map(toESTreeLocation);\n }\n\n return file;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseRegExpLiteral({ pattern, flags }): N.EstreeRegExpLiteral {\n let regex: RegExp | null = null;\n try {\n regex = new RegExp(pattern, flags);\n } catch (e) {\n // In environments that don't support these flags value will\n // be null as the regex can't be represented natively.\n }\n const node = this.estreeParseLiteral<N.EstreeRegExpLiteral>(regex);\n node.regex = { pattern, flags };\n\n return node;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseBigIntLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/es2020.md#bigintliteral\n let bigInt: BigInt | null;\n try {\n bigInt = BigInt(value);\n } catch {\n bigInt = null;\n }\n const node = this.estreeParseLiteral<N.EstreeBigIntLiteral>(bigInt);\n node.bigint = String(node.value || value);\n\n return node;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseDecimalLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/experimental/decimal.md\n // todo: use BigDecimal when node supports it.\n const decimal: null = null;\n const node = this.estreeParseLiteral(decimal);\n node.decimal = String(node.value || value);\n\n return node;\n }\n\n estreeParseLiteral<T extends N.Node>(value: any) {\n // @ts-expect-error ESTree plugin changes node types\n return this.parseLiteral<T>(value, \"Literal\");\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseStringLiteral(value: any): N.Node {\n return this.estreeParseLiteral(value);\n }\n\n parseNumericLiteral(value: any): any {\n return this.estreeParseLiteral(value);\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseNullLiteral(): N.Node {\n return this.estreeParseLiteral(null);\n }\n\n parseBooleanLiteral(value: boolean): N.BooleanLiteral {\n return this.estreeParseLiteral(value);\n }\n\n // Cast a Directive to an ExpressionStatement. Mutates the input Directive.\n directiveToStmt(directive: N.Directive): N.ExpressionStatement {\n const expression = directive.value as any as N.EstreeLiteral;\n delete directive.value;\n\n expression.type = \"Literal\";\n // @ts-expect-error N.EstreeLiteral.raw is not defined.\n expression.raw = expression.extra.raw;\n expression.value = expression.extra.expressionValue;\n\n const stmt = directive as any as N.ExpressionStatement;\n stmt.type = \"ExpressionStatement\";\n stmt.expression = expression;\n // @ts-expect-error N.ExpressionStatement.directive is not defined\n stmt.directive = expression.extra.rawValue;\n\n delete expression.extra;\n\n return stmt;\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n initFunction(node: N.BodilessFunctionOrMethodBase, isAsync: boolean): void {\n super.initFunction(node, isAsync);\n node.expression = false;\n }\n\n checkDeclaration(node: N.Pattern | N.ObjectProperty): void {\n if (node != null && this.isObjectProperty(node)) {\n // @ts-expect-error plugin typings\n this.checkDeclaration((node as unknown as N.EstreeProperty).value);\n } else {\n super.checkDeclaration(node);\n }\n }\n\n getObjectOrClassMethodParams(method: N.ObjectMethod | N.ClassMethod) {\n return (method as any as N.EstreeProperty | N.EstreeMethodDefinition)\n .value.params;\n }\n\n isValidDirective(stmt: N.Statement): boolean {\n return (\n stmt.type === \"ExpressionStatement\" &&\n stmt.expression.type === \"Literal\" &&\n typeof stmt.expression.value === \"string\" &&\n !stmt.expression.extra?.parenthesized\n );\n }\n\n parseBlockBody(\n node: N.BlockStatementLike,\n allowDirectives: boolean | undefined | null,\n topLevel: boolean,\n end: TokenType,\n afterBlockParse?: (hasStrictModeDirective: boolean) => void,\n ): void {\n super.parseBlockBody(\n node,\n allowDirectives,\n topLevel,\n end,\n afterBlockParse,\n );\n\n const directiveStatements = node.directives.map(d =>\n this.directiveToStmt(d),\n );\n // @ts-expect-error estree plugin typings\n node.body = directiveStatements.concat(node.body);\n delete node.directives;\n }\n\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n this.parseMethod(\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n \"ClassMethod\",\n true,\n );\n if (method.typeParameters) {\n // @ts-expect-error mutate AST types\n method.value.typeParameters = method.typeParameters;\n delete method.typeParameters;\n }\n classBody.body.push(method);\n }\n\n parsePrivateName(): any {\n const node = super.parsePrivateName();\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return node;\n }\n }\n return this.convertPrivateNameToPrivateIdentifier(node);\n }\n\n convertPrivateNameToPrivateIdentifier(\n node: N.PrivateName,\n ): N.EstreePrivateIdentifier {\n const name = super.getPrivateNameSV(node);\n node = node as any;\n delete node.id;\n // @ts-expect-error mutate AST types\n node.name = name;\n // @ts-expect-error mutate AST types\n node.type = \"PrivateIdentifier\";\n return node as unknown as N.EstreePrivateIdentifier;\n }\n\n isPrivateName(node: N.Node): boolean {\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.isPrivateName(node);\n }\n }\n return node.type === \"PrivateIdentifier\";\n }\n\n getPrivateNameSV(node: N.Node): string {\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.getPrivateNameSV(node);\n }\n }\n return node.name;\n }\n\n // @ts-expect-error plugin may override interfaces\n parseLiteral<T extends N.Literal>(value: any, type: T[\"type\"]): T {\n const node = super.parseLiteral<T>(value, type);\n // @ts-expect-error mutating AST types\n node.raw = node.extra.raw;\n delete node.extra;\n\n return node;\n }\n\n parseFunctionBody(\n node: N.Function,\n allowExpression?: boolean | null,\n isMethod: boolean = false,\n ): void {\n super.parseFunctionBody(node, allowExpression, isMethod);\n node.expression = node.body.type !== \"BlockStatement\";\n }\n\n // @ts-expect-error plugin may override interfaces\n parseMethod<\n T extends N.ClassPrivateMethod | N.ObjectMethod | N.ClassMethod,\n >(\n node: Undone<T>,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowDirectSuper: boolean,\n type: T[\"type\"],\n inClassScope: boolean = false,\n ): N.EstreeMethodDefinition {\n let funcNode = this.startNode<N.MethodLike>();\n funcNode.kind = node.kind; // provide kind, so super method correctly sets state\n funcNode = super.parseMethod(\n // @ts-expect-error todo(flow->ts)\n funcNode,\n isGenerator,\n isAsync,\n isConstructor,\n allowDirectSuper,\n type,\n inClassScope,\n );\n // @ts-expect-error mutate AST types\n funcNode.type = \"FunctionExpression\";\n delete funcNode.kind;\n // @ts-expect-error mutate AST types\n node.value = funcNode;\n if (type === \"ClassPrivateMethod\") {\n node.computed = false;\n }\n return this.finishNode(\n // @ts-expect-error cast methods to estree types\n node as Undone<N.EstreeMethodDefinition>,\n \"MethodDefinition\",\n );\n }\n\n parseClassProperty(...args: [N.ClassProperty]): any {\n const propertyNode = super.parseClassProperty(...args) as any;\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return propertyNode as N.EstreePropertyDefinition;\n }\n }\n propertyNode.type = \"PropertyDefinition\";\n return propertyNode as N.EstreePropertyDefinition;\n }\n\n parseClassPrivateProperty(...args: [N.ClassPrivateProperty]): any {\n const propertyNode = super.parseClassPrivateProperty(...args) as any;\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return propertyNode as N.EstreePropertyDefinition;\n }\n }\n propertyNode.type = \"PropertyDefinition\";\n propertyNode.computed = false;\n return propertyNode as N.EstreePropertyDefinition;\n }\n\n parseObjectMethod(\n prop: N.ObjectMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n ): N.ObjectMethod | undefined | null {\n const node: N.EstreeProperty = super.parseObjectMethod(\n prop,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n ) as any;\n\n if (node) {\n node.type = \"Property\";\n if ((node as any as N.ClassMethod).kind === \"method\") {\n node.kind = \"init\";\n }\n node.shorthand = false;\n }\n\n return node as any;\n }\n\n parseObjectProperty(\n prop: N.ObjectProperty,\n startLoc: Position | undefined | null,\n isPattern: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ObjectProperty | undefined | null {\n const node: N.EstreeProperty = super.parseObjectProperty(\n prop,\n startLoc,\n isPattern,\n refExpressionErrors,\n ) as any;\n\n if (node) {\n node.kind = \"init\";\n node.type = \"Property\";\n }\n\n return node as any;\n }\n\n isValidLVal(\n type: string,\n isUnparenthesizedInAssign: boolean,\n binding: BindingTypes,\n ) {\n return type === \"Property\"\n ? \"value\"\n : super.isValidLVal(type, isUnparenthesizedInAssign, binding);\n }\n\n isAssignable(node: N.Node, isBinding?: boolean): boolean {\n if (node != null && this.isObjectProperty(node)) {\n return this.isAssignable(node.value, isBinding);\n }\n return super.isAssignable(node, isBinding);\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): void {\n if (node != null && this.isObjectProperty(node)) {\n const { key, value } = node;\n if (this.isPrivateName(key)) {\n this.classScope.usePrivateName(\n this.getPrivateNameSV(key),\n key.loc.start,\n );\n }\n this.toAssignable(value, isLHS);\n } else {\n super.toAssignable(node, isLHS);\n }\n }\n\n toAssignableObjectExpressionProp(\n prop: N.Node,\n isLast: boolean,\n isLHS: boolean,\n ) {\n if (prop.kind === \"get\" || prop.kind === \"set\") {\n this.raise(Errors.PatternHasAccessor, { at: prop.key });\n } else if (prop.method) {\n this.raise(Errors.PatternHasMethod, { at: prop.key });\n } else {\n super.toAssignableObjectExpressionProp(prop, isLast, isLHS);\n }\n }\n\n finishCallExpression<T extends N.CallExpression | N.OptionalCallExpression>(\n unfinished: Undone<T>,\n optional: boolean,\n ): T {\n const node = super.finishCallExpression(unfinished, optional);\n\n if (node.callee.type === \"Import\") {\n (node as N.Node as N.EstreeImportExpression).type = \"ImportExpression\";\n (node as N.Node as N.EstreeImportExpression).source = node.arguments[0];\n if (\n this.hasPlugin(\"importAttributes\") ||\n this.hasPlugin(\"importAssertions\")\n ) {\n (node as N.Node as N.EstreeImportExpression).attributes =\n node.arguments[1] ?? null;\n }\n // arguments isn't optional in the type definition\n delete node.arguments;\n // callee isn't optional in the type definition\n delete node.callee;\n }\n\n return node;\n }\n\n toReferencedArguments(\n node:\n | N.CallExpression\n | N.OptionalCallExpression\n | N.EstreeImportExpression,\n /* isParenthesizedExpr?: boolean, */\n ) {\n // ImportExpressions do not have an arguments array.\n if (node.type === \"ImportExpression\") {\n return;\n }\n\n super.toReferencedArguments(node);\n }\n\n parseExport(\n unfinished: Undone<N.AnyExport>,\n decorators: N.Decorator[] | null,\n ) {\n const exportStartLoc = this.state.lastTokStartLoc;\n const node = super.parseExport(unfinished, decorators);\n\n switch (node.type) {\n case \"ExportAllDeclaration\":\n // @ts-expect-error mutating AST types\n node.exported = null;\n break;\n\n case \"ExportNamedDeclaration\":\n if (\n node.specifiers.length === 1 &&\n // @ts-expect-error mutating AST types\n node.specifiers[0].type === \"ExportNamespaceSpecifier\"\n ) {\n // @ts-expect-error mutating AST types\n node.type = \"ExportAllDeclaration\";\n // @ts-expect-error mutating AST types\n node.exported = node.specifiers[0].exported;\n delete node.specifiers;\n }\n\n // fallthrough\n case \"ExportDefaultDeclaration\":\n {\n const { declaration } = node;\n if (\n declaration?.type === \"ClassDeclaration\" &&\n declaration.decorators?.length > 0 &&\n // decorator comes before export\n declaration.start === node.start\n ) {\n this.resetStartLocation(\n node,\n // For compatibility with ESLint's keyword-spacing rule, which assumes that an\n // export declaration must start with export.\n // https://github.com/babel/babel/issues/15085\n // Here we reset export declaration's start to be the start of the export token\n exportStartLoc,\n );\n }\n }\n\n break;\n }\n\n return node;\n }\n\n parseSubscript(\n base: N.Expression,\n startLoc: Position,\n noCalls: boolean | undefined | null,\n state: N.ParseSubscriptState,\n ) {\n const node = super.parseSubscript(base, startLoc, noCalls, state);\n\n if (state.optionalChainMember) {\n // https://github.com/estree/estree/blob/master/es2020.md#chainexpression\n if (\n node.type === \"OptionalMemberExpression\" ||\n node.type === \"OptionalCallExpression\"\n ) {\n node.type = node.type.substring(8); // strip Optional prefix\n }\n if (state.stop) {\n const chain = this.startNodeAtNode(node);\n chain.expression = node;\n return this.finishNode(chain, \"ChainExpression\");\n }\n } else if (\n node.type === \"MemberExpression\" ||\n node.type === \"CallExpression\"\n ) {\n node.optional = false;\n }\n\n return node;\n }\n\n hasPropertyAsPrivateName(node: N.Node): boolean {\n if (node.type === \"ChainExpression\") {\n node = node.expression;\n }\n return super.hasPropertyAsPrivateName(node);\n }\n\n // @ts-expect-error override interfaces\n isObjectProperty(node: N.Node): boolean {\n return node.type === \"Property\" && node.kind === \"init\" && !node.method;\n }\n\n isObjectMethod(node: N.Node): boolean {\n return node.method || node.kind === \"get\" || node.kind === \"set\";\n }\n\n finishNodeAt<T extends NodeType>(\n node: Undone<T>,\n type: T[\"type\"],\n endLoc: Position,\n ): T {\n return toESTreeLocation(super.finishNodeAt(node, type, endLoc));\n }\n\n resetStartLocation(node: N.Node, startLoc: Position) {\n super.resetStartLocation(node, startLoc);\n toESTreeLocation(node);\n }\n\n resetEndLocation(\n node: NodeBase,\n endLoc: Position = this.state.lastTokEndLoc,\n ): void {\n super.resetEndLocation(node, endLoc);\n toESTreeLocation(node);\n }\n };\n"],"mappings":";;;;;;AAMA,IAAAA,WAAA,GAAAC,OAAA;AAIA,MAAM;EAAEC;AAAe,CAAC,GAAGC,MAAM;AACjC,MAAMC,cAAc,GAAGA,CAACC,MAAW,EAAEC,GAAW,KAC9CJ,cAAc,CAACG,MAAM,EAAEC,GAAG,EAAE;EAAEC,UAAU,EAAE,KAAK;EAAEC,KAAK,EAAEH,MAAM,CAACC,GAAG;AAAE,CAAC,CAAC;AAExE,SAASG,gBAAgBA,CAACC,IAAS,EAAE;EACnCA,IAAI,CAACC,GAAG,CAACC,KAAK,IAAIR,cAAc,CAACM,IAAI,CAACC,GAAG,CAACC,KAAK,EAAE,OAAO,CAAC;EACz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AAC8C,MAAM;EACzE;EAEAiG,cAAcA,CAAC/I,IAAY,EAAW;IACpC,OAAOA,IAAI,CAAC8C,MAAM,IAAI9C,IAAI,CAACkF,IAAI,KAAK,KAAK,IAAIlF,IAAI,CAACkF,IAAI,KAAK,KAAK;EAClE;EAEA8D,YAAYA,CACVhJ,IAAe,EACfmC,IAAe,EACf8G,MAAgB,EACb;IACH,OAAOlJ,gBAAgB,CAAC,KAAK,CAACiJ,YAAY,CAAChJ,IAAI,EAAEmC,IAAI,EAAE8G,MAAM,CAAC,CAAC;EACjE;EAEAZ,kBAAkBA,CAACrI,IAAY,EAAE+F,QAAkB,EAAE;IACnD,KAAK,CAACsC,kBAAkB,CAACrI,IAAI,EAAE+F,QAAQ,CAAC;IACxChG,gBAAgB,CAACC,IAAI,CAAC;EACxB;EAEAkJ,gBAAgBA,CACdlJ,IAAc,EACdiJ,MAAgB,GAAG,IAAI,CAACnB,KAAK,CAACqB,aAAa,EACrC;IACN,KAAK,CAACD,gBAAgB,CAAClJ,IAAI,EAAEiJ,MAAM,CAAC;IACpClJ,gBAAgB,CAACC,IAAI,CAAC;EACxB;AACF,CAAC;AAAAoJ,OAAA,CAAAC,OAAA,GAAAjJ,QAAA"} lib/plugins/flow/index.js 0000644 00000250747 15120211212 0011411 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _types = require("../../tokenizer/types"); var _context = require("../../tokenizer/context"); var _identifier = require("../../util/identifier"); var _scope = require("./scope"); var _scopeflags = require("../../util/scopeflags"); var _parseError = require("../../parse-error"); var _node = require("../../parser/node"); const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]); const FlowErrors = (0, _parseError.ParseErrorEnum)`flow`({ AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.", AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.", AssignReservedType: ({ reservedType }) => `Cannot overwrite reserved type ${reservedType}.`, DeclareClassElement: "The `declare` modifier can only appear on class fields.", DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.", DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement.", EnumBooleanMemberNotInitialized: ({ memberName, enumName }) => `Boolean enum members need to be initialized. Use either \`${memberName} = true,\` or \`${memberName} = false,\` in enum \`${enumName}\`.`, EnumDuplicateMemberName: ({ memberName, enumName }) => `Enum member names need to be unique, but the name \`${memberName}\` has already been used before in enum \`${enumName}\`.`, EnumInconsistentMemberValues: ({ enumName }) => `Enum \`${enumName}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`, EnumInvalidExplicitType: ({ invalidEnumType, enumName }) => `Enum type \`${invalidEnumType}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, EnumInvalidExplicitTypeUnknownSupplied: ({ enumName }) => `Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, EnumInvalidMemberInitializerPrimaryType: ({ enumName, memberName, explicitType }) => `Enum \`${enumName}\` has type \`${explicitType}\`, so the initializer of \`${memberName}\` needs to be a ${explicitType} literal.`, EnumInvalidMemberInitializerSymbolType: ({ enumName, memberName }) => `Symbol enum members cannot be initialized. Use \`${memberName},\` in enum \`${enumName}\`.`, EnumInvalidMemberInitializerUnknownType: ({ enumName, memberName }) => `The enum member initializer for \`${memberName}\` needs to be a literal (either a boolean, number, or string) in enum \`${enumName}\`.`, EnumInvalidMemberName: ({ enumName, memberName, suggestion }) => `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${memberName}\`, consider using \`${suggestion}\`, in enum \`${enumName}\`.`, EnumNumberMemberNotInitialized: ({ enumName, memberName }) => `Number enum members need to be initialized, e.g. \`${memberName} = 1\` in enum \`${enumName}\`.`, EnumStringMemberInconsistentlyInitailized: ({ enumName }) => `String enum members need to consistently either all use initializers, or use no initializers, in enum \`${enumName}\`.`, GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.", ImportReflectionHasImportType: "An `import module` declaration can not use `type` or `typeof` keyword.", ImportTypeShorthandOnlyInPureImport: "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.", InexactInsideExact: "Explicit inexact syntax cannot appear inside an explicit exact object type.", InexactInsideNonObject: "Explicit inexact syntax cannot appear in class or interface definitions.", InexactVariance: "Explicit inexact syntax cannot have variance.", InvalidNonTypeImportInDeclareModule: "Imports within a `declare module` body must always be `import type` or `import typeof`.", MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.", NestedDeclareModule: "`declare module` cannot be used inside another `declare module`.", NestedFlowComment: "Cannot have a flow comment inside another flow comment.", PatternIsOptional: Object.assign({ message: "A binding pattern parameter cannot be optional in an implementation signature." }, { reasonCode: "OptionalBindingPattern" }), SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.", SpreadVariance: "Spread properties cannot have variance.", ThisParamAnnotationRequired: "A type annotation is required for the `this` parameter.", ThisParamBannedInConstructor: "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.", ThisParamMayNotBeOptional: "The `this` parameter cannot be optional.", ThisParamMustBeFirst: "The `this` parameter must be the first function parameter.", ThisParamNoDefault: "The `this` parameter may not have a default value.", TypeBeforeInitializer: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", TypeCastInPattern: "The type cast expression is expected to be wrapped with parenthesis.", UnexpectedExplicitInexactInObject: "Explicit inexact syntax must appear at the end of an inexact object.", UnexpectedReservedType: ({ reservedType }) => `Unexpected reserved type ${reservedType}.`, UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new.", UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.", UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions.", UnexpectedSubtractionOperand: 'Unexpected token, expected "number" or "bigint".', UnexpectedTokenAfterTypeParameter: "Expected an arrow function after this type parameter declaration.", UnexpectedTypeParameterBeforeAsyncArrowFunction: "Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.", UnsupportedDeclareExportKind: ({ unsupportedExportKind, suggestion }) => `\`declare export ${unsupportedExportKind}\` is not supported. Use \`${suggestion}\` instead.`, UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module.", UnterminatedFlowComment: "Unterminated flow-comment." }); function isEsModuleType(bodyElement) { return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration"); } function hasTypeImportKind(node) { return node.importKind === "type" || node.importKind === "typeof"; } const exportSuggestions = { const: "declare export var", let: "declare export var", type: "export type", interface: "export interface" }; function partition(list, test) { const list1 = []; const list2 = []; for (let i = 0; i < list.length; i++) { (test(list[i], i, list) ? list1 : list2).push(list[i]); } return [list1, list2]; } const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/; var _default = superClass => class FlowParserMixin extends superClass { constructor(...args) { super(...args); this.flowPragma = undefined; } getScopeHandler() { return _scope.default; } shouldParseTypes() { return this.getPluginOption("flow", "all") || this.flowPragma === "flow"; } shouldParseEnums() { return !!this.getPluginOption("flow", "enums"); } finishToken(type, val) { if (type !== 131 && type !== 13 && type !== 28) { if (this.flowPragma === undefined) { this.flowPragma = null; } } super.finishToken(type, val); } addComment(comment) { if (this.flowPragma === undefined) { const matches = FLOW_PRAGMA_REGEX.exec(comment.value); if (!matches) {} else if (matches[1] === "flow") { this.flowPragma = "flow"; } else if (matches[1] === "noflow") { this.flowPragma = "noflow"; } else { throw new Error("Unexpected flow pragma"); } } super.addComment(comment); } flowParseTypeInitialiser(tok) { const oldInType = this.state.inType; this.state.inType = true; this.expect(tok || 14); const type = this.flowParseType(); this.state.inType = oldInType; return type; } flowParsePredicate() { const node = this.startNode(); const moduloLoc = this.state.startLoc; this.next(); this.expectContextual(108); if (this.state.lastTokStart > moduloLoc.index + 1) { this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, { at: moduloLoc }); } if (this.eat(10)) { node.value = super.parseExpression(); this.expect(11); return this.finishNode(node, "DeclaredPredicate"); } else { return this.finishNode(node, "InferredPredicate"); } } flowParseTypeAndPredicateInitialiser() { const oldInType = this.state.inType; this.state.inType = true; this.expect(14); let type = null; let predicate = null; if (this.match(54)) { this.state.inType = oldInType; predicate = this.flowParsePredicate(); } else { type = this.flowParseType(); this.state.inType = oldInType; if (this.match(54)) { predicate = this.flowParsePredicate(); } } return [type, predicate]; } flowParseDeclareClass(node) { this.next(); this.flowParseInterfaceish(node, true); return this.finishNode(node, "DeclareClass"); } flowParseDeclareFunction(node) { this.next(); const id = node.id = this.parseIdentifier(); const typeNode = this.startNode(); const typeContainer = this.startNode(); if (this.match(47)) { typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); } else { typeNode.typeParameters = null; } this.expect(10); const tmp = this.flowParseFunctionTypeParams(); typeNode.params = tmp.params; typeNode.rest = tmp.rest; typeNode.this = tmp._this; this.expect(11); [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); this.resetEndLocation(id); this.semicolon(); this.scope.declareName(node.id.name, _scopeflags.BIND_FLOW_DECLARE_FN, node.id.loc.start); return this.finishNode(node, "DeclareFunction"); } flowParseDeclare(node, insideModule) { if (this.match(80)) { return this.flowParseDeclareClass(node); } else if (this.match(68)) { return this.flowParseDeclareFunction(node); } else if (this.match(74)) { return this.flowParseDeclareVariable(node); } else if (this.eatContextual(125)) { if (this.match(16)) { return this.flowParseDeclareModuleExports(node); } else { if (insideModule) { this.raise(FlowErrors.NestedDeclareModule, { at: this.state.lastTokStartLoc }); } return this.flowParseDeclareModule(node); } } else if (this.isContextual(128)) { return this.flowParseDeclareTypeAlias(node); } else if (this.isContextual(129)) { return this.flowParseDeclareOpaqueType(node); } else if (this.isContextual(127)) { return this.flowParseDeclareInterface(node); } else if (this.match(82)) { return this.flowParseDeclareExportDeclaration(node, insideModule); } else { this.unexpected(); } } flowParseDeclareVariable(node) { this.next(); node.id = this.flowParseTypeAnnotatableIdentifier(true); this.scope.declareName(node.id.name, _scopeflags.BIND_VAR, node.id.loc.start); this.semicolon(); return this.finishNode(node, "DeclareVariable"); } flowParseDeclareModule(node) { this.scope.enter(_scopeflags.SCOPE_OTHER); if (this.match(131)) { node.id = super.parseExprAtom(); } else { node.id = this.parseIdentifier(); } const bodyNode = node.body = this.startNode(); const body = bodyNode.body = []; this.expect(5); while (!this.match(8)) { let bodyNode = this.startNode(); if (this.match(83)) { this.next(); if (!this.isContextual(128) && !this.match(87)) { this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, { at: this.state.lastTokStartLoc }); } super.parseImport(bodyNode); } else { this.expectContextual(123, FlowErrors.UnsupportedStatementInDeclareModule); bodyNode = this.flowParseDeclare(bodyNode, true); } body.push(bodyNode); } this.scope.exit(); this.expect(8); this.finishNode(bodyNode, "BlockStatement"); let kind = null; let hasModuleExport = false; body.forEach(bodyElement => { if (isEsModuleType(bodyElement)) { if (kind === "CommonJS") { this.raise(FlowErrors.AmbiguousDeclareModuleKind, { at: bodyElement }); } kind = "ES"; } else if (bodyElement.type === "DeclareModuleExports") { if (hasModuleExport) { this.raise(FlowErrors.DuplicateDeclareModuleExports, { at: bodyElement }); } if (kind === "ES") { this.raise(FlowErrors.AmbiguousDeclareModuleKind, { at: bodyElement }); } kind = "CommonJS"; hasModuleExport = true; } }); node.kind = kind || "CommonJS"; return this.finishNode(node, "DeclareModule"); } flowParseDeclareExportDeclaration(node, insideModule) { this.expect(82); if (this.eat(65)) { if (this.match(68) || this.match(80)) { node.declaration = this.flowParseDeclare(this.startNode()); } else { node.declaration = this.flowParseType(); this.semicolon(); } node.default = true; return this.finishNode(node, "DeclareExportDeclaration"); } else { if (this.match(75) || this.isLet() || (this.isContextual(128) || this.isContextual(127)) && !insideModule) { const label = this.state.value; throw this.raise(FlowErrors.UnsupportedDeclareExportKind, { at: this.state.startLoc, unsupportedExportKind: label, suggestion: exportSuggestions[label] }); } if (this.match(74) || this.match(68) || this.match(80) || this.isContextual(129)) { node.declaration = this.flowParseDeclare(this.startNode()); node.default = false; return this.finishNode(node, "DeclareExportDeclaration"); } else if (this.match(55) || this.match(5) || this.isContextual(127) || this.isContextual(128) || this.isContextual(129)) { node = this.parseExport(node, null); if (node.type === "ExportNamedDeclaration") { node.type = "ExportDeclaration"; node.default = false; delete node.exportKind; } node.type = "Declare" + node.type; return node; } } this.unexpected(); } flowParseDeclareModuleExports(node) { this.next(); this.expectContextual(109); node.typeAnnotation = this.flowParseTypeAnnotation(); this.semicolon(); return this.finishNode(node, "DeclareModuleExports"); } flowParseDeclareTypeAlias(node) { this.next(); const finished = this.flowParseTypeAlias(node); finished.type = "DeclareTypeAlias"; return finished; } flowParseDeclareOpaqueType(node) { this.next(); const finished = this.flowParseOpaqueType(node, true); finished.type = "DeclareOpaqueType"; return finished; } flowParseDeclareInterface(node) { this.next(); this.flowParseInterfaceish(node, false); return this.finishNode(node, "DeclareInterface"); } flowParseInterfaceish(node, isClass) { node.id = this.flowParseRestrictedIdentifier(!isClass, true); this.scope.declareName(node.id.name, isClass ? _scopeflags.BIND_FUNCTION : _scopeflags.BIND_LEXICAL, node.id.loc.start); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } else { node.typeParameters = null; } node.extends = []; if (this.eat(81)) { do { node.extends.push(this.flowParseInterfaceExtends()); } while (!isClass && this.eat(12)); } if (isClass) { node.implements = []; node.mixins = []; if (this.eatContextual(115)) { do { node.mixins.push(this.flowParseInterfaceExtends()); } while (this.eat(12)); } if (this.eatContextual(111)) { do { node.implements.push(this.flowParseInterfaceExtends()); } while (this.eat(12)); } } node.body = this.flowParseObjectType({ allowStatic: isClass, allowExact: false, allowSpread: false, allowProto: isClass, allowInexact: false }); } flowParseInterfaceExtends() { const node = this.startNode(); node.id = this.flowParseQualifiedTypeIdentifier(); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterInstantiation(); } else { node.typeParameters = null; } return this.finishNode(node, "InterfaceExtends"); } flowParseInterface(node) { this.flowParseInterfaceish(node, false); return this.finishNode(node, "InterfaceDeclaration"); } checkNotUnderscore(word) { if (word === "_") { this.raise(FlowErrors.UnexpectedReservedUnderscore, { at: this.state.startLoc }); } } checkReservedType(word, startLoc, declaration) { if (!reservedTypes.has(word)) return; this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, { at: startLoc, reservedType: word }); } flowParseRestrictedIdentifier(liberal, declaration) { this.checkReservedType(this.state.value, this.state.startLoc, declaration); return this.parseIdentifier(liberal); } flowParseTypeAlias(node) { node.id = this.flowParseRestrictedIdentifier(false, true); this.scope.declareName(node.id.name, _scopeflags.BIND_LEXICAL, node.id.loc.start); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } else { node.typeParameters = null; } node.right = this.flowParseTypeInitialiser(29); this.semicolon(); return this.finishNode(node, "TypeAlias"); } flowParseOpaqueType(node, declare) { this.expectContextual(128); node.id = this.flowParseRestrictedIdentifier(true, true); this.scope.declareName(node.id.name, _scopeflags.BIND_LEXICAL, node.id.loc.start); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } else { node.typeParameters = null; } node.supertype = null; if (this.match(14)) { node.supertype = this.flowParseTypeInitialiser(14); } node.impltype = null; if (!declare) { node.impltype = this.flowParseTypeInitialiser(29); } this.semicolon(); return this.finishNode(node, "OpaqueType"); } flowParseTypeParameter(requireDefault = false) { const nodeStartLoc = this.state.startLoc; const node = this.startNode(); const variance = this.flowParseVariance(); const ident = this.flowParseTypeAnnotatableIdentifier(); node.name = ident.name; node.variance = variance; node.bound = ident.typeAnnotation; if (this.match(29)) { this.eat(29); node.default = this.flowParseType(); } else { if (requireDefault) { this.raise(FlowErrors.MissingTypeParamDefault, { at: nodeStartLoc }); } } return this.finishNode(node, "TypeParameter"); } flowParseTypeParameterDeclaration() { const oldInType = this.state.inType; const node = this.startNode(); node.params = []; this.state.inType = true; if (this.match(47) || this.match(140)) { this.next(); } else { this.unexpected(); } let defaultRequired = false; do { const typeParameter = this.flowParseTypeParameter(defaultRequired); node.params.push(typeParameter); if (typeParameter.default) { defaultRequired = true; } if (!this.match(48)) { this.expect(12); } } while (!this.match(48)); this.expect(48); this.state.inType = oldInType; return this.finishNode(node, "TypeParameterDeclaration"); } flowParseTypeParameterInstantiation() { const node = this.startNode(); const oldInType = this.state.inType; node.params = []; this.state.inType = true; this.expect(47); const oldNoAnonFunctionType = this.state.noAnonFunctionType; this.state.noAnonFunctionType = false; while (!this.match(48)) { node.params.push(this.flowParseType()); if (!this.match(48)) { this.expect(12); } } this.state.noAnonFunctionType = oldNoAnonFunctionType; this.expect(48); this.state.inType = oldInType; return this.finishNode(node, "TypeParameterInstantiation"); } flowParseTypeParameterInstantiationCallOrNew() { const node = this.startNode(); const oldInType = this.state.inType; node.params = []; this.state.inType = true; this.expect(47); while (!this.match(48)) { node.params.push(this.flowParseTypeOrImplicitInstantiation()); if (!this.match(48)) { this.expect(12); } } this.expect(48); this.state.inType = oldInType; return this.finishNode(node, "TypeParameterInstantiation"); } flowParseInterfaceType() { const node = this.startNode(); this.expectContextual(127); node.extends = []; if (this.eat(81)) { do { node.extends.push(this.flowParseInterfaceExtends()); } while (this.eat(12)); } node.body = this.flowParseObjectType({ allowStatic: false, allowExact: false, allowSpread: false, allowProto: false, allowInexact: false }); return this.finishNode(node, "InterfaceTypeAnnotation"); } flowParseObjectPropertyKey() { return this.match(132) || this.match(131) ? super.parseExprAtom() : this.parseIdentifier(true); } flowParseObjectTypeIndexer(node, isStatic, variance) { node.static = isStatic; if (this.lookahead().type === 14) { node.id = this.flowParseObjectPropertyKey(); node.key = this.flowParseTypeInitialiser(); } else { node.id = null; node.key = this.flowParseType(); } this.expect(3); node.value = this.flowParseTypeInitialiser(); node.variance = variance; return this.finishNode(node, "ObjectTypeIndexer"); } flowParseObjectTypeInternalSlot(node, isStatic) { node.static = isStatic; node.id = this.flowParseObjectPropertyKey(); this.expect(3); this.expect(3); if (this.match(47) || this.match(10)) { node.method = true; node.optional = false; node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start)); } else { node.method = false; if (this.eat(17)) { node.optional = true; } node.value = this.flowParseTypeInitialiser(); } return this.finishNode(node, "ObjectTypeInternalSlot"); } flowParseObjectTypeMethodish(node) { node.params = []; node.rest = null; node.typeParameters = null; node.this = null; if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } this.expect(10); if (this.match(78)) { node.this = this.flowParseFunctionTypeParam(true); node.this.name = null; if (!this.match(11)) { this.expect(12); } } while (!this.match(11) && !this.match(21)) { node.params.push(this.flowParseFunctionTypeParam(false)); if (!this.match(11)) { this.expect(12); } } if (this.eat(21)) { node.rest = this.flowParseFunctionTypeParam(false); } this.expect(11); node.returnType = this.flowParseTypeInitialiser(); return this.finishNode(node, "FunctionTypeAnnotation"); } flowParseObjectTypeCallProperty(node, isStatic) { const valueNode = this.startNode(); node.static = isStatic; node.value = this.flowParseObjectTypeMethodish(valueNode); return this.finishNode(node, "ObjectTypeCallProperty"); } flowParseObjectType({ allowStatic, allowExact, allowSpread, allowProto, allowInexact }) { const oldInType = this.state.inType; this.state.inType = true; const nodeStart = this.startNode(); nodeStart.callProperties = []; nodeStart.properties = []; nodeStart.indexers = []; nodeStart.internalSlots = []; let endDelim; let exact; let inexact = false; if (allowExact && this.match(6)) { this.expect(6); endDelim = 9; exact = true; } else { this.expect(5); endDelim = 8; exact = false; } nodeStart.exact = exact; while (!this.match(endDelim)) { let isStatic = false; let protoStartLoc = null; let inexactStartLoc = null; const node = this.startNode(); if (allowProto && this.isContextual(116)) { const lookahead = this.lookahead(); if (lookahead.type !== 14 && lookahead.type !== 17) { this.next(); protoStartLoc = this.state.startLoc; allowStatic = false; } } if (allowStatic && this.isContextual(104)) { const lookahead = this.lookahead(); if (lookahead.type !== 14 && lookahead.type !== 17) { this.next(); isStatic = true; } } const variance = this.flowParseVariance(); if (this.eat(0)) { if (protoStartLoc != null) { this.unexpected(protoStartLoc); } if (this.eat(0)) { if (variance) { this.unexpected(variance.loc.start); } nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic)); } else { nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); } } else if (this.match(10) || this.match(47)) { if (protoStartLoc != null) { this.unexpected(protoStartLoc); } if (variance) { this.unexpected(variance.loc.start); } nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); } else { let kind = "init"; if (this.isContextual(98) || this.isContextual(103)) { const lookahead = this.lookahead(); if ((0, _types.tokenIsLiteralPropertyName)(lookahead.type)) { kind = this.state.value; this.next(); } } const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact); if (propOrInexact === null) { inexact = true; inexactStartLoc = this.state.lastTokStartLoc; } else { nodeStart.properties.push(propOrInexact); } } this.flowObjectTypeSemicolon(); if (inexactStartLoc && !this.match(8) && !this.match(9)) { this.raise(FlowErrors.UnexpectedExplicitInexactInObject, { at: inexactStartLoc }); } } this.expect(endDelim); if (allowSpread) { nodeStart.inexact = inexact; } const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); this.state.inType = oldInType; return out; } flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact) { if (this.eat(21)) { const isInexactToken = this.match(12) || this.match(13) || this.match(8) || this.match(9); if (isInexactToken) { if (!allowSpread) { this.raise(FlowErrors.InexactInsideNonObject, { at: this.state.lastTokStartLoc }); } else if (!allowInexact) { this.raise(FlowErrors.InexactInsideExact, { at: this.state.lastTokStartLoc }); } if (variance) { this.raise(FlowErrors.InexactVariance, { at: variance }); } return null; } if (!allowSpread) { this.raise(FlowErrors.UnexpectedSpreadType, { at: this.state.lastTokStartLoc }); } if (protoStartLoc != null) { this.unexpected(protoStartLoc); } if (variance) { this.raise(FlowErrors.SpreadVariance, { at: variance }); } node.argument = this.flowParseType(); return this.finishNode(node, "ObjectTypeSpreadProperty"); } else { node.key = this.flowParseObjectPropertyKey(); node.static = isStatic; node.proto = protoStartLoc != null; node.kind = kind; let optional = false; if (this.match(47) || this.match(10)) { node.method = true; if (protoStartLoc != null) { this.unexpected(protoStartLoc); } if (variance) { this.unexpected(variance.loc.start); } node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start)); if (kind === "get" || kind === "set") { this.flowCheckGetterSetterParams(node); } if (!allowSpread && node.key.name === "constructor" && node.value.this) { this.raise(FlowErrors.ThisParamBannedInConstructor, { at: node.value.this }); } } else { if (kind !== "init") this.unexpected(); node.method = false; if (this.eat(17)) { optional = true; } node.value = this.flowParseTypeInitialiser(); node.variance = variance; } node.optional = optional; return this.finishNode(node, "ObjectTypeProperty"); } } flowCheckGetterSetterParams(property) { const paramCount = property.kind === "get" ? 0 : 1; const length = property.value.params.length + (property.value.rest ? 1 : 0); if (property.value.this) { this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, { at: property.value.this }); } if (length !== paramCount) { this.raise(property.kind === "get" ? _parseError.Errors.BadGetterArity : _parseError.Errors.BadSetterArity, { at: property }); } if (property.kind === "set" && property.value.rest) { this.raise(_parseError.Errors.BadSetterRestParameter, { at: property }); } } flowObjectTypeSemicolon() { if (!this.eat(13) && !this.eat(12) && !this.match(8) && !this.match(9)) { this.unexpected(); } } flowParseQualifiedTypeIdentifier(startLoc, id) { var _startLoc; (_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc; let node = id || this.flowParseRestrictedIdentifier(true); while (this.eat(16)) { const node2 = this.startNodeAt(startLoc); node2.qualification = node; node2.id = this.flowParseRestrictedIdentifier(true); node = this.finishNode(node2, "QualifiedTypeIdentifier"); } return node; } flowParseGenericType(startLoc, id) { const node = this.startNodeAt(startLoc); node.typeParameters = null; node.id = this.flowParseQualifiedTypeIdentifier(startLoc, id); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterInstantiation(); } return this.finishNode(node, "GenericTypeAnnotation"); } flowParseTypeofType() { const node = this.startNode(); this.expect(87); node.argument = this.flowParsePrimaryType(); return this.finishNode(node, "TypeofTypeAnnotation"); } flowParseTupleType() { const node = this.startNode(); node.types = []; this.expect(0); while (this.state.pos < this.length && !this.match(3)) { node.types.push(this.flowParseType()); if (this.match(3)) break; this.expect(12); } this.expect(3); return this.finishNode(node, "TupleTypeAnnotation"); } flowParseFunctionTypeParam(first) { let name = null; let optional = false; let typeAnnotation = null; const node = this.startNode(); const lh = this.lookahead(); const isThis = this.state.type === 78; if (lh.type === 14 || lh.type === 17) { if (isThis && !first) { this.raise(FlowErrors.ThisParamMustBeFirst, { at: node }); } name = this.parseIdentifier(isThis); if (this.eat(17)) { optional = true; if (isThis) { this.raise(FlowErrors.ThisParamMayNotBeOptional, { at: node }); } } typeAnnotation = this.flowParseTypeInitialiser(); } else { typeAnnotation = this.flowParseType(); } node.name = name; node.optional = optional; node.typeAnnotation = typeAnnotation; return this.finishNode(node, "FunctionTypeParam"); } reinterpretTypeAsFunctionTypeParam(type) { const node = this.startNodeAt(type.loc.start); node.name = null; node.optional = false; node.typeAnnotation = type; return this.finishNode(node, "FunctionTypeParam"); } flowParseFunctionTypeParams(params = []) { let rest = null; let _this = null; if (this.match(78)) { _this = this.flowParseFunctionTypeParam(true); _this.name = null; if (!this.match(11)) { this.expect(12); } } while (!this.match(11) && !this.match(21)) { params.push(this.flowParseFunctionTypeParam(false)); if (!this.match(11)) { this.expect(12); } } if (this.eat(21)) { rest = this.flowParseFunctionTypeParam(false); } return { params, rest, _this }; } flowIdentToTypeAnnotation(startLoc, node, id) { switch (id.name) { case "any": return this.finishNode(node, "AnyTypeAnnotation"); case "bool": case "boolean": return this.finishNode(node, "BooleanTypeAnnotation"); case "mixed": return this.finishNode(node, "MixedTypeAnnotation"); case "empty": return this.finishNode(node, "EmptyTypeAnnotation"); case "number": return this.finishNode(node, "NumberTypeAnnotation"); case "string": return this.finishNode(node, "StringTypeAnnotation"); case "symbol": return this.finishNode(node, "SymbolTypeAnnotation"); default: this.checkNotUnderscore(id.name); return this.flowParseGenericType(startLoc, id); } } flowParsePrimaryType() { const startLoc = this.state.startLoc; const node = this.startNode(); let tmp; let type; let isGroupedType = false; const oldNoAnonFunctionType = this.state.noAnonFunctionType; switch (this.state.type) { case 5: return this.flowParseObjectType({ allowStatic: false, allowExact: false, allowSpread: true, allowProto: false, allowInexact: true }); case 6: return this.flowParseObjectType({ allowStatic: false, allowExact: true, allowSpread: true, allowProto: false, allowInexact: false }); case 0: this.state.noAnonFunctionType = false; type = this.flowParseTupleType(); this.state.noAnonFunctionType = oldNoAnonFunctionType; return type; case 47: node.typeParameters = this.flowParseTypeParameterDeclaration(); this.expect(10); tmp = this.flowParseFunctionTypeParams(); node.params = tmp.params; node.rest = tmp.rest; node.this = tmp._this; this.expect(11); this.expect(19); node.returnType = this.flowParseType(); return this.finishNode(node, "FunctionTypeAnnotation"); case 10: this.next(); if (!this.match(11) && !this.match(21)) { if ((0, _types.tokenIsIdentifier)(this.state.type) || this.match(78)) { const token = this.lookahead().type; isGroupedType = token !== 17 && token !== 14; } else { isGroupedType = true; } } if (isGroupedType) { this.state.noAnonFunctionType = false; type = this.flowParseType(); this.state.noAnonFunctionType = oldNoAnonFunctionType; if (this.state.noAnonFunctionType || !(this.match(12) || this.match(11) && this.lookahead().type === 19)) { this.expect(11); return type; } else { this.eat(12); } } if (type) { tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]); } else { tmp = this.flowParseFunctionTypeParams(); } node.params = tmp.params; node.rest = tmp.rest; node.this = tmp._this; this.expect(11); this.expect(19); node.returnType = this.flowParseType(); node.typeParameters = null; return this.finishNode(node, "FunctionTypeAnnotation"); case 131: return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); case 85: case 86: node.value = this.match(85); this.next(); return this.finishNode(node, "BooleanLiteralTypeAnnotation"); case 53: if (this.state.value === "-") { this.next(); if (this.match(132)) { return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node); } if (this.match(133)) { return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node); } throw this.raise(FlowErrors.UnexpectedSubtractionOperand, { at: this.state.startLoc }); } this.unexpected(); return; case 132: return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); case 133: return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); case 88: this.next(); return this.finishNode(node, "VoidTypeAnnotation"); case 84: this.next(); return this.finishNode(node, "NullLiteralTypeAnnotation"); case 78: this.next(); return this.finishNode(node, "ThisTypeAnnotation"); case 55: this.next(); return this.finishNode(node, "ExistsTypeAnnotation"); case 87: return this.flowParseTypeofType(); default: if ((0, _types.tokenIsKeyword)(this.state.type)) { const label = (0, _types.tokenLabelName)(this.state.type); this.next(); return super.createIdentifier(node, label); } else if ((0, _types.tokenIsIdentifier)(this.state.type)) { if (this.isContextual(127)) { return this.flowParseInterfaceType(); } return this.flowIdentToTypeAnnotation(startLoc, node, this.parseIdentifier()); } } this.unexpected(); } flowParsePostfixType() { const startLoc = this.state.startLoc; let type = this.flowParsePrimaryType(); let seenOptionalIndexedAccess = false; while ((this.match(0) || this.match(18)) && !this.canInsertSemicolon()) { const node = this.startNodeAt(startLoc); const optional = this.eat(18); seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional; this.expect(0); if (!optional && this.match(3)) { node.elementType = type; this.next(); type = this.finishNode(node, "ArrayTypeAnnotation"); } else { node.objectType = type; node.indexType = this.flowParseType(); this.expect(3); if (seenOptionalIndexedAccess) { node.optional = optional; type = this.finishNode(node, "OptionalIndexedAccessType"); } else { type = this.finishNode(node, "IndexedAccessType"); } } } return type; } flowParsePrefixType() { const node = this.startNode(); if (this.eat(17)) { node.typeAnnotation = this.flowParsePrefixType(); return this.finishNode(node, "NullableTypeAnnotation"); } else { return this.flowParsePostfixType(); } } flowParseAnonFunctionWithoutParens() { const param = this.flowParsePrefixType(); if (!this.state.noAnonFunctionType && this.eat(19)) { const node = this.startNodeAt(param.loc.start); node.params = [this.reinterpretTypeAsFunctionTypeParam(param)]; node.rest = null; node.this = null; node.returnType = this.flowParseType(); node.typeParameters = null; return this.finishNode(node, "FunctionTypeAnnotation"); } return param; } flowParseIntersectionType() { const node = this.startNode(); this.eat(45); const type = this.flowParseAnonFunctionWithoutParens(); node.types = [type]; while (this.eat(45)) { node.types.push(this.flowParseAnonFunctionWithoutParens()); } return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); } flowParseUnionType() { const node = this.startNode(); this.eat(43); const type = this.flowParseIntersectionType(); node.types = [type]; while (this.eat(43)) { node.types.push(this.flowParseIntersectionType()); } return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); } flowParseType() { const oldInType = this.state.inType; this.state.inType = true; const type = this.flowParseUnionType(); this.state.inType = oldInType; return type; } flowParseTypeOrImplicitInstantiation() { if (this.state.type === 130 && this.state.value === "_") { const startLoc = this.state.startLoc; const node = this.parseIdentifier(); return this.flowParseGenericType(startLoc, node); } else { return this.flowParseType(); } } flowParseTypeAnnotation() { const node = this.startNode(); node.typeAnnotation = this.flowParseTypeInitialiser(); return this.finishNode(node, "TypeAnnotation"); } flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) { const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier(); if (this.match(14)) { ident.typeAnnotation = this.flowParseTypeAnnotation(); this.resetEndLocation(ident); } return ident; } typeCastToParameter(node) { node.expression.typeAnnotation = node.typeAnnotation; this.resetEndLocation(node.expression, node.typeAnnotation.loc.end); return node.expression; } flowParseVariance() { let variance = null; if (this.match(53)) { variance = this.startNode(); if (this.state.value === "+") { variance.kind = "plus"; } else { variance.kind = "minus"; } this.next(); return this.finishNode(variance, "Variance"); } return variance; } parseFunctionBody(node, allowExpressionBody, isMethod = false) { if (allowExpressionBody) { this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod)); return; } super.parseFunctionBody(node, false, isMethod); } parseFunctionBodyAndFinish(node, type, isMethod = false) { if (this.match(14)) { const typeNode = this.startNode(); [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null; } return super.parseFunctionBodyAndFinish(node, type, isMethod); } parseStatementLike(flags) { if (this.state.strict && this.isContextual(127)) { const lookahead = this.lookahead(); if ((0, _types.tokenIsKeywordOrIdentifier)(lookahead.type)) { const node = this.startNode(); this.next(); return this.flowParseInterface(node); } } else if (this.shouldParseEnums() && this.isContextual(124)) { const node = this.startNode(); this.next(); return this.flowParseEnumDeclaration(node); } const stmt = super.parseStatementLike(flags); if (this.flowPragma === undefined && !this.isValidDirective(stmt)) { this.flowPragma = null; } return stmt; } parseExpressionStatement(node, expr, decorators) { if (expr.type === "Identifier") { if (expr.name === "declare") { if (this.match(80) || (0, _types.tokenIsIdentifier)(this.state.type) || this.match(68) || this.match(74) || this.match(82)) { return this.flowParseDeclare(node); } } else if ((0, _types.tokenIsIdentifier)(this.state.type)) { if (expr.name === "interface") { return this.flowParseInterface(node); } else if (expr.name === "type") { return this.flowParseTypeAlias(node); } else if (expr.name === "opaque") { return this.flowParseOpaqueType(node, false); } } } return super.parseExpressionStatement(node, expr, decorators); } shouldParseExportDeclaration() { const { type } = this.state; if ((0, _types.tokenIsFlowInterfaceOrTypeOrOpaque)(type) || this.shouldParseEnums() && type === 124) { return !this.state.containsEsc; } return super.shouldParseExportDeclaration(); } isExportDefaultSpecifier() { const { type } = this.state; if ((0, _types.tokenIsFlowInterfaceOrTypeOrOpaque)(type) || this.shouldParseEnums() && type === 124) { return this.state.containsEsc; } return super.isExportDefaultSpecifier(); } parseExportDefaultExpression() { if (this.shouldParseEnums() && this.isContextual(124)) { const node = this.startNode(); this.next(); return this.flowParseEnumDeclaration(node); } return super.parseExportDefaultExpression(); } parseConditional(expr, startLoc, refExpressionErrors) { if (!this.match(17)) return expr; if (this.state.maybeInArrowParameters) { const nextCh = this.lookaheadCharCode(); if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) { this.setOptionalParametersError(refExpressionErrors); return expr; } } this.expect(17); const state = this.state.clone(); const originalNoArrowAt = this.state.noArrowAt; const node = this.startNodeAt(startLoc); let { consequent, failed } = this.tryParseConditionalConsequent(); let [valid, invalid] = this.getArrowLikeExpressions(consequent); if (failed || invalid.length > 0) { const noArrowAt = [...originalNoArrowAt]; if (invalid.length > 0) { this.state = state; this.state.noArrowAt = noArrowAt; for (let i = 0; i < invalid.length; i++) { noArrowAt.push(invalid[i].start); } ({ consequent, failed } = this.tryParseConditionalConsequent()); [valid, invalid] = this.getArrowLikeExpressions(consequent); } if (failed && valid.length > 1) { this.raise(FlowErrors.AmbiguousConditionalArrow, { at: state.startLoc }); } if (failed && valid.length === 1) { this.state = state; noArrowAt.push(valid[0].start); this.state.noArrowAt = noArrowAt; ({ consequent, failed } = this.tryParseConditionalConsequent()); } } this.getArrowLikeExpressions(consequent, true); this.state.noArrowAt = originalNoArrowAt; this.expect(14); node.test = expr; node.consequent = consequent; node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined)); return this.finishNode(node, "ConditionalExpression"); } tryParseConditionalConsequent() { this.state.noArrowParamsConversionAt.push(this.state.start); const consequent = this.parseMaybeAssignAllowIn(); const failed = !this.match(14); this.state.noArrowParamsConversionAt.pop(); return { consequent, failed }; } getArrowLikeExpressions(node, disallowInvalid) { const stack = [node]; const arrows = []; while (stack.length !== 0) { const node = stack.pop(); if (node.type === "ArrowFunctionExpression") { if (node.typeParameters || !node.returnType) { this.finishArrowValidation(node); } else { arrows.push(node); } stack.push(node.body); } else if (node.type === "ConditionalExpression") { stack.push(node.consequent); stack.push(node.alternate); } } if (disallowInvalid) { arrows.forEach(node => this.finishArrowValidation(node)); return [arrows, []]; } return partition(arrows, node => node.params.every(param => this.isAssignable(param, true))); } finishArrowValidation(node) { var _node$extra; this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, false); this.scope.enter(_scopeflags.SCOPE_FUNCTION | _scopeflags.SCOPE_ARROW); super.checkParams(node, false, true); this.scope.exit(); } forwardNoArrowParamsConversionAt(node, parse) { let result; if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { this.state.noArrowParamsConversionAt.push(this.state.start); result = parse(); this.state.noArrowParamsConversionAt.pop(); } else { result = parse(); } return result; } parseParenItem(node, startLoc) { node = super.parseParenItem(node, startLoc); if (this.eat(17)) { node.optional = true; this.resetEndLocation(node); } if (this.match(14)) { const typeCastNode = this.startNodeAt(startLoc); typeCastNode.expression = node; typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); return this.finishNode(typeCastNode, "TypeCastExpression"); } return node; } assertModuleNodeAllowed(node) { if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") { return; } super.assertModuleNodeAllowed(node); } parseExportDeclaration(node) { if (this.isContextual(128)) { node.exportKind = "type"; const declarationNode = this.startNode(); this.next(); if (this.match(5)) { node.specifiers = this.parseExportSpecifiers(true); super.parseExportFrom(node); return null; } else { return this.flowParseTypeAlias(declarationNode); } } else if (this.isContextual(129)) { node.exportKind = "type"; const declarationNode = this.startNode(); this.next(); return this.flowParseOpaqueType(declarationNode, false); } else if (this.isContextual(127)) { node.exportKind = "type"; const declarationNode = this.startNode(); this.next(); return this.flowParseInterface(declarationNode); } else if (this.shouldParseEnums() && this.isContextual(124)) { node.exportKind = "value"; const declarationNode = this.startNode(); this.next(); return this.flowParseEnumDeclaration(declarationNode); } else { return super.parseExportDeclaration(node); } } eatExportStar(node) { if (super.eatExportStar(node)) return true; if (this.isContextual(128) && this.lookahead().type === 55) { node.exportKind = "type"; this.next(); this.next(); return true; } return false; } maybeParseExportNamespaceSpecifier(node) { const { startLoc } = this.state; const hasNamespace = super.maybeParseExportNamespaceSpecifier(node); if (hasNamespace && node.exportKind === "type") { this.unexpected(startLoc); } return hasNamespace; } parseClassId(node, isStatement, optionalId) { super.parseClassId(node, isStatement, optionalId); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } } parseClassMember(classBody, member, state) { const { startLoc } = this.state; if (this.isContextual(123)) { if (super.parseClassMemberFromModifier(classBody, member)) { return; } member.declare = true; } super.parseClassMember(classBody, member, state); if (member.declare) { if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") { this.raise(FlowErrors.DeclareClassElement, { at: startLoc }); } else if (member.value) { this.raise(FlowErrors.DeclareClassFieldInitializer, { at: member.value }); } } } isIterator(word) { return word === "iterator" || word === "asyncIterator"; } readIterator() { const word = super.readWord1(); const fullWord = "@@" + word; if (!this.isIterator(word) || !this.state.inType) { this.raise(_parseError.Errors.InvalidIdentifier, { at: this.state.curPosition(), identifierName: fullWord }); } this.finishToken(130, fullWord); } getTokenFromCode(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (code === 123 && next === 124) { this.finishOp(6, 2); } else if (this.state.inType && (code === 62 || code === 60)) { this.finishOp(code === 62 ? 48 : 47, 1); } else if (this.state.inType && code === 63) { if (next === 46) { this.finishOp(18, 2); } else { this.finishOp(17, 1); } } else if ((0, _identifier.isIteratorStart)(code, next, this.input.charCodeAt(this.state.pos + 2))) { this.state.pos += 2; this.readIterator(); } else { super.getTokenFromCode(code); } } isAssignable(node, isBinding) { if (node.type === "TypeCastExpression") { return this.isAssignable(node.expression, isBinding); } else { return super.isAssignable(node, isBinding); } } toAssignable(node, isLHS = false) { if (!isLHS && node.type === "AssignmentExpression" && node.left.type === "TypeCastExpression") { node.left = this.typeCastToParameter(node.left); } super.toAssignable(node, isLHS); } toAssignableList(exprList, trailingCommaLoc, isLHS) { for (let i = 0; i < exprList.length; i++) { const expr = exprList[i]; if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") { exprList[i] = this.typeCastToParameter(expr); } } super.toAssignableList(exprList, trailingCommaLoc, isLHS); } toReferencedList(exprList, isParenthesizedExpr) { for (let i = 0; i < exprList.length; i++) { var _expr$extra; const expr = exprList[i]; if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) { this.raise(FlowErrors.TypeCastInPattern, { at: expr.typeAnnotation }); } } return exprList; } parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); if (canBePattern && !this.state.maybeInArrowParameters) { this.toReferencedList(node.elements); } return node; } isValidLVal(type, isParenthesized, binding) { return type === "TypeCastExpression" || super.isValidLVal(type, isParenthesized, binding); } parseClassProperty(node) { if (this.match(14)) { node.typeAnnotation = this.flowParseTypeAnnotation(); } return super.parseClassProperty(node); } parseClassPrivateProperty(node) { if (this.match(14)) { node.typeAnnotation = this.flowParseTypeAnnotation(); } return super.parseClassPrivateProperty(node); } isClassMethod() { return this.match(47) || super.isClassMethod(); } isClassProperty() { return this.match(14) || super.isClassProperty(); } isNonstaticConstructor(method) { return !this.match(14) && super.isNonstaticConstructor(method); } pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { if (method.variance) { this.unexpected(method.variance.loc.start); } delete method.variance; if (this.match(47)) { method.typeParameters = this.flowParseTypeParameterDeclaration(); } super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); if (method.params && isConstructor) { const params = method.params; if (params.length > 0 && this.isThisParam(params[0])) { this.raise(FlowErrors.ThisParamBannedInConstructor, { at: method }); } } else if (method.type === "MethodDefinition" && isConstructor && method.value.params) { const params = method.value.params; if (params.length > 0 && this.isThisParam(params[0])) { this.raise(FlowErrors.ThisParamBannedInConstructor, { at: method }); } } } pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { if (method.variance) { this.unexpected(method.variance.loc.start); } delete method.variance; if (this.match(47)) { method.typeParameters = this.flowParseTypeParameterDeclaration(); } super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); } parseClassSuper(node) { super.parseClassSuper(node); if (node.superClass && this.match(47)) { node.superTypeParameters = this.flowParseTypeParameterInstantiation(); } if (this.isContextual(111)) { this.next(); const implemented = node.implements = []; do { const node = this.startNode(); node.id = this.flowParseRestrictedIdentifier(true); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterInstantiation(); } else { node.typeParameters = null; } implemented.push(this.finishNode(node, "ClassImplements")); } while (this.eat(12)); } } checkGetterSetterParams(method) { super.checkGetterSetterParams(method); const params = this.getObjectOrClassMethodParams(method); if (params.length > 0) { const param = params[0]; if (this.isThisParam(param) && method.kind === "get") { this.raise(FlowErrors.GetterMayNotHaveThisParam, { at: param }); } else if (this.isThisParam(param)) { this.raise(FlowErrors.SetterMayNotHaveThisParam, { at: param }); } } } parsePropertyNamePrefixOperator(node) { node.variance = this.flowParseVariance(); } parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { if (prop.variance) { this.unexpected(prop.variance.loc.start); } delete prop.variance; let typeParameters; if (this.match(47) && !isAccessor) { typeParameters = this.flowParseTypeParameterDeclaration(); if (!this.match(10)) this.unexpected(); } const result = super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); if (typeParameters) { (result.value || result).typeParameters = typeParameters; } return result; } parseAssignableListItemTypes(param) { if (this.eat(17)) { if (param.type !== "Identifier") { this.raise(FlowErrors.PatternIsOptional, { at: param }); } if (this.isThisParam(param)) { this.raise(FlowErrors.ThisParamMayNotBeOptional, { at: param }); } param.optional = true; } if (this.match(14)) { param.typeAnnotation = this.flowParseTypeAnnotation(); } else if (this.isThisParam(param)) { this.raise(FlowErrors.ThisParamAnnotationRequired, { at: param }); } if (this.match(29) && this.isThisParam(param)) { this.raise(FlowErrors.ThisParamNoDefault, { at: param }); } this.resetEndLocation(param); return param; } parseMaybeDefault(startLoc, left) { const node = super.parseMaybeDefault(startLoc, left); if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { this.raise(FlowErrors.TypeBeforeInitializer, { at: node.typeAnnotation }); } return node; } checkImportReflection(node) { super.checkImportReflection(node); if (node.module && node.importKind !== "value") { this.raise(FlowErrors.ImportReflectionHasImportType, { at: node.specifiers[0].loc.start }); } } parseImportSpecifierLocal(node, specifier, type) { specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier(); node.specifiers.push(this.finishImportSpecifier(specifier, type)); } isPotentialImportPhase(isExport) { if (super.isPotentialImportPhase(isExport)) return true; if (this.isContextual(128)) { if (!isExport) return true; const ch = this.lookaheadCharCode(); return ch === 123 || ch === 42; } return !isExport && this.isContextual(87); } applyImportPhase(node, isExport, phase, loc) { super.applyImportPhase(node, isExport, phase, loc); if (isExport) { if (!phase && this.match(65)) { return; } node.exportKind = phase === "type" ? phase : "value"; } else { if (phase === "type" && this.match(55)) this.unexpected(); node.importKind = phase === "type" || phase === "typeof" ? phase : "value"; } } parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { const firstIdent = specifier.imported; let specifierTypeKind = null; if (firstIdent.type === "Identifier") { if (firstIdent.name === "type") { specifierTypeKind = "type"; } else if (firstIdent.name === "typeof") { specifierTypeKind = "typeof"; } } let isBinding = false; if (this.isContextual(93) && !this.isLookaheadContextual("as")) { const as_ident = this.parseIdentifier(true); if (specifierTypeKind !== null && !(0, _types.tokenIsKeywordOrIdentifier)(this.state.type)) { specifier.imported = as_ident; specifier.importKind = specifierTypeKind; specifier.local = (0, _node.cloneIdentifier)(as_ident); } else { specifier.imported = firstIdent; specifier.importKind = null; specifier.local = this.parseIdentifier(); } } else { if (specifierTypeKind !== null && (0, _types.tokenIsKeywordOrIdentifier)(this.state.type)) { specifier.imported = this.parseIdentifier(true); specifier.importKind = specifierTypeKind; } else { if (importedIsString) { throw this.raise(_parseError.Errors.ImportBindingIsString, { at: specifier, importName: firstIdent.value }); } specifier.imported = firstIdent; specifier.importKind = null; } if (this.eatContextual(93)) { specifier.local = this.parseIdentifier(); } else { isBinding = true; specifier.local = (0, _node.cloneIdentifier)(specifier.imported); } } const specifierIsTypeImport = hasTypeImportKind(specifier); if (isInTypeOnlyImport && specifierIsTypeImport) { this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, { at: specifier }); } if (isInTypeOnlyImport || specifierIsTypeImport) { this.checkReservedType(specifier.local.name, specifier.local.loc.start, true); } if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) { this.checkReservedWord(specifier.local.name, specifier.loc.start, true, true); } return this.finishImportSpecifier(specifier, "ImportSpecifier"); } parseBindingAtom() { switch (this.state.type) { case 78: return this.parseIdentifier(true); default: return super.parseBindingAtom(); } } parseFunctionParams(node, isConstructor) { const kind = node.kind; if (kind !== "get" && kind !== "set" && this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } super.parseFunctionParams(node, isConstructor); } parseVarId(decl, kind) { super.parseVarId(decl, kind); if (this.match(14)) { decl.id.typeAnnotation = this.flowParseTypeAnnotation(); this.resetEndLocation(decl.id); } } parseAsyncArrowFromCallExpression(node, call) { if (this.match(14)) { const oldNoAnonFunctionType = this.state.noAnonFunctionType; this.state.noAnonFunctionType = true; node.returnType = this.flowParseTypeAnnotation(); this.state.noAnonFunctionType = oldNoAnonFunctionType; } return super.parseAsyncArrowFromCallExpression(node, call); } shouldParseAsyncArrow() { return this.match(14) || super.shouldParseAsyncArrow(); } parseMaybeAssign(refExpressionErrors, afterLeftParse) { var _jsx; let state = null; let jsx; if (this.hasPlugin("jsx") && (this.match(140) || this.match(47))) { state = this.state.clone(); jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); if (!jsx.error) return jsx.node; const { context } = this.state; const currentContext = context[context.length - 1]; if (currentContext === _context.types.j_oTag || currentContext === _context.types.j_expr) { context.pop(); } } if ((_jsx = jsx) != null && _jsx.error || this.match(47)) { var _jsx2, _jsx3; state = state || this.state.clone(); let typeParameters; const arrow = this.tryParse(abort => { var _arrowExpression$extr; typeParameters = this.flowParseTypeParameterDeclaration(); const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => { const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse); this.resetStartLocationFromNode(result, typeParameters); return result; }); if ((_arrowExpression$extr = arrowExpression.extra) != null && _arrowExpression$extr.parenthesized) abort(); const expr = this.maybeUnwrapTypeCastExpression(arrowExpression); if (expr.type !== "ArrowFunctionExpression") abort(); expr.typeParameters = typeParameters; this.resetStartLocationFromNode(expr, typeParameters); return arrowExpression; }, state); let arrowExpression = null; if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") { if (!arrow.error && !arrow.aborted) { if (arrow.node.async) { this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, { at: typeParameters }); } return arrow.node; } arrowExpression = arrow.node; } if ((_jsx2 = jsx) != null && _jsx2.node) { this.state = jsx.failState; return jsx.node; } if (arrowExpression) { this.state = arrow.failState; return arrowExpression; } if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error; if (arrow.thrown) throw arrow.error; throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, { at: typeParameters }); } return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); } parseArrow(node) { if (this.match(14)) { const result = this.tryParse(() => { const oldNoAnonFunctionType = this.state.noAnonFunctionType; this.state.noAnonFunctionType = true; const typeNode = this.startNode(); [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); this.state.noAnonFunctionType = oldNoAnonFunctionType; if (this.canInsertSemicolon()) this.unexpected(); if (!this.match(19)) this.unexpected(); return typeNode; }); if (result.thrown) return null; if (result.error) this.state = result.failState; node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null; } return super.parseArrow(node); } shouldParseArrow(params) { return this.match(14) || super.shouldParseArrow(params); } setArrowFunctionParameters(node, params) { if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { node.params = params; } else { super.setArrowFunctionParameters(node, params); } } checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { return; } for (let i = 0; i < node.params.length; i++) { if (this.isThisParam(node.params[i]) && i > 0) { this.raise(FlowErrors.ThisParamMustBeFirst, { at: node.params[i] }); } } super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged); } parseParenAndDistinguishExpression(canBeArrow) { return super.parseParenAndDistinguishExpression(canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1); } parseSubscripts(base, startLoc, noCalls) { if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.indexOf(startLoc.index) !== -1) { this.next(); const node = this.startNodeAt(startLoc); node.callee = base; node.arguments = super.parseCallExpressionArguments(11, false); base = this.finishNode(node, "CallExpression"); } else if (base.type === "Identifier" && base.name === "async" && this.match(47)) { const state = this.state.clone(); const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(), state); if (!arrow.error && !arrow.aborted) return arrow.node; const result = this.tryParse(() => super.parseSubscripts(base, startLoc, noCalls), state); if (result.node && !result.error) return result.node; if (arrow.node) { this.state = arrow.failState; return arrow.node; } if (result.node) { this.state = result.failState; return result.node; } throw arrow.error || result.error; } return super.parseSubscripts(base, startLoc, noCalls); } parseSubscript(base, startLoc, noCalls, subscriptState) { if (this.match(18) && this.isLookaheadToken_lt()) { subscriptState.optionalChainMember = true; if (noCalls) { subscriptState.stop = true; return base; } this.next(); const node = this.startNodeAt(startLoc); node.callee = base; node.typeArguments = this.flowParseTypeParameterInstantiation(); this.expect(10); node.arguments = this.parseCallExpressionArguments(11, false); node.optional = true; return this.finishCallExpression(node, true); } else if (!noCalls && this.shouldParseTypes() && this.match(47)) { const node = this.startNodeAt(startLoc); node.callee = base; const result = this.tryParse(() => { node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(); this.expect(10); node.arguments = super.parseCallExpressionArguments(11, false); if (subscriptState.optionalChainMember) { node.optional = false; } return this.finishCallExpression(node, subscriptState.optionalChainMember); }); if (result.node) { if (result.error) this.state = result.failState; return result.node; } } return super.parseSubscript(base, startLoc, noCalls, subscriptState); } parseNewCallee(node) { super.parseNewCallee(node); let targs = null; if (this.shouldParseTypes() && this.match(47)) { targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node; } node.typeArguments = targs; } parseAsyncArrowWithTypeParameters(startLoc) { const node = this.startNodeAt(startLoc); this.parseFunctionParams(node, false); if (!this.parseArrow(node)) return; return super.parseArrowExpression(node, undefined, true); } readToken_mult_modulo(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (code === 42 && next === 47 && this.state.hasFlowComment) { this.state.hasFlowComment = false; this.state.pos += 2; this.nextToken(); return; } super.readToken_mult_modulo(code); } readToken_pipe_amp(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (code === 124 && next === 125) { this.finishOp(9, 2); return; } super.readToken_pipe_amp(code); } parseTopLevel(file, program) { const fileNode = super.parseTopLevel(file, program); if (this.state.hasFlowComment) { this.raise(FlowErrors.UnterminatedFlowComment, { at: this.state.curPosition() }); } return fileNode; } skipBlockComment() { if (this.hasPlugin("flowComments") && this.skipFlowComment()) { if (this.state.hasFlowComment) { throw this.raise(FlowErrors.NestedFlowComment, { at: this.state.startLoc }); } this.hasFlowCommentCompletion(); const commentSkip = this.skipFlowComment(); if (commentSkip) { this.state.pos += commentSkip; this.state.hasFlowComment = true; } return; } return super.skipBlockComment(this.state.hasFlowComment ? "*-/" : "*/"); } skipFlowComment() { const { pos } = this.state; let shiftToFirstNonWhiteSpace = 2; while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) { shiftToFirstNonWhiteSpace++; } const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos); const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1); if (ch2 === 58 && ch3 === 58) { return shiftToFirstNonWhiteSpace + 2; } if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") { return shiftToFirstNonWhiteSpace + 12; } if (ch2 === 58 && ch3 !== 58) { return shiftToFirstNonWhiteSpace; } return false; } hasFlowCommentCompletion() { const end = this.input.indexOf("*/", this.state.pos); if (end === -1) { throw this.raise(_parseError.Errors.UnterminatedComment, { at: this.state.curPosition() }); } } flowEnumErrorBooleanMemberNotInitialized(loc, { enumName, memberName }) { this.raise(FlowErrors.EnumBooleanMemberNotInitialized, { at: loc, memberName, enumName }); } flowEnumErrorInvalidMemberInitializer(loc, enumContext) { return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, Object.assign({ at: loc }, enumContext)); } flowEnumErrorNumberMemberNotInitialized(loc, { enumName, memberName }) { this.raise(FlowErrors.EnumNumberMemberNotInitialized, { at: loc, enumName, memberName }); } flowEnumErrorStringMemberInconsistentlyInitailized(node, { enumName }) { this.raise(FlowErrors.EnumStringMemberInconsistentlyInitailized, { at: node, enumName }); } flowEnumMemberInit() { const startLoc = this.state.startLoc; const endOfInit = () => this.match(12) || this.match(8); switch (this.state.type) { case 132: { const literal = this.parseNumericLiteral(this.state.value); if (endOfInit()) { return { type: "number", loc: literal.loc.start, value: literal }; } return { type: "invalid", loc: startLoc }; } case 131: { const literal = this.parseStringLiteral(this.state.value); if (endOfInit()) { return { type: "string", loc: literal.loc.start, value: literal }; } return { type: "invalid", loc: startLoc }; } case 85: case 86: { const literal = this.parseBooleanLiteral(this.match(85)); if (endOfInit()) { return { type: "boolean", loc: literal.loc.start, value: literal }; } return { type: "invalid", loc: startLoc }; } default: return { type: "invalid", loc: startLoc }; } } flowEnumMemberRaw() { const loc = this.state.startLoc; const id = this.parseIdentifier(true); const init = this.eat(29) ? this.flowEnumMemberInit() : { type: "none", loc }; return { id, init }; } flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) { const { explicitType } = context; if (explicitType === null) { return; } if (explicitType !== expectedType) { this.flowEnumErrorInvalidMemberInitializer(loc, context); } } flowEnumMembers({ enumName, explicitType }) { const seenNames = new Set(); const members = { booleanMembers: [], numberMembers: [], stringMembers: [], defaultedMembers: [] }; let hasUnknownMembers = false; while (!this.match(8)) { if (this.eat(21)) { hasUnknownMembers = true; break; } const memberNode = this.startNode(); const { id, init } = this.flowEnumMemberRaw(); const memberName = id.name; if (memberName === "") { continue; } if (/^[a-z]/.test(memberName)) { this.raise(FlowErrors.EnumInvalidMemberName, { at: id, memberName, suggestion: memberName[0].toUpperCase() + memberName.slice(1), enumName }); } if (seenNames.has(memberName)) { this.raise(FlowErrors.EnumDuplicateMemberName, { at: id, memberName, enumName }); } seenNames.add(memberName); const context = { enumName, explicitType, memberName }; memberNode.id = id; switch (init.type) { case "boolean": { this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "boolean"); memberNode.init = init.value; members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember")); break; } case "number": { this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "number"); memberNode.init = init.value; members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember")); break; } case "string": { this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "string"); memberNode.init = init.value; members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember")); break; } case "invalid": { throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context); } case "none": { switch (explicitType) { case "boolean": this.flowEnumErrorBooleanMemberNotInitialized(init.loc, context); break; case "number": this.flowEnumErrorNumberMemberNotInitialized(init.loc, context); break; default: members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember")); } } } if (!this.match(8)) { this.expect(12); } } return { members, hasUnknownMembers }; } flowEnumStringMembers(initializedMembers, defaultedMembers, { enumName }) { if (initializedMembers.length === 0) { return defaultedMembers; } else if (defaultedMembers.length === 0) { return initializedMembers; } else if (defaultedMembers.length > initializedMembers.length) { for (const member of initializedMembers) { this.flowEnumErrorStringMemberInconsistentlyInitailized(member, { enumName }); } return defaultedMembers; } else { for (const member of defaultedMembers) { this.flowEnumErrorStringMemberInconsistentlyInitailized(member, { enumName }); } return initializedMembers; } } flowEnumParseExplicitType({ enumName }) { if (!this.eatContextual(101)) return null; if (!(0, _types.tokenIsIdentifier)(this.state.type)) { throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, { at: this.state.startLoc, enumName }); } const { value } = this.state; this.next(); if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") { this.raise(FlowErrors.EnumInvalidExplicitType, { at: this.state.startLoc, enumName, invalidEnumType: value }); } return value; } flowEnumBody(node, id) { const enumName = id.name; const nameLoc = id.loc.start; const explicitType = this.flowEnumParseExplicitType({ enumName }); this.expect(5); const { members, hasUnknownMembers } = this.flowEnumMembers({ enumName, explicitType }); node.hasUnknownMembers = hasUnknownMembers; switch (explicitType) { case "boolean": node.explicitType = true; node.members = members.booleanMembers; this.expect(8); return this.finishNode(node, "EnumBooleanBody"); case "number": node.explicitType = true; node.members = members.numberMembers; this.expect(8); return this.finishNode(node, "EnumNumberBody"); case "string": node.explicitType = true; node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { enumName }); this.expect(8); return this.finishNode(node, "EnumStringBody"); case "symbol": node.members = members.defaultedMembers; this.expect(8); return this.finishNode(node, "EnumSymbolBody"); default: { const empty = () => { node.members = []; this.expect(8); return this.finishNode(node, "EnumStringBody"); }; node.explicitType = false; const boolsLen = members.booleanMembers.length; const numsLen = members.numberMembers.length; const strsLen = members.stringMembers.length; const defaultedLen = members.defaultedMembers.length; if (!boolsLen && !numsLen && !strsLen && !defaultedLen) { return empty(); } else if (!boolsLen && !numsLen) { node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { enumName }); this.expect(8); return this.finishNode(node, "EnumStringBody"); } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) { for (const member of members.defaultedMembers) { this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, { enumName, memberName: member.id.name }); } node.members = members.booleanMembers; this.expect(8); return this.finishNode(node, "EnumBooleanBody"); } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) { for (const member of members.defaultedMembers) { this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, { enumName, memberName: member.id.name }); } node.members = members.numberMembers; this.expect(8); return this.finishNode(node, "EnumNumberBody"); } else { this.raise(FlowErrors.EnumInconsistentMemberValues, { at: nameLoc, enumName }); return empty(); } } } } flowParseEnumDeclaration(node) { const id = this.parseIdentifier(); node.id = id; node.body = this.flowEnumBody(this.startNode(), id); return this.finishNode(node, "EnumDeclaration"); } isLookaheadToken_lt() { const next = this.nextTokenStart(); if (this.input.charCodeAt(next) === 60) { const afterNext = this.input.charCodeAt(next + 1); return afterNext !== 60 && afterNext !== 61; } return false; } maybeUnwrapTypeCastExpression(node) { return node.type === "TypeCastExpression" ? node.expression : node; } }; exports.default = _default; //# sourceMappingURL=index.js.map lib/plugins/flow/index.js.map 0000644 00000663724 15120211212 0012170 0 ustar 00 {"version":3,"names":["_types","require","_context","_identifier","_scope","_scopeflags","_parseError","_node","reservedTypes","Set","FlowErrors","ParseErrorEnum","AmbiguousConditionalArrow","AmbiguousDeclareModuleKind","AssignReservedType","reservedType","DeclareClassElement","DeclareClassFieldInitializer","DuplicateDeclareModuleExports","EnumBooleanMemberNotInitialized","memberName","enumName","EnumDuplicateMemberName","EnumInconsistentMemberValues","EnumInvalidExplicitType","invalidEnumType","EnumInvalidExplicitTypeUnknownSupplied","EnumInvalidMemberInitializerPrimaryType","explicitType","EnumInvalidMemberInitializerSymbolType","EnumInvalidMemberInitializerUnknownType","EnumInvalidMemberName","suggestion","EnumNumberMemberNotInitialized","EnumStringMemberInconsistentlyInitailized","GetterMayNotHaveThisParam","ImportReflectionHasImportType","ImportTypeShorthandOnlyInPureImport","InexactInsideExact","InexactInsideNonObject","InexactVariance","InvalidNonTypeImportInDeclareModule","MissingTypeParamDefault","NestedDeclareModule","NestedFlowComment","PatternIsOptional","Object","assign","message","reasonCode","SetterMayNotHaveThisParam","SpreadVariance","ThisParamAnnotationRequired","ThisParamBannedInConstructor","ThisParamMayNotBeOptional","ThisParamMustBeFirst","ThisParamNoDefault","TypeBeforeInitializer","TypeCastInPattern","UnexpectedExplicitInexactInObject","UnexpectedReservedType","UnexpectedReservedUnderscore","UnexpectedSpaceBetweenModuloChecks","UnexpectedSpreadType","UnexpectedSubtractionOperand","UnexpectedTokenAfterTypeParameter","UnexpectedTypeParameterBeforeAsyncArrowFunction","UnsupportedDeclareExportKind","unsupportedExportKind","UnsupportedStatementInDeclareModule","UnterminatedFlowComment","isEsModuleType","bodyElement","type","declaration","hasTypeImportKind","node","importKind","exportSuggestions","const","let","interface","partition","list","test","list1","list2","i","length","push","FLOW_PRAGMA_REGEX","_default","superClass","FlowParserMixin","constructor","args","flowPragma","undefined","getScopeHandler","FlowScopeHandler","shouldParseTypes","getPluginOption","shouldParseEnums","finishToken","val","addComment","comment","matches","exec","value","Error","flowParseTypeInitialiser","tok","oldInType","state","inType","expect","flowParseType","flowParsePredicate","startNode","moduloLoc","startLoc","next","expectContextual","lastTokStart","index","raise","at","eat","parseExpression","finishNode","flowParseTypeAndPredicateInitialiser","predicate","match","flowParseDeclareClass","flowParseInterfaceish","flowParseDeclareFunction","id","parseIdentifier","typeNode","typeContainer","typeParameters","flowParseTypeParameterDeclaration","tmp","flowParseFunctionTypeParams","params","rest","this","_this","returnType","typeAnnotation","resetEndLocation","semicolon","scope","declareName","name","BIND_FLOW_DECLARE_FN","loc","start","flowParseDeclare","insideModule","flowParseDeclareVariable","eatContextual","flowParseDeclareModuleExports","lastTokStartLoc","flowParseDeclareModule","isContextual","flowParseDeclareTypeAlias","flowParseDeclareOpaqueType","flowParseDeclareInterface","flowParseDeclareExportDeclaration","unexpected","flowParseTypeAnnotatableIdentifier","BIND_VAR","enter","SCOPE_OTHER","parseExprAtom","bodyNode","body","parseImport","exit","kind","hasModuleExport","forEach","default","isLet","label","parseExport","exportKind","flowParseTypeAnnotation","finished","flowParseTypeAlias","flowParseOpaqueType","isClass","flowParseRestrictedIdentifier","BIND_FUNCTION","BIND_LEXICAL","extends","flowParseInterfaceExtends","implements","mixins","flowParseObjectType","allowStatic","allowExact","allowSpread","allowProto","allowInexact","flowParseQualifiedTypeIdentifier","flowParseTypeParameterInstantiation","flowParseInterface","checkNotUnderscore","word","checkReservedType","has","liberal","right","declare","supertype","impltype","flowParseTypeParameter","requireDefault","nodeStartLoc","variance","flowParseVariance","ident","bound","defaultRequired","typeParameter","oldNoAnonFunctionType","noAnonFunctionType","flowParseTypeParameterInstantiationCallOrNew","flowParseTypeOrImplicitInstantiation","flowParseInterfaceType","flowParseObjectPropertyKey","flowParseObjectTypeIndexer","isStatic","static","lookahead","key","flowParseObjectTypeInternalSlot","method","optional","flowParseObjectTypeMethodish","startNodeAt","flowParseFunctionTypeParam","flowParseObjectTypeCallProperty","valueNode","nodeStart","callProperties","properties","indexers","internalSlots","endDelim","exact","inexact","protoStartLoc","inexactStartLoc","tokenIsLiteralPropertyName","propOrInexact","flowParseObjectTypeProperty","flowObjectTypeSemicolon","out","isInexactToken","argument","proto","flowCheckGetterSetterParams","property","paramCount","Errors","BadGetterArity","BadSetterArity","BadSetterRestParameter","_startLoc","node2","qualification","flowParseGenericType","flowParseTypeofType","flowParsePrimaryType","flowParseTupleType","types","pos","first","lh","isThis","reinterpretTypeAsFunctionTypeParam","flowIdentToTypeAnnotation","isGroupedType","tokenIsIdentifier","token","parseLiteral","parseLiteralAtNode","tokenIsKeyword","tokenLabelName","createIdentifier","flowParsePostfixType","seenOptionalIndexedAccess","canInsertSemicolon","elementType","objectType","indexType","flowParsePrefixType","flowParseAnonFunctionWithoutParens","param","flowParseIntersectionType","flowParseUnionType","allowPrimitiveOverride","typeCastToParameter","expression","end","parseFunctionBody","allowExpressionBody","isMethod","forwardNoArrowParamsConversionAt","parseFunctionBodyAndFinish","parseStatementLike","flags","strict","tokenIsKeywordOrIdentifier","flowParseEnumDeclaration","stmt","isValidDirective","parseExpressionStatement","expr","decorators","shouldParseExportDeclaration","tokenIsFlowInterfaceOrTypeOrOpaque","containsEsc","isExportDefaultSpecifier","parseExportDefaultExpression","parseConditional","refExpressionErrors","maybeInArrowParameters","nextCh","lookaheadCharCode","setOptionalParametersError","clone","originalNoArrowAt","noArrowAt","consequent","failed","tryParseConditionalConsequent","valid","invalid","getArrowLikeExpressions","alternate","parseMaybeAssign","noArrowParamsConversionAt","parseMaybeAssignAllowIn","pop","disallowInvalid","stack","arrows","finishArrowValidation","every","isAssignable","_node$extra","toAssignableList","extra","trailingCommaLoc","SCOPE_FUNCTION","SCOPE_ARROW","checkParams","parse","result","indexOf","parseParenItem","typeCastNode","assertModuleNodeAllowed","parseExportDeclaration","declarationNode","specifiers","parseExportSpecifiers","parseExportFrom","eatExportStar","maybeParseExportNamespaceSpecifier","hasNamespace","parseClassId","isStatement","optionalId","parseClassMember","classBody","member","parseClassMemberFromModifier","isIterator","readIterator","readWord1","fullWord","InvalidIdentifier","curPosition","identifierName","getTokenFromCode","code","input","charCodeAt","finishOp","isIteratorStart","isBinding","toAssignable","isLHS","left","exprList","toReferencedList","isParenthesizedExpr","_expr$extra","parenthesized","parseArrayLike","close","canBePattern","isTuple","elements","isValidLVal","isParenthesized","binding","parseClassProperty","parseClassPrivateProperty","isClassMethod","isClassProperty","isNonstaticConstructor","pushClassMethod","isGenerator","isAsync","isConstructor","allowsDirectSuper","isThisParam","pushClassPrivateMethod","parseClassSuper","superTypeParameters","implemented","checkGetterSetterParams","getObjectOrClassMethodParams","parsePropertyNamePrefixOperator","parseObjPropValue","prop","isPattern","isAccessor","parseAssignableListItemTypes","parseMaybeDefault","checkImportReflection","module","parseImportSpecifierLocal","specifier","local","finishImportSpecifier","isPotentialImportPhase","isExport","ch","applyImportPhase","phase","parseImportSpecifier","importedIsString","isInTypeOnlyImport","isMaybeTypeOnly","bindingType","firstIdent","imported","specifierTypeKind","isLookaheadContextual","as_ident","cloneIdentifier","ImportBindingIsString","importName","specifierIsTypeImport","checkReservedWord","parseBindingAtom","parseFunctionParams","parseVarId","decl","parseAsyncArrowFromCallExpression","call","shouldParseAsyncArrow","afterLeftParse","_jsx","jsx","hasPlugin","tryParse","error","context","currentContext","tc","j_oTag","j_expr","_jsx2","_jsx3","arrow","abort","_arrowExpression$extr","arrowExpression","resetStartLocationFromNode","maybeUnwrapTypeCastExpression","aborted","async","failState","thrown","parseArrow","shouldParseArrow","setArrowFunctionParameters","allowDuplicates","isArrowFunction","strictModeChanged","parseParenAndDistinguishExpression","canBeArrow","parseSubscripts","base","noCalls","callee","arguments","parseCallExpressionArguments","parseAsyncArrowWithTypeParameters","parseSubscript","subscriptState","isLookaheadToken_lt","optionalChainMember","stop","typeArguments","finishCallExpression","parseNewCallee","targs","parseArrowExpression","readToken_mult_modulo","hasFlowComment","nextToken","readToken_pipe_amp","parseTopLevel","file","program","fileNode","skipBlockComment","skipFlowComment","hasFlowCommentCompletion","commentSkip","shiftToFirstNonWhiteSpace","includes","ch2","ch3","slice","UnterminatedComment","flowEnumErrorBooleanMemberNotInitialized","flowEnumErrorInvalidMemberInitializer","enumContext","flowEnumErrorNumberMemberNotInitialized","flowEnumErrorStringMemberInconsistentlyInitailized","flowEnumMemberInit","endOfInit","literal","parseNumericLiteral","parseStringLiteral","parseBooleanLiteral","flowEnumMemberRaw","init","flowEnumCheckExplicitTypeMismatch","expectedType","flowEnumMembers","seenNames","members","booleanMembers","numberMembers","stringMembers","defaultedMembers","hasUnknownMembers","memberNode","toUpperCase","add","flowEnumStringMembers","initializedMembers","flowEnumParseExplicitType","flowEnumBody","nameLoc","empty","boolsLen","numsLen","strsLen","defaultedLen","nextTokenStart","afterNext","exports"],"sources":["../../../src/plugins/flow/index.ts"],"sourcesContent":["/*:: declare var invariant; */\n\nimport type Parser from \"../../parser\";\nimport {\n tokenIsIdentifier,\n tokenIsKeyword,\n tokenIsKeywordOrIdentifier,\n tokenIsLiteralPropertyName,\n tokenLabelName,\n tt,\n type TokenType,\n tokenIsFlowInterfaceOrTypeOrOpaque,\n} from \"../../tokenizer/types\";\nimport type * as N from \"../../types\";\nimport type { Position } from \"../../util/location\";\nimport { types as tc } from \"../../tokenizer/context\";\nimport * as charCodes from \"charcodes\";\nimport { isIteratorStart } from \"../../util/identifier\";\nimport FlowScopeHandler from \"./scope\";\nimport {\n BIND_LEXICAL,\n BIND_VAR,\n BIND_FUNCTION,\n BIND_FLOW_DECLARE_FN,\n SCOPE_ARROW,\n SCOPE_FUNCTION,\n SCOPE_OTHER,\n type BindingTypes,\n} from \"../../util/scopeflags\";\nimport type { ExpressionErrors } from \"../../parser/util\";\nimport type { ParseStatementFlag } from \"../../parser/statement\";\nimport { Errors, ParseErrorEnum } from \"../../parse-error\";\nimport { cloneIdentifier, type Undone } from \"../../parser/node\";\n\nconst reservedTypes = new Set([\n \"_\",\n \"any\",\n \"bool\",\n \"boolean\",\n \"empty\",\n \"extends\",\n \"false\",\n \"interface\",\n \"mixed\",\n \"null\",\n \"number\",\n \"static\",\n \"string\",\n \"true\",\n \"typeof\",\n \"void\",\n]);\n\n/* eslint sort-keys: \"error\" */\n// The Errors key follows https://github.com/facebook/flow/blob/master/src/parser/parse_error.ml unless it does not exist\nconst FlowErrors = ParseErrorEnum`flow`({\n AmbiguousConditionalArrow:\n \"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.\",\n AmbiguousDeclareModuleKind:\n \"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.\",\n // TODO: When we get proper string enums in typescript make this ReservedType.\n // Not really worth it to do the whole $Values dance with reservedTypes set.\n AssignReservedType: ({ reservedType }: { reservedType: string }) =>\n `Cannot overwrite reserved type ${reservedType}.`,\n DeclareClassElement:\n \"The `declare` modifier can only appear on class fields.\",\n DeclareClassFieldInitializer:\n \"Initializers are not allowed in fields with the `declare` modifier.\",\n DuplicateDeclareModuleExports:\n \"Duplicate `declare module.exports` statement.\",\n EnumBooleanMemberNotInitialized: ({\n memberName,\n enumName,\n }: {\n memberName: string;\n enumName: string;\n }) =>\n `Boolean enum members need to be initialized. Use either \\`${memberName} = true,\\` or \\`${memberName} = false,\\` in enum \\`${enumName}\\`.`,\n EnumDuplicateMemberName: ({\n memberName,\n enumName,\n }: {\n memberName: string;\n enumName: string;\n }) =>\n `Enum member names need to be unique, but the name \\`${memberName}\\` has already been used before in enum \\`${enumName}\\`.`,\n EnumInconsistentMemberValues: ({ enumName }: { enumName: string }) =>\n `Enum \\`${enumName}\\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,\n EnumInvalidExplicitType: ({\n invalidEnumType,\n enumName,\n }: {\n invalidEnumType: string;\n enumName: string;\n }) =>\n `Enum type \\`${invalidEnumType}\\` is not valid. Use one of \\`boolean\\`, \\`number\\`, \\`string\\`, or \\`symbol\\` in enum \\`${enumName}\\`.`,\n EnumInvalidExplicitTypeUnknownSupplied: ({\n enumName,\n }: {\n enumName: string;\n }) =>\n `Supplied enum type is not valid. Use one of \\`boolean\\`, \\`number\\`, \\`string\\`, or \\`symbol\\` in enum \\`${enumName}\\`.`,\n\n // TODO: When moving to typescript, we should either have each of the\n // following errors only accept the specific strings they want:\n //\n // ...PrimaryType: explicitType: \"string\" | \"number\" | \"boolean\"\n // ...SymbolType: explicitType: \"symbol\"\n // ...UnknownType: explicitType: null\n //\n // Or, alternatively, merge these three errors together into one\n // `EnumInvalidMemberInitializer` error that can accept `EnumExplicitType`\n // without alteration, and then just have its message change based on the\n // explicitType.\n EnumInvalidMemberInitializerPrimaryType: ({\n enumName,\n memberName,\n explicitType,\n }: {\n enumName: string;\n memberName: string;\n explicitType: EnumExplicitType;\n }) =>\n `Enum \\`${enumName}\\` has type \\`${explicitType}\\`, so the initializer of \\`${memberName}\\` needs to be a ${explicitType} literal.`,\n EnumInvalidMemberInitializerSymbolType: ({\n enumName,\n memberName,\n }: {\n enumName: string;\n memberName: string;\n explicitType: EnumExplicitType;\n }) =>\n `Symbol enum members cannot be initialized. Use \\`${memberName},\\` in enum \\`${enumName}\\`.`,\n EnumInvalidMemberInitializerUnknownType: ({\n enumName,\n memberName,\n }: {\n enumName: string;\n memberName: string;\n explicitType: EnumExplicitType;\n }) =>\n `The enum member initializer for \\`${memberName}\\` needs to be a literal (either a boolean, number, or string) in enum \\`${enumName}\\`.`,\n EnumInvalidMemberName: ({\n enumName,\n memberName,\n suggestion,\n }: {\n enumName: string;\n memberName: string;\n suggestion: string;\n }) =>\n `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \\`${memberName}\\`, consider using \\`${suggestion}\\`, in enum \\`${enumName}\\`.`,\n EnumNumberMemberNotInitialized: ({\n enumName,\n memberName,\n }: {\n enumName: string;\n memberName: string;\n }) =>\n `Number enum members need to be initialized, e.g. \\`${memberName} = 1\\` in enum \\`${enumName}\\`.`,\n EnumStringMemberInconsistentlyInitailized: ({\n enumName,\n }: {\n enumName: string;\n }) =>\n `String enum members need to consistently either all use initializers, or use no initializers, in enum \\`${enumName}\\`.`,\n GetterMayNotHaveThisParam: \"A getter cannot have a `this` parameter.\",\n ImportReflectionHasImportType:\n \"An `import module` declaration can not use `type` or `typeof` keyword.\",\n ImportTypeShorthandOnlyInPureImport:\n \"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.\",\n InexactInsideExact:\n \"Explicit inexact syntax cannot appear inside an explicit exact object type.\",\n InexactInsideNonObject:\n \"Explicit inexact syntax cannot appear in class or interface definitions.\",\n InexactVariance: \"Explicit inexact syntax cannot have variance.\",\n InvalidNonTypeImportInDeclareModule:\n \"Imports within a `declare module` body must always be `import type` or `import typeof`.\",\n MissingTypeParamDefault:\n \"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.\",\n NestedDeclareModule:\n \"`declare module` cannot be used inside another `declare module`.\",\n NestedFlowComment: \"Cannot have a flow comment inside another flow comment.\",\n PatternIsOptional: {\n message:\n \"A binding pattern parameter cannot be optional in an implementation signature.\",\n // For consistency in TypeScript and Flow error codes\n ...(!process.env.BABEL_8_BREAKING\n ? { reasonCode: \"OptionalBindingPattern\" }\n : {}),\n },\n SetterMayNotHaveThisParam: \"A setter cannot have a `this` parameter.\",\n SpreadVariance: \"Spread properties cannot have variance.\",\n ThisParamAnnotationRequired:\n \"A type annotation is required for the `this` parameter.\",\n ThisParamBannedInConstructor:\n \"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.\",\n ThisParamMayNotBeOptional: \"The `this` parameter cannot be optional.\",\n ThisParamMustBeFirst:\n \"The `this` parameter must be the first function parameter.\",\n ThisParamNoDefault: \"The `this` parameter may not have a default value.\",\n TypeBeforeInitializer:\n \"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.\",\n TypeCastInPattern:\n \"The type cast expression is expected to be wrapped with parenthesis.\",\n UnexpectedExplicitInexactInObject:\n \"Explicit inexact syntax must appear at the end of an inexact object.\",\n UnexpectedReservedType: ({ reservedType }: { reservedType: string }) =>\n `Unexpected reserved type ${reservedType}.`,\n UnexpectedReservedUnderscore:\n \"`_` is only allowed as a type argument to call or new.\",\n UnexpectedSpaceBetweenModuloChecks:\n \"Spaces between `%` and `checks` are not allowed here.\",\n UnexpectedSpreadType:\n \"Spread operator cannot appear in class or interface definitions.\",\n UnexpectedSubtractionOperand:\n 'Unexpected token, expected \"number\" or \"bigint\".',\n UnexpectedTokenAfterTypeParameter:\n \"Expected an arrow function after this type parameter declaration.\",\n UnexpectedTypeParameterBeforeAsyncArrowFunction:\n \"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.\",\n UnsupportedDeclareExportKind: ({\n unsupportedExportKind,\n suggestion,\n }: {\n unsupportedExportKind: string;\n suggestion: string;\n }) =>\n `\\`declare export ${unsupportedExportKind}\\` is not supported. Use \\`${suggestion}\\` instead.`,\n UnsupportedStatementInDeclareModule:\n \"Only declares and type imports are allowed inside declare module.\",\n UnterminatedFlowComment: \"Unterminated flow-comment.\",\n});\n/* eslint-disable sort-keys */\n\nfunction isEsModuleType(bodyElement: N.Node): boolean {\n return (\n bodyElement.type === \"DeclareExportAllDeclaration\" ||\n (bodyElement.type === \"DeclareExportDeclaration\" &&\n (!bodyElement.declaration ||\n (bodyElement.declaration.type !== \"TypeAlias\" &&\n bodyElement.declaration.type !== \"InterfaceDeclaration\")))\n );\n}\n\nfunction hasTypeImportKind(node: N.Node): boolean {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n}\n\nconst exportSuggestions = {\n const: \"declare export var\",\n let: \"declare export var\",\n type: \"export type\",\n interface: \"export interface\",\n};\n\n// Like Array#filter, but returns a tuple [ acceptedElements, discardedElements ]\nfunction partition<T>(\n list: T[],\n test: (c: T, b: number, a: T[]) => boolean | undefined | null,\n): [T[], T[]] {\n const list1: T[] = [];\n const list2: T[] = [];\n for (let i = 0; i < list.length; i++) {\n (test(list[i], i, list) ? list1 : list2).push(list[i]);\n }\n return [list1, list2];\n}\n\nconst FLOW_PRAGMA_REGEX = /\\*?\\s*@((?:no)?flow)\\b/;\n\n// Flow enums types\ntype EnumExplicitType = null | \"boolean\" | \"number\" | \"string\" | \"symbol\";\n\ntype EnumContext = {\n enumName: string;\n explicitType: EnumExplicitType;\n memberName: string;\n};\n\ntype EnumMemberInit =\n | {\n type: \"number\";\n loc: Position;\n value: N.Node;\n }\n | {\n type: \"string\";\n loc: Position;\n value: N.Node;\n }\n | {\n type: \"boolean\";\n loc: Position;\n value: N.Node;\n }\n | {\n type: \"invalid\";\n loc: Position;\n }\n | {\n type: \"none\";\n loc: Position;\n };\n\nexport default (superClass: typeof Parser) =>\n class FlowParserMixin extends superClass implements Parser {\n // The value of the @flow/@noflow pragma. Initially undefined, transitions\n // to \"@flow\" or \"@noflow\" if we see a pragma. Transitions to null if we are\n // past the initial comment.\n flowPragma: void | null | \"flow\" | \"noflow\" = undefined;\n\n getScopeHandler(): {\n new (...args: any): FlowScopeHandler;\n } {\n return FlowScopeHandler;\n }\n\n shouldParseTypes(): boolean {\n return this.getPluginOption(\"flow\", \"all\") || this.flowPragma === \"flow\";\n }\n\n shouldParseEnums(): boolean {\n return !!this.getPluginOption(\"flow\", \"enums\");\n }\n\n finishToken(type: TokenType, val: any): void {\n if (\n type !== tt.string &&\n type !== tt.semi &&\n type !== tt.interpreterDirective\n ) {\n if (this.flowPragma === undefined) {\n this.flowPragma = null;\n }\n }\n super.finishToken(type, val);\n }\n\n addComment(comment: N.Comment): void {\n if (this.flowPragma === undefined) {\n // Try to parse a flow pragma.\n const matches = FLOW_PRAGMA_REGEX.exec(comment.value);\n if (!matches) {\n // do nothing\n } else if (matches[1] === \"flow\") {\n this.flowPragma = \"flow\";\n } else if (matches[1] === \"noflow\") {\n this.flowPragma = \"noflow\";\n } else {\n throw new Error(\"Unexpected flow pragma\");\n }\n }\n super.addComment(comment);\n }\n\n flowParseTypeInitialiser(tok?: TokenType): N.FlowType {\n const oldInType = this.state.inType;\n this.state.inType = true;\n this.expect(tok || tt.colon);\n\n const type = this.flowParseType();\n this.state.inType = oldInType;\n return type;\n }\n\n flowParsePredicate(): N.FlowPredicate {\n const node = this.startNode();\n const moduloLoc = this.state.startLoc;\n this.next(); // eat `%`\n this.expectContextual(tt._checks);\n // Force '%' and 'checks' to be adjacent\n if (this.state.lastTokStart > moduloLoc.index + 1) {\n this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, {\n at: moduloLoc,\n });\n }\n if (this.eat(tt.parenL)) {\n node.value = super.parseExpression();\n this.expect(tt.parenR);\n return this.finishNode(node, \"DeclaredPredicate\");\n } else {\n return this.finishNode(node, \"InferredPredicate\");\n }\n }\n\n flowParseTypeAndPredicateInitialiser(): [\n N.FlowType | undefined | null,\n N.FlowPredicate | undefined | null,\n ] {\n const oldInType = this.state.inType;\n this.state.inType = true;\n this.expect(tt.colon);\n let type = null;\n let predicate = null;\n if (this.match(tt.modulo)) {\n this.state.inType = oldInType;\n predicate = this.flowParsePredicate();\n } else {\n type = this.flowParseType();\n this.state.inType = oldInType;\n if (this.match(tt.modulo)) {\n predicate = this.flowParsePredicate();\n }\n }\n return [type, predicate];\n }\n\n flowParseDeclareClass(\n node: Undone<N.FlowDeclareClass>,\n ): N.FlowDeclareClass {\n this.next();\n this.flowParseInterfaceish(node, /*isClass*/ true);\n return this.finishNode(node, \"DeclareClass\");\n }\n\n flowParseDeclareFunction(\n node: Undone<N.FlowDeclareFunction>,\n ): N.FlowDeclareFunction {\n this.next();\n\n const id = (node.id = this.parseIdentifier());\n\n const typeNode = this.startNode();\n const typeContainer = this.startNode<N.TypeAnnotation>();\n\n if (this.match(tt.lt)) {\n typeNode.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n typeNode.typeParameters = null;\n }\n\n this.expect(tt.parenL);\n const tmp = this.flowParseFunctionTypeParams();\n typeNode.params = tmp.params;\n typeNode.rest = tmp.rest;\n typeNode.this = tmp._this;\n this.expect(tt.parenR);\n\n [typeNode.returnType, node.predicate] =\n this.flowParseTypeAndPredicateInitialiser();\n\n typeContainer.typeAnnotation = this.finishNode(\n typeNode,\n \"FunctionTypeAnnotation\",\n );\n\n id.typeAnnotation = this.finishNode(typeContainer, \"TypeAnnotation\");\n\n this.resetEndLocation(id);\n this.semicolon();\n\n this.scope.declareName(\n node.id.name,\n BIND_FLOW_DECLARE_FN,\n node.id.loc.start,\n );\n\n return this.finishNode(node, \"DeclareFunction\");\n }\n\n flowParseDeclare(\n node: Undone<N.FlowDeclare>,\n insideModule?: boolean,\n ): N.FlowDeclare {\n if (this.match(tt._class)) {\n return this.flowParseDeclareClass(node);\n } else if (this.match(tt._function)) {\n return this.flowParseDeclareFunction(node);\n } else if (this.match(tt._var)) {\n return this.flowParseDeclareVariable(node);\n } else if (this.eatContextual(tt._module)) {\n if (this.match(tt.dot)) {\n return this.flowParseDeclareModuleExports(node);\n } else {\n if (insideModule) {\n this.raise(FlowErrors.NestedDeclareModule, {\n at: this.state.lastTokStartLoc,\n });\n }\n return this.flowParseDeclareModule(node);\n }\n } else if (this.isContextual(tt._type)) {\n return this.flowParseDeclareTypeAlias(node);\n } else if (this.isContextual(tt._opaque)) {\n return this.flowParseDeclareOpaqueType(node);\n } else if (this.isContextual(tt._interface)) {\n return this.flowParseDeclareInterface(node);\n } else if (this.match(tt._export)) {\n return this.flowParseDeclareExportDeclaration(node, insideModule);\n } else {\n this.unexpected();\n }\n }\n\n flowParseDeclareVariable(\n node: Undone<N.FlowDeclareVariable>,\n ): N.FlowDeclareVariable {\n this.next();\n node.id = this.flowParseTypeAnnotatableIdentifier(\n /*allowPrimitiveOverride*/ true,\n );\n this.scope.declareName(node.id.name, BIND_VAR, node.id.loc.start);\n this.semicolon();\n return this.finishNode(node, \"DeclareVariable\");\n }\n\n flowParseDeclareModule(\n node: Undone<N.FlowDeclareModule>,\n ): N.FlowDeclareModule {\n this.scope.enter(SCOPE_OTHER);\n\n if (this.match(tt.string)) {\n node.id = super.parseExprAtom();\n } else {\n node.id = this.parseIdentifier();\n }\n\n const bodyNode = (node.body = this.startNode());\n // @ts-expect-error refine typings\n const body = (bodyNode.body = []);\n this.expect(tt.braceL);\n while (!this.match(tt.braceR)) {\n let bodyNode = this.startNode<N.ImportDeclaration>();\n\n if (this.match(tt._import)) {\n this.next();\n if (!this.isContextual(tt._type) && !this.match(tt._typeof)) {\n this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, {\n at: this.state.lastTokStartLoc,\n });\n }\n super.parseImport(bodyNode);\n } else {\n this.expectContextual(\n tt._declare,\n FlowErrors.UnsupportedStatementInDeclareModule,\n );\n // @ts-expect-error refine typings\n bodyNode = this.flowParseDeclare(bodyNode, true);\n }\n\n body.push(bodyNode);\n }\n\n this.scope.exit();\n\n this.expect(tt.braceR);\n\n this.finishNode(bodyNode, \"BlockStatement\");\n\n let kind: \"CommonJS\" | \"ES\" | null = null;\n let hasModuleExport = false;\n body.forEach(bodyElement => {\n if (isEsModuleType(bodyElement)) {\n if (kind === \"CommonJS\") {\n this.raise(FlowErrors.AmbiguousDeclareModuleKind, {\n at: bodyElement,\n });\n }\n kind = \"ES\";\n } else if (bodyElement.type === \"DeclareModuleExports\") {\n if (hasModuleExport) {\n this.raise(FlowErrors.DuplicateDeclareModuleExports, {\n at: bodyElement,\n });\n }\n if (kind === \"ES\") {\n this.raise(FlowErrors.AmbiguousDeclareModuleKind, {\n at: bodyElement,\n });\n }\n kind = \"CommonJS\";\n hasModuleExport = true;\n }\n });\n\n node.kind = kind || \"CommonJS\";\n return this.finishNode(node, \"DeclareModule\");\n }\n\n flowParseDeclareExportDeclaration(\n node: Undone<N.FlowDeclareExportDeclaration>,\n insideModule?: boolean | null,\n ): N.FlowDeclareExportDeclaration {\n this.expect(tt._export);\n\n if (this.eat(tt._default)) {\n if (this.match(tt._function) || this.match(tt._class)) {\n // declare export default class ...\n // declare export default function ...\n node.declaration = this.flowParseDeclare(this.startNode());\n } else {\n // declare export default [type];\n node.declaration = this.flowParseType();\n this.semicolon();\n }\n node.default = true;\n\n return this.finishNode(node, \"DeclareExportDeclaration\");\n } else {\n if (\n this.match(tt._const) ||\n this.isLet() ||\n ((this.isContextual(tt._type) || this.isContextual(tt._interface)) &&\n !insideModule)\n ) {\n const label = this.state.value as\n | \"const\"\n | \"let\"\n | \"type\"\n | \"interface\";\n throw this.raise(FlowErrors.UnsupportedDeclareExportKind, {\n at: this.state.startLoc,\n unsupportedExportKind: label,\n suggestion: exportSuggestions[label],\n });\n }\n\n if (\n this.match(tt._var) || // declare export var ...\n this.match(tt._function) || // declare export function ...\n this.match(tt._class) || // declare export class ...\n this.isContextual(tt._opaque) // declare export opaque ..\n ) {\n node.declaration = this.flowParseDeclare(this.startNode());\n node.default = false;\n\n return this.finishNode(node, \"DeclareExportDeclaration\");\n } else if (\n this.match(tt.star) || // declare export * from ''\n this.match(tt.braceL) || // declare export {} ...\n this.isContextual(tt._interface) || // declare export interface ...\n this.isContextual(tt._type) || // declare export type ...\n this.isContextual(tt._opaque) // declare export opaque type ...\n ) {\n node = this.parseExport(\n node as Undone<N.ExportNamedDeclaration | N.ExportAllDeclaration>,\n /* decorators */ null,\n );\n if (node.type === \"ExportNamedDeclaration\") {\n node.type = \"ExportDeclaration\";\n node.default = false;\n delete node.exportKind;\n }\n\n node.type = \"Declare\" + node.type;\n\n return node as N.Node;\n }\n }\n\n this.unexpected();\n }\n\n flowParseDeclareModuleExports(\n node: Undone<N.FlowDeclareModuleExports>,\n ): N.FlowDeclareModuleExports {\n this.next();\n this.expectContextual(tt._exports);\n node.typeAnnotation = this.flowParseTypeAnnotation();\n this.semicolon();\n\n return this.finishNode(node, \"DeclareModuleExports\");\n }\n\n flowParseDeclareTypeAlias(\n node: Undone<N.FlowDeclareTypeAlias>,\n ): N.FlowDeclareTypeAlias {\n this.next();\n const finished = this.flowParseTypeAlias(node);\n // Don't do finishNode as we don't want to process comments twice\n finished.type = \"DeclareTypeAlias\";\n return finished;\n }\n\n flowParseDeclareOpaqueType(\n node: Undone<N.FlowDeclareOpaqueType>,\n ): N.FlowDeclareOpaqueType {\n this.next();\n const finished = this.flowParseOpaqueType(node, true);\n // Don't do finishNode as we don't want to process comments twice\n finished.type = \"DeclareOpaqueType\";\n return finished;\n }\n\n flowParseDeclareInterface(\n node: Undone<N.FlowDeclareInterface>,\n ): N.FlowDeclareInterface {\n this.next();\n this.flowParseInterfaceish(node, /* isClass */ false);\n return this.finishNode(node, \"DeclareInterface\");\n }\n\n // Interfaces\n\n flowParseInterfaceish(node: Undone<N.FlowDeclare>, isClass: boolean): void {\n node.id = this.flowParseRestrictedIdentifier(\n /* liberal */ !isClass,\n /* declaration */ true,\n );\n\n this.scope.declareName(\n node.id.name,\n isClass ? BIND_FUNCTION : BIND_LEXICAL,\n node.id.loc.start,\n );\n\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n node.extends = [];\n\n if (this.eat(tt._extends)) {\n do {\n node.extends.push(this.flowParseInterfaceExtends());\n } while (!isClass && this.eat(tt.comma));\n }\n\n if (isClass) {\n node.implements = [];\n node.mixins = [];\n\n if (this.eatContextual(tt._mixins)) {\n do {\n node.mixins.push(this.flowParseInterfaceExtends());\n } while (this.eat(tt.comma));\n }\n\n if (this.eatContextual(tt._implements)) {\n do {\n node.implements.push(this.flowParseInterfaceExtends());\n } while (this.eat(tt.comma));\n }\n }\n\n node.body = this.flowParseObjectType({\n allowStatic: isClass,\n allowExact: false,\n allowSpread: false,\n allowProto: isClass,\n allowInexact: false,\n });\n }\n\n flowParseInterfaceExtends(): N.FlowInterfaceExtends {\n const node = this.startNode();\n\n node.id = this.flowParseQualifiedTypeIdentifier();\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n } else {\n node.typeParameters = null;\n }\n\n return this.finishNode(node, \"InterfaceExtends\");\n }\n\n flowParseInterface(node: Undone<N.FlowInterface>): N.FlowInterface {\n this.flowParseInterfaceish(node, /* isClass */ false);\n return this.finishNode(node, \"InterfaceDeclaration\");\n }\n\n checkNotUnderscore(word: string) {\n if (word === \"_\") {\n this.raise(FlowErrors.UnexpectedReservedUnderscore, {\n at: this.state.startLoc,\n });\n }\n }\n\n checkReservedType(word: string, startLoc: Position, declaration?: boolean) {\n if (!reservedTypes.has(word)) return;\n\n this.raise(\n declaration\n ? FlowErrors.AssignReservedType\n : FlowErrors.UnexpectedReservedType,\n {\n at: startLoc,\n reservedType: word,\n },\n );\n }\n\n flowParseRestrictedIdentifier(\n liberal?: boolean,\n declaration?: boolean,\n ): N.Identifier {\n this.checkReservedType(\n this.state.value,\n this.state.startLoc,\n declaration,\n );\n return this.parseIdentifier(liberal);\n }\n\n // Type aliases\n\n flowParseTypeAlias(node: Undone<N.FlowTypeAlias>): N.FlowTypeAlias {\n node.id = this.flowParseRestrictedIdentifier(\n /* liberal */ false,\n /* declaration */ true,\n );\n this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start);\n\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n node.right = this.flowParseTypeInitialiser(tt.eq);\n this.semicolon();\n\n return this.finishNode(node, \"TypeAlias\");\n }\n\n flowParseOpaqueType(\n node: Undone<N.FlowOpaqueType>,\n declare: boolean,\n ): N.FlowOpaqueType {\n this.expectContextual(tt._type);\n node.id = this.flowParseRestrictedIdentifier(\n /* liberal */ true,\n /* declaration */ true,\n );\n this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start);\n\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n // Parse the supertype\n node.supertype = null;\n if (this.match(tt.colon)) {\n node.supertype = this.flowParseTypeInitialiser(tt.colon);\n }\n\n node.impltype = null;\n if (!declare) {\n node.impltype = this.flowParseTypeInitialiser(tt.eq);\n }\n this.semicolon();\n\n return this.finishNode(node, \"OpaqueType\");\n }\n\n // Type annotations\n\n flowParseTypeParameter(requireDefault: boolean = false): N.TypeParameter {\n const nodeStartLoc = this.state.startLoc;\n\n const node = this.startNode<N.TypeParameter>();\n\n const variance = this.flowParseVariance();\n\n const ident = this.flowParseTypeAnnotatableIdentifier();\n node.name = ident.name;\n // @ts-expect-error migrate to Babel types\n node.variance = variance;\n // @ts-expect-error migrate to Babel types\n node.bound = ident.typeAnnotation;\n\n if (this.match(tt.eq)) {\n this.eat(tt.eq);\n // @ts-expect-error migrate to Babel types\n node.default = this.flowParseType();\n } else {\n if (requireDefault) {\n this.raise(FlowErrors.MissingTypeParamDefault, { at: nodeStartLoc });\n }\n }\n\n return this.finishNode(node, \"TypeParameter\");\n }\n\n flowParseTypeParameterDeclaration(): N.TypeParameterDeclaration {\n const oldInType = this.state.inType;\n const node = this.startNode<N.TypeParameterDeclaration>();\n node.params = [];\n\n this.state.inType = true;\n\n // istanbul ignore else: this condition is already checked at all call sites\n if (this.match(tt.lt) || this.match(tt.jsxTagStart)) {\n this.next();\n } else {\n this.unexpected();\n }\n\n let defaultRequired = false;\n\n do {\n const typeParameter = this.flowParseTypeParameter(defaultRequired);\n\n node.params.push(typeParameter);\n\n if (typeParameter.default) {\n defaultRequired = true;\n }\n\n if (!this.match(tt.gt)) {\n this.expect(tt.comma);\n }\n } while (!this.match(tt.gt));\n this.expect(tt.gt);\n\n this.state.inType = oldInType;\n\n return this.finishNode(node, \"TypeParameterDeclaration\");\n }\n\n flowParseTypeParameterInstantiation(): N.TypeParameterInstantiation {\n const node = this.startNode<N.TypeParameterInstantiation>();\n const oldInType = this.state.inType;\n node.params = [];\n\n this.state.inType = true;\n\n this.expect(tt.lt);\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = false;\n while (!this.match(tt.gt)) {\n node.params.push(this.flowParseType());\n if (!this.match(tt.gt)) {\n this.expect(tt.comma);\n }\n }\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n this.expect(tt.gt);\n\n this.state.inType = oldInType;\n\n return this.finishNode(node, \"TypeParameterInstantiation\");\n }\n\n flowParseTypeParameterInstantiationCallOrNew(): N.TypeParameterInstantiation {\n const node = this.startNode<N.TypeParameterInstantiation>();\n const oldInType = this.state.inType;\n node.params = [];\n\n this.state.inType = true;\n\n this.expect(tt.lt);\n while (!this.match(tt.gt)) {\n node.params.push(this.flowParseTypeOrImplicitInstantiation());\n if (!this.match(tt.gt)) {\n this.expect(tt.comma);\n }\n }\n this.expect(tt.gt);\n\n this.state.inType = oldInType;\n\n return this.finishNode(node, \"TypeParameterInstantiation\");\n }\n\n flowParseInterfaceType(): N.FlowInterfaceType {\n const node = this.startNode<N.FlowInterfaceType>();\n this.expectContextual(tt._interface);\n\n node.extends = [];\n if (this.eat(tt._extends)) {\n do {\n node.extends.push(this.flowParseInterfaceExtends());\n } while (this.eat(tt.comma));\n }\n\n node.body = this.flowParseObjectType({\n allowStatic: false,\n allowExact: false,\n allowSpread: false,\n allowProto: false,\n allowInexact: false,\n });\n\n return this.finishNode(node, \"InterfaceTypeAnnotation\");\n }\n\n flowParseObjectPropertyKey(): N.Expression {\n return this.match(tt.num) || this.match(tt.string)\n ? super.parseExprAtom()\n : this.parseIdentifier(true);\n }\n\n flowParseObjectTypeIndexer(\n node: Undone<N.FlowObjectTypeIndexer>,\n isStatic: boolean,\n variance?: N.FlowVariance | null,\n ): N.FlowObjectTypeIndexer {\n node.static = isStatic;\n\n // Note: bracketL has already been consumed\n if (this.lookahead().type === tt.colon) {\n node.id = this.flowParseObjectPropertyKey();\n node.key = this.flowParseTypeInitialiser();\n } else {\n node.id = null;\n node.key = this.flowParseType();\n }\n this.expect(tt.bracketR);\n node.value = this.flowParseTypeInitialiser();\n node.variance = variance;\n\n return this.finishNode(node, \"ObjectTypeIndexer\");\n }\n\n flowParseObjectTypeInternalSlot(\n node: Undone<N.FlowObjectTypeInternalSlot>,\n isStatic: boolean,\n ): N.FlowObjectTypeInternalSlot {\n node.static = isStatic;\n // Note: both bracketL have already been consumed\n node.id = this.flowParseObjectPropertyKey();\n this.expect(tt.bracketR);\n this.expect(tt.bracketR);\n if (this.match(tt.lt) || this.match(tt.parenL)) {\n node.method = true;\n node.optional = false;\n node.value = this.flowParseObjectTypeMethodish(\n this.startNodeAt(node.loc.start),\n );\n } else {\n node.method = false;\n if (this.eat(tt.question)) {\n node.optional = true;\n }\n node.value = this.flowParseTypeInitialiser();\n }\n return this.finishNode(node, \"ObjectTypeInternalSlot\");\n }\n\n flowParseObjectTypeMethodish(\n node: Undone<N.FlowFunctionTypeAnnotation>,\n ): N.FlowFunctionTypeAnnotation {\n node.params = [];\n node.rest = null;\n node.typeParameters = null;\n node.this = null;\n\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n this.expect(tt.parenL);\n if (this.match(tt._this)) {\n node.this = this.flowParseFunctionTypeParam(/* first */ true);\n // match Flow parser behavior\n node.this.name = null;\n if (!this.match(tt.parenR)) {\n this.expect(tt.comma);\n }\n }\n while (!this.match(tt.parenR) && !this.match(tt.ellipsis)) {\n node.params.push(this.flowParseFunctionTypeParam(false));\n if (!this.match(tt.parenR)) {\n this.expect(tt.comma);\n }\n }\n\n if (this.eat(tt.ellipsis)) {\n node.rest = this.flowParseFunctionTypeParam(false);\n }\n this.expect(tt.parenR);\n node.returnType = this.flowParseTypeInitialiser();\n\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n\n flowParseObjectTypeCallProperty(\n node: Undone<N.FlowObjectTypeCallProperty>,\n isStatic: boolean,\n ): N.FlowObjectTypeCallProperty {\n const valueNode = this.startNode();\n node.static = isStatic;\n node.value = this.flowParseObjectTypeMethodish(valueNode);\n return this.finishNode(node, \"ObjectTypeCallProperty\");\n }\n\n flowParseObjectType({\n allowStatic,\n allowExact,\n allowSpread,\n allowProto,\n allowInexact,\n }: {\n allowStatic: boolean;\n allowExact: boolean;\n allowSpread: boolean;\n allowProto: boolean;\n allowInexact: boolean;\n }): N.FlowObjectTypeAnnotation {\n const oldInType = this.state.inType;\n this.state.inType = true;\n\n const nodeStart = this.startNode();\n\n nodeStart.callProperties = [];\n nodeStart.properties = [];\n nodeStart.indexers = [];\n nodeStart.internalSlots = [];\n\n let endDelim;\n let exact;\n let inexact = false;\n if (allowExact && this.match(tt.braceBarL)) {\n this.expect(tt.braceBarL);\n endDelim = tt.braceBarR;\n exact = true;\n } else {\n this.expect(tt.braceL);\n endDelim = tt.braceR;\n exact = false;\n }\n\n nodeStart.exact = exact;\n\n while (!this.match(endDelim)) {\n let isStatic = false;\n let protoStartLoc: Position | undefined | null = null;\n let inexactStartLoc: Position | undefined | null = null;\n const node = this.startNode();\n\n if (allowProto && this.isContextual(tt._proto)) {\n const lookahead = this.lookahead();\n\n if (lookahead.type !== tt.colon && lookahead.type !== tt.question) {\n this.next();\n protoStartLoc = this.state.startLoc;\n allowStatic = false;\n }\n }\n\n if (allowStatic && this.isContextual(tt._static)) {\n const lookahead = this.lookahead();\n\n // static is a valid identifier name\n if (lookahead.type !== tt.colon && lookahead.type !== tt.question) {\n this.next();\n isStatic = true;\n }\n }\n\n const variance = this.flowParseVariance();\n\n if (this.eat(tt.bracketL)) {\n if (protoStartLoc != null) {\n this.unexpected(protoStartLoc);\n }\n if (this.eat(tt.bracketL)) {\n if (variance) {\n this.unexpected(variance.loc.start);\n }\n nodeStart.internalSlots.push(\n this.flowParseObjectTypeInternalSlot(node, isStatic),\n );\n } else {\n nodeStart.indexers.push(\n this.flowParseObjectTypeIndexer(node, isStatic, variance),\n );\n }\n } else if (this.match(tt.parenL) || this.match(tt.lt)) {\n if (protoStartLoc != null) {\n this.unexpected(protoStartLoc);\n }\n if (variance) {\n this.unexpected(variance.loc.start);\n }\n nodeStart.callProperties.push(\n this.flowParseObjectTypeCallProperty(node, isStatic),\n );\n } else {\n let kind = \"init\";\n\n if (this.isContextual(tt._get) || this.isContextual(tt._set)) {\n const lookahead = this.lookahead();\n if (tokenIsLiteralPropertyName(lookahead.type)) {\n kind = this.state.value;\n this.next();\n }\n }\n\n const propOrInexact = this.flowParseObjectTypeProperty(\n node,\n isStatic,\n protoStartLoc,\n variance,\n kind,\n allowSpread,\n allowInexact ?? !exact,\n );\n\n if (propOrInexact === null) {\n inexact = true;\n inexactStartLoc = this.state.lastTokStartLoc;\n } else {\n nodeStart.properties.push(propOrInexact);\n }\n }\n\n this.flowObjectTypeSemicolon();\n\n if (\n inexactStartLoc &&\n !this.match(tt.braceR) &&\n !this.match(tt.braceBarR)\n ) {\n this.raise(FlowErrors.UnexpectedExplicitInexactInObject, {\n at: inexactStartLoc,\n });\n }\n }\n\n this.expect(endDelim);\n\n /* The inexact flag should only be added on ObjectTypeAnnotations that\n * are not the body of an interface, declare interface, or declare class.\n * Since spreads are only allowed in object types, checking that is\n * sufficient here.\n */\n if (allowSpread) {\n nodeStart.inexact = inexact;\n }\n\n const out = this.finishNode(nodeStart, \"ObjectTypeAnnotation\");\n\n this.state.inType = oldInType;\n\n return out;\n }\n\n flowParseObjectTypeProperty(\n node: Undone<N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty>,\n isStatic: boolean,\n protoStartLoc: Position | undefined | null,\n variance: N.FlowVariance | undefined | null,\n kind: string,\n allowSpread: boolean,\n allowInexact: boolean,\n ): N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty | null {\n if (this.eat(tt.ellipsis)) {\n const isInexactToken =\n this.match(tt.comma) ||\n this.match(tt.semi) ||\n this.match(tt.braceR) ||\n this.match(tt.braceBarR);\n\n if (isInexactToken) {\n if (!allowSpread) {\n this.raise(FlowErrors.InexactInsideNonObject, {\n at: this.state.lastTokStartLoc,\n });\n } else if (!allowInexact) {\n this.raise(FlowErrors.InexactInsideExact, {\n at: this.state.lastTokStartLoc,\n });\n }\n if (variance) {\n this.raise(FlowErrors.InexactVariance, { at: variance });\n }\n\n return null;\n }\n\n if (!allowSpread) {\n this.raise(FlowErrors.UnexpectedSpreadType, {\n at: this.state.lastTokStartLoc,\n });\n }\n if (protoStartLoc != null) {\n this.unexpected(protoStartLoc);\n }\n if (variance) {\n this.raise(FlowErrors.SpreadVariance, { at: variance });\n }\n\n node.argument = this.flowParseType();\n return this.finishNode(node, \"ObjectTypeSpreadProperty\");\n } else {\n node.key = this.flowParseObjectPropertyKey();\n node.static = isStatic;\n node.proto = protoStartLoc != null;\n node.kind = kind;\n\n let optional = false;\n if (this.match(tt.lt) || this.match(tt.parenL)) {\n // This is a method property\n node.method = true;\n\n if (protoStartLoc != null) {\n this.unexpected(protoStartLoc);\n }\n if (variance) {\n this.unexpected(variance.loc.start);\n }\n\n node.value = this.flowParseObjectTypeMethodish(\n this.startNodeAt(node.loc.start),\n );\n if (kind === \"get\" || kind === \"set\") {\n this.flowCheckGetterSetterParams(node);\n }\n /** Declared classes/interfaces do not allow spread */\n if (\n !allowSpread &&\n node.key.name === \"constructor\" &&\n node.value.this\n ) {\n this.raise(FlowErrors.ThisParamBannedInConstructor, {\n at: node.value.this,\n });\n }\n } else {\n if (kind !== \"init\") this.unexpected();\n\n node.method = false;\n\n if (this.eat(tt.question)) {\n optional = true;\n }\n node.value = this.flowParseTypeInitialiser();\n node.variance = variance;\n }\n\n node.optional = optional;\n\n return this.finishNode(node, \"ObjectTypeProperty\");\n }\n }\n\n // This is similar to checkGetterSetterParams, but as\n // @babel/parser uses non estree properties we cannot reuse it here\n flowCheckGetterSetterParams(\n property: Undone<\n N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty\n >,\n ): void {\n const paramCount = property.kind === \"get\" ? 0 : 1;\n const length =\n property.value.params.length + (property.value.rest ? 1 : 0);\n\n if (property.value.this) {\n this.raise(\n property.kind === \"get\"\n ? FlowErrors.GetterMayNotHaveThisParam\n : FlowErrors.SetterMayNotHaveThisParam,\n { at: property.value.this },\n );\n }\n\n if (length !== paramCount) {\n this.raise(\n property.kind === \"get\"\n ? Errors.BadGetterArity\n : Errors.BadSetterArity,\n { at: property },\n );\n }\n\n if (property.kind === \"set\" && property.value.rest) {\n this.raise(Errors.BadSetterRestParameter, { at: property });\n }\n }\n\n flowObjectTypeSemicolon(): void {\n if (\n !this.eat(tt.semi) &&\n !this.eat(tt.comma) &&\n !this.match(tt.braceR) &&\n !this.match(tt.braceBarR)\n ) {\n this.unexpected();\n }\n }\n\n flowParseQualifiedTypeIdentifier(\n startLoc?: Position,\n id?: N.Identifier,\n ): N.FlowQualifiedTypeIdentifier {\n startLoc ??= this.state.startLoc;\n let node: N.Identifier | N.FlowQualifiedTypeIdentifier =\n id || this.flowParseRestrictedIdentifier(true);\n\n while (this.eat(tt.dot)) {\n const node2 = this.startNodeAt<N.FlowQualifiedTypeIdentifier>(startLoc);\n node2.qualification = node;\n node2.id = this.flowParseRestrictedIdentifier(true);\n node = this.finishNode(node2, \"QualifiedTypeIdentifier\");\n }\n\n return node;\n }\n\n flowParseGenericType(\n startLoc: Position,\n id: N.Identifier,\n ): N.FlowGenericTypeAnnotation {\n const node = this.startNodeAt(startLoc);\n\n node.typeParameters = null;\n node.id = this.flowParseQualifiedTypeIdentifier(startLoc, id);\n\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n }\n\n return this.finishNode(node, \"GenericTypeAnnotation\");\n }\n\n flowParseTypeofType(): N.FlowTypeofTypeAnnotation {\n const node = this.startNode();\n this.expect(tt._typeof);\n node.argument = this.flowParsePrimaryType();\n return this.finishNode(node, \"TypeofTypeAnnotation\");\n }\n\n flowParseTupleType(): N.FlowTupleTypeAnnotation {\n const node = this.startNode();\n node.types = [];\n this.expect(tt.bracketL);\n // We allow trailing commas\n while (this.state.pos < this.length && !this.match(tt.bracketR)) {\n node.types.push(this.flowParseType());\n if (this.match(tt.bracketR)) break;\n this.expect(tt.comma);\n }\n this.expect(tt.bracketR);\n return this.finishNode(node, \"TupleTypeAnnotation\");\n }\n\n flowParseFunctionTypeParam(first: boolean): N.FlowFunctionTypeParam {\n let name = null;\n let optional = false;\n let typeAnnotation = null;\n const node = this.startNode<N.FlowFunctionTypeParam>();\n const lh = this.lookahead();\n const isThis = this.state.type === tt._this;\n\n if (lh.type === tt.colon || lh.type === tt.question) {\n if (isThis && !first) {\n this.raise(FlowErrors.ThisParamMustBeFirst, { at: node });\n }\n name = this.parseIdentifier(isThis);\n if (this.eat(tt.question)) {\n optional = true;\n if (isThis) {\n this.raise(FlowErrors.ThisParamMayNotBeOptional, { at: node });\n }\n }\n typeAnnotation = this.flowParseTypeInitialiser();\n } else {\n typeAnnotation = this.flowParseType();\n }\n node.name = name;\n node.optional = optional;\n node.typeAnnotation = typeAnnotation;\n return this.finishNode(node, \"FunctionTypeParam\");\n }\n\n reinterpretTypeAsFunctionTypeParam(\n type: N.FlowType,\n ): N.FlowFunctionTypeParam {\n const node = this.startNodeAt(type.loc.start);\n node.name = null;\n node.optional = false;\n node.typeAnnotation = type;\n return this.finishNode(node, \"FunctionTypeParam\");\n }\n\n flowParseFunctionTypeParams(params: N.FlowFunctionTypeParam[] = []): {\n params: N.FlowFunctionTypeParam[];\n rest: N.FlowFunctionTypeParam | undefined | null;\n _this: N.FlowFunctionTypeParam | undefined | null;\n } {\n let rest: N.FlowFunctionTypeParam | undefined | null = null;\n let _this: N.FlowFunctionTypeParam | undefined | null = null;\n if (this.match(tt._this)) {\n _this = this.flowParseFunctionTypeParam(/* first */ true);\n // match Flow parser behavior\n _this.name = null;\n if (!this.match(tt.parenR)) {\n this.expect(tt.comma);\n }\n }\n while (!this.match(tt.parenR) && !this.match(tt.ellipsis)) {\n params.push(this.flowParseFunctionTypeParam(false));\n if (!this.match(tt.parenR)) {\n this.expect(tt.comma);\n }\n }\n if (this.eat(tt.ellipsis)) {\n rest = this.flowParseFunctionTypeParam(false);\n }\n return { params, rest, _this };\n }\n\n flowIdentToTypeAnnotation(\n startLoc: Position,\n node: Undone<N.FlowTypeAnnotation>,\n id: N.Identifier,\n ): N.FlowTypeAnnotation {\n switch (id.name) {\n case \"any\":\n return this.finishNode(node, \"AnyTypeAnnotation\");\n\n case \"bool\":\n case \"boolean\":\n return this.finishNode(node, \"BooleanTypeAnnotation\");\n\n case \"mixed\":\n return this.finishNode(node, \"MixedTypeAnnotation\");\n\n case \"empty\":\n return this.finishNode(node, \"EmptyTypeAnnotation\");\n\n case \"number\":\n return this.finishNode(node, \"NumberTypeAnnotation\");\n\n case \"string\":\n return this.finishNode(node, \"StringTypeAnnotation\");\n\n case \"symbol\":\n return this.finishNode(node, \"SymbolTypeAnnotation\");\n\n default:\n this.checkNotUnderscore(id.name);\n return this.flowParseGenericType(startLoc, id);\n }\n }\n\n // The parsing of types roughly parallels the parsing of expressions, and\n // primary types are kind of like primary expressions...they're the\n // primitives with which other types are constructed.\n flowParsePrimaryType(): N.FlowTypeAnnotation {\n const startLoc = this.state.startLoc;\n const node = this.startNode();\n let tmp;\n let type;\n let isGroupedType = false;\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n\n switch (this.state.type) {\n case tt.braceL:\n return this.flowParseObjectType({\n allowStatic: false,\n allowExact: false,\n allowSpread: true,\n allowProto: false,\n allowInexact: true,\n });\n\n case tt.braceBarL:\n return this.flowParseObjectType({\n allowStatic: false,\n allowExact: true,\n allowSpread: true,\n allowProto: false,\n allowInexact: false,\n });\n\n case tt.bracketL:\n this.state.noAnonFunctionType = false;\n type = this.flowParseTupleType();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n return type;\n\n case tt.lt:\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n this.expect(tt.parenL);\n tmp = this.flowParseFunctionTypeParams();\n node.params = tmp.params;\n node.rest = tmp.rest;\n node.this = tmp._this;\n this.expect(tt.parenR);\n\n this.expect(tt.arrow);\n\n node.returnType = this.flowParseType();\n\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n\n case tt.parenL:\n this.next();\n\n // Check to see if this is actually a grouped type\n if (!this.match(tt.parenR) && !this.match(tt.ellipsis)) {\n if (tokenIsIdentifier(this.state.type) || this.match(tt._this)) {\n const token = this.lookahead().type;\n isGroupedType = token !== tt.question && token !== tt.colon;\n } else {\n isGroupedType = true;\n }\n }\n\n if (isGroupedType) {\n this.state.noAnonFunctionType = false;\n type = this.flowParseType();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n\n // A `,` or a `) =>` means this is an anonymous function type\n if (\n this.state.noAnonFunctionType ||\n !(\n this.match(tt.comma) ||\n (this.match(tt.parenR) && this.lookahead().type === tt.arrow)\n )\n ) {\n this.expect(tt.parenR);\n return type;\n } else {\n // Eat a comma if there is one\n this.eat(tt.comma);\n }\n }\n\n if (type) {\n tmp = this.flowParseFunctionTypeParams([\n this.reinterpretTypeAsFunctionTypeParam(type),\n ]);\n } else {\n tmp = this.flowParseFunctionTypeParams();\n }\n\n node.params = tmp.params;\n node.rest = tmp.rest;\n node.this = tmp._this;\n\n this.expect(tt.parenR);\n\n this.expect(tt.arrow);\n\n node.returnType = this.flowParseType();\n\n node.typeParameters = null;\n\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n\n case tt.string:\n return this.parseLiteral<N.StringLiteralTypeAnnotation>(\n this.state.value,\n \"StringLiteralTypeAnnotation\",\n );\n\n case tt._true:\n case tt._false:\n node.value = this.match(tt._true);\n this.next();\n return this.finishNode(\n node as Undone<N.BooleanLiteralTypeAnnotation>,\n \"BooleanLiteralTypeAnnotation\",\n );\n\n case tt.plusMin:\n if (this.state.value === \"-\") {\n this.next();\n if (this.match(tt.num)) {\n return this.parseLiteralAtNode<N.NumberLiteralTypeAnnotation>(\n -this.state.value,\n \"NumberLiteralTypeAnnotation\",\n node,\n );\n }\n\n if (this.match(tt.bigint)) {\n return this.parseLiteralAtNode<N.BigIntLiteralTypeAnnotation>(\n -this.state.value,\n \"BigIntLiteralTypeAnnotation\",\n node,\n );\n }\n\n throw this.raise(FlowErrors.UnexpectedSubtractionOperand, {\n at: this.state.startLoc,\n });\n }\n this.unexpected();\n return;\n case tt.num:\n return this.parseLiteral(\n this.state.value,\n \"NumberLiteralTypeAnnotation\",\n );\n\n case tt.bigint:\n return this.parseLiteral(\n this.state.value,\n \"BigIntLiteralTypeAnnotation\",\n );\n\n case tt._void:\n this.next();\n return this.finishNode(node, \"VoidTypeAnnotation\");\n\n case tt._null:\n this.next();\n return this.finishNode(node, \"NullLiteralTypeAnnotation\");\n\n case tt._this:\n this.next();\n return this.finishNode(node, \"ThisTypeAnnotation\");\n\n case tt.star:\n this.next();\n return this.finishNode(node, \"ExistsTypeAnnotation\");\n\n case tt._typeof:\n return this.flowParseTypeofType();\n\n default:\n if (tokenIsKeyword(this.state.type)) {\n const label = tokenLabelName(this.state.type);\n this.next();\n return super.createIdentifier(node as Undone<N.Identifier>, label);\n } else if (tokenIsIdentifier(this.state.type)) {\n if (this.isContextual(tt._interface)) {\n return this.flowParseInterfaceType();\n }\n\n return this.flowIdentToTypeAnnotation(\n startLoc,\n node,\n this.parseIdentifier(),\n );\n }\n }\n\n this.unexpected();\n }\n\n flowParsePostfixType(): N.FlowTypeAnnotation {\n const startLoc = this.state.startLoc;\n let type = this.flowParsePrimaryType();\n let seenOptionalIndexedAccess = false;\n while (\n (this.match(tt.bracketL) || this.match(tt.questionDot)) &&\n !this.canInsertSemicolon()\n ) {\n const node = this.startNodeAt(startLoc);\n const optional = this.eat(tt.questionDot);\n seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional;\n this.expect(tt.bracketL);\n if (!optional && this.match(tt.bracketR)) {\n node.elementType = type;\n this.next(); // eat `]`\n type = this.finishNode(node, \"ArrayTypeAnnotation\");\n } else {\n node.objectType = type;\n node.indexType = this.flowParseType();\n this.expect(tt.bracketR);\n if (seenOptionalIndexedAccess) {\n node.optional = optional;\n type = this.finishNode<N.FlowOptionalIndexedAccessType>(\n // @ts-expect-error todo(flow->ts)\n node,\n \"OptionalIndexedAccessType\",\n );\n } else {\n type = this.finishNode<N.FlowIndexedAccessType>(\n // @ts-expect-error todo(flow->ts)\n node,\n \"IndexedAccessType\",\n );\n }\n }\n }\n return type;\n }\n\n flowParsePrefixType(): N.FlowTypeAnnotation {\n const node = this.startNode();\n if (this.eat(tt.question)) {\n node.typeAnnotation = this.flowParsePrefixType();\n return this.finishNode(node, \"NullableTypeAnnotation\");\n } else {\n return this.flowParsePostfixType();\n }\n }\n\n flowParseAnonFunctionWithoutParens(): N.FlowTypeAnnotation {\n const param = this.flowParsePrefixType();\n if (!this.state.noAnonFunctionType && this.eat(tt.arrow)) {\n // TODO: This should be a type error. Passing in a SourceLocation, and it expects a Position.\n const node = this.startNodeAt(param.loc.start);\n node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];\n node.rest = null;\n node.this = null;\n node.returnType = this.flowParseType();\n node.typeParameters = null;\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n return param;\n }\n\n flowParseIntersectionType(): N.FlowTypeAnnotation {\n const node = this.startNode();\n this.eat(tt.bitwiseAND);\n const type = this.flowParseAnonFunctionWithoutParens();\n node.types = [type];\n while (this.eat(tt.bitwiseAND)) {\n node.types.push(this.flowParseAnonFunctionWithoutParens());\n }\n return node.types.length === 1\n ? type\n : this.finishNode(node, \"IntersectionTypeAnnotation\");\n }\n\n flowParseUnionType(): N.FlowTypeAnnotation {\n const node = this.startNode();\n this.eat(tt.bitwiseOR);\n const type = this.flowParseIntersectionType();\n node.types = [type];\n while (this.eat(tt.bitwiseOR)) {\n node.types.push(this.flowParseIntersectionType());\n }\n return node.types.length === 1\n ? type\n : this.finishNode(node, \"UnionTypeAnnotation\");\n }\n\n flowParseType(): N.FlowTypeAnnotation {\n const oldInType = this.state.inType;\n this.state.inType = true;\n const type = this.flowParseUnionType();\n this.state.inType = oldInType;\n return type;\n }\n\n flowParseTypeOrImplicitInstantiation(): N.FlowTypeAnnotation {\n if (this.state.type === tt.name && this.state.value === \"_\") {\n const startLoc = this.state.startLoc;\n const node = this.parseIdentifier();\n return this.flowParseGenericType(startLoc, node);\n } else {\n return this.flowParseType();\n }\n }\n\n flowParseTypeAnnotation(): N.FlowTypeAnnotation {\n const node = this.startNode<N.FlowTypeAnnotation>();\n node.typeAnnotation = this.flowParseTypeInitialiser();\n return this.finishNode(node, \"TypeAnnotation\");\n }\n\n flowParseTypeAnnotatableIdentifier(\n allowPrimitiveOverride?: boolean,\n ): N.Identifier {\n const ident = allowPrimitiveOverride\n ? this.parseIdentifier()\n : this.flowParseRestrictedIdentifier();\n if (this.match(tt.colon)) {\n // @ts-expect-error: refine typings\n ident.typeAnnotation = this.flowParseTypeAnnotation();\n this.resetEndLocation(ident);\n }\n return ident;\n }\n\n typeCastToParameter(node: N.Node): N.Node {\n node.expression.typeAnnotation = node.typeAnnotation;\n\n this.resetEndLocation(node.expression, node.typeAnnotation.loc.end);\n\n return node.expression;\n }\n\n flowParseVariance(): N.FlowVariance | undefined | null {\n let variance = null;\n if (this.match(tt.plusMin)) {\n variance = this.startNode<N.FlowVariance>();\n if (this.state.value === \"+\") {\n variance.kind = \"plus\";\n } else {\n variance.kind = \"minus\";\n }\n this.next();\n return this.finishNode(variance, \"Variance\");\n }\n return variance;\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n parseFunctionBody(\n node: N.Function,\n allowExpressionBody?: boolean | null,\n isMethod: boolean = false,\n ): void {\n if (allowExpressionBody) {\n this.forwardNoArrowParamsConversionAt(node, () =>\n super.parseFunctionBody(node, true, isMethod),\n );\n return;\n }\n\n super.parseFunctionBody(node, false, isMethod);\n }\n\n parseFunctionBodyAndFinish<\n T extends\n | N.Function\n | N.TSDeclareMethod\n | N.TSDeclareFunction\n | N.ClassPrivateMethod,\n >(node: Undone<T>, type: T[\"type\"], isMethod: boolean = false): T {\n if (this.match(tt.colon)) {\n const typeNode = this.startNode<N.TypeAnnotation>();\n\n [\n typeNode.typeAnnotation,\n // @ts-expect-error predicate may not exist\n node.predicate,\n ] = this.flowParseTypeAndPredicateInitialiser();\n\n node.returnType = typeNode.typeAnnotation\n ? this.finishNode(typeNode, \"TypeAnnotation\")\n : null;\n }\n\n return super.parseFunctionBodyAndFinish(node, type, isMethod);\n }\n\n // interfaces and enums\n parseStatementLike(flags: ParseStatementFlag): N.Statement {\n // strict mode handling of `interface` since it's a reserved word\n if (this.state.strict && this.isContextual(tt._interface)) {\n const lookahead = this.lookahead();\n if (tokenIsKeywordOrIdentifier(lookahead.type)) {\n const node = this.startNode<N.FlowInterface>();\n this.next();\n return this.flowParseInterface(node);\n }\n } else if (this.shouldParseEnums() && this.isContextual(tt._enum)) {\n const node = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(node);\n }\n const stmt = super.parseStatementLike(flags);\n // We will parse a flow pragma in any comment before the first statement.\n if (this.flowPragma === undefined && !this.isValidDirective(stmt)) {\n this.flowPragma = null;\n }\n return stmt;\n }\n\n // declares, interfaces and type aliases\n parseExpressionStatement(\n node: N.ExpressionStatement,\n expr: N.Expression,\n decorators: N.Decorator[] | null,\n ): N.ExpressionStatement {\n if (expr.type === \"Identifier\") {\n if (expr.name === \"declare\") {\n if (\n this.match(tt._class) ||\n tokenIsIdentifier(this.state.type) ||\n this.match(tt._function) ||\n this.match(tt._var) ||\n this.match(tt._export)\n ) {\n // @ts-expect-error: refine typings\n return this.flowParseDeclare(node);\n }\n } else if (tokenIsIdentifier(this.state.type)) {\n if (expr.name === \"interface\") {\n // @ts-expect-error: refine typings\n return this.flowParseInterface(node);\n } else if (expr.name === \"type\") {\n // @ts-expect-error: refine typings\n return this.flowParseTypeAlias(node);\n } else if (expr.name === \"opaque\") {\n // @ts-expect-error: refine typings\n return this.flowParseOpaqueType(node, false);\n }\n }\n }\n\n return super.parseExpressionStatement(node, expr, decorators);\n }\n\n // export type\n shouldParseExportDeclaration(): boolean {\n const { type } = this.state;\n if (\n tokenIsFlowInterfaceOrTypeOrOpaque(type) ||\n (this.shouldParseEnums() && type === tt._enum)\n ) {\n return !this.state.containsEsc;\n }\n return super.shouldParseExportDeclaration();\n }\n\n isExportDefaultSpecifier(): boolean {\n const { type } = this.state;\n if (\n tokenIsFlowInterfaceOrTypeOrOpaque(type) ||\n (this.shouldParseEnums() && type === tt._enum)\n ) {\n return this.state.containsEsc;\n }\n\n return super.isExportDefaultSpecifier();\n }\n\n parseExportDefaultExpression(): N.Expression | N.Declaration {\n if (this.shouldParseEnums() && this.isContextual(tt._enum)) {\n const node = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(node);\n }\n return super.parseExportDefaultExpression();\n }\n\n parseConditional(\n expr: N.Expression,\n\n startLoc: Position,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.Expression {\n if (!this.match(tt.question)) return expr;\n\n if (this.state.maybeInArrowParameters) {\n const nextCh = this.lookaheadCharCode();\n // These tokens cannot start an expression, so if one of them follows\n // ? then we are probably in an arrow function parameters list and we\n // don't parse the conditional expression.\n if (\n nextCh === charCodes.comma || // (a?, b) => c\n nextCh === charCodes.equalsTo || // (a? = b) => c\n nextCh === charCodes.colon || // (a?: b) => c\n nextCh === charCodes.rightParenthesis // (a?) => c\n ) {\n /*:: invariant(refExpressionErrors != null) */\n this.setOptionalParametersError(refExpressionErrors);\n return expr;\n }\n }\n\n this.expect(tt.question);\n const state = this.state.clone();\n const originalNoArrowAt = this.state.noArrowAt;\n const node = this.startNodeAt(startLoc);\n let { consequent, failed } = this.tryParseConditionalConsequent();\n let [valid, invalid] = this.getArrowLikeExpressions(consequent);\n\n if (failed || invalid.length > 0) {\n const noArrowAt = [...originalNoArrowAt];\n\n if (invalid.length > 0) {\n this.state = state;\n this.state.noArrowAt = noArrowAt;\n\n for (let i = 0; i < invalid.length; i++) {\n noArrowAt.push(invalid[i].start);\n }\n\n ({ consequent, failed } = this.tryParseConditionalConsequent());\n [valid, invalid] = this.getArrowLikeExpressions(consequent);\n }\n\n if (failed && valid.length > 1) {\n // if there are two or more possible correct ways of parsing, throw an\n // error.\n // e.g. Source: a ? (b): c => (d): e => f\n // Result 1: a ? b : (c => ((d): e => f))\n // Result 2: a ? ((b): c => d) : (e => f)\n this.raise(FlowErrors.AmbiguousConditionalArrow, {\n at: state.startLoc,\n });\n }\n\n if (failed && valid.length === 1) {\n this.state = state;\n noArrowAt.push(valid[0].start);\n this.state.noArrowAt = noArrowAt;\n ({ consequent, failed } = this.tryParseConditionalConsequent());\n }\n }\n\n this.getArrowLikeExpressions(consequent, true);\n\n this.state.noArrowAt = originalNoArrowAt;\n this.expect(tt.colon);\n\n node.test = expr;\n node.consequent = consequent;\n node.alternate = this.forwardNoArrowParamsConversionAt(node, () =>\n this.parseMaybeAssign(undefined, undefined),\n );\n\n return this.finishNode(node, \"ConditionalExpression\");\n }\n\n tryParseConditionalConsequent(): {\n consequent: N.Expression;\n failed: boolean;\n } {\n this.state.noArrowParamsConversionAt.push(this.state.start);\n\n const consequent = this.parseMaybeAssignAllowIn();\n const failed = !this.match(tt.colon);\n\n this.state.noArrowParamsConversionAt.pop();\n\n return { consequent, failed };\n }\n\n // Given an expression, walks through out its arrow functions whose body is\n // an expression and through out conditional expressions. It returns every\n // function which has been parsed with a return type but could have been\n // parenthesized expressions.\n // These functions are separated into two arrays: one containing the ones\n // whose parameters can be converted to assignable lists, one containing the\n // others.\n getArrowLikeExpressions(\n node: N.Expression,\n disallowInvalid?: boolean,\n ): [N.ArrowFunctionExpression[], N.ArrowFunctionExpression[]] {\n const stack = [node];\n const arrows: N.ArrowFunctionExpression[] = [];\n\n while (stack.length !== 0) {\n const node = stack.pop();\n if (node.type === \"ArrowFunctionExpression\") {\n if (node.typeParameters || !node.returnType) {\n // This is an arrow expression without ambiguity, so check its parameters\n // @ts-expect-error: refine typings\n this.finishArrowValidation(node);\n } else {\n // @ts-expect-error: refine typings\n arrows.push(node);\n }\n stack.push(node.body);\n } else if (node.type === \"ConditionalExpression\") {\n stack.push(node.consequent);\n stack.push(node.alternate);\n }\n }\n\n if (disallowInvalid) {\n arrows.forEach(node => this.finishArrowValidation(node));\n return [arrows, []];\n }\n\n return partition(arrows, node =>\n node.params.every(param => this.isAssignable(param, true)),\n );\n }\n\n finishArrowValidation(node: N.ArrowFunctionExpression) {\n this.toAssignableList(\n // node.params is Expression[] instead of $ReadOnlyArray<Pattern> because it\n // has not been converted yet.\n node.params as any as N.Expression[],\n node.extra?.trailingCommaLoc,\n /* isLHS */ false,\n );\n // Enter scope, as checkParams defines bindings\n this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);\n // Use super's method to force the parameters to be checked\n super.checkParams(node, false, true);\n this.scope.exit();\n }\n\n forwardNoArrowParamsConversionAt<T>(\n node: Undone<N.Node>,\n parse: () => T,\n ): T {\n let result: T;\n if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {\n this.state.noArrowParamsConversionAt.push(this.state.start);\n result = parse();\n this.state.noArrowParamsConversionAt.pop();\n } else {\n result = parse();\n }\n\n return result;\n }\n\n parseParenItem(\n node: N.Expression,\n\n startLoc: Position,\n ): N.Expression {\n node = super.parseParenItem(node, startLoc);\n if (this.eat(tt.question)) {\n node.optional = true;\n // Include questionmark in location of node\n // Don't use this.finishNode() as otherwise we might process comments twice and\n // include already consumed parens\n this.resetEndLocation(node);\n }\n\n if (this.match(tt.colon)) {\n const typeCastNode = this.startNodeAt(startLoc);\n typeCastNode.expression = node;\n typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();\n\n return this.finishNode(typeCastNode, \"TypeCastExpression\");\n }\n\n return node;\n }\n\n assertModuleNodeAllowed(node: N.Node) {\n if (\n (node.type === \"ImportDeclaration\" &&\n (node.importKind === \"type\" || node.importKind === \"typeof\")) ||\n (node.type === \"ExportNamedDeclaration\" &&\n node.exportKind === \"type\") ||\n (node.type === \"ExportAllDeclaration\" && node.exportKind === \"type\")\n ) {\n // Allow Flowtype imports and exports in all conditions because\n // Flow itself does not care about 'sourceType'.\n return;\n }\n\n super.assertModuleNodeAllowed(node);\n }\n\n parseExportDeclaration(\n node: N.ExportNamedDeclaration,\n ): N.Declaration | undefined | null {\n if (this.isContextual(tt._type)) {\n node.exportKind = \"type\";\n\n const declarationNode = this.startNode();\n this.next();\n\n if (this.match(tt.braceL)) {\n // export type { foo, bar };\n node.specifiers = this.parseExportSpecifiers(\n /* isInTypeExport */ true,\n );\n super.parseExportFrom(node);\n return null;\n } else {\n // export type Foo = Bar;\n // @ts-expect-error: refine typings\n return this.flowParseTypeAlias(declarationNode);\n }\n } else if (this.isContextual(tt._opaque)) {\n node.exportKind = \"type\";\n\n const declarationNode = this.startNode();\n this.next();\n // export opaque type Foo = Bar;\n // @ts-expect-error: refine typings\n return this.flowParseOpaqueType(declarationNode, false);\n } else if (this.isContextual(tt._interface)) {\n node.exportKind = \"type\";\n const declarationNode = this.startNode();\n this.next();\n // @ts-expect-error: refine typings\n return this.flowParseInterface(declarationNode);\n } else if (this.shouldParseEnums() && this.isContextual(tt._enum)) {\n node.exportKind = \"value\";\n const declarationNode = this.startNode();\n this.next();\n // @ts-expect-error: refine typings\n return this.flowParseEnumDeclaration(declarationNode);\n } else {\n return super.parseExportDeclaration(node);\n }\n }\n\n eatExportStar(node: N.Node): boolean {\n if (super.eatExportStar(node)) return true;\n\n if (this.isContextual(tt._type) && this.lookahead().type === tt.star) {\n node.exportKind = \"type\";\n this.next();\n this.next();\n return true;\n }\n\n return false;\n }\n\n maybeParseExportNamespaceSpecifier(node: N.Node): boolean {\n const { startLoc } = this.state;\n const hasNamespace = super.maybeParseExportNamespaceSpecifier(node);\n if (hasNamespace && node.exportKind === \"type\") {\n this.unexpected(startLoc);\n }\n return hasNamespace;\n }\n\n parseClassId(\n node: N.Class,\n isStatement: boolean,\n optionalId?: boolean | null,\n ) {\n super.parseClassId(node, isStatement, optionalId);\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n }\n\n parseClassMember(\n classBody: N.ClassBody,\n member: any,\n state: N.ParseClassMemberState,\n ): void {\n const { startLoc } = this.state;\n if (this.isContextual(tt._declare)) {\n if (super.parseClassMemberFromModifier(classBody, member)) {\n // 'declare' is a class element name\n return;\n }\n\n member.declare = true;\n }\n\n super.parseClassMember(classBody, member, state);\n\n if (member.declare) {\n if (\n member.type !== \"ClassProperty\" &&\n member.type !== \"ClassPrivateProperty\" &&\n member.type !== \"PropertyDefinition\" // Used by estree plugin\n ) {\n this.raise(FlowErrors.DeclareClassElement, { at: startLoc });\n } else if (member.value) {\n this.raise(FlowErrors.DeclareClassFieldInitializer, {\n at: member.value,\n });\n }\n }\n }\n\n isIterator(word: string): boolean {\n return word === \"iterator\" || word === \"asyncIterator\";\n }\n\n readIterator(): void {\n const word = super.readWord1();\n const fullWord = \"@@\" + word;\n\n // Allow @@iterator and @@asyncIterator as a identifier only inside type\n if (!this.isIterator(word) || !this.state.inType) {\n this.raise(Errors.InvalidIdentifier, {\n at: this.state.curPosition(),\n identifierName: fullWord,\n });\n }\n\n this.finishToken(tt.name, fullWord);\n }\n\n // ensure that inside flow types, we bypass the jsx parser plugin\n getTokenFromCode(code: number): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (code === charCodes.leftCurlyBrace && next === charCodes.verticalBar) {\n this.finishOp(tt.braceBarL, 2);\n } else if (\n this.state.inType &&\n (code === charCodes.greaterThan || code === charCodes.lessThan)\n ) {\n this.finishOp(code === charCodes.greaterThan ? tt.gt : tt.lt, 1);\n } else if (this.state.inType && code === charCodes.questionMark) {\n if (next === charCodes.dot) {\n this.finishOp(tt.questionDot, 2);\n } else {\n // allow double nullable types in Flow: ??string\n this.finishOp(tt.question, 1);\n }\n } else if (\n isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))\n ) {\n this.state.pos += 2; // eat \"@@\"\n this.readIterator();\n } else {\n super.getTokenFromCode(code);\n }\n }\n\n isAssignable(node: N.Node, isBinding?: boolean): boolean {\n if (node.type === \"TypeCastExpression\") {\n return this.isAssignable(node.expression, isBinding);\n } else {\n return super.isAssignable(node, isBinding);\n }\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): void {\n if (\n !isLHS &&\n node.type === \"AssignmentExpression\" &&\n node.left.type === \"TypeCastExpression\"\n ) {\n node.left = this.typeCastToParameter(node.left);\n }\n super.toAssignable(node, isLHS);\n }\n\n // turn type casts that we found in function parameter head into type annotated params\n toAssignableList(\n exprList: N.Expression[],\n trailingCommaLoc: Position | undefined | null,\n isLHS: boolean,\n ): void {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if (expr?.type === \"TypeCastExpression\") {\n exprList[i] = this.typeCastToParameter(expr);\n }\n }\n super.toAssignableList(exprList, trailingCommaLoc, isLHS);\n }\n\n // this is a list of nodes, from something like a call expression, we need to filter the\n // type casts that we've found that are illegal in this context\n toReferencedList(\n exprList: ReadonlyArray<N.Expression | undefined | null>,\n isParenthesizedExpr?: boolean,\n ): ReadonlyArray<N.Expression | undefined | null> {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if (\n expr &&\n expr.type === \"TypeCastExpression\" &&\n !expr.extra?.parenthesized &&\n (exprList.length > 1 || !isParenthesizedExpr)\n ) {\n this.raise(FlowErrors.TypeCastInPattern, {\n at: expr.typeAnnotation,\n });\n }\n }\n\n return exprList;\n }\n\n parseArrayLike(\n close: TokenType,\n canBePattern: boolean,\n isTuple: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ArrayExpression | N.TupleExpression {\n const node = super.parseArrayLike(\n close,\n canBePattern,\n isTuple,\n refExpressionErrors,\n );\n\n // This could be an array pattern:\n // ([a: string, b: string]) => {}\n // In this case, we don't have to call toReferencedList. We will\n // call it, if needed, when we are sure that it is a parenthesized\n // expression by calling toReferencedListDeep.\n if (canBePattern && !this.state.maybeInArrowParameters) {\n this.toReferencedList(node.elements);\n }\n\n return node;\n }\n\n isValidLVal(type: string, isParenthesized: boolean, binding: BindingTypes) {\n return (\n type === \"TypeCastExpression\" ||\n super.isValidLVal(type, isParenthesized, binding)\n );\n }\n\n // parse class property type annotations\n parseClassProperty(node: N.ClassProperty): N.ClassProperty {\n if (this.match(tt.colon)) {\n // @ts-expect-error refine typings\n node.typeAnnotation = this.flowParseTypeAnnotation();\n }\n return super.parseClassProperty(node);\n }\n\n parseClassPrivateProperty(\n node: N.ClassPrivateProperty,\n ): N.ClassPrivateProperty {\n if (this.match(tt.colon)) {\n // @ts-expect-error refine typings\n node.typeAnnotation = this.flowParseTypeAnnotation();\n }\n return super.parseClassPrivateProperty(node);\n }\n\n // determine whether or not we're currently in the position where a class method would appear\n isClassMethod(): boolean {\n return this.match(tt.lt) || super.isClassMethod();\n }\n\n // determine whether or not we're currently in the position where a class property would appear\n isClassProperty(): boolean {\n return this.match(tt.colon) || super.isClassProperty();\n }\n\n isNonstaticConstructor(method: N.ClassMethod | N.ClassProperty): boolean {\n return !this.match(tt.colon) && super.isNonstaticConstructor(method);\n }\n\n // parse type parameters for class methods\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n if ((method as any).variance) {\n this.unexpected((method as any).variance.loc.start);\n }\n delete (method as any).variance;\n if (this.match(tt.lt)) {\n method.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n super.pushClassMethod(\n classBody,\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n );\n\n if (method.params && isConstructor) {\n const params = method.params;\n if (params.length > 0 && this.isThisParam(params[0])) {\n this.raise(FlowErrors.ThisParamBannedInConstructor, { at: method });\n }\n // estree support\n } else if (\n // @ts-expect-error TS does not know about the face that estree can replace ClassMethod with MethodDefinition\n method.type === \"MethodDefinition\" &&\n isConstructor &&\n // @ts-expect-error estree\n method.value.params\n ) {\n // @ts-expect-error estree\n const params = method.value.params;\n if (params.length > 0 && this.isThisParam(params[0])) {\n this.raise(FlowErrors.ThisParamBannedInConstructor, { at: method });\n }\n }\n }\n\n pushClassPrivateMethod(\n classBody: N.ClassBody,\n method: N.ClassPrivateMethod,\n isGenerator: boolean,\n isAsync: boolean,\n ): void {\n if ((method as any).variance) {\n this.unexpected((method as any).variance.loc.start);\n }\n delete (method as any).variance;\n if (this.match(tt.lt)) {\n method.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);\n }\n\n // parse a the super class type parameters and implements\n parseClassSuper(node: N.Class): void {\n super.parseClassSuper(node);\n if (node.superClass && this.match(tt.lt)) {\n node.superTypeParameters = this.flowParseTypeParameterInstantiation();\n }\n if (this.isContextual(tt._implements)) {\n this.next();\n const implemented: N.FlowClassImplements[] = (node.implements = []);\n do {\n const node = this.startNode();\n node.id = this.flowParseRestrictedIdentifier(/*liberal*/ true);\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n } else {\n node.typeParameters = null;\n }\n implemented.push(this.finishNode(node, \"ClassImplements\"));\n } while (this.eat(tt.comma));\n }\n }\n\n checkGetterSetterParams(method: N.ObjectMethod | N.ClassMethod): void {\n super.checkGetterSetterParams(method);\n const params = this.getObjectOrClassMethodParams(method);\n if (params.length > 0) {\n const param = params[0];\n if (this.isThisParam(param) && method.kind === \"get\") {\n this.raise(FlowErrors.GetterMayNotHaveThisParam, { at: param });\n } else if (this.isThisParam(param)) {\n this.raise(FlowErrors.SetterMayNotHaveThisParam, { at: param });\n }\n }\n }\n\n parsePropertyNamePrefixOperator(\n node: N.ObjectOrClassMember | N.ClassMember,\n ): void {\n node.variance = this.flowParseVariance();\n }\n\n // parse type parameters for object method shorthand\n parseObjPropValue(\n prop: Undone<N.ObjectMethod | N.ObjectProperty>,\n startLoc: Position | undefined | null,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ObjectMethod | N.ObjectProperty {\n if ((prop as any).variance) {\n this.unexpected((prop as any).variance.loc.start);\n }\n delete (prop as any).variance;\n\n let typeParameters;\n\n // method shorthand\n if (this.match(tt.lt) && !isAccessor) {\n typeParameters = this.flowParseTypeParameterDeclaration();\n if (!this.match(tt.parenL)) this.unexpected();\n }\n\n const result = super.parseObjPropValue(\n prop,\n startLoc,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n refExpressionErrors,\n );\n\n // add typeParameters if we found them\n if (typeParameters) {\n (result.value || result).typeParameters = typeParameters;\n }\n return result;\n }\n\n parseAssignableListItemTypes(param: N.Pattern): N.Pattern {\n if (this.eat(tt.question)) {\n if (param.type !== \"Identifier\") {\n this.raise(FlowErrors.PatternIsOptional, { at: param });\n }\n if (this.isThisParam(param)) {\n this.raise(FlowErrors.ThisParamMayNotBeOptional, { at: param });\n }\n\n (param as any as N.Identifier).optional = true;\n }\n if (this.match(tt.colon)) {\n // @ts-expect-error: refine typings\n param.typeAnnotation = this.flowParseTypeAnnotation();\n } else if (this.isThisParam(param)) {\n this.raise(FlowErrors.ThisParamAnnotationRequired, { at: param });\n }\n\n if (this.match(tt.eq) && this.isThisParam(param)) {\n this.raise(FlowErrors.ThisParamNoDefault, { at: param });\n }\n\n this.resetEndLocation(param);\n return param;\n }\n\n parseMaybeDefault(\n startLoc?: Position | null,\n left?: N.Pattern | null,\n ): N.Pattern {\n const node = super.parseMaybeDefault(startLoc, left);\n\n if (\n node.type === \"AssignmentPattern\" &&\n node.typeAnnotation &&\n node.right.start < node.typeAnnotation.start\n ) {\n this.raise(FlowErrors.TypeBeforeInitializer, {\n at: node.typeAnnotation,\n });\n }\n\n return node;\n }\n\n checkImportReflection(node: Undone<N.ImportDeclaration>) {\n super.checkImportReflection(node);\n if (node.module && node.importKind !== \"value\") {\n this.raise(FlowErrors.ImportReflectionHasImportType, {\n at: node.specifiers[0].loc.start,\n });\n }\n }\n\n parseImportSpecifierLocal<\n T extends\n | N.ImportSpecifier\n | N.ImportDefaultSpecifier\n | N.ImportNamespaceSpecifier,\n >(node: N.ImportDeclaration, specifier: Undone<T>, type: T[\"type\"]): void {\n specifier.local = hasTypeImportKind(node)\n ? this.flowParseRestrictedIdentifier(\n /* liberal */ true,\n /* declaration */ true,\n )\n : this.parseIdentifier();\n\n node.specifiers.push(this.finishImportSpecifier(specifier, type));\n }\n\n isPotentialImportPhase(isExport: boolean): boolean {\n if (super.isPotentialImportPhase(isExport)) return true;\n if (this.isContextual(tt._type)) {\n if (!isExport) return true;\n const ch = this.lookaheadCharCode();\n return ch === charCodes.leftCurlyBrace || ch === charCodes.asterisk;\n }\n return !isExport && this.isContextual(tt._typeof);\n }\n\n applyImportPhase(\n node: Undone<N.ImportDeclaration | N.ExportNamedDeclaration>,\n isExport: boolean,\n phase: string | null,\n loc?: Position,\n ): void {\n super.applyImportPhase(node, isExport, phase, loc);\n if (isExport) {\n if (!phase && this.match(tt._default)) {\n // TODO: Align with our TS AST and always add .exportKind\n return;\n }\n (node as N.ExportNamedDeclaration).exportKind =\n phase === \"type\" ? phase : \"value\";\n } else {\n if (phase === \"type\" && this.match(tt.star)) this.unexpected();\n (node as N.ImportDeclaration).importKind =\n phase === \"type\" || phase === \"typeof\" ? phase : \"value\";\n }\n }\n\n // parse import-type/typeof shorthand\n parseImportSpecifier(\n specifier: any,\n importedIsString: boolean,\n isInTypeOnlyImport: boolean,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n isMaybeTypeOnly: boolean,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n bindingType: BindingTypes | undefined,\n ): N.ImportSpecifier {\n const firstIdent = specifier.imported;\n\n let specifierTypeKind = null;\n if (firstIdent.type === \"Identifier\") {\n if (firstIdent.name === \"type\") {\n specifierTypeKind = \"type\";\n } else if (firstIdent.name === \"typeof\") {\n specifierTypeKind = \"typeof\";\n }\n }\n\n let isBinding = false;\n if (this.isContextual(tt._as) && !this.isLookaheadContextual(\"as\")) {\n const as_ident = this.parseIdentifier(true);\n if (\n specifierTypeKind !== null &&\n !tokenIsKeywordOrIdentifier(this.state.type)\n ) {\n // `import {type as ,` or `import {type as }`\n specifier.imported = as_ident;\n specifier.importKind = specifierTypeKind;\n specifier.local = cloneIdentifier(as_ident);\n } else {\n // `import {type as foo`\n specifier.imported = firstIdent;\n specifier.importKind = null;\n specifier.local = this.parseIdentifier();\n }\n } else {\n if (\n specifierTypeKind !== null &&\n tokenIsKeywordOrIdentifier(this.state.type)\n ) {\n // `import {type foo`\n specifier.imported = this.parseIdentifier(true);\n specifier.importKind = specifierTypeKind;\n } else {\n if (importedIsString) {\n /*:: invariant(firstIdent instanceof N.StringLiteral) */\n throw this.raise(Errors.ImportBindingIsString, {\n at: specifier,\n importName: firstIdent.value,\n });\n }\n /*:: invariant(firstIdent instanceof N.Node) */\n specifier.imported = firstIdent;\n specifier.importKind = null;\n }\n\n if (this.eatContextual(tt._as)) {\n specifier.local = this.parseIdentifier();\n } else {\n isBinding = true;\n specifier.local = cloneIdentifier(specifier.imported);\n }\n }\n\n const specifierIsTypeImport = hasTypeImportKind(specifier);\n\n if (isInTypeOnlyImport && specifierIsTypeImport) {\n this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, {\n at: specifier,\n });\n }\n\n if (isInTypeOnlyImport || specifierIsTypeImport) {\n this.checkReservedType(\n specifier.local.name,\n specifier.local.loc.start,\n /* declaration */ true,\n );\n }\n\n if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) {\n this.checkReservedWord(\n specifier.local.name,\n specifier.loc.start,\n true,\n true,\n );\n }\n\n return this.finishImportSpecifier(specifier, \"ImportSpecifier\");\n }\n\n parseBindingAtom(): N.Pattern {\n switch (this.state.type) {\n case tt._this:\n // \"this\" may be the name of a parameter, so allow it.\n return this.parseIdentifier(/* liberal */ true);\n default:\n return super.parseBindingAtom();\n }\n }\n\n // parse function type parameters - function foo<T>() {}\n parseFunctionParams(\n node: Undone<N.Function>,\n isConstructor: boolean,\n ): void {\n // @ts-expect-error kind may not index node\n const kind = node.kind;\n if (kind !== \"get\" && kind !== \"set\" && this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n super.parseFunctionParams(node, isConstructor);\n }\n\n // parse flow type annotations on variable declarator heads - let foo: string = bar\n parseVarId(\n decl: N.VariableDeclarator,\n kind: \"var\" | \"let\" | \"const\",\n ): void {\n super.parseVarId(decl, kind);\n if (this.match(tt.colon)) {\n // @ts-expect-error: refine typings\n decl.id.typeAnnotation = this.flowParseTypeAnnotation();\n this.resetEndLocation(decl.id); // set end position to end of type\n }\n }\n\n // parse the return type of an async arrow function - let foo = (async (): number => {});\n parseAsyncArrowFromCallExpression(\n node: N.ArrowFunctionExpression,\n call: N.CallExpression,\n ): N.ArrowFunctionExpression {\n if (this.match(tt.colon)) {\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = true;\n // @ts-expect-error refine typings\n node.returnType = this.flowParseTypeAnnotation();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n }\n\n return super.parseAsyncArrowFromCallExpression(node, call);\n }\n\n // todo description\n shouldParseAsyncArrow(): boolean {\n return this.match(tt.colon) || super.shouldParseAsyncArrow();\n }\n\n // We need to support type parameter declarations for arrow functions. This\n // is tricky. There are three situations we need to handle\n //\n // 1. This is either JSX or an arrow function. We'll try JSX first. If that\n // fails, we'll try an arrow function. If that fails, we'll throw the JSX\n // error.\n // 2. This is an arrow function. We'll parse the type parameter declaration,\n // parse the rest, make sure the rest is an arrow function, and go from\n // there\n // 3. This is neither. Just call the super method\n parseMaybeAssign(\n refExpressionErrors?: ExpressionErrors | null,\n afterLeftParse?: Function,\n ): N.Expression {\n let state = null;\n\n let jsx;\n\n if (\n this.hasPlugin(\"jsx\") &&\n (this.match(tt.jsxTagStart) || this.match(tt.lt))\n ) {\n state = this.state.clone();\n\n jsx = this.tryParse(\n () => super.parseMaybeAssign(refExpressionErrors, afterLeftParse),\n state,\n );\n\n /*:: invariant(!jsx.aborted) */\n /*:: invariant(jsx.node != null) */\n if (!jsx.error) return jsx.node;\n\n // Remove `tc.j_expr` and `tc.j_oTag` from context added\n // by parsing `jsxTagStart` to stop the JSX plugin from\n // messing with the tokens\n const { context } = this.state;\n const currentContext = context[context.length - 1];\n if (currentContext === tc.j_oTag || currentContext === tc.j_expr) {\n context.pop();\n }\n }\n\n if (jsx?.error || this.match(tt.lt)) {\n state = state || this.state.clone();\n\n let typeParameters: N.TypeParameterDeclaration;\n\n const arrow = this.tryParse(abort => {\n typeParameters = this.flowParseTypeParameterDeclaration();\n\n const arrowExpression = this.forwardNoArrowParamsConversionAt(\n typeParameters,\n () => {\n const result = super.parseMaybeAssign(\n refExpressionErrors,\n afterLeftParse,\n );\n\n this.resetStartLocationFromNode(result, typeParameters);\n\n return result;\n },\n );\n\n // <T>(() => {});\n // <T>(() => {}: any);\n if (arrowExpression.extra?.parenthesized) abort();\n\n // The above can return a TypeCastExpression when the arrow\n // expression is not wrapped in parens. See also `this.parseParenItem`.\n // (<T>() => {}: any);\n const expr = this.maybeUnwrapTypeCastExpression(arrowExpression);\n\n if (expr.type !== \"ArrowFunctionExpression\") abort();\n\n expr.typeParameters = typeParameters;\n this.resetStartLocationFromNode(expr, typeParameters);\n\n return arrowExpression;\n }, state);\n\n let arrowExpression:\n | N.ArrowFunctionExpression\n | N.TypeCastExpression\n | undefined\n | null = null;\n\n if (\n arrow.node &&\n // @ts-expect-error: refine tryParse typings\n this.maybeUnwrapTypeCastExpression(arrow.node).type ===\n \"ArrowFunctionExpression\"\n ) {\n if (!arrow.error && !arrow.aborted) {\n // <T> async () => {}\n // @ts-expect-error: refine tryParse typings\n if (arrow.node.async) {\n /*:: invariant(typeParameters) */\n this.raise(\n FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction,\n { at: typeParameters },\n );\n }\n // @ts-expect-error: refine tryParse typings\n return arrow.node;\n }\n\n // @ts-expect-error: refine typings\n arrowExpression = arrow.node;\n }\n\n // If we are here, both JSX and Flow parsing attempts failed.\n // Give the precedence to the JSX error, except if JSX had an\n // unrecoverable error while Flow didn't.\n // If the error is recoverable, we can only re-report it if there is\n // a node we can return.\n\n if (jsx?.node) {\n /*:: invariant(jsx.failState) */\n this.state = jsx.failState;\n return jsx.node;\n }\n\n if (arrowExpression) {\n /*:: invariant(arrow.failState) */\n this.state = arrow.failState;\n return arrowExpression;\n }\n\n if (jsx?.thrown) throw jsx.error;\n if (arrow.thrown) throw arrow.error;\n\n /*:: invariant(typeParameters) */\n throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, {\n at: typeParameters,\n });\n }\n\n return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);\n }\n\n // handle return types for arrow functions\n parseArrow(\n node: Undone<N.ArrowFunctionExpression>,\n ): Undone<N.ArrowFunctionExpression> | undefined | null {\n if (this.match(tt.colon)) {\n // @ts-expect-error todo(flow->ts)\n const result = this.tryParse(() => {\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = true;\n\n const typeNode = this.startNode<N.TypeAnnotation>();\n\n [\n typeNode.typeAnnotation,\n // @ts-expect-error (destructuring not supported yet)\n node.predicate,\n ] = this.flowParseTypeAndPredicateInitialiser();\n\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n\n if (this.canInsertSemicolon()) this.unexpected();\n if (!this.match(tt.arrow)) this.unexpected();\n\n return typeNode;\n });\n\n if (result.thrown) return null;\n /*:: invariant(result.node) */\n\n if (result.error) this.state = result.failState;\n\n // assign after it is clear it is an arrow\n // @ts-expect-error todo(flow->ts)\n node.returnType = result.node.typeAnnotation\n ? this.finishNode(result.node, \"TypeAnnotation\")\n : null;\n }\n\n return super.parseArrow(node);\n }\n\n shouldParseArrow(params: Array<N.Node>): boolean {\n return this.match(tt.colon) || super.shouldParseArrow(params);\n }\n\n setArrowFunctionParameters(\n node: N.ArrowFunctionExpression,\n params: N.Pattern[],\n ): void {\n if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {\n node.params = params;\n } else {\n super.setArrowFunctionParameters(node, params);\n }\n }\n\n checkParams(\n node: N.Function,\n allowDuplicates: boolean,\n isArrowFunction?: boolean | null,\n strictModeChanged: boolean = true,\n ): void {\n if (\n isArrowFunction &&\n this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1\n ) {\n return;\n }\n\n // ensure the `this` param is first, if it exists\n for (let i = 0; i < node.params.length; i++) {\n if (this.isThisParam(node.params[i]) && i > 0) {\n this.raise(FlowErrors.ThisParamMustBeFirst, { at: node.params[i] });\n }\n }\n\n super.checkParams(\n node,\n allowDuplicates,\n isArrowFunction,\n strictModeChanged,\n );\n }\n\n parseParenAndDistinguishExpression(canBeArrow: boolean): N.Expression {\n return super.parseParenAndDistinguishExpression(\n canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1,\n );\n }\n\n parseSubscripts(\n base: N.Expression,\n\n startLoc: Position,\n noCalls?: boolean | null,\n ): N.Expression {\n if (\n base.type === \"Identifier\" &&\n base.name === \"async\" &&\n this.state.noArrowAt.indexOf(startLoc.index) !== -1\n ) {\n this.next();\n\n const node = this.startNodeAt(startLoc);\n node.callee = base;\n node.arguments = super.parseCallExpressionArguments(tt.parenR, false);\n base = this.finishNode(node, \"CallExpression\");\n } else if (\n base.type === \"Identifier\" &&\n base.name === \"async\" &&\n this.match(tt.lt)\n ) {\n const state = this.state.clone();\n const arrow = this.tryParse(\n abort => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(),\n state,\n );\n\n /*:: invariant(arrow.node != null) */\n // @ts-expect-error: refine tryParse typings\n if (!arrow.error && !arrow.aborted) return arrow.node;\n\n const result = this.tryParse(\n () => super.parseSubscripts(base, startLoc, noCalls),\n state,\n );\n\n if (result.node && !result.error) return result.node;\n\n if (arrow.node) {\n this.state = arrow.failState;\n // @ts-expect-error: refine tryParse typings\n return arrow.node;\n }\n\n if (result.node) {\n this.state = result.failState;\n return result.node;\n }\n\n throw arrow.error || result.error;\n }\n\n return super.parseSubscripts(base, startLoc, noCalls);\n }\n\n parseSubscript(\n base: N.Expression,\n\n startLoc: Position,\n noCalls: boolean | undefined | null,\n subscriptState: N.ParseSubscriptState,\n ): N.Expression {\n if (this.match(tt.questionDot) && this.isLookaheadToken_lt()) {\n subscriptState.optionalChainMember = true;\n if (noCalls) {\n subscriptState.stop = true;\n return base;\n }\n this.next();\n const node = this.startNodeAt<N.OptionalCallExpression>(startLoc);\n node.callee = base;\n node.typeArguments = this.flowParseTypeParameterInstantiation();\n this.expect(tt.parenL);\n node.arguments = this.parseCallExpressionArguments(tt.parenR, false);\n node.optional = true;\n return this.finishCallExpression(node, /* optional */ true);\n } else if (!noCalls && this.shouldParseTypes() && this.match(tt.lt)) {\n const node = this.startNodeAt<\n N.OptionalCallExpression | N.CallExpression\n >(startLoc);\n node.callee = base;\n\n const result = this.tryParse(() => {\n node.typeArguments =\n this.flowParseTypeParameterInstantiationCallOrNew();\n this.expect(tt.parenL);\n node.arguments = super.parseCallExpressionArguments(tt.parenR, false);\n if (subscriptState.optionalChainMember) {\n (node as Undone<N.OptionalCallExpression>).optional = false;\n }\n return this.finishCallExpression(\n node,\n subscriptState.optionalChainMember,\n );\n });\n\n if (result.node) {\n if (result.error) this.state = result.failState;\n return result.node;\n }\n }\n\n return super.parseSubscript(\n base,\n\n startLoc,\n noCalls,\n subscriptState,\n );\n }\n\n parseNewCallee(node: N.NewExpression): void {\n super.parseNewCallee(node);\n\n let targs = null;\n if (this.shouldParseTypes() && this.match(tt.lt)) {\n targs = this.tryParse(() =>\n this.flowParseTypeParameterInstantiationCallOrNew(),\n ).node;\n }\n node.typeArguments = targs;\n }\n\n parseAsyncArrowWithTypeParameters(\n startLoc: Position,\n ): N.ArrowFunctionExpression | undefined | null {\n const node = this.startNodeAt<N.ArrowFunctionExpression>(startLoc);\n this.parseFunctionParams(node, false);\n if (!this.parseArrow(node)) return;\n return super.parseArrowExpression(\n node,\n /* params */ undefined,\n /* isAsync */ true,\n );\n }\n\n readToken_mult_modulo(code: number): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (\n code === charCodes.asterisk &&\n next === charCodes.slash &&\n this.state.hasFlowComment\n ) {\n this.state.hasFlowComment = false;\n this.state.pos += 2;\n this.nextToken();\n return;\n }\n\n super.readToken_mult_modulo(code);\n }\n\n readToken_pipe_amp(code: number): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (\n code === charCodes.verticalBar &&\n next === charCodes.rightCurlyBrace\n ) {\n // '|}'\n this.finishOp(tt.braceBarR, 2);\n return;\n }\n\n super.readToken_pipe_amp(code);\n }\n\n parseTopLevel(file: N.File, program: N.Program): N.File {\n const fileNode = super.parseTopLevel(file, program);\n if (this.state.hasFlowComment) {\n this.raise(FlowErrors.UnterminatedFlowComment, {\n at: this.state.curPosition(),\n });\n }\n return fileNode;\n }\n\n skipBlockComment(): N.CommentBlock | undefined {\n if (this.hasPlugin(\"flowComments\") && this.skipFlowComment()) {\n if (this.state.hasFlowComment) {\n throw this.raise(FlowErrors.NestedFlowComment, {\n at: this.state.startLoc,\n });\n }\n this.hasFlowCommentCompletion();\n const commentSkip = this.skipFlowComment();\n if (commentSkip) {\n this.state.pos += commentSkip;\n this.state.hasFlowComment = true;\n }\n return;\n }\n\n return super.skipBlockComment(this.state.hasFlowComment ? \"*-/\" : \"*/\");\n }\n\n skipFlowComment(): number | false {\n const { pos } = this.state;\n let shiftToFirstNonWhiteSpace = 2;\n while (\n [charCodes.space, charCodes.tab].includes(\n // @ts-expect-error testing whether a number is included\n this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace),\n )\n ) {\n shiftToFirstNonWhiteSpace++;\n }\n\n const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos);\n const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1);\n\n if (ch2 === charCodes.colon && ch3 === charCodes.colon) {\n return shiftToFirstNonWhiteSpace + 2; // check for /*::\n }\n if (\n this.input.slice(\n shiftToFirstNonWhiteSpace + pos,\n shiftToFirstNonWhiteSpace + pos + 12,\n ) === \"flow-include\"\n ) {\n return shiftToFirstNonWhiteSpace + 12; // check for /*flow-include\n }\n if (ch2 === charCodes.colon && ch3 !== charCodes.colon) {\n return shiftToFirstNonWhiteSpace; // check for /*:, advance up to :\n }\n return false;\n }\n\n hasFlowCommentCompletion(): void {\n const end = this.input.indexOf(\"*/\", this.state.pos);\n if (end === -1) {\n throw this.raise(Errors.UnterminatedComment, {\n at: this.state.curPosition(),\n });\n }\n }\n\n // Flow enum parsing\n\n flowEnumErrorBooleanMemberNotInitialized(\n loc: Position,\n {\n enumName,\n memberName,\n }: {\n enumName: string;\n memberName: string;\n },\n ): void {\n this.raise(FlowErrors.EnumBooleanMemberNotInitialized, {\n at: loc,\n memberName,\n enumName,\n });\n }\n\n flowEnumErrorInvalidMemberInitializer(\n loc: Position,\n enumContext: EnumContext,\n ) {\n return this.raise(\n !enumContext.explicitType\n ? FlowErrors.EnumInvalidMemberInitializerUnknownType\n : enumContext.explicitType === \"symbol\"\n ? FlowErrors.EnumInvalidMemberInitializerSymbolType\n : FlowErrors.EnumInvalidMemberInitializerPrimaryType,\n {\n at: loc,\n ...enumContext,\n },\n );\n }\n\n flowEnumErrorNumberMemberNotInitialized(\n loc: Position,\n {\n enumName,\n memberName,\n }: {\n enumName: string;\n memberName: string;\n },\n ): void {\n this.raise(FlowErrors.EnumNumberMemberNotInitialized, {\n at: loc,\n enumName,\n memberName,\n });\n }\n\n flowEnumErrorStringMemberInconsistentlyInitailized(\n node: N.Node,\n {\n enumName,\n }: {\n enumName: string;\n },\n ): void {\n this.raise(FlowErrors.EnumStringMemberInconsistentlyInitailized, {\n at: node,\n enumName,\n });\n }\n\n flowEnumMemberInit(): EnumMemberInit {\n const startLoc = this.state.startLoc;\n const endOfInit = () => this.match(tt.comma) || this.match(tt.braceR);\n switch (this.state.type) {\n case tt.num: {\n const literal = this.parseNumericLiteral(this.state.value);\n if (endOfInit()) {\n return { type: \"number\", loc: literal.loc.start, value: literal };\n }\n return { type: \"invalid\", loc: startLoc };\n }\n case tt.string: {\n const literal = this.parseStringLiteral(this.state.value);\n if (endOfInit()) {\n return { type: \"string\", loc: literal.loc.start, value: literal };\n }\n return { type: \"invalid\", loc: startLoc };\n }\n case tt._true:\n case tt._false: {\n const literal = this.parseBooleanLiteral(this.match(tt._true));\n if (endOfInit()) {\n return {\n type: \"boolean\",\n loc: literal.loc.start,\n value: literal,\n };\n }\n return { type: \"invalid\", loc: startLoc };\n }\n default:\n return { type: \"invalid\", loc: startLoc };\n }\n }\n\n flowEnumMemberRaw(): {\n id: N.Node;\n init: EnumMemberInit;\n } {\n const loc = this.state.startLoc;\n const id = this.parseIdentifier(true);\n const init = this.eat(tt.eq)\n ? this.flowEnumMemberInit()\n : { type: \"none\" as const, loc };\n return { id, init };\n }\n\n flowEnumCheckExplicitTypeMismatch(\n loc: Position,\n context: EnumContext,\n expectedType: EnumExplicitType,\n ): void {\n const { explicitType } = context;\n if (explicitType === null) {\n return;\n }\n if (explicitType !== expectedType) {\n this.flowEnumErrorInvalidMemberInitializer(loc, context);\n }\n }\n\n flowEnumMembers({\n enumName,\n explicitType,\n }: {\n enumName: string;\n explicitType: EnumExplicitType;\n }): {\n members: {\n booleanMembers: Array<N.Node>;\n numberMembers: Array<N.Node>;\n stringMembers: Array<N.Node>;\n defaultedMembers: Array<N.Node>;\n };\n hasUnknownMembers: boolean;\n } {\n const seenNames = new Set();\n const members = {\n // @ts-expect-error: migrate to Babel types\n booleanMembers: [],\n // @ts-expect-error: migrate to Babel types\n numberMembers: [],\n // @ts-expect-error: migrate to Babel types\n stringMembers: [],\n // @ts-expect-error: migrate to Babel types\n defaultedMembers: [],\n };\n let hasUnknownMembers = false;\n while (!this.match(tt.braceR)) {\n if (this.eat(tt.ellipsis)) {\n hasUnknownMembers = true;\n break;\n }\n const memberNode = this.startNode();\n const { id, init } = this.flowEnumMemberRaw();\n const memberName = id.name;\n if (memberName === \"\") {\n continue;\n }\n if (/^[a-z]/.test(memberName)) {\n this.raise(FlowErrors.EnumInvalidMemberName, {\n at: id,\n memberName,\n suggestion: memberName[0].toUpperCase() + memberName.slice(1),\n enumName,\n });\n }\n if (seenNames.has(memberName)) {\n this.raise(FlowErrors.EnumDuplicateMemberName, {\n at: id,\n memberName,\n enumName,\n });\n }\n seenNames.add(memberName);\n const context = { enumName, explicitType, memberName };\n memberNode.id = id;\n switch (init.type) {\n case \"boolean\": {\n this.flowEnumCheckExplicitTypeMismatch(\n init.loc,\n context,\n \"boolean\",\n );\n memberNode.init = init.value;\n members.booleanMembers.push(\n this.finishNode(memberNode, \"EnumBooleanMember\"),\n );\n break;\n }\n case \"number\": {\n this.flowEnumCheckExplicitTypeMismatch(init.loc, context, \"number\");\n memberNode.init = init.value;\n members.numberMembers.push(\n this.finishNode(memberNode, \"EnumNumberMember\"),\n );\n break;\n }\n case \"string\": {\n this.flowEnumCheckExplicitTypeMismatch(init.loc, context, \"string\");\n memberNode.init = init.value;\n members.stringMembers.push(\n this.finishNode(memberNode, \"EnumStringMember\"),\n );\n break;\n }\n case \"invalid\": {\n throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context);\n }\n case \"none\": {\n switch (explicitType) {\n case \"boolean\":\n this.flowEnumErrorBooleanMemberNotInitialized(\n init.loc,\n context,\n );\n break;\n case \"number\":\n this.flowEnumErrorNumberMemberNotInitialized(init.loc, context);\n break;\n default:\n members.defaultedMembers.push(\n this.finishNode(memberNode, \"EnumDefaultedMember\"),\n );\n }\n }\n }\n\n if (!this.match(tt.braceR)) {\n this.expect(tt.comma);\n }\n }\n return { members, hasUnknownMembers };\n }\n\n flowEnumStringMembers(\n initializedMembers: Array<N.Node>,\n defaultedMembers: Array<N.Node>,\n {\n enumName,\n }: {\n enumName: string;\n },\n ): Array<N.Node> {\n if (initializedMembers.length === 0) {\n return defaultedMembers;\n } else if (defaultedMembers.length === 0) {\n return initializedMembers;\n } else if (defaultedMembers.length > initializedMembers.length) {\n for (const member of initializedMembers) {\n this.flowEnumErrorStringMemberInconsistentlyInitailized(member, {\n enumName,\n });\n }\n return defaultedMembers;\n } else {\n for (const member of defaultedMembers) {\n this.flowEnumErrorStringMemberInconsistentlyInitailized(member, {\n enumName,\n });\n }\n return initializedMembers;\n }\n }\n\n flowEnumParseExplicitType({\n enumName,\n }: {\n enumName: string;\n }): EnumExplicitType {\n if (!this.eatContextual(tt._of)) return null;\n\n if (!tokenIsIdentifier(this.state.type)) {\n throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, {\n at: this.state.startLoc,\n enumName,\n });\n }\n\n const { value } = this.state;\n this.next();\n\n if (\n value !== \"boolean\" &&\n value !== \"number\" &&\n value !== \"string\" &&\n value !== \"symbol\"\n ) {\n this.raise(FlowErrors.EnumInvalidExplicitType, {\n at: this.state.startLoc,\n enumName,\n invalidEnumType: value,\n });\n }\n\n return value;\n }\n\n flowEnumBody(node: Undone<N.Node>, id: N.Node): N.Node {\n const enumName = id.name;\n const nameLoc = id.loc.start;\n const explicitType = this.flowEnumParseExplicitType({ enumName });\n this.expect(tt.braceL);\n const { members, hasUnknownMembers } = this.flowEnumMembers({\n enumName,\n explicitType,\n });\n node.hasUnknownMembers = hasUnknownMembers;\n\n switch (explicitType) {\n case \"boolean\":\n node.explicitType = true;\n node.members = members.booleanMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumBooleanBody\");\n case \"number\":\n node.explicitType = true;\n node.members = members.numberMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumNumberBody\");\n case \"string\":\n node.explicitType = true;\n node.members = this.flowEnumStringMembers(\n members.stringMembers,\n members.defaultedMembers,\n { enumName },\n );\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n case \"symbol\":\n node.members = members.defaultedMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumSymbolBody\");\n default: {\n // `explicitType` is `null`\n const empty = () => {\n node.members = [];\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n };\n node.explicitType = false;\n\n const boolsLen = members.booleanMembers.length;\n const numsLen = members.numberMembers.length;\n const strsLen = members.stringMembers.length;\n const defaultedLen = members.defaultedMembers.length;\n\n if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {\n return empty();\n } else if (!boolsLen && !numsLen) {\n node.members = this.flowEnumStringMembers(\n members.stringMembers,\n members.defaultedMembers,\n { enumName },\n );\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {\n for (const member of members.defaultedMembers) {\n this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, {\n enumName,\n memberName: member.id.name,\n });\n }\n node.members = members.booleanMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumBooleanBody\");\n } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {\n for (const member of members.defaultedMembers) {\n this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, {\n enumName,\n memberName: member.id.name,\n });\n }\n node.members = members.numberMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumNumberBody\");\n } else {\n this.raise(FlowErrors.EnumInconsistentMemberValues, {\n at: nameLoc,\n enumName,\n });\n return empty();\n }\n }\n }\n }\n\n flowParseEnumDeclaration(node: Undone<N.Node>): N.Node {\n const id = this.parseIdentifier();\n node.id = id;\n node.body = this.flowEnumBody(this.startNode(), id);\n return this.finishNode(node, \"EnumDeclaration\");\n }\n\n // check if the next token is a tt.lt\n isLookaheadToken_lt(): boolean {\n const next = this.nextTokenStart();\n if (this.input.charCodeAt(next) === charCodes.lessThan) {\n const afterNext = this.input.charCodeAt(next + 1);\n return (\n afterNext !== charCodes.lessThan && afterNext !== charCodes.equalsTo\n );\n }\n return false;\n }\n\n maybeUnwrapTypeCastExpression(node: N.Node) {\n return node.type === \"TypeCastExpression\" ? node.expression : node;\n }\n };\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAYA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAYA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAEA,MAAMO,aAAa,GAAG,IAAIC,GAAG,CAAC,CAC5B,GAAG,EACH,KAAK,EACL,MAAM,EACN,SAAS,EACT,OAAO,EACP,SAAS,EACT,OAAO,EACP,WAAW,EACX,OAAO,EACP,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,CACP,CAAC;AAIF,MAAMC,UAAU,GAAG,IAAAC,0BAAc,CAAC,MAAK,CAAC;EACtCC,yBAAyB,EACvB,gFAAgF;EAClFC,0BAA0B,EACxB,wKAAwK;EAG1KC,kBAAkB,EAAEA,CAAC;IAAEC;EAAuC,CAAC,KAC5D,kCAAiCA,YAA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,GAAGG,IAAI,CAACuO,UAAU,GAAGvO,IAAI;EACpE;AACF,CAAC;AAAAkf,OAAA,CAAAtY,OAAA,GAAA7F,QAAA"} lib/plugins/flow/scope.js 0000644 00000002461 15120211212 0011377 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _scope = require("../../util/scope"); var _scopeflags = require("../../util/scopeflags"); class FlowScope extends _scope.Scope { constructor(...args) { super(...args); this.declareFunctions = new Set(); } } class FlowScopeHandler extends _scope.default { createScope(flags) { return new FlowScope(flags); } declareName(name, bindingType, loc) { const scope = this.currentScope(); if (bindingType & _scopeflags.BIND_FLAGS_FLOW_DECLARE_FN) { this.checkRedeclarationInScope(scope, name, bindingType, loc); this.maybeExportDefined(scope, name); scope.declareFunctions.add(name); return; } super.declareName(name, bindingType, loc); } isRedeclaredInScope(scope, name, bindingType) { if (super.isRedeclaredInScope(scope, name, bindingType)) return true; if (bindingType & _scopeflags.BIND_FLAGS_FLOW_DECLARE_FN) { return !scope.declareFunctions.has(name) && (scope.lexical.has(name) || scope.functions.has(name)); } return false; } checkLocalExport(id) { if (!this.scopeStack[0].declareFunctions.has(id.name)) { super.checkLocalExport(id); } } } exports.default = FlowScopeHandler; //# sourceMappingURL=scope.js.map lib/plugins/flow/scope.js.map 0000644 00000006576 15120211212 0012166 0 ustar 00 {"version":3,"names":["_scope","require","_scopeflags","FlowScope","Scope","constructor","args","declareFunctions","Set","FlowScopeHandler","ScopeHandler","createScope","flags","declareName","name","bindingType","loc","scope","currentScope","BIND_FLAGS_FLOW_DECLARE_FN","checkRedeclarationInScope","maybeExportDefined","add","isRedeclaredInScope","has","lexical","functions","checkLocalExport","id","scopeStack","exports","default"],"sources":["../../../src/plugins/flow/scope.ts"],"sourcesContent":["import type { Position } from \"../../util/location\";\nimport ScopeHandler, { Scope } from \"../../util/scope\";\nimport {\n BIND_FLAGS_FLOW_DECLARE_FN,\n type ScopeFlags,\n type BindingTypes,\n} from \"../../util/scopeflags\";\nimport type * as N from \"../../types\";\n\n// Reference implementation: https://github.com/facebook/flow/blob/23aeb2a2ef6eb4241ce178fde5d8f17c5f747fb5/src/typing/env.ml#L536-L584\nclass FlowScope extends Scope {\n // declare function foo(): type;\n declareFunctions: Set<string> = new Set();\n}\n\nexport default class FlowScopeHandler extends ScopeHandler<FlowScope> {\n createScope(flags: ScopeFlags): FlowScope {\n return new FlowScope(flags);\n }\n\n declareName(name: string, bindingType: BindingTypes, loc: Position) {\n const scope = this.currentScope();\n if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n this.maybeExportDefined(scope, name);\n scope.declareFunctions.add(name);\n return;\n }\n\n super.declareName(name, bindingType, loc);\n }\n\n isRedeclaredInScope(\n scope: FlowScope,\n name: string,\n bindingType: BindingTypes,\n ): boolean {\n if (super.isRedeclaredInScope(scope, name, bindingType)) return true;\n\n if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {\n return (\n !scope.declareFunctions.has(name) &&\n (scope.lexical.has(name) || scope.functions.has(name))\n );\n }\n\n return false;\n }\n\n checkLocalExport(id: N.Identifier) {\n if (!this.scopeStack[0].declareFunctions.has(id.name)) {\n super.checkLocalExport(id);\n }\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAQA,MAAME,SAAS,SAASC,YAAK,CAAC;EAAAC,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAA,KAE5BC,gBAAgB,GAAgB,IAAIC,GAAG,CAAC,CAAC;EAAA;AAC3C;AAEe,MAAMC,gBAAgB,SAASC,cAAY,CAAY;EACpEC,WAAWA,CAACC,KAAiB,EAAa;IACxC,OAAO,IAAIT,SAAS,CAACS,KAAK,CAAC;EAC7B;EAEAC,WAAWA,CAACC,IAAY,EAAEC,WAAyB,EAAEC,GAAa,EAAE;IAClE,MAAMC,KAAK,GAAG,IAAI,CAACC,YAAY,CAAC,CAAC;IACjC,IAAIH,WAAW,GAAGI,sCAA0B,EAAE;MAC5C,IAAI,CAACC,yBAAyB,CAACH,KAAK,EAAEH,IAAI,EAAEC,WAAW,EAAEC,GAAG,CAAC;MAC7D,IAAI,CAACK,kBAAkB,CAACJ,KAAK,EAAEH,IAAI,CAAC;MACpCG,KAAK,CAACV,gBAAgB,CAACe,GAAG,CAACR,IAAI,CAAC;MAChC;IACF;IAEA,KAAK,CAACD,WAAW,CAACC,IAAI,EAAEC,WAAW,EAAEC,GAAG,CAAC;EAC3C;EAEAO,mBAAmBA,CACjBN,KAAgB,EAChBH,IAAY,EACZC,WAAyB,EAChB;IACT,IAAI,KAAK,CAACQ,mBAAmB,CAACN,KAAK,EAAEH,IAAI,EAAEC,WAAW,CAAC,EAAE,OAAO,IAAI;IAEpE,IAAIA,WAAW,GAAGI,sCAA0B,EAAE;MAC5C,OACE,CAACF,KAAK,CAACV,gBAAgB,CAACiB,GAAG,CAACV,IAAI,CAAC,KAChCG,KAAK,CAACQ,OAAO,CAACD,GAAG,CAACV,IAAI,CAAC,IAAIG,KAAK,CAACS,SAAS,CAACF,GAAG,CAACV,IAAI,CAAC,CAAC;IAE1D;IAEA,OAAO,KAAK;EACd;EAEAa,gBAAgBA,CAACC,EAAgB,EAAE;IACjC,IAAI,CAAC,IAAI,CAACC,UAAU,CAAC,CAAC,CAAC,CAACtB,gBAAgB,CAACiB,GAAG,CAACI,EAAE,CAACd,IAAI,CAAC,EAAE;MACrD,KAAK,CAACa,gBAAgB,CAACC,EAAE,CAAC;IAC5B;EACF;AACF;AAACE,OAAA,CAAAC,OAAA,GAAAtB,gBAAA"} lib/plugins/jsx/index.js 0000644 00000034763 15120211212 0011244 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _xhtml = require("./xhtml"); var _types = require("../../tokenizer/types"); var _context = require("../../tokenizer/context"); var _identifier = require("../../util/identifier"); var _whitespace = require("../../util/whitespace"); var _parseError = require("../../parse-error"); const JsxErrors = (0, _parseError.ParseErrorEnum)`jsx`({ AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.", MissingClosingTagElement: ({ openingTagName }) => `Expected corresponding JSX closing tag for <${openingTagName}>.`, MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.", UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?", UnexpectedToken: ({ unexpected, HTMLEntity }) => `Unexpected token \`${unexpected}\`. Did you mean \`${HTMLEntity}\` or \`{'${unexpected}'}\`?`, UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text.", UnterminatedJsxContent: "Unterminated JSX contents.", UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?" }); function isFragment(object) { return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false; } function getQualifiedJSXName(object) { if (object.type === "JSXIdentifier") { return object.name; } if (object.type === "JSXNamespacedName") { return object.namespace.name + ":" + object.name.name; } if (object.type === "JSXMemberExpression") { return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); } throw new Error("Node had unexpected type: " + object.type); } var _default = superClass => class JSXParserMixin extends superClass { jsxReadToken() { let out = ""; let chunkStart = this.state.pos; for (;;) { if (this.state.pos >= this.length) { throw this.raise(JsxErrors.UnterminatedJsxContent, { at: this.state.startLoc }); } const ch = this.input.charCodeAt(this.state.pos); switch (ch) { case 60: case 123: if (this.state.pos === this.state.start) { if (ch === 60 && this.state.canStartJSXElement) { ++this.state.pos; this.finishToken(140); } else { super.getTokenFromCode(ch); } return; } out += this.input.slice(chunkStart, this.state.pos); this.finishToken(139, out); return; case 38: out += this.input.slice(chunkStart, this.state.pos); out += this.jsxReadEntity(); chunkStart = this.state.pos; break; case 62: case 125: ; default: if ((0, _whitespace.isNewLine)(ch)) { out += this.input.slice(chunkStart, this.state.pos); out += this.jsxReadNewLine(true); chunkStart = this.state.pos; } else { ++this.state.pos; } } } } jsxReadNewLine(normalizeCRLF) { const ch = this.input.charCodeAt(this.state.pos); let out; ++this.state.pos; if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { ++this.state.pos; out = normalizeCRLF ? "\n" : "\r\n"; } else { out = String.fromCharCode(ch); } ++this.state.curLine; this.state.lineStart = this.state.pos; return out; } jsxReadString(quote) { let out = ""; let chunkStart = ++this.state.pos; for (;;) { if (this.state.pos >= this.length) { throw this.raise(_parseError.Errors.UnterminatedString, { at: this.state.startLoc }); } const ch = this.input.charCodeAt(this.state.pos); if (ch === quote) break; if (ch === 38) { out += this.input.slice(chunkStart, this.state.pos); out += this.jsxReadEntity(); chunkStart = this.state.pos; } else if ((0, _whitespace.isNewLine)(ch)) { out += this.input.slice(chunkStart, this.state.pos); out += this.jsxReadNewLine(false); chunkStart = this.state.pos; } else { ++this.state.pos; } } out += this.input.slice(chunkStart, this.state.pos++); this.finishToken(131, out); } jsxReadEntity() { const startPos = ++this.state.pos; if (this.codePointAtPos(this.state.pos) === 35) { ++this.state.pos; let radix = 10; if (this.codePointAtPos(this.state.pos) === 120) { radix = 16; ++this.state.pos; } const codePoint = this.readInt(radix, undefined, false, "bail"); if (codePoint !== null && this.codePointAtPos(this.state.pos) === 59) { ++this.state.pos; return String.fromCodePoint(codePoint); } } else { let count = 0; let semi = false; while (count++ < 10 && this.state.pos < this.length && !(semi = this.codePointAtPos(this.state.pos) == 59)) { ++this.state.pos; } if (semi) { const desc = this.input.slice(startPos, this.state.pos); const entity = _xhtml.default[desc]; ++this.state.pos; if (entity) { return entity; } } } this.state.pos = startPos; return "&"; } jsxReadWord() { let ch; const start = this.state.pos; do { ch = this.input.charCodeAt(++this.state.pos); } while ((0, _identifier.isIdentifierChar)(ch) || ch === 45); this.finishToken(138, this.input.slice(start, this.state.pos)); } jsxParseIdentifier() { const node = this.startNode(); if (this.match(138)) { node.name = this.state.value; } else if ((0, _types.tokenIsKeyword)(this.state.type)) { node.name = (0, _types.tokenLabelName)(this.state.type); } else { this.unexpected(); } this.next(); return this.finishNode(node, "JSXIdentifier"); } jsxParseNamespacedName() { const startLoc = this.state.startLoc; const name = this.jsxParseIdentifier(); if (!this.eat(14)) return name; const node = this.startNodeAt(startLoc); node.namespace = name; node.name = this.jsxParseIdentifier(); return this.finishNode(node, "JSXNamespacedName"); } jsxParseElementName() { const startLoc = this.state.startLoc; let node = this.jsxParseNamespacedName(); if (node.type === "JSXNamespacedName") { return node; } while (this.eat(16)) { const newNode = this.startNodeAt(startLoc); newNode.object = node; newNode.property = this.jsxParseIdentifier(); node = this.finishNode(newNode, "JSXMemberExpression"); } return node; } jsxParseAttributeValue() { let node; switch (this.state.type) { case 5: node = this.startNode(); this.setContext(_context.types.brace); this.next(); node = this.jsxParseExpressionContainer(node, _context.types.j_oTag); if (node.expression.type === "JSXEmptyExpression") { this.raise(JsxErrors.AttributeIsEmpty, { at: node }); } return node; case 140: case 131: return this.parseExprAtom(); default: throw this.raise(JsxErrors.UnsupportedJsxValue, { at: this.state.startLoc }); } } jsxParseEmptyExpression() { const node = this.startNodeAt(this.state.lastTokEndLoc); return this.finishNodeAt(node, "JSXEmptyExpression", this.state.startLoc); } jsxParseSpreadChild(node) { this.next(); node.expression = this.parseExpression(); this.setContext(_context.types.j_expr); this.state.canStartJSXElement = true; this.expect(8); return this.finishNode(node, "JSXSpreadChild"); } jsxParseExpressionContainer(node, previousContext) { if (this.match(8)) { node.expression = this.jsxParseEmptyExpression(); } else { const expression = this.parseExpression(); ; node.expression = expression; } this.setContext(previousContext); this.state.canStartJSXElement = true; this.expect(8); return this.finishNode(node, "JSXExpressionContainer"); } jsxParseAttribute() { const node = this.startNode(); if (this.match(5)) { this.setContext(_context.types.brace); this.next(); this.expect(21); node.argument = this.parseMaybeAssignAllowIn(); this.setContext(_context.types.j_oTag); this.state.canStartJSXElement = true; this.expect(8); return this.finishNode(node, "JSXSpreadAttribute"); } node.name = this.jsxParseNamespacedName(); node.value = this.eat(29) ? this.jsxParseAttributeValue() : null; return this.finishNode(node, "JSXAttribute"); } jsxParseOpeningElementAt(startLoc) { const node = this.startNodeAt(startLoc); if (this.eat(141)) { return this.finishNode(node, "JSXOpeningFragment"); } node.name = this.jsxParseElementName(); return this.jsxParseOpeningElementAfterName(node); } jsxParseOpeningElementAfterName(node) { const attributes = []; while (!this.match(56) && !this.match(141)) { attributes.push(this.jsxParseAttribute()); } node.attributes = attributes; node.selfClosing = this.eat(56); this.expect(141); return this.finishNode(node, "JSXOpeningElement"); } jsxParseClosingElementAt(startLoc) { const node = this.startNodeAt(startLoc); if (this.eat(141)) { return this.finishNode(node, "JSXClosingFragment"); } node.name = this.jsxParseElementName(); this.expect(141); return this.finishNode(node, "JSXClosingElement"); } jsxParseElementAt(startLoc) { const node = this.startNodeAt(startLoc); const children = []; const openingElement = this.jsxParseOpeningElementAt(startLoc); let closingElement = null; if (!openingElement.selfClosing) { contents: for (;;) { switch (this.state.type) { case 140: startLoc = this.state.startLoc; this.next(); if (this.eat(56)) { closingElement = this.jsxParseClosingElementAt(startLoc); break contents; } children.push(this.jsxParseElementAt(startLoc)); break; case 139: children.push(this.parseExprAtom()); break; case 5: { const node = this.startNode(); this.setContext(_context.types.brace); this.next(); if (this.match(21)) { children.push(this.jsxParseSpreadChild(node)); } else { children.push(this.jsxParseExpressionContainer(node, _context.types.j_expr)); } break; } default: this.unexpected(); } } if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) { this.raise(JsxErrors.MissingClosingTagFragment, { at: closingElement }); } else if (!isFragment(openingElement) && isFragment(closingElement)) { this.raise(JsxErrors.MissingClosingTagElement, { at: closingElement, openingTagName: getQualifiedJSXName(openingElement.name) }); } else if (!isFragment(openingElement) && !isFragment(closingElement)) { if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { this.raise(JsxErrors.MissingClosingTagElement, { at: closingElement, openingTagName: getQualifiedJSXName(openingElement.name) }); } } } if (isFragment(openingElement)) { node.openingFragment = openingElement; node.closingFragment = closingElement; } else { node.openingElement = openingElement; node.closingElement = closingElement; } node.children = children; if (this.match(47)) { throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, { at: this.state.startLoc }); } return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement"); } jsxParseElement() { const startLoc = this.state.startLoc; this.next(); return this.jsxParseElementAt(startLoc); } setContext(newContext) { const { context } = this.state; context[context.length - 1] = newContext; } parseExprAtom(refExpressionErrors) { if (this.match(139)) { return this.parseLiteral(this.state.value, "JSXText"); } else if (this.match(140)) { return this.jsxParseElement(); } else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) { this.replaceToken(140); return this.jsxParseElement(); } else { return super.parseExprAtom(refExpressionErrors); } } skipSpace() { const curContext = this.curContext(); if (!curContext.preserveSpace) super.skipSpace(); } getTokenFromCode(code) { const context = this.curContext(); if (context === _context.types.j_expr) { this.jsxReadToken(); return; } if (context === _context.types.j_oTag || context === _context.types.j_cTag) { if ((0, _identifier.isIdentifierStart)(code)) { this.jsxReadWord(); return; } if (code === 62) { ++this.state.pos; this.finishToken(141); return; } if ((code === 34 || code === 39) && context === _context.types.j_oTag) { this.jsxReadString(code); return; } } if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) { ++this.state.pos; this.finishToken(140); return; } super.getTokenFromCode(code); } updateContext(prevType) { const { context, type } = this.state; if (type === 56 && prevType === 140) { context.splice(-2, 2, _context.types.j_cTag); this.state.canStartJSXElement = false; } else if (type === 140) { context.push(_context.types.j_oTag); } else if (type === 141) { const out = context[context.length - 1]; if (out === _context.types.j_oTag && prevType === 56 || out === _context.types.j_cTag) { context.pop(); this.state.canStartJSXElement = context[context.length - 1] === _context.types.j_expr; } else { this.setContext(_context.types.j_expr); this.state.canStartJSXElement = true; } } else { this.state.canStartJSXElement = (0, _types.tokenComesBeforeExpression)(type); } } }; exports.default = _default; //# sourceMappingURL=index.js.map lib/plugins/jsx/index.js.map 0000644 00000114066 15120211212 0012013 0 ustar 00 {"version":3,"names":["_xhtml","require","_types","_context","_identifier","_whitespace","_parseError","JsxErrors","ParseErrorEnum","AttributeIsEmpty","MissingClosingTagElement","openingTagName","MissingClosingTagFragment","UnexpectedSequenceExpression","UnexpectedToken","unexpected","HTMLEntity","UnsupportedJsxValue","UnterminatedJsxContent","UnwrappedAdjacentJSXElements","isFragment","object","type","getQualifiedJSXName","name","namespace","property","Error","_default","superClass","JSXParserMixin","jsxReadToken","out","chunkStart","state","pos","length","raise","at","startLoc","ch","input","charCodeAt","start","canStartJSXElement","finishToken","getTokenFromCode","slice","jsxReadEntity","isNewLine","jsxReadNewLine","normalizeCRLF","String","fromCharCode","curLine","lineStart","jsxReadString","quote","Errors","UnterminatedString","startPos","codePointAtPos","radix","codePoint","readInt","undefined","fromCodePoint","count","semi","desc","entity","XHTMLEntities","jsxReadWord","isIdentifierChar","jsxParseIdentifier","node","startNode","match","value","tokenIsKeyword","tokenLabelName","next","finishNode","jsxParseNamespacedName","eat","startNodeAt","jsxParseElementName","newNode","jsxParseAttributeValue","setContext","tc","brace","jsxParseExpressionContainer","j_oTag","expression","parseExprAtom","jsxParseEmptyExpression","lastTokEndLoc","finishNodeAt","jsxParseSpreadChild","parseExpression","j_expr","expect","previousContext","jsxParseAttribute","argument","parseMaybeAssignAllowIn","jsxParseOpeningElementAt","jsxParseOpeningElementAfterName","attributes","push","selfClosing","jsxParseClosingElementAt","jsxParseElementAt","children","openingElement","closingElement","contents","openingFragment","closingFragment","jsxParseElement","newContext","context","refExpressionErrors","parseLiteral","replaceToken","skipSpace","curContext","preserveSpace","code","j_cTag","isIdentifierStart","updateContext","prevType","splice","pop","tokenComesBeforeExpression","exports","default"],"sources":["../../../src/plugins/jsx/index.ts"],"sourcesContent":["import * as charCodes from \"charcodes\";\n\nimport XHTMLEntities from \"./xhtml\";\nimport type Parser from \"../../parser\";\nimport type { ExpressionErrors } from \"../../parser/util\";\nimport {\n tokenComesBeforeExpression,\n tokenIsKeyword,\n tokenLabelName,\n type TokenType,\n tt,\n} from \"../../tokenizer/types\";\nimport type { TokContext } from \"../../tokenizer/context\";\nimport { types as tc } from \"../../tokenizer/context\";\nimport type * as N from \"../../types\";\nimport { isIdentifierChar, isIdentifierStart } from \"../../util/identifier\";\nimport type { Position } from \"../../util/location\";\nimport { isNewLine } from \"../../util/whitespace\";\nimport { Errors, ParseErrorEnum } from \"../../parse-error\";\nimport type { Undone } from \"../../parser/node\";\n\n/* eslint sort-keys: \"error\" */\nconst JsxErrors = ParseErrorEnum`jsx`({\n AttributeIsEmpty:\n \"JSX attributes must only be assigned a non-empty expression.\",\n MissingClosingTagElement: ({ openingTagName }: { openingTagName: string }) =>\n `Expected corresponding JSX closing tag for <${openingTagName}>.`,\n MissingClosingTagFragment: \"Expected corresponding JSX closing tag for <>.\",\n UnexpectedSequenceExpression:\n \"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?\",\n // FIXME: Unify with Errors.UnexpectedToken\n UnexpectedToken: ({\n unexpected,\n HTMLEntity,\n }: {\n unexpected: string;\n HTMLEntity: string;\n }) =>\n `Unexpected token \\`${unexpected}\\`. Did you mean \\`${HTMLEntity}\\` or \\`{'${unexpected}'}\\`?`,\n UnsupportedJsxValue:\n \"JSX value should be either an expression or a quoted JSX text.\",\n UnterminatedJsxContent: \"Unterminated JSX contents.\",\n UnwrappedAdjacentJSXElements:\n \"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?\",\n});\n\n/* eslint-disable sort-keys */\n\nfunction isFragment(object?: N.JSXElement | null): boolean {\n return object\n ? object.type === \"JSXOpeningFragment\" ||\n object.type === \"JSXClosingFragment\"\n : false;\n}\n\n// Transforms JSX element name to string.\n\nfunction getQualifiedJSXName(\n object: N.JSXIdentifier | N.JSXNamespacedName | N.JSXMemberExpression,\n): string {\n if (object.type === \"JSXIdentifier\") {\n return object.name;\n }\n\n if (object.type === \"JSXNamespacedName\") {\n return object.namespace.name + \":\" + object.name.name;\n }\n\n if (object.type === \"JSXMemberExpression\") {\n return (\n getQualifiedJSXName(object.object) +\n \".\" +\n getQualifiedJSXName(object.property)\n );\n }\n\n // istanbul ignore next\n throw new Error(\"Node had unexpected type: \" + object.type);\n}\n\nexport interface IJSXParserMixin {\n jsxParseOpeningElementAfterName(\n node: N.JSXOpeningElement,\n ): N.JSXOpeningElement;\n}\n\nexport default (superClass: typeof Parser) =>\n class JSXParserMixin extends superClass implements Parser, IJSXParserMixin {\n // Reads inline JSX contents token.\n\n jsxReadToken(): void {\n let out = \"\";\n let chunkStart = this.state.pos;\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(JsxErrors.UnterminatedJsxContent, {\n at: this.state.startLoc,\n });\n }\n\n const ch = this.input.charCodeAt(this.state.pos);\n\n switch (ch) {\n case charCodes.lessThan:\n case charCodes.leftCurlyBrace:\n if (this.state.pos === this.state.start) {\n if (ch === charCodes.lessThan && this.state.canStartJSXElement) {\n ++this.state.pos;\n this.finishToken(tt.jsxTagStart);\n } else {\n super.getTokenFromCode(ch);\n }\n return;\n }\n out += this.input.slice(chunkStart, this.state.pos);\n this.finishToken(tt.jsxText, out);\n return;\n\n case charCodes.ampersand:\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadEntity();\n chunkStart = this.state.pos;\n break;\n\n case charCodes.greaterThan:\n case charCodes.rightCurlyBrace:\n if (process.env.BABEL_8_BREAKING) {\n this.raise(JsxErrors.UnexpectedToken, {\n at: this.state.curPosition(),\n unexpected: this.input[this.state.pos],\n HTMLEntity:\n ch === charCodes.rightCurlyBrace ? \"}\" : \">\",\n });\n }\n /* falls through */\n\n default:\n if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadNewLine(true);\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n }\n }\n }\n\n jsxReadNewLine(normalizeCRLF: boolean): string {\n const ch = this.input.charCodeAt(this.state.pos);\n let out;\n ++this.state.pos;\n if (\n ch === charCodes.carriageReturn &&\n this.input.charCodeAt(this.state.pos) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n out = normalizeCRLF ? \"\\n\" : \"\\r\\n\";\n } else {\n out = String.fromCharCode(ch);\n }\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n\n return out;\n }\n\n jsxReadString(quote: number): void {\n let out = \"\";\n let chunkStart = ++this.state.pos;\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(Errors.UnterminatedString, {\n at: this.state.startLoc,\n });\n }\n\n const ch = this.input.charCodeAt(this.state.pos);\n if (ch === quote) break;\n if (ch === charCodes.ampersand) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadEntity();\n chunkStart = this.state.pos;\n } else if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadNewLine(false);\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n }\n out += this.input.slice(chunkStart, this.state.pos++);\n this.finishToken(tt.string, out);\n }\n\n jsxReadEntity(): string {\n const startPos = ++this.state.pos;\n if (this.codePointAtPos(this.state.pos) === charCodes.numberSign) {\n ++this.state.pos;\n\n let radix = 10;\n if (this.codePointAtPos(this.state.pos) === charCodes.lowercaseX) {\n radix = 16;\n ++this.state.pos;\n }\n\n const codePoint = this.readInt(\n radix,\n /* len */ undefined,\n /* forceLen */ false,\n /* allowNumSeparator */ \"bail\",\n );\n if (\n codePoint !== null &&\n this.codePointAtPos(this.state.pos) === charCodes.semicolon\n ) {\n ++this.state.pos;\n return String.fromCodePoint(codePoint);\n }\n } else {\n let count = 0;\n let semi = false;\n while (\n count++ < 10 &&\n this.state.pos < this.length &&\n !(semi = this.codePointAtPos(this.state.pos) == charCodes.semicolon)\n ) {\n ++this.state.pos;\n }\n\n if (semi) {\n const desc = this.input.slice(startPos, this.state.pos);\n const entity = XHTMLEntities[desc];\n ++this.state.pos;\n\n if (entity) {\n return entity;\n }\n }\n }\n\n // Not a valid entity\n this.state.pos = startPos;\n return \"&\";\n }\n\n // Read a JSX identifier (valid tag or attribute name).\n //\n // Optimized version since JSX identifiers can\"t contain\n // escape characters and so can be read as single slice.\n // Also assumes that first character was already checked\n // by isIdentifierStart in readToken.\n\n jsxReadWord(): void {\n let ch;\n const start = this.state.pos;\n do {\n ch = this.input.charCodeAt(++this.state.pos);\n } while (isIdentifierChar(ch) || ch === charCodes.dash);\n this.finishToken(tt.jsxName, this.input.slice(start, this.state.pos));\n }\n\n // Parse next token as JSX identifier\n\n jsxParseIdentifier(): N.JSXIdentifier {\n const node = this.startNode();\n if (this.match(tt.jsxName)) {\n node.name = this.state.value;\n } else if (tokenIsKeyword(this.state.type)) {\n node.name = tokenLabelName(this.state.type);\n } else {\n this.unexpected();\n }\n this.next();\n return this.finishNode(node, \"JSXIdentifier\");\n }\n\n // Parse namespaced identifier.\n\n jsxParseNamespacedName(): N.JSXNamespacedName {\n const startLoc = this.state.startLoc;\n const name = this.jsxParseIdentifier();\n if (!this.eat(tt.colon)) return name;\n\n const node = this.startNodeAt(startLoc);\n node.namespace = name;\n node.name = this.jsxParseIdentifier();\n return this.finishNode(node, \"JSXNamespacedName\");\n }\n\n // Parses element name in any form - namespaced, member\n // or single identifier.\n\n jsxParseElementName():\n | N.JSXIdentifier\n | N.JSXNamespacedName\n | N.JSXMemberExpression {\n const startLoc = this.state.startLoc;\n let node = this.jsxParseNamespacedName();\n if (node.type === \"JSXNamespacedName\") {\n return node;\n }\n while (this.eat(tt.dot)) {\n const newNode = this.startNodeAt(startLoc);\n newNode.object = node;\n newNode.property = this.jsxParseIdentifier();\n node = this.finishNode(newNode, \"JSXMemberExpression\");\n }\n return node;\n }\n\n // Parses any type of JSX attribute value.\n\n jsxParseAttributeValue(): N.Expression {\n let node;\n switch (this.state.type) {\n case tt.braceL:\n node = this.startNode();\n this.setContext(tc.brace);\n this.next();\n node = this.jsxParseExpressionContainer(node, tc.j_oTag);\n if (node.expression.type === \"JSXEmptyExpression\") {\n this.raise(JsxErrors.AttributeIsEmpty, { at: node });\n }\n return node;\n\n case tt.jsxTagStart:\n case tt.string:\n return this.parseExprAtom();\n\n default:\n throw this.raise(JsxErrors.UnsupportedJsxValue, {\n at: this.state.startLoc,\n });\n }\n }\n\n // JSXEmptyExpression is unique type since it doesn't actually parse anything,\n // and so it should start at the end of last read token (left brace) and finish\n // at the beginning of the next one (right brace).\n\n jsxParseEmptyExpression(): N.JSXEmptyExpression {\n const node = this.startNodeAt(this.state.lastTokEndLoc);\n return this.finishNodeAt(node, \"JSXEmptyExpression\", this.state.startLoc);\n }\n\n // Parse JSX spread child\n\n jsxParseSpreadChild(node: Undone<N.JSXSpreadChild>): N.JSXSpreadChild {\n this.next(); // ellipsis\n node.expression = this.parseExpression();\n this.setContext(tc.j_expr);\n this.state.canStartJSXElement = true;\n this.expect(tt.braceR);\n\n return this.finishNode(node, \"JSXSpreadChild\");\n }\n\n // Parses JSX expression enclosed into curly brackets.\n\n jsxParseExpressionContainer(\n node: Undone<N.JSXExpressionContainer>,\n previousContext: TokContext,\n ): N.JSXExpressionContainer {\n if (this.match(tt.braceR)) {\n node.expression = this.jsxParseEmptyExpression();\n } else {\n const expression = this.parseExpression();\n\n if (process.env.BABEL_8_BREAKING) {\n if (\n expression.type === \"SequenceExpression\" &&\n !expression.extra?.parenthesized\n ) {\n this.raise(JsxErrors.UnexpectedSequenceExpression, {\n at: expression.expressions[1],\n });\n }\n }\n\n node.expression = expression;\n }\n this.setContext(previousContext);\n this.state.canStartJSXElement = true;\n this.expect(tt.braceR);\n\n return this.finishNode(node, \"JSXExpressionContainer\");\n }\n\n // Parses following JSX attribute name-value pair.\n\n jsxParseAttribute(): N.JSXAttribute {\n const node = this.startNode();\n if (this.match(tt.braceL)) {\n this.setContext(tc.brace);\n this.next();\n this.expect(tt.ellipsis);\n node.argument = this.parseMaybeAssignAllowIn();\n this.setContext(tc.j_oTag);\n this.state.canStartJSXElement = true;\n this.expect(tt.braceR);\n return this.finishNode(node, \"JSXSpreadAttribute\");\n }\n node.name = this.jsxParseNamespacedName();\n node.value = this.eat(tt.eq) ? this.jsxParseAttributeValue() : null;\n return this.finishNode(node, \"JSXAttribute\");\n }\n\n // Parses JSX opening tag starting after \"<\".\n\n jsxParseOpeningElementAt(startLoc: Position): N.JSXOpeningElement {\n const node = this.startNodeAt<N.JSXOpeningElement | N.JSXOpeningFragment>(\n startLoc,\n );\n if (this.eat(tt.jsxTagEnd)) {\n // @ts-expect-error migrate to Babel types\n return this.finishNode(node, \"JSXOpeningFragment\");\n }\n node.name = this.jsxParseElementName();\n return this.jsxParseOpeningElementAfterName(\n node as Undone<N.JSXOpeningElement>,\n );\n }\n\n jsxParseOpeningElementAfterName(\n node: Undone<N.JSXOpeningElement>,\n ): N.JSXOpeningElement {\n const attributes: N.JSXAttribute[] = [];\n while (!this.match(tt.slash) && !this.match(tt.jsxTagEnd)) {\n attributes.push(this.jsxParseAttribute());\n }\n node.attributes = attributes;\n node.selfClosing = this.eat(tt.slash);\n this.expect(tt.jsxTagEnd);\n return this.finishNode(node, \"JSXOpeningElement\");\n }\n\n // Parses JSX closing tag starting after \"</\".\n\n jsxParseClosingElementAt(startLoc: Position): N.JSXClosingElement {\n const node = this.startNodeAt(startLoc);\n if (this.eat(tt.jsxTagEnd)) {\n return this.finishNode(node, \"JSXClosingFragment\");\n }\n node.name = this.jsxParseElementName();\n this.expect(tt.jsxTagEnd);\n return this.finishNode(node, \"JSXClosingElement\");\n }\n\n // Parses entire JSX element, including it\"s opening tag\n // (starting after \"<\"), attributes, contents and closing tag.\n\n jsxParseElementAt(startLoc: Position): N.JSXElement {\n const node = this.startNodeAt(startLoc);\n const children = [];\n const openingElement = this.jsxParseOpeningElementAt(startLoc);\n let closingElement = null;\n\n if (!openingElement.selfClosing) {\n contents: for (;;) {\n switch (this.state.type) {\n case tt.jsxTagStart:\n startLoc = this.state.startLoc;\n this.next();\n if (this.eat(tt.slash)) {\n closingElement = this.jsxParseClosingElementAt(startLoc);\n break contents;\n }\n children.push(this.jsxParseElementAt(startLoc));\n break;\n\n case tt.jsxText:\n children.push(this.parseExprAtom());\n break;\n\n case tt.braceL: {\n const node = this.startNode<\n N.JSXSpreadChild | N.JSXExpressionContainer\n >();\n this.setContext(tc.brace);\n this.next();\n if (this.match(tt.ellipsis)) {\n children.push(this.jsxParseSpreadChild(node));\n } else {\n children.push(\n this.jsxParseExpressionContainer(node, tc.j_expr),\n );\n }\n\n break;\n }\n // istanbul ignore next - should never happen\n default:\n this.unexpected();\n }\n }\n\n if (\n isFragment(openingElement) &&\n !isFragment(closingElement) &&\n closingElement !== null\n ) {\n this.raise(JsxErrors.MissingClosingTagFragment, {\n at: closingElement,\n });\n } else if (!isFragment(openingElement) && isFragment(closingElement)) {\n this.raise(JsxErrors.MissingClosingTagElement, {\n at: closingElement,\n openingTagName: getQualifiedJSXName(openingElement.name),\n });\n } else if (!isFragment(openingElement) && !isFragment(closingElement)) {\n if (\n getQualifiedJSXName(closingElement.name) !==\n getQualifiedJSXName(openingElement.name)\n ) {\n this.raise(JsxErrors.MissingClosingTagElement, {\n at: closingElement,\n openingTagName: getQualifiedJSXName(openingElement.name),\n });\n }\n }\n }\n\n if (isFragment(openingElement)) {\n node.openingFragment = openingElement;\n node.closingFragment = closingElement;\n } else {\n node.openingElement = openingElement;\n node.closingElement = closingElement;\n }\n node.children = children;\n if (this.match(tt.lt)) {\n throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, {\n at: this.state.startLoc,\n });\n }\n\n return isFragment(openingElement)\n ? this.finishNode(node, \"JSXFragment\")\n : this.finishNode(node, \"JSXElement\");\n }\n\n // Parses entire JSX element from current position.\n\n jsxParseElement(): N.JSXElement {\n const startLoc = this.state.startLoc;\n this.next();\n return this.jsxParseElementAt(startLoc);\n }\n\n setContext(newContext: TokContext) {\n const { context } = this.state;\n context[context.length - 1] = newContext;\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n parseExprAtom(refExpressionErrors?: ExpressionErrors | null): N.Expression {\n if (this.match(tt.jsxText)) {\n return this.parseLiteral(this.state.value, \"JSXText\");\n } else if (this.match(tt.jsxTagStart)) {\n return this.jsxParseElement();\n } else if (\n this.match(tt.lt) &&\n this.input.charCodeAt(this.state.pos) !== charCodes.exclamationMark\n ) {\n // In case we encounter an lt token here it will always be the start of\n // jsx as the lt sign is not allowed in places that expect an expression\n this.replaceToken(tt.jsxTagStart);\n return this.jsxParseElement();\n } else {\n return super.parseExprAtom(refExpressionErrors);\n }\n }\n\n skipSpace() {\n const curContext = this.curContext();\n if (!curContext.preserveSpace) super.skipSpace();\n }\n\n getTokenFromCode(code: number): void {\n const context = this.curContext();\n\n if (context === tc.j_expr) {\n this.jsxReadToken();\n return;\n }\n\n if (context === tc.j_oTag || context === tc.j_cTag) {\n if (isIdentifierStart(code)) {\n this.jsxReadWord();\n return;\n }\n\n if (code === charCodes.greaterThan) {\n ++this.state.pos;\n this.finishToken(tt.jsxTagEnd);\n return;\n }\n\n if (\n (code === charCodes.quotationMark || code === charCodes.apostrophe) &&\n context === tc.j_oTag\n ) {\n this.jsxReadString(code);\n return;\n }\n }\n\n if (\n code === charCodes.lessThan &&\n this.state.canStartJSXElement &&\n this.input.charCodeAt(this.state.pos + 1) !== charCodes.exclamationMark\n ) {\n ++this.state.pos;\n this.finishToken(tt.jsxTagStart);\n return;\n }\n\n super.getTokenFromCode(code);\n }\n\n updateContext(prevType: TokenType): void {\n const { context, type } = this.state;\n if (type === tt.slash && prevType === tt.jsxTagStart) {\n // do not consider JSX expr -> JSX open tag -> ... anymore\n // reconsider as closing tag context\n context.splice(-2, 2, tc.j_cTag);\n this.state.canStartJSXElement = false;\n } else if (type === tt.jsxTagStart) {\n // start opening tag context\n context.push(tc.j_oTag);\n } else if (type === tt.jsxTagEnd) {\n const out = context[context.length - 1];\n if ((out === tc.j_oTag && prevType === tt.slash) || out === tc.j_cTag) {\n context.pop();\n this.state.canStartJSXElement =\n context[context.length - 1] === tc.j_expr;\n } else {\n this.setContext(tc.j_expr);\n this.state.canStartJSXElement =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;MAElCoG,OAAO,CAACZ,IAAI,CAACpB,cAAE,CAACG,MAAM,CAAC;IACzB,CAAC,MAAM,IAAIvE,IAAI,QAAiB,EAAE;MAChC,MAAMU,GAAG,GAAG0F,OAAO,CAACA,OAAO,CAACtF,MAAM,GAAG,CAAC,CAAC;MACvC,IAAKJ,GAAG,KAAK0D,cAAE,CAACG,MAAM,IAAIwC,QAAQ,OAAa,IAAKrG,GAAG,KAAK0D,cAAE,CAACwC,MAAM,EAAE;QACrER,OAAO,CAACa,GAAG,CAAC,CAAC;QACb,IAAI,CAACrG,KAAK,CAACU,kBAAkB,GAC3B8E,OAAO,CAACA,OAAO,CAACtF,MAAM,GAAG,CAAC,CAAC,KAAKsD,cAAE,CAACW,MAAM;MAC7C,CAAC,MAAM;QACL,IAAI,CAACZ,UAAU,CAACC,cAAE,CAACW,MAAM,CAAC;QAC1B,IAAI,CAACnE,KAAK,CAACU,kBAAkB,GAAG,IAAI;MACtC;IACF,CAAC,MAAM;MACL,IAAI,CAACV,KAAK,CAACU,kBAAkB,GAAG,IAAA4F,iCAA0B,EAAClH,IAAI,CAAC;IAClE;EACF;AACF,CAAC;AAAAmH,OAAA,CAAAC,OAAA,GAAA9G,QAAA"} lib/plugins/jsx/xhtml.js 0000644 00000011501 15120211212 0011252 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; const entities = { __proto__: null, quot: "\u0022", amp: "&", apos: "\u0027", lt: "<", gt: ">", nbsp: "\u00A0", iexcl: "\u00A1", cent: "\u00A2", pound: "\u00A3", curren: "\u00A4", yen: "\u00A5", brvbar: "\u00A6", sect: "\u00A7", uml: "\u00A8", copy: "\u00A9", ordf: "\u00AA", laquo: "\u00AB", not: "\u00AC", shy: "\u00AD", reg: "\u00AE", macr: "\u00AF", deg: "\u00B0", plusmn: "\u00B1", sup2: "\u00B2", sup3: "\u00B3", acute: "\u00B4", micro: "\u00B5", para: "\u00B6", middot: "\u00B7", cedil: "\u00B8", sup1: "\u00B9", ordm: "\u00BA", raquo: "\u00BB", frac14: "\u00BC", frac12: "\u00BD", frac34: "\u00BE", iquest: "\u00BF", Agrave: "\u00C0", Aacute: "\u00C1", Acirc: "\u00C2", Atilde: "\u00C3", Auml: "\u00C4", Aring: "\u00C5", AElig: "\u00C6", Ccedil: "\u00C7", Egrave: "\u00C8", Eacute: "\u00C9", Ecirc: "\u00CA", Euml: "\u00CB", Igrave: "\u00CC", Iacute: "\u00CD", Icirc: "\u00CE", Iuml: "\u00CF", ETH: "\u00D0", Ntilde: "\u00D1", Ograve: "\u00D2", Oacute: "\u00D3", Ocirc: "\u00D4", Otilde: "\u00D5", Ouml: "\u00D6", times: "\u00D7", Oslash: "\u00D8", Ugrave: "\u00D9", Uacute: "\u00DA", Ucirc: "\u00DB", Uuml: "\u00DC", Yacute: "\u00DD", THORN: "\u00DE", szlig: "\u00DF", agrave: "\u00E0", aacute: "\u00E1", acirc: "\u00E2", atilde: "\u00E3", auml: "\u00E4", aring: "\u00E5", aelig: "\u00E6", ccedil: "\u00E7", egrave: "\u00E8", eacute: "\u00E9", ecirc: "\u00EA", euml: "\u00EB", igrave: "\u00EC", iacute: "\u00ED", icirc: "\u00EE", iuml: "\u00EF", eth: "\u00F0", ntilde: "\u00F1", ograve: "\u00F2", oacute: "\u00F3", ocirc: "\u00F4", otilde: "\u00F5", ouml: "\u00F6", divide: "\u00F7", oslash: "\u00F8", ugrave: "\u00F9", uacute: "\u00FA", ucirc: "\u00FB", uuml: "\u00FC", yacute: "\u00FD", thorn: "\u00FE", yuml: "\u00FF", OElig: "\u0152", oelig: "\u0153", Scaron: "\u0160", scaron: "\u0161", Yuml: "\u0178", fnof: "\u0192", circ: "\u02C6", tilde: "\u02DC", Alpha: "\u0391", Beta: "\u0392", Gamma: "\u0393", Delta: "\u0394", Epsilon: "\u0395", Zeta: "\u0396", Eta: "\u0397", Theta: "\u0398", Iota: "\u0399", Kappa: "\u039A", Lambda: "\u039B", Mu: "\u039C", Nu: "\u039D", Xi: "\u039E", Omicron: "\u039F", Pi: "\u03A0", Rho: "\u03A1", Sigma: "\u03A3", Tau: "\u03A4", Upsilon: "\u03A5", Phi: "\u03A6", Chi: "\u03A7", Psi: "\u03A8", Omega: "\u03A9", alpha: "\u03B1", beta: "\u03B2", gamma: "\u03B3", delta: "\u03B4", epsilon: "\u03B5", zeta: "\u03B6", eta: "\u03B7", theta: "\u03B8", iota: "\u03B9", kappa: "\u03BA", lambda: "\u03BB", mu: "\u03BC", nu: "\u03BD", xi: "\u03BE", omicron: "\u03BF", pi: "\u03C0", rho: "\u03C1", sigmaf: "\u03C2", sigma: "\u03C3", tau: "\u03C4", upsilon: "\u03C5", phi: "\u03C6", chi: "\u03C7", psi: "\u03C8", omega: "\u03C9", thetasym: "\u03D1", upsih: "\u03D2", piv: "\u03D6", ensp: "\u2002", emsp: "\u2003", thinsp: "\u2009", zwnj: "\u200C", zwj: "\u200D", lrm: "\u200E", rlm: "\u200F", ndash: "\u2013", mdash: "\u2014", lsquo: "\u2018", rsquo: "\u2019", sbquo: "\u201A", ldquo: "\u201C", rdquo: "\u201D", bdquo: "\u201E", dagger: "\u2020", Dagger: "\u2021", bull: "\u2022", hellip: "\u2026", permil: "\u2030", prime: "\u2032", Prime: "\u2033", lsaquo: "\u2039", rsaquo: "\u203A", oline: "\u203E", frasl: "\u2044", euro: "\u20AC", image: "\u2111", weierp: "\u2118", real: "\u211C", trade: "\u2122", alefsym: "\u2135", larr: "\u2190", uarr: "\u2191", rarr: "\u2192", darr: "\u2193", harr: "\u2194", crarr: "\u21B5", lArr: "\u21D0", uArr: "\u21D1", rArr: "\u21D2", dArr: "\u21D3", hArr: "\u21D4", forall: "\u2200", part: "\u2202", exist: "\u2203", empty: "\u2205", nabla: "\u2207", isin: "\u2208", notin: "\u2209", ni: "\u220B", prod: "\u220F", sum: "\u2211", minus: "\u2212", lowast: "\u2217", radic: "\u221A", prop: "\u221D", infin: "\u221E", ang: "\u2220", and: "\u2227", or: "\u2228", cap: "\u2229", cup: "\u222A", int: "\u222B", there4: "\u2234", sim: "\u223C", cong: "\u2245", asymp: "\u2248", ne: "\u2260", equiv: "\u2261", le: "\u2264", ge: "\u2265", sub: "\u2282", sup: "\u2283", nsub: "\u2284", sube: "\u2286", supe: "\u2287", oplus: "\u2295", otimes: "\u2297", perp: "\u22A5", sdot: "\u22C5", lceil: "\u2308", rceil: "\u2309", lfloor: "\u230A", rfloor: "\u230B", lang: "\u2329", rang: "\u232A", loz: "\u25CA", spades: "\u2660", clubs: "\u2663", hearts: "\u2665", diams: "\u2666" }; var _default = entities; exports.default = _default; //# sourceMappingURL=xhtml.js.map lib/plugins/jsx/xhtml.js.map 0000644 00000032155 15120211212 0012036 0 ustar 00 {"version":3,"names":["entities","__proto__","quot","amp","apos","lt","gt","nbsp","iexcl","cent","pound","curren","yen","brvbar","sect","uml","copy","ordf","laquo","not","shy","reg","macr","deg","plusmn","sup2","sup3","acute","micro","para","middot","cedil","sup1","ordm","raquo","frac14","frac12","frac34","iquest","Agrave","Aacute","Acirc","Atilde","Auml","Aring","AElig","Ccedil","Egrave","Eacute","Ecirc","Euml","Igrave","Iacute","Icirc","Iuml","ETH","Ntilde","Ograve","Oacute","Ocirc","Otilde","Ouml","times","Oslash","Ugrave","Uacute","Ucirc","Uuml","Yacute","THORN","szlig","agrave","aacute","acirc","atilde","auml","aring","aelig","ccedil","egrave","eacute","ecirc","euml","igrave","iacute","icirc","iuml","eth","ntilde","ograve","oacute","ocirc","otilde","ouml","divide","oslash","ugrave","uacute","ucirc","uuml","yacute","thorn","yuml","OElig","oelig","Scaron","scaron","Yuml","fnof","circ","tilde","Alpha","Beta","Gamma","Delta","Epsilon","Zeta","Eta","Theta","Iota","Kappa","Lambda","Mu","Nu","Xi","Omicron","Pi","Rho","Sigma","Tau","Upsilon","Phi","Chi","Psi","Omega","alpha","beta","gamma","delta","epsilon","zeta","eta","theta","iota","kappa","lambda","mu","nu","xi","omicron","pi","rho","sigmaf","sigma","tau","upsilon","phi","chi","psi","omega","thetasym","upsih","piv","ensp","emsp","thinsp","zwnj","zwj","lrm","rlm","ndash","mdash","lsquo","rsquo","sbquo","ldquo","rdquo","bdquo","dagger","Dagger","bull","hellip","permil","prime","Prime","lsaquo","rsaquo","oline","frasl","euro","image","weierp","real","trade","alefsym","larr","uarr","rarr","darr","harr","crarr","lArr","uArr","rArr","dArr","hArr","forall","part","exist","empty","nabla","isin","notin","ni","prod","sum","minus","lowast","radic","prop","infin","ang","and","or","cap","cup","int","there4","sim","cong","asymp","ne","equiv","le","ge","sub","sup","nsub","sube","supe","oplus","otimes","perp","sdot","lceil","rceil","lfloor","rfloor","lang","rang","loz","spades","clubs","hearts","diams","_default","exports","default"],"sources":["../../../src/plugins/jsx/xhtml.ts"],"sourcesContent":["const entities: {\n __proto__: null;\n [name: string]: string;\n} = {\n __proto__: null,\n quot: \"\\u0022\",\n amp: \"&\",\n apos: \"\\u0027\",\n lt: \"<\",\n gt: \">\",\n nbsp: \"\\u00A0\",\n iexcl: \"\\u00A1\",\n cent: \"\\u00A2\",\n pound: \"\\u00A3\",\n curren: \"\\u00A4\",\n yen: \"\\u00A5\",\n brvbar: \"\\u00A6\",\n sect: \"\\u00A7\",\n uml: \"\\u00A8\",\n copy: \"\\u00A9\",\n ordf: \"\\u00AA\",\n laquo: \"\\u00AB\",\n not: \"\\u00AC\",\n shy: \"\\u00AD\",\n reg: \"\\u00AE\",\n macr: \"\\u00AF\",\n deg: \"\\u00B0\",\n plusmn: \"\\u00B1\",\n sup2: \"\\u00B2\",\n sup3: \"\\u00B3\",\n acute: \"\\u00B4\",\n micro: \"\\u00B5\",\n para: \"\\u00B6\",\n middot: \"\\u00B7\",\n cedil: \"\\u00B8\",\n sup1: \"\\u00B9\",\n ordm: \"\\u00BA\",\n raquo: \"\\u00BB\",\n frac14: \"\\u00BC\",\n frac12: \"\\u00BD\",\n frac34: \"\\u00BE\",\n iquest: \"\\u00BF\",\n Agrave: \"\\u00C0\",\n Aacute: \"\\u00C1\",\n Acirc: \"\\u00C2\",\n Atilde: \"\\u00C3\",\n Auml: \"\\u00C4\",\n Aring: \"\\u00C5\",\n AElig: \"\\u00C6\",\n Ccedil: \"\\u00C7\",\n Egrave: \"\\u00C8\",\n Eacute: \"\\u00C9\",\n Ecirc: \"\\u00CA\",\n Euml: \"\\u00CB\",\n Igrave: \"\\u00CC\",\n Iacute: \"\\u00CD\",\n Icirc: \"\\u00CE\",\n Iuml: \"\\u00CF\",\n ETH: \"\\u00D0\",\n Ntilde: \"\\u00D1\",\n Ograve: \"\\u00D2\",\n Oacute: \"\\u00D3\",\n Ocirc: \"\\u00D4\",\n Otilde: \"\\u00D5\",\n Ouml: \"\\u00D6\",\n times: \"\\u00D7\",\n Oslash: \"\\u00D8\",\n Ugrave: \"\\u00D9\",\n Uacute: \"\\u00DA\",\n Ucirc: \"\\u00DB\",\n Uuml: \"\\u00DC\",\n Yacute: \"\\u00DD\",\n THORN: \"\\u00DE\",\n szlig: \"\\u00DF\",\n agrave: \"\\u00E0\",\n aacute: \"\\u00E1\",\n acirc: \"\\u00E2\",\n atilde: \"\\u00E3\",\n auml: \"\\u00E4\",\n aring: \"\\u00E5\",\n aelig: \"\\u00E6\",\n ccedil: \"\\u00E7\",\n egrave: \"\\u00E8\",\n eacute: \"\\u00E9\",\n ecirc: \"\\u00EA\",\n euml: \"\\u00EB\",\n igrave: \"\\u00EC\",\n iacute: \"\\u00ED\",\n icirc: \"\\u00EE\",\n iuml: \"\\u00EF\",\n eth: \"\\u00F0\",\n ntilde: \"\\u00F1\",\n ograve: \"\\u00F2\",\n oacute: \"\\u00F3\",\n ocirc: \"\\u00F4\",\n otilde: \"\\u00F5\",\n ouml: \"\\u00F6\",\n divide: \"\\u00F7\",\n oslash: \"\\u00F8\",\n ugrave: \"\\u00F9\",\n uacute: \"\\u00FA\",\n ucirc: \"\\u00FB\",\n uuml: \"\\u00FC\",\n yacute: \"\\u00FD\",\n thorn: \"\\u00FE\",\n yuml: \"\\u00FF\",\n OElig: \"\\u0152\",\n oelig: \"\\u0153\",\n Scaron: \"\\u0160\",\n scaron: \"\\u0161\",\n Yuml: \"\\u0178\",\n fnof: \"\\u0192\",\n circ: \"\\u02C6\",\n tilde: \"\\u02DC\",\n Alpha: \"\\u0391\",\n Beta: \"\\u0392\",\n Gamma: \"\\u0393\",\n Delta: \"\\u0394\",\n Epsilon: \"\\u0395\",\n Zeta: \"\\u0396\",\n Eta: \"\\u0397\",\n Theta: \"\\u0398\",\n Iota: \"\\u0399\",\n Kappa: \"\\u039A\",\n Lambda: \"\\u039B\",\n Mu: \"\\u039C\",\n Nu: \"\\u039D\",\n Xi: \"\\u039E\",\n Omicron: \"\\u039F\",\n Pi: \"\\u03A0\",\n Rho: \"\\u03A1\",\n Sigma: \"\\u03A3\",\n Tau: \"\\u03A4\",\n Upsilon: \"\\u03A5\",\n Phi: \"\\u03A6\",\n Chi: \"\\u03A7\",\n Psi: \"\\u03A8\",\n Omega: \"\\u03A9\",\n alpha: \"\\u03B1\",\n beta: \"\\u03B2\",\n gamma: \"\\u03B3\",\n delta: \"\\u03B4\",\n epsilon: \"\\u03B5\",\n zeta: \"\\u03B6\",\n eta: \"\\u03B7\",\n theta: \"\\u03B8\",\n iota: \"\\u03B9\",\n kappa: \"\\u03BA\",\n lambda: \"\\u03BB\",\n mu: \"\\u03BC\",\n nu: \"\\u03BD\",\n xi: \"\\u03BE\",\n omicron: \"\\u03BF\",\n pi: \"\\u03C0\",\n rho: \"\\u03C1\",\n sigmaf: \"\\u03C2\",\n sigma: \"\\u03C3\",\n tau: \"\\u03C4\",\n upsilon: \"\\u03C5\",\n phi: \"\\u03C6\",\n chi: \"\\u03C7\",\n psi: \"\\u03C8\",\n omega: \"\\u03C9\",\n thetasym: \"\\u03D1\",\n upsih: \"\\u03D2\",\n piv: \"\\u03D6\",\n ensp: \"\\u2002\",\n emsp: \"\\u2003\",\n thinsp: \"\\u2009\",\n zwnj: \"\\u200C\",\n zwj: \"\\u200D\",\n lrm: \"\\u200E\",\n rlm: \"\\u200F\",\n ndash: \"\\u2013\",\n mdash: \"\\u2014\",\n lsquo: \"\\u2018\",\n rsquo: \"\\u2019\",\n sbquo: \"\\u201A\",\n ldquo: \"\\u201C\",\n rdquo: \"\\u201D\",\n bdquo: \"\\u201E\",\n dagger: \"\\u2020\",\n Dagger: \"\\u2021\",\n bull: \"\\u2022\",\n hellip: \"\\u2026\",\n permil: \"\\u2030\",\n prime: \"\\u2032\",\n Prime: \"\\u2033\",\n lsaquo: \"\\u2039\",\n rsaquo: \"\\u203A\",\n oline: \"\\u203E\",\n frasl: \"\\u2044\",\n euro: \"\\u20AC\",\n image: \"\\u2111\",\n weierp: \"\\u2118\",\n real: \"\\u211C\",\n trade: \"\\u2122\",\n alefsym: \"\\u2135\",\n larr: \"\\u2190\",\n uarr: \"\\u2191\",\n rarr: \"\\u2192\",\n darr: \"\\u2193\",\n harr: \"\\u2194\",\n crarr: \"\\u21B5\",\n lArr: \"\\u21D0\",\n uArr: \"\\u21D1\",\n rArr: \"\\u21D2\",\n dArr: \"\\u21D3\",\n hArr: \"\\u21D4\",\n forall: \"\\u2200\",\n part: \"\\u2202\",\n exist: \"\\u2203\",\n empty: \"\\u2205\",\n nabla: \"\\u2207\",\n isin: \"\\u2208\",\n notin: \"\\u2209\",\n ni: \"\\u220B\",\n prod: \"\\u220F\",\n sum: \"\\u2211\",\n minus: \"\\u2212\",\n lowast: \"\\u2217\",\n radic: \"\\u221A\",\n prop: \"\\u221D\",\n infin: \"\\u221E\",\n ang: \"\\u2220\",\n and: \"\\u2227\",\n or: \"\\u2228\",\n cap: \"\\u2229\",\n cup: \"\\u222A\",\n int: \"\\u222B\",\n there4: \"\\u2234\",\n sim: \"\\u223C\",\n cong: \"\\u2245\",\n asymp: \"\\u2248\",\n ne: \"\\u2260\",\n equiv: \"\\u2261\",\n le: \"\\u2264\",\n ge: \"\\u2265\",\n sub: \"\\u2282\",\n sup: \"\\u2283\",\n nsub: \"\\u2284\",\n sube: \"\\u2286\",\n supe: \"\\u2287\",\n oplus: \"\\u2295\",\n otimes: \"\\u2297\",\n perp: \"\\u22A5\",\n sdot: \"\\u22C5\",\n lceil: \"\\u2308\",\n rceil: \"\\u2309\",\n lfloor: \"\\u230A\",\n rfloor: \"\\u230B\",\n lang: \"\\u2329\",\n rang: \"\\u232A\",\n loz: \"\\u25CA\",\n spades: \"\\u2660\",\n clubs: \"\\u2663\",\n hearts: \"\\u2665\",\n diams: \"\\u2666\",\n} as const;\nexport default entities;\n"],"mappings":";;;;;;AAAA,MAAMA,QAGL,GAAG;EACFC,SAAS,EAAE,IAAI;EACfC,IAAI,EAAE,QAAQ;EACdC,GAAG,EAAE,GAAG;EACRC,IAAI,EAAE,QAAQ;EACdC,EAAE,EAAE,GAAG;EACPC,EAAE,EAAE,GAAG;EACPC,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAE,QAAQ;EACfC,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAE,QAAQ;EACfC,MAAM,EAAE,QAAQ;EAChBC,GAAG,EAAE,QAAQ;EACbC,MAAM,EAAE,QAAQ;EAChBC,IAAI,EAAE,QAAQ;EACdC,GAAG,EAAE,QAAQ;EACbC,IAAI,EAAE,QAAQ;EACdC,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAE,QAAQ;EACfC,GAAG,EAAE,QAAQ;EACbC,GAAG,EAAE,QAAQ;EACbC,GAAG,EAAE,QAAQ;EACbC,IAAI,EAAE,QAAQ;EACdC,GAAG,EAAE,QAAQ;EACbC,MAAM,EAAE,QAAQ;EAChBC,IAAI,EAAE,QAAQ;EACdC,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE,QAAQ;EACfC,IAAI,EAAE,QAAQ;EACdC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,QAAQ;EACfC,IAAI,EAAE,QAAQ;EACdC,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAE,QAAQ;EACfC,MAAM,EAAE,QAAQ;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BC,GAAG,EAAE,QAAQ;EACbC,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAE,QAAQ;EACfC,EAAE,EAAE,QAAQ;EACZC,KAAK,EAAE,QAAQ;EACfC,EAAE,EAAE,QAAQ;EACZC,EAAE,EAAE,QAAQ;EACZC,GAAG,EAAE,QAAQ;EACbC,GAAG,EAAE,QAAQ;EACbC,IAAI,EAAE,QAAQ;EACdC,IAAI,EAAE,QAAQ;EACdC,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAE,QAAQ;EACfC,MAAM,EAAE,QAAQ;EAChBC,IAAI,EAAE,QAAQ;EACdC,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE,QAAQ;EACfC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE,QAAQ;EAChBC,IAAI,EAAE,QAAQ;EACdC,IAAI,EAAE,QAAQ;EACdC,GAAG,EAAE,QAAQ;EACbC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,QAAQ;EACfC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE;AACT,CAAU;AAAC,IAAAC,QAAA,GACI/P,QAAQ;AAAAgQ,OAAA,CAAAC,OAAA,GAAAF,QAAA"} lib/plugins/placeholders.js 0000644 00000015664 15120211212 0011775 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _types = require("../tokenizer/types"); var _parseError = require("../parse-error"); const PlaceholderErrors = (0, _parseError.ParseErrorEnum)`placeholders`({ ClassNameIsRequired: "A class name is required.", UnexpectedSpace: "Unexpected space in placeholder." }); var _default = superClass => class PlaceholdersParserMixin extends superClass { parsePlaceholder(expectedNode) { if (this.match(142)) { const node = this.startNode(); this.next(); this.assertNoSpace(); node.name = super.parseIdentifier(true); this.assertNoSpace(); this.expect(142); return this.finishPlaceholder(node, expectedNode); } } finishPlaceholder(node, expectedNode) { const isFinished = !!(node.expectedNode && node.type === "Placeholder"); node.expectedNode = expectedNode; return isFinished ? node : this.finishNode(node, "Placeholder"); } getTokenFromCode(code) { if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) { this.finishOp(142, 2); } else { super.getTokenFromCode(code); } } parseExprAtom(refExpressionErrors) { return this.parsePlaceholder("Expression") || super.parseExprAtom(refExpressionErrors); } parseIdentifier(liberal) { return this.parsePlaceholder("Identifier") || super.parseIdentifier(liberal); } checkReservedWord(word, startLoc, checkKeywords, isBinding) { if (word !== undefined) { super.checkReservedWord(word, startLoc, checkKeywords, isBinding); } } parseBindingAtom() { return this.parsePlaceholder("Pattern") || super.parseBindingAtom(); } isValidLVal(type, isParenthesized, binding) { return type === "Placeholder" || super.isValidLVal(type, isParenthesized, binding); } toAssignable(node, isLHS) { if (node && node.type === "Placeholder" && node.expectedNode === "Expression") { node.expectedNode = "Pattern"; } else { super.toAssignable(node, isLHS); } } chStartsBindingIdentifier(ch, pos) { if (super.chStartsBindingIdentifier(ch, pos)) { return true; } const nextToken = this.lookahead(); if (nextToken.type === 142) { return true; } return false; } verifyBreakContinue(node, isBreak) { if (node.label && node.label.type === "Placeholder") return; super.verifyBreakContinue(node, isBreak); } parseExpressionStatement(node, expr) { if (expr.type !== "Placeholder" || expr.extra && expr.extra.parenthesized) { return super.parseExpressionStatement(node, expr); } if (this.match(14)) { const stmt = node; stmt.label = this.finishPlaceholder(expr, "Identifier"); this.next(); stmt.body = super.parseStatementOrSloppyAnnexBFunctionDeclaration(); return this.finishNode(stmt, "LabeledStatement"); } this.semicolon(); node.name = expr.name; return this.finishPlaceholder(node, "Statement"); } parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse) { return this.parsePlaceholder("BlockStatement") || super.parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse); } parseFunctionId(requireId) { return this.parsePlaceholder("Identifier") || super.parseFunctionId(requireId); } parseClass(node, isStatement, optionalId) { const type = isStatement ? "ClassDeclaration" : "ClassExpression"; this.next(); const oldStrict = this.state.strict; const placeholder = this.parsePlaceholder("Identifier"); if (placeholder) { if (this.match(81) || this.match(142) || this.match(5)) { node.id = placeholder; } else if (optionalId || !isStatement) { node.id = null; node.body = this.finishPlaceholder(placeholder, "ClassBody"); return this.finishNode(node, type); } else { throw this.raise(PlaceholderErrors.ClassNameIsRequired, { at: this.state.startLoc }); } } else { this.parseClassId(node, isStatement, optionalId); } super.parseClassSuper(node); node.body = this.parsePlaceholder("ClassBody") || super.parseClassBody(!!node.superClass, oldStrict); return this.finishNode(node, type); } parseExport(node, decorators) { const placeholder = this.parsePlaceholder("Identifier"); if (!placeholder) return super.parseExport(node, decorators); if (!this.isContextual(97) && !this.match(12)) { node.specifiers = []; node.source = null; node.declaration = this.finishPlaceholder(placeholder, "Declaration"); return this.finishNode(node, "ExportNamedDeclaration"); } this.expectPlugin("exportDefaultFrom"); const specifier = this.startNode(); specifier.exported = placeholder; node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; return super.parseExport(node, decorators); } isExportDefaultSpecifier() { if (this.match(65)) { const next = this.nextTokenStart(); if (this.isUnparsedContextual(next, "from")) { if (this.input.startsWith((0, _types.tokenLabelName)(142), this.nextTokenStartSince(next + 4))) { return true; } } } return super.isExportDefaultSpecifier(); } maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) { var _specifiers; if ((_specifiers = node.specifiers) != null && _specifiers.length) { return true; } return super.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier); } checkExport(node) { const { specifiers } = node; if (specifiers != null && specifiers.length) { node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder"); } super.checkExport(node); node.specifiers = specifiers; } parseImport(node) { const placeholder = this.parsePlaceholder("Identifier"); if (!placeholder) return super.parseImport(node); node.specifiers = []; if (!this.isContextual(97) && !this.match(12)) { node.source = this.finishPlaceholder(placeholder, "StringLiteral"); this.semicolon(); return this.finishNode(node, "ImportDeclaration"); } const specifier = this.startNodeAtNode(placeholder); specifier.local = placeholder; node.specifiers.push(this.finishNode(specifier, "ImportDefaultSpecifier")); if (this.eat(12)) { const hasStarImport = this.maybeParseStarImportSpecifier(node); if (!hasStarImport) this.parseNamedImportSpecifiers(node); } this.expectContextual(97); node.source = this.parseImportSource(); this.semicolon(); return this.finishNode(node, "ImportDeclaration"); } parseImportSource() { return this.parsePlaceholder("StringLiteral") || super.parseImportSource(); } assertNoSpace() { if (this.state.start > this.state.lastTokEndLoc.index) { this.raise(PlaceholderErrors.UnexpectedSpace, { at: this.state.lastTokEndLoc }); } } }; exports.default = _default; //# sourceMappingURL=placeholders.js.map lib/plugins/placeholders.js.map 0000644 00000054013 15120211212 0012540 0 ustar 00 {"version":3,"names":["_types","require","_parseError","PlaceholderErrors","ParseErrorEnum","ClassNameIsRequired","UnexpectedSpace","_default","superClass","PlaceholdersParserMixin","parsePlaceholder","expectedNode","match","node","startNode","next","assertNoSpace","name","parseIdentifier","expect","finishPlaceholder","isFinished","type","finishNode","getTokenFromCode","code","input","charCodeAt","state","pos","finishOp","parseExprAtom","refExpressionErrors","liberal","checkReservedWord","word","startLoc","checkKeywords","isBinding","undefined","parseBindingAtom","isValidLVal","isParenthesized","binding","toAssignable","isLHS","chStartsBindingIdentifier","ch","nextToken","lookahead","verifyBreakContinue","isBreak","label","parseExpressionStatement","expr","extra","parenthesized","stmt","body","parseStatementOrSloppyAnnexBFunctionDeclaration","semicolon","parseBlock","allowDirectives","createNewLexicalScope","afterBlockParse","parseFunctionId","requireId","parseClass","isStatement","optionalId","oldStrict","strict","placeholder","id","raise","at","parseClassId","parseClassSuper","parseClassBody","parseExport","decorators","isContextual","specifiers","source","declaration","expectPlugin","specifier","exported","isExportDefaultSpecifier","nextTokenStart","isUnparsedContextual","startsWith","tokenLabelName","nextTokenStartSince","maybeParseExportDefaultSpecifier","maybeDefaultIdentifier","_specifiers","length","checkExport","filter","parseImport","startNodeAtNode","local","push","eat","hasStarImport","maybeParseStarImportSpecifier","parseNamedImportSpecifiers","expectContextual","parseImportSource","start","lastTokEndLoc","index","exports","default"],"sources":["../../src/plugins/placeholders.ts"],"sourcesContent":["import * as charCodes from \"charcodes\";\n\nimport { tokenLabelName, tt } from \"../tokenizer/types\";\nimport type Parser from \"../parser\";\nimport type * as N from \"../types\";\nimport { ParseErrorEnum } from \"../parse-error\";\nimport type { Undone } from \"../parser/node\";\nimport type { ExpressionErrors } from \"../parser/util\";\nimport type { BindingTypes } from \"../util/scopeflags\";\nimport type { Position } from \"../util/location\";\n\ntype PossiblePlaceholders = {\n Identifier: N.Identifier;\n StringLiteral: N.StringLiteral;\n Expression: N.Expression;\n Statement: N.Statement;\n Declaration: N.Declaration;\n BlockStatement: N.BlockStatement;\n ClassBody: N.ClassBody;\n Pattern: N.Pattern;\n};\nexport type PlaceholderTypes = keyof PossiblePlaceholders;\n\ntype NodeOf<T extends keyof PossiblePlaceholders> = PossiblePlaceholders[T];\n// todo: when there is proper union type for Node\n// type NodeOf<T extends PlaceholderTypes> = Extract<N.Node, { type: T }>;\n\n// todo: Placeholder<T> breaks everything, because its type is incompatible with\n// the substituted nodes.\ntype MaybePlaceholder<T extends PlaceholderTypes> = NodeOf<T>; // | Placeholder<T>\n\n/* eslint sort-keys: \"error\" */\nconst PlaceholderErrors = ParseErrorEnum`placeholders`({\n ClassNameIsRequired: \"A class name is required.\",\n UnexpectedSpace: \"Unexpected space in placeholder.\",\n});\n\n/* eslint-disable sort-keys */\n\nexport default (superClass: typeof Parser) =>\n class PlaceholdersParserMixin extends superClass implements Parser {\n parsePlaceholder<T extends PlaceholderTypes>(\n expectedNode: T,\n ): /*?N.Placeholder<T>*/ MaybePlaceholder<T> | undefined | null {\n if (this.match(tt.placeholder)) {\n const node = this.startNode();\n this.next();\n this.assertNoSpace();\n\n // We can't use this.parseIdentifier because\n // we don't want nested placeholders.\n node.name = super.parseIdentifier(/* liberal */ true);\n\n this.assertNoSpace();\n this.expect(tt.placeholder);\n // @ts-expect-error placeholder typings\n return this.finishPlaceholder(node, expectedNode);\n }\n }\n\n finishPlaceholder<T extends PlaceholderTypes>(\n node: N.Node,\n expectedNode: T,\n ): /*N.Placeholder<T>*/ MaybePlaceholder<T> {\n const isFinished = !!(node.expectedNode && node.type === \"Placeholder\");\n node.expectedNode = expectedNode;\n\n // @ts-expect-error todo(flow->ts)\n return isFinished ? node : this.finishNode(node, \"Placeholder\");\n }\n\n /* ============================================================ *\n * tokenizer/index.js *\n * ============================================================ */\n\n getTokenFromCode(code: number) {\n if (\n code === charCodes.percentSign &&\n this.input.charCodeAt(this.state.pos + 1) === charCodes.percentSign\n ) {\n this.finishOp(tt.placeholder, 2);\n } else {\n super.getTokenFromCode(code);\n }\n }\n\n /* ============================================================ *\n * parser/expression.js *\n * ============================================================ */\n\n parseExprAtom(\n refExpressionErrors?: ExpressionErrors | null,\n ): MaybePlaceholder<\"Expression\"> {\n return (\n this.parsePlaceholder(\"Expression\") ||\n super.parseExprAtom(refExpressionErrors)\n );\n }\n\n parseIdentifier(liberal?: boolean): MaybePlaceholder<\"Identifier\"> {\n // NOTE: This function only handles identifiers outside of\n // expressions and binding patterns, since they are already\n // handled by the parseExprAtom and parseBindingAtom functions.\n // This is needed, for example, to parse \"class %%NAME%% {}\".\n return (\n this.parsePlaceholder(\"Identifier\") || super.parseIdentifier(liberal)\n );\n }\n\n checkReservedWord(\n word: string,\n startLoc: Position,\n checkKeywords: boolean,\n isBinding: boolean,\n ) {\n // Sometimes we call #checkReservedWord(node.name), expecting\n // that node is an Identifier. If it is a Placeholder, name\n // will be undefined.\n if (word !== undefined) {\n super.checkReservedWord(word, startLoc, checkKeywords, isBinding);\n }\n }\n\n /* ============================================================ *\n * parser/lval.js *\n * ============================================================ */\n\n parseBindingAtom(): MaybePlaceholder<\"Pattern\"> {\n return this.parsePlaceholder(\"Pattern\") || super.parseBindingAtom();\n }\n\n isValidLVal(type: string, isParenthesized: boolean, binding: BindingTypes) {\n return (\n type === \"Placeholder\" ||\n super.isValidLVal(type, isParenthesized, binding)\n );\n }\n\n toAssignable(node: N.Node, isLHS: boolean): void {\n if (\n node &&\n node.type === \"Placeholder\" &&\n node.expectedNode === \"Expression\"\n ) {\n node.expectedNode = \"Pattern\";\n } else {\n super.toAssignable(node, isLHS);\n }\n }\n\n /* ============================================================ *\n * parser/statement.js *\n * ============================================================ */\n\n chStartsBindingIdentifier(ch: number, pos: number): boolean {\n if (super.chStartsBindingIdentifier(ch, pos)) {\n return true;\n }\n\n // Accept \"let %%\" as the start of \"let %%placeholder%%\", as though the\n // placeholder were an identifier.\n const nextToken = this.lookahead();\n if (nextToken.type === tt.placeholder) {\n return true;\n }\n\n return false;\n }\n\n verifyBreakContinue(\n node: N.BreakStatement | N.ContinueStatement,\n isBreak: boolean,\n ) {\n // @ts-expect-error: node.label could be Placeholder\n if (node.label && node.label.type === \"Placeholder\") return;\n super.verifyBreakContinue(node, isBreak);\n }\n\n // @ts-expect-error Plugin will override parser interface\n parseExpressionStatement(\n node: MaybePlaceholder<\"Statement\">,\n expr: N.Expression,\n ): MaybePlaceholder<\"Statement\"> {\n if (\n expr.type !== \"Placeholder\" ||\n (expr.extra && expr.extra.parenthesized)\n ) {\n // @ts-expect-error placeholder typings\n return super.parseExpressionStatement(node, expr);\n }\n\n if (this.match(tt.colon)) {\n // @ts-expect-error placeholder typings\n const stmt: N.LabeledStatement = node;\n stmt.label = this.finishPlaceholder(expr, \"Identifier\");\n this.next();\n stmt.body = super.parseStatementOrSloppyAnnexBFunctionDeclaration();\n return this.finishNode(stmt, \"LabeledStatement\");\n }\n\n this.semicolon();\n node.name = expr.name;\n return this.finishPlaceholder(node, \"Statement\");\n }\n\n parseBlock(\n allowDirectives?: boolean,\n createNewLexicalScope?: boolean,\n afterBlockParse?: (hasStrictModeDirective: boolean) => void,\n ): MaybePlaceholder<\"BlockStatement\"> {\n return (\n this.parsePlaceholder(\"BlockStatement\") ||\n super.parseBlock(\n allowDirectives,\n createNewLexicalScope,\n afterBlockParse,\n )\n );\n }\n\n parseFunctionId(\n requireId?: boolean,\n ): MaybePlaceholder<\"Identifier\"> | undefined | null {\n return (\n this.parsePlaceholder(\"Identifier\") || super.parseFunctionId(requireId)\n );\n }\n // @ts-expect-error Plugin will override parser interface\n parseClass<T extends N.Class>(\n node: T,\n isStatement: /* T === ClassDeclaration */ boolean,\n optionalId?: boolean,\n ): T {\n const type = isStatement ? \"ClassDeclaration\" : \"ClassExpression\";\n\n this.next();\n const oldStrict = this.state.strict;\n\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (placeholder) {\n if (\n this.match(tt._extends) ||\n this.match(tt.placeholder) ||\n this.match(tt.braceL)\n ) {\n node.id = placeholder;\n } else if (optionalId || !isStatement) {\n node.id = null;\n node.body = this.finishPlaceholder(placeholder, \"ClassBody\");\n return this.finishNode(node, type);\n } else {\n throw this.raise(PlaceholderErrors.ClassNameIsRequired, {\n at: this.state.startLoc,\n });\n }\n } else {\n this.parseClassId(node, isStatement, optionalId);\n }\n\n super.parseClassSuper(node);\n node.body =\n this.parsePlaceholder(\"ClassBody\") ||\n super.parseClassBody(!!node.superClass, oldStrict);\n return this.finishNode(node, type);\n }\n\n parseExport(node: N.Node, decorators: N.Decorator[] | null): N.AnyExport {\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (!placeholder) return super.parseExport(node, decorators);\n\n if (!this.isContextual(tt._from) && !this.match(tt.comma)) {\n // export %%DECL%%;\n node.specifiers = [];\n node.source = null;\n node.declaration = this.finishPlaceholder(placeholder, \"Declaration\");\n return this.finishNode(node, \"ExportNamedDeclaration\");\n }\n\n // export %%NAME%% from \"foo\";\n this.expectPlugin(\"exportDefaultFrom\");\n const specifier = this.startNode();\n specifier.exported = placeholder;\n node.specifiers = [this.finishNode(specifier, \"ExportDefaultSpecifier\")];\n\n return super.parseExport(node, decorators);\n }\n\n isExportDefaultSpecifier(): boolean {\n if (this.match(tt._default)) {\n const next = this.nextTokenStart();\n if (this.isUnparsedContextual(next, \"from\")) {\n if (\n this.input.startsWith(\n tokenLabelName(tt.placeholder),\n this.nextTokenStartSince(next + 4),\n )\n ) {\n return true;\n }\n }\n }\n return super.isExportDefaultSpecifier();\n }\n\n maybeParseExportDefaultSpecifier(\n node: Undone<\n | N.ExportDefaultDeclaration\n | N.ExportAllDeclaration\n | N.ExportNamedDeclaration\n >,\n maybeDefaultIdentifier: N.Identifier | null,\n ): node is Undone<N.ExportNamedDeclaration> {\n if ((node as N.ExportNamedDeclaration).specifiers?.length) {\n // \"export %%NAME%%\" has already been parsed by #parseExport.\n return true;\n }\n return super.maybeParseExportDefaultSpecifier(\n node,\n maybeDefaultIdentifier,\n );\n }\n\n checkExport(node: N.ExportNamedDeclaration): void {\n const { specifiers } = node;\n if (specifiers?.length) {\n node.specifiers = specifiers.filter(\n // @ts-expect-error placeholder typings\n node => node.exported.type === \"Placeholder\",\n );\n }\n super.checkExport(node);\n node.specifiers = specifiers;\n }\n\n parseImport(\n node: Undone<N.ImportDeclaration>,\n ): N.ImportDeclaration | N.TsImportEqualsDeclaration {\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (!placeholder) return super.parseImport(node);\n\n node.specifiers = [];\n\n if (!this.isContextual(tt._from) && !this.match(tt.comma)) {\n // import %%STRING%%;\n node.source = this.finishPlaceholder(placeholder, \"StringLiteral\");\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n\n // import %%DEFAULT%% ...\n const specifier =\n this.startNodeAtNode<N.ImportDefaultSpecifier>(placeholder);\n specifier.local = placeholder;\n node.specifiers.push(\n this.finishNode(specifier, \"ImportDefaultSpecifier\"),\n );\n\n if (this.eat(tt.comma)) {\n // import %%DEFAULT%%, * as ...\n const hasStarImport = this.maybeParseStarImportSpecifier(node);\n\n // import %%DEFAULT%%, { ...\n if (!hasStarImport) this.parseNamedImportSpecifiers(node);\n }\n\n this.expectContextual(tt._from);\n node.source = this.parseImportSource();\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n\n parseImportSource(): MaybePlaceholder<\"StringLiteral\"> {\n // import ... from %%STRING%%;\n\n return (\n this.parsePlaceholder(\"StringLiteral\") || super.parseImportSource()\n );\n }\n\n // Throws if the current token and the prev one are separated by a space.\n assertNoSpace(): void {\n if (this.state.start > this.state.lastTokEndLoc.index) {\n this.raise(PlaceholderErrors.UnexpectedSpace, {\n at: this.state.lastTokEndLoc,\n });\n }\n }\n };\n"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AAGA,IAAAC,WAAA,GAAAD,OAAA;AA2BA,MAAME,iBAAiB,GAAG,IAAAC,0BAAc,CAAC,cAAa,CAAC;EACrDC,mBAAmB,EAAE,2BAA2B;EAChDC,eAAe,EAAE;AACnB,CAAC,CAAC;AAAC,IAAAC,QAAA,GAIaC,UAAyB,IACvC,MAAMC,uBAAuB,SAASD,UAAU,CAAmB;EACjEE,gBAAgBA,CACdC,YAAe,EAC+C;IAC9D,IAAI,IAAI,CAACC,KAAK,IAAe,CAAC,EAAE;MAC9B,MAAMC,IAAI,GAAG,IAAI,CAACC,SAAS,CAAC,CAAC;MAC7B,IAAI,CAACC,IAAI,CAAC,CAAC;MACX,IAAI,CAACC,aAAa,CAAC,CAAC;MAIpBH,IAAI,CAACI,IAAI,GAAG,KAAK,CAACC,eAAe,CAAe,IAAI,CAAC;MAErD,IAAI,CAACF,aAAa,CAAC,CAAC;MACpB,IAAI,CAACG,MAAM,IAAe,CAAC;MAE3B,OAAO,IAAI,CAACC,iBAAiB,CAACP,IAAI,EAAEF,YAAY,CAAC;IACnD;EACF;EAEAS,iBAAiBA,CACfP,IAAY,EACZF,YAAe,EAC2B;IAC1C,MAAMU,UAAU,GAAG,CAAC,EAAER,IAAI,CAACF,YAAY,IAAIE,IAAI,CAACS,IAAI,KAAK,aAAa,CAAC;IACvET,IAAI,CAACF,YAAY,GAAGA,YAAY;IAGhC,OAAOU,UAAU,GAAGR,IAAI,GAAG,IAAI,CAACU,UAAU,CAACV,IAAI,EAAE,aAAa,CAAC;EACjE;EAMAW,gBAAgBA,CAACC,IAAY,EAAE;IAC7B,IACEA,IAAI,OAA0B,IAC9B,IAAI,CAACC,KAAK,CAAC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KAAK,EAAE;MACrD,IAAI,CAACtC,KAAK,CAACvE,iBAAiB,CAACG,eAAe,EAAE;QAC5CqE,EAAE,EAAE,IAAI,CAAC/C,KAAK,CAACmF;MACjB,CAAC,CAAC;IACJ;EACF;AACF,CAAC;AAAAE,OAAA,CAAAC,OAAA,GAAA3G,QAAA"} lib/plugins/typescript/index.js 0000644 00000271047 15120211212 0012644 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _types = require("../../tokenizer/types"); var _context = require("../../tokenizer/context"); var _location = require("../../util/location"); var _scopeflags = require("../../util/scopeflags"); var _scope = require("./scope"); var _productionParameter = require("../../util/production-parameter"); var _parseError = require("../../parse-error"); var _node = require("../../parser/node"); var _lval = require("../../parser/lval"); const getOwn = (object, key) => Object.hasOwnProperty.call(object, key) && object[key]; function nonNull(x) { if (x == null) { throw new Error(`Unexpected ${x} value.`); } return x; } function assert(x) { if (!x) { throw new Error("Assert fail"); } } const TSErrors = (0, _parseError.ParseErrorEnum)`typescript`({ AbstractMethodHasImplementation: ({ methodName }) => `Method '${methodName}' cannot have an implementation because it is marked abstract.`, AbstractPropertyHasInitializer: ({ propertyName }) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`, AccesorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.", AccesorCannotHaveTypeParameters: "An accessor cannot have type parameters.", AccessorCannotBeOptional: "An 'accessor' property cannot be declared optional.", ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.", ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.", ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.", ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.", DeclareAccessor: ({ kind }) => `'declare' is not allowed in ${kind}ters.`, DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.", DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.", DuplicateAccessibilityModifier: ({ modifier }) => `Accessibility modifier already seen.`, DuplicateModifier: ({ modifier }) => `Duplicate modifier: '${modifier}'.`, EmptyHeritageClauseType: ({ token }) => `'${token}' list cannot be empty.`, EmptyTypeArguments: "Type argument list cannot be empty.", EmptyTypeParameters: "Type parameter list cannot be empty.", ExpectedAmbientAfterExportDeclare: "'export declare' must be followed by an ambient declaration.", ImportAliasHasImportType: "An import alias can not use 'import type'.", ImportReflectionHasImportType: "An `import module` declaration can not use `type` modifier", IncompatibleModifiers: ({ modifiers }) => `'${modifiers[0]}' modifier cannot be used with '${modifiers[1]}' modifier.`, IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier.", IndexSignatureHasAccessibility: ({ modifier }) => `Index signatures cannot have an accessibility modifier ('${modifier}').`, IndexSignatureHasDeclare: "Index signatures cannot have the 'declare' modifier.", IndexSignatureHasOverride: "'override' modifier cannot appear on an index signature.", IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier.", InitializerNotAllowedInAmbientContext: "Initializers are not allowed in ambient contexts.", InvalidModifierOnTypeMember: ({ modifier }) => `'${modifier}' modifier cannot appear on a type member.`, InvalidModifierOnTypeParameter: ({ modifier }) => `'${modifier}' modifier cannot appear on a type parameter.`, InvalidModifierOnTypeParameterPositions: ({ modifier }) => `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`, InvalidModifiersOrder: ({ orderedModifiers }) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`, InvalidPropertyAccessAfterInstantiationExpression: "Invalid property access after an instantiation expression. " + "You can either wrap the instantiation expression in parentheses, or delete the type arguments.", InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.", MissingInterfaceName: "'interface' declarations must be followed by an identifier.", MixedLabeledAndUnlabeledElements: "Tuple members must all have names or all not have names.", NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.", NonClassMethodPropertyHasAbstractModifer: "'abstract' modifier can only appear on a class, method, or property declaration.", OptionalTypeBeforeRequired: "A required element cannot follow an optional element.", OverrideNotInSubClass: "This member cannot have an 'override' modifier because its containing class does not extend another class.", PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.", PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.", PrivateElementHasAccessibility: ({ modifier }) => `Private elements cannot have an accessibility modifier ('${modifier}').`, ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.", ReservedArrowTypeParam: "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.", ReservedTypeAssertion: "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.", SetAccesorCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.", SetAccesorCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.", SetAccesorCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.", SingleTypeParameterWithoutTrailingComma: ({ typeParameterName }) => `Single type parameter ${typeParameterName} should have a trailing comma. Example usage: <${typeParameterName},>.`, StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.", TupleOptionalAfterType: "A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).", TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.", TypeModifierIsUsedInTypeExports: "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.", TypeModifierIsUsedInTypeImports: "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.", UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.", UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.", UnexpectedTypeAnnotation: "Did not expect a type annotation here.", UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.", UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.", UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.", UnsupportedSignatureParameterKind: ({ type }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.` }); function keywordTypeFromName(value) { switch (value) { case "any": return "TSAnyKeyword"; case "boolean": return "TSBooleanKeyword"; case "bigint": return "TSBigIntKeyword"; case "never": return "TSNeverKeyword"; case "number": return "TSNumberKeyword"; case "object": return "TSObjectKeyword"; case "string": return "TSStringKeyword"; case "symbol": return "TSSymbolKeyword"; case "undefined": return "TSUndefinedKeyword"; case "unknown": return "TSUnknownKeyword"; default: return undefined; } } function tsIsAccessModifier(modifier) { return modifier === "private" || modifier === "public" || modifier === "protected"; } function tsIsVarianceAnnotations(modifier) { return modifier === "in" || modifier === "out"; } var _default = superClass => class TypeScriptParserMixin extends superClass { constructor(...args) { super(...args); this.tsParseInOutModifiers = this.tsParseModifiers.bind(this, { allowedModifiers: ["in", "out"], disallowedModifiers: ["const", "public", "private", "protected", "readonly", "declare", "abstract", "override"], errorTemplate: TSErrors.InvalidModifierOnTypeParameter }); this.tsParseConstModifier = this.tsParseModifiers.bind(this, { allowedModifiers: ["const"], disallowedModifiers: ["in", "out"], errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions }); this.tsParseInOutConstModifiers = this.tsParseModifiers.bind(this, { allowedModifiers: ["in", "out", "const"], disallowedModifiers: ["public", "private", "protected", "readonly", "declare", "abstract", "override"], errorTemplate: TSErrors.InvalidModifierOnTypeParameter }); } getScopeHandler() { return _scope.default; } tsIsIdentifier() { return (0, _types.tokenIsIdentifier)(this.state.type); } tsTokenCanFollowModifier() { return (this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(136) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak(); } tsNextTokenCanFollowModifier() { this.next(); return this.tsTokenCanFollowModifier(); } tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) { if (!(0, _types.tokenIsIdentifier)(this.state.type) && this.state.type !== 58 && this.state.type !== 75) { return undefined; } const modifier = this.state.value; if (allowedModifiers.indexOf(modifier) !== -1) { if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) { return undefined; } if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) { return modifier; } } return undefined; } tsParseModifiers({ allowedModifiers, disallowedModifiers, stopOnStartOfClassStaticBlock, errorTemplate = TSErrors.InvalidModifierOnTypeMember }, modified) { const enforceOrder = (loc, modifier, before, after) => { if (modifier === before && modified[after]) { this.raise(TSErrors.InvalidModifiersOrder, { at: loc, orderedModifiers: [before, after] }); } }; const incompatible = (loc, modifier, mod1, mod2) => { if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) { this.raise(TSErrors.IncompatibleModifiers, { at: loc, modifiers: [mod1, mod2] }); } }; for (;;) { const { startLoc } = this.state; const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : []), stopOnStartOfClassStaticBlock); if (!modifier) break; if (tsIsAccessModifier(modifier)) { if (modified.accessibility) { this.raise(TSErrors.DuplicateAccessibilityModifier, { at: startLoc, modifier }); } else { enforceOrder(startLoc, modifier, modifier, "override"); enforceOrder(startLoc, modifier, modifier, "static"); enforceOrder(startLoc, modifier, modifier, "readonly"); modified.accessibility = modifier; } } else if (tsIsVarianceAnnotations(modifier)) { if (modified[modifier]) { this.raise(TSErrors.DuplicateModifier, { at: startLoc, modifier }); } modified[modifier] = true; enforceOrder(startLoc, modifier, "in", "out"); } else { if (Object.hasOwnProperty.call(modified, modifier)) { this.raise(TSErrors.DuplicateModifier, { at: startLoc, modifier }); } else { enforceOrder(startLoc, modifier, "static", "readonly"); enforceOrder(startLoc, modifier, "static", "override"); enforceOrder(startLoc, modifier, "override", "readonly"); enforceOrder(startLoc, modifier, "abstract", "override"); incompatible(startLoc, modifier, "declare", "override"); incompatible(startLoc, modifier, "static", "abstract"); } modified[modifier] = true; } if (disallowedModifiers != null && disallowedModifiers.includes(modifier)) { this.raise(errorTemplate, { at: startLoc, modifier }); } } } tsIsListTerminator(kind) { switch (kind) { case "EnumMembers": case "TypeMembers": return this.match(8); case "HeritageClauseElement": return this.match(5); case "TupleElementTypes": return this.match(3); case "TypeParametersOrArguments": return this.match(48); } } tsParseList(kind, parseElement) { const result = []; while (!this.tsIsListTerminator(kind)) { result.push(parseElement()); } return result; } tsParseDelimitedList(kind, parseElement, refTrailingCommaPos) { return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true, refTrailingCommaPos)); } tsParseDelimitedListWorker(kind, parseElement, expectSuccess, refTrailingCommaPos) { const result = []; let trailingCommaPos = -1; for (;;) { if (this.tsIsListTerminator(kind)) { break; } trailingCommaPos = -1; const element = parseElement(); if (element == null) { return undefined; } result.push(element); if (this.eat(12)) { trailingCommaPos = this.state.lastTokStart; continue; } if (this.tsIsListTerminator(kind)) { break; } if (expectSuccess) { this.expect(12); } return undefined; } if (refTrailingCommaPos) { refTrailingCommaPos.value = trailingCommaPos; } return result; } tsParseBracketedList(kind, parseElement, bracket, skipFirstToken, refTrailingCommaPos) { if (!skipFirstToken) { if (bracket) { this.expect(0); } else { this.expect(47); } } const result = this.tsParseDelimitedList(kind, parseElement, refTrailingCommaPos); if (bracket) { this.expect(3); } else { this.expect(48); } return result; } tsParseImportType() { const node = this.startNode(); this.expect(83); this.expect(10); if (!this.match(131)) { this.raise(TSErrors.UnsupportedImportTypeArgument, { at: this.state.startLoc }); } node.argument = super.parseExprAtom(); this.expect(11); if (this.eat(16)) { node.qualifier = this.tsParseEntityName(); } if (this.match(47)) { node.typeParameters = this.tsParseTypeArguments(); } return this.finishNode(node, "TSImportType"); } tsParseEntityName(allowReservedWords = true) { let entity = this.parseIdentifier(allowReservedWords); while (this.eat(16)) { const node = this.startNodeAtNode(entity); node.left = entity; node.right = this.parseIdentifier(allowReservedWords); entity = this.finishNode(node, "TSQualifiedName"); } return entity; } tsParseTypeReference() { const node = this.startNode(); node.typeName = this.tsParseEntityName(); if (!this.hasPrecedingLineBreak() && this.match(47)) { node.typeParameters = this.tsParseTypeArguments(); } return this.finishNode(node, "TSTypeReference"); } tsParseThisTypePredicate(lhs) { this.next(); const node = this.startNodeAtNode(lhs); node.parameterName = lhs; node.typeAnnotation = this.tsParseTypeAnnotation(false); node.asserts = false; return this.finishNode(node, "TSTypePredicate"); } tsParseThisTypeNode() { const node = this.startNode(); this.next(); return this.finishNode(node, "TSThisType"); } tsParseTypeQuery() { const node = this.startNode(); this.expect(87); if (this.match(83)) { node.exprName = this.tsParseImportType(); } else { node.exprName = this.tsParseEntityName(); } if (!this.hasPrecedingLineBreak() && this.match(47)) { node.typeParameters = this.tsParseTypeArguments(); } return this.finishNode(node, "TSTypeQuery"); } tsParseTypeParameter(parseModifiers) { const node = this.startNode(); parseModifiers(node); node.name = this.tsParseTypeParameterName(); node.constraint = this.tsEatThenParseType(81); node.default = this.tsEatThenParseType(29); return this.finishNode(node, "TSTypeParameter"); } tsTryParseTypeParameters(parseModifiers) { if (this.match(47)) { return this.tsParseTypeParameters(parseModifiers); } } tsParseTypeParameters(parseModifiers) { const node = this.startNode(); if (this.match(47) || this.match(140)) { this.next(); } else { this.unexpected(); } const refTrailingCommaPos = { value: -1 }; node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, parseModifiers), false, true, refTrailingCommaPos); if (node.params.length === 0) { this.raise(TSErrors.EmptyTypeParameters, { at: node }); } if (refTrailingCommaPos.value !== -1) { this.addExtra(node, "trailingComma", refTrailingCommaPos.value); } return this.finishNode(node, "TSTypeParameterDeclaration"); } tsFillSignature(returnToken, signature) { const returnTokenRequired = returnToken === 19; const paramsKey = "parameters"; const returnTypeKey = "typeAnnotation"; signature.typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); this.expect(10); signature[paramsKey] = this.tsParseBindingListForSignature(); if (returnTokenRequired) { signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); } else if (this.match(returnToken)) { signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); } } tsParseBindingListForSignature() { const list = super.parseBindingList(11, 41, _lval.ParseBindingListFlags.IS_FUNCTION_PARAMS); for (const pattern of list) { const { type } = pattern; if (type === "AssignmentPattern" || type === "TSParameterProperty") { this.raise(TSErrors.UnsupportedSignatureParameterKind, { at: pattern, type }); } } return list; } tsParseTypeMemberSemicolon() { if (!this.eat(12) && !this.isLineTerminator()) { this.expect(13); } } tsParseSignatureMember(kind, node) { this.tsFillSignature(14, node); this.tsParseTypeMemberSemicolon(); return this.finishNode(node, kind); } tsIsUnambiguouslyIndexSignature() { this.next(); if ((0, _types.tokenIsIdentifier)(this.state.type)) { this.next(); return this.match(14); } return false; } tsTryParseIndexSignature(node) { if (!(this.match(0) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) { return; } this.expect(0); const id = this.parseIdentifier(); id.typeAnnotation = this.tsParseTypeAnnotation(); this.resetEndLocation(id); this.expect(3); node.parameters = [id]; const type = this.tsTryParseTypeAnnotation(); if (type) node.typeAnnotation = type; this.tsParseTypeMemberSemicolon(); return this.finishNode(node, "TSIndexSignature"); } tsParsePropertyOrMethodSignature(node, readonly) { if (this.eat(17)) node.optional = true; const nodeAny = node; if (this.match(10) || this.match(47)) { if (readonly) { this.raise(TSErrors.ReadonlyForMethodSignature, { at: node }); } const method = nodeAny; if (method.kind && this.match(47)) { this.raise(TSErrors.AccesorCannotHaveTypeParameters, { at: this.state.curPosition() }); } this.tsFillSignature(14, method); this.tsParseTypeMemberSemicolon(); const paramsKey = "parameters"; const returnTypeKey = "typeAnnotation"; if (method.kind === "get") { if (method[paramsKey].length > 0) { this.raise(_parseError.Errors.BadGetterArity, { at: this.state.curPosition() }); if (this.isThisParam(method[paramsKey][0])) { this.raise(TSErrors.AccesorCannotDeclareThisParameter, { at: this.state.curPosition() }); } } } else if (method.kind === "set") { if (method[paramsKey].length !== 1) { this.raise(_parseError.Errors.BadSetterArity, { at: this.state.curPosition() }); } else { const firstParameter = method[paramsKey][0]; if (this.isThisParam(firstParameter)) { this.raise(TSErrors.AccesorCannotDeclareThisParameter, { at: this.state.curPosition() }); } if (firstParameter.type === "Identifier" && firstParameter.optional) { this.raise(TSErrors.SetAccesorCannotHaveOptionalParameter, { at: this.state.curPosition() }); } if (firstParameter.type === "RestElement") { this.raise(TSErrors.SetAccesorCannotHaveRestParameter, { at: this.state.curPosition() }); } } if (method[returnTypeKey]) { this.raise(TSErrors.SetAccesorCannotHaveReturnType, { at: method[returnTypeKey] }); } } else { method.kind = "method"; } return this.finishNode(method, "TSMethodSignature"); } else { const property = nodeAny; if (readonly) property.readonly = true; const type = this.tsTryParseTypeAnnotation(); if (type) property.typeAnnotation = type; this.tsParseTypeMemberSemicolon(); return this.finishNode(property, "TSPropertySignature"); } } tsParseTypeMember() { const node = this.startNode(); if (this.match(10) || this.match(47)) { return this.tsParseSignatureMember("TSCallSignatureDeclaration", node); } if (this.match(77)) { const id = this.startNode(); this.next(); if (this.match(10) || this.match(47)) { return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node); } else { node.key = this.createIdentifier(id, "new"); return this.tsParsePropertyOrMethodSignature(node, false); } } this.tsParseModifiers({ allowedModifiers: ["readonly"], disallowedModifiers: ["declare", "abstract", "private", "protected", "public", "static", "override"] }, node); const idx = this.tsTryParseIndexSignature(node); if (idx) { return idx; } super.parsePropertyName(node); if (!node.computed && node.key.type === "Identifier" && (node.key.name === "get" || node.key.name === "set") && this.tsTokenCanFollowModifier()) { node.kind = node.key.name; super.parsePropertyName(node); } return this.tsParsePropertyOrMethodSignature(node, !!node.readonly); } tsParseTypeLiteral() { const node = this.startNode(); node.members = this.tsParseObjectTypeMembers(); return this.finishNode(node, "TSTypeLiteral"); } tsParseObjectTypeMembers() { this.expect(5); const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this)); this.expect(8); return members; } tsIsStartOfMappedType() { this.next(); if (this.eat(53)) { return this.isContextual(120); } if (this.isContextual(120)) { this.next(); } if (!this.match(0)) { return false; } this.next(); if (!this.tsIsIdentifier()) { return false; } this.next(); return this.match(58); } tsParseMappedTypeParameter() { const node = this.startNode(); node.name = this.tsParseTypeParameterName(); node.constraint = this.tsExpectThenParseType(58); return this.finishNode(node, "TSTypeParameter"); } tsParseMappedType() { const node = this.startNode(); this.expect(5); if (this.match(53)) { node.readonly = this.state.value; this.next(); this.expectContextual(120); } else if (this.eatContextual(120)) { node.readonly = true; } this.expect(0); node.typeParameter = this.tsParseMappedTypeParameter(); node.nameType = this.eatContextual(93) ? this.tsParseType() : null; this.expect(3); if (this.match(53)) { node.optional = this.state.value; this.next(); this.expect(17); } else if (this.eat(17)) { node.optional = true; } node.typeAnnotation = this.tsTryParseType(); this.semicolon(); this.expect(8); return this.finishNode(node, "TSMappedType"); } tsParseTupleType() { const node = this.startNode(); node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false); let seenOptionalElement = false; let labeledElements = null; node.elementTypes.forEach(elementNode => { var _labeledElements; const { type } = elementNode; if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) { this.raise(TSErrors.OptionalTypeBeforeRequired, { at: elementNode }); } seenOptionalElement || (seenOptionalElement = type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType"); let checkType = type; if (type === "TSRestType") { elementNode = elementNode.typeAnnotation; checkType = elementNode.type; } const isLabeled = checkType === "TSNamedTupleMember"; (_labeledElements = labeledElements) != null ? _labeledElements : labeledElements = isLabeled; if (labeledElements !== isLabeled) { this.raise(TSErrors.MixedLabeledAndUnlabeledElements, { at: elementNode }); } }); return this.finishNode(node, "TSTupleType"); } tsParseTupleElementType() { const { startLoc } = this.state; const rest = this.eat(21); let labeled; let label; let optional; let type; const isWord = (0, _types.tokenIsKeywordOrIdentifier)(this.state.type); const chAfterWord = isWord ? this.lookaheadCharCode() : null; if (chAfterWord === 58) { labeled = true; optional = false; label = this.parseIdentifier(true); this.expect(14); type = this.tsParseType(); } else if (chAfterWord === 63) { optional = true; const startLoc = this.state.startLoc; const wordName = this.state.value; const typeOrLabel = this.tsParseNonArrayType(); if (this.lookaheadCharCode() === 58) { labeled = true; label = this.createIdentifier(this.startNodeAt(startLoc), wordName); this.expect(17); this.expect(14); type = this.tsParseType(); } else { labeled = false; type = typeOrLabel; this.expect(17); } } else { type = this.tsParseType(); optional = this.eat(17); labeled = this.eat(14); } if (labeled) { let labeledNode; if (label) { labeledNode = this.startNodeAtNode(label); labeledNode.optional = optional; labeledNode.label = label; labeledNode.elementType = type; if (this.eat(17)) { labeledNode.optional = true; this.raise(TSErrors.TupleOptionalAfterType, { at: this.state.lastTokStartLoc }); } } else { labeledNode = this.startNodeAtNode(type); labeledNode.optional = optional; this.raise(TSErrors.InvalidTupleMemberLabel, { at: type }); labeledNode.label = type; labeledNode.elementType = this.tsParseType(); } type = this.finishNode(labeledNode, "TSNamedTupleMember"); } else if (optional) { const optionalTypeNode = this.startNodeAtNode(type); optionalTypeNode.typeAnnotation = type; type = this.finishNode(optionalTypeNode, "TSOptionalType"); } if (rest) { const restNode = this.startNodeAt(startLoc); restNode.typeAnnotation = type; type = this.finishNode(restNode, "TSRestType"); } return type; } tsParseParenthesizedType() { const node = this.startNode(); this.expect(10); node.typeAnnotation = this.tsParseType(); this.expect(11); return this.finishNode(node, "TSParenthesizedType"); } tsParseFunctionOrConstructorType(type, abstract) { const node = this.startNode(); if (type === "TSConstructorType") { node.abstract = !!abstract; if (abstract) this.next(); this.next(); } this.tsInAllowConditionalTypesContext(() => this.tsFillSignature(19, node)); return this.finishNode(node, type); } tsParseLiteralTypeNode() { const node = this.startNode(); switch (this.state.type) { case 132: case 133: case 131: case 85: case 86: node.literal = super.parseExprAtom(); break; default: this.unexpected(); } return this.finishNode(node, "TSLiteralType"); } tsParseTemplateLiteralType() { const node = this.startNode(); node.literal = super.parseTemplate(false); return this.finishNode(node, "TSLiteralType"); } parseTemplateSubstitution() { if (this.state.inType) return this.tsParseType(); return super.parseTemplateSubstitution(); } tsParseThisTypeOrThisTypePredicate() { const thisKeyword = this.tsParseThisTypeNode(); if (this.isContextual(114) && !this.hasPrecedingLineBreak()) { return this.tsParseThisTypePredicate(thisKeyword); } else { return thisKeyword; } } tsParseNonArrayType() { switch (this.state.type) { case 131: case 132: case 133: case 85: case 86: return this.tsParseLiteralTypeNode(); case 53: if (this.state.value === "-") { const node = this.startNode(); const nextToken = this.lookahead(); if (nextToken.type !== 132 && nextToken.type !== 133) { this.unexpected(); } node.literal = this.parseMaybeUnary(); return this.finishNode(node, "TSLiteralType"); } break; case 78: return this.tsParseThisTypeOrThisTypePredicate(); case 87: return this.tsParseTypeQuery(); case 83: return this.tsParseImportType(); case 5: return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral(); case 0: return this.tsParseTupleType(); case 10: ; return this.tsParseParenthesizedType(); case 25: case 24: return this.tsParseTemplateLiteralType(); default: { const { type } = this.state; if ((0, _types.tokenIsIdentifier)(type) || type === 88 || type === 84) { const nodeType = type === 88 ? "TSVoidKeyword" : type === 84 ? "TSNullKeyword" : keywordTypeFromName(this.state.value); if (nodeType !== undefined && this.lookaheadCharCode() !== 46) { const node = this.startNode(); this.next(); return this.finishNode(node, nodeType); } return this.tsParseTypeReference(); } } } this.unexpected(); } tsParseArrayTypeOrHigher() { let type = this.tsParseNonArrayType(); while (!this.hasPrecedingLineBreak() && this.eat(0)) { if (this.match(3)) { const node = this.startNodeAtNode(type); node.elementType = type; this.expect(3); type = this.finishNode(node, "TSArrayType"); } else { const node = this.startNodeAtNode(type); node.objectType = type; node.indexType = this.tsParseType(); this.expect(3); type = this.finishNode(node, "TSIndexedAccessType"); } } return type; } tsParseTypeOperator() { const node = this.startNode(); const operator = this.state.value; this.next(); node.operator = operator; node.typeAnnotation = this.tsParseTypeOperatorOrHigher(); if (operator === "readonly") { this.tsCheckTypeAnnotationForReadOnly(node); } return this.finishNode(node, "TSTypeOperator"); } tsCheckTypeAnnotationForReadOnly(node) { switch (node.typeAnnotation.type) { case "TSTupleType": case "TSArrayType": return; default: this.raise(TSErrors.UnexpectedReadonly, { at: node }); } } tsParseInferType() { const node = this.startNode(); this.expectContextual(113); const typeParameter = this.startNode(); typeParameter.name = this.tsParseTypeParameterName(); typeParameter.constraint = this.tsTryParse(() => this.tsParseConstraintForInferType()); node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter"); return this.finishNode(node, "TSInferType"); } tsParseConstraintForInferType() { if (this.eat(81)) { const constraint = this.tsInDisallowConditionalTypesContext(() => this.tsParseType()); if (this.state.inDisallowConditionalTypesContext || !this.match(17)) { return constraint; } } } tsParseTypeOperatorOrHigher() { const isTypeOperator = (0, _types.tokenIsTSTypeOperator)(this.state.type) && !this.state.containsEsc; return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(113) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher()); } tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) { const node = this.startNode(); const hasLeadingOperator = this.eat(operator); const types = []; do { types.push(parseConstituentType()); } while (this.eat(operator)); if (types.length === 1 && !hasLeadingOperator) { return types[0]; } node.types = types; return this.finishNode(node, kind); } tsParseIntersectionTypeOrHigher() { return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), 45); } tsParseUnionTypeOrHigher() { return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), 43); } tsIsStartOfFunctionType() { if (this.match(47)) { return true; } return this.match(10) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this)); } tsSkipParameterStart() { if ((0, _types.tokenIsIdentifier)(this.state.type) || this.match(78)) { this.next(); return true; } if (this.match(5)) { const { errors } = this.state; const previousErrorCount = errors.length; try { this.parseObjectLike(8, true); return errors.length === previousErrorCount; } catch (_unused) { return false; } } if (this.match(0)) { this.next(); const { errors } = this.state; const previousErrorCount = errors.length; try { super.parseBindingList(3, 93, _lval.ParseBindingListFlags.ALLOW_EMPTY); return errors.length === previousErrorCount; } catch (_unused2) { return false; } } return false; } tsIsUnambiguouslyStartOfFunctionType() { this.next(); if (this.match(11) || this.match(21)) { return true; } if (this.tsSkipParameterStart()) { if (this.match(14) || this.match(12) || this.match(17) || this.match(29)) { return true; } if (this.match(11)) { this.next(); if (this.match(19)) { return true; } } } return false; } tsParseTypeOrTypePredicateAnnotation(returnToken) { return this.tsInType(() => { const t = this.startNode(); this.expect(returnToken); const node = this.startNode(); const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this)); if (asserts && this.match(78)) { let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate(); if (thisTypePredicate.type === "TSThisType") { node.parameterName = thisTypePredicate; node.asserts = true; node.typeAnnotation = null; thisTypePredicate = this.finishNode(node, "TSTypePredicate"); } else { this.resetStartLocationFromNode(thisTypePredicate, node); thisTypePredicate.asserts = true; } t.typeAnnotation = thisTypePredicate; return this.finishNode(t, "TSTypeAnnotation"); } const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this)); if (!typePredicateVariable) { if (!asserts) { return this.tsParseTypeAnnotation(false, t); } node.parameterName = this.parseIdentifier(); node.asserts = asserts; node.typeAnnotation = null; t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); return this.finishNode(t, "TSTypeAnnotation"); } const type = this.tsParseTypeAnnotation(false); node.parameterName = typePredicateVariable; node.typeAnnotation = type; node.asserts = asserts; t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); return this.finishNode(t, "TSTypeAnnotation"); }); } tsTryParseTypeOrTypePredicateAnnotation() { if (this.match(14)) { return this.tsParseTypeOrTypePredicateAnnotation(14); } } tsTryParseTypeAnnotation() { if (this.match(14)) { return this.tsParseTypeAnnotation(); } } tsTryParseType() { return this.tsEatThenParseType(14); } tsParseTypePredicatePrefix() { const id = this.parseIdentifier(); if (this.isContextual(114) && !this.hasPrecedingLineBreak()) { this.next(); return id; } } tsParseTypePredicateAsserts() { if (this.state.type !== 107) { return false; } const containsEsc = this.state.containsEsc; this.next(); if (!(0, _types.tokenIsIdentifier)(this.state.type) && !this.match(78)) { return false; } if (containsEsc) { this.raise(_parseError.Errors.InvalidEscapedReservedWord, { at: this.state.lastTokStartLoc, reservedWord: "asserts" }); } return true; } tsParseTypeAnnotation(eatColon = true, t = this.startNode()) { this.tsInType(() => { if (eatColon) this.expect(14); t.typeAnnotation = this.tsParseType(); }); return this.finishNode(t, "TSTypeAnnotation"); } tsParseType() { assert(this.state.inType); const type = this.tsParseNonConditionalType(); if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(81)) { return type; } const node = this.startNodeAtNode(type); node.checkType = type; node.extendsType = this.tsInDisallowConditionalTypesContext(() => this.tsParseNonConditionalType()); this.expect(17); node.trueType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()); this.expect(14); node.falseType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()); return this.finishNode(node, "TSConditionalType"); } isAbstractConstructorSignature() { return this.isContextual(122) && this.lookahead().type === 77; } tsParseNonConditionalType() { if (this.tsIsStartOfFunctionType()) { return this.tsParseFunctionOrConstructorType("TSFunctionType"); } if (this.match(77)) { return this.tsParseFunctionOrConstructorType("TSConstructorType"); } else if (this.isAbstractConstructorSignature()) { return this.tsParseFunctionOrConstructorType("TSConstructorType", true); } return this.tsParseUnionTypeOrHigher(); } tsParseTypeAssertion() { if (this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) { this.raise(TSErrors.ReservedTypeAssertion, { at: this.state.startLoc }); } const node = this.startNode(); node.typeAnnotation = this.tsInType(() => { this.next(); return this.match(75) ? this.tsParseTypeReference() : this.tsParseType(); }); this.expect(48); node.expression = this.parseMaybeUnary(); return this.finishNode(node, "TSTypeAssertion"); } tsParseHeritageClause(token) { const originalStartLoc = this.state.startLoc; const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", () => { const node = this.startNode(); node.expression = this.tsParseEntityName(); if (this.match(47)) { node.typeParameters = this.tsParseTypeArguments(); } return this.finishNode(node, "TSExpressionWithTypeArguments"); }); if (!delimitedList.length) { this.raise(TSErrors.EmptyHeritageClauseType, { at: originalStartLoc, token }); } return delimitedList; } tsParseInterfaceDeclaration(node, properties = {}) { if (this.hasFollowingLineBreak()) return null; this.expectContextual(127); if (properties.declare) node.declare = true; if ((0, _types.tokenIsIdentifier)(this.state.type)) { node.id = this.parseIdentifier(); this.checkIdentifier(node.id, _scopeflags.BIND_TS_INTERFACE); } else { node.id = null; this.raise(TSErrors.MissingInterfaceName, { at: this.state.startLoc }); } node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers); if (this.eat(81)) { node.extends = this.tsParseHeritageClause("extends"); } const body = this.startNode(); body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)); node.body = this.finishNode(body, "TSInterfaceBody"); return this.finishNode(node, "TSInterfaceDeclaration"); } tsParseTypeAliasDeclaration(node) { node.id = this.parseIdentifier(); this.checkIdentifier(node.id, _scopeflags.BIND_TS_TYPE); node.typeAnnotation = this.tsInType(() => { node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers); this.expect(29); if (this.isContextual(112) && this.lookahead().type !== 16) { const node = this.startNode(); this.next(); return this.finishNode(node, "TSIntrinsicKeyword"); } return this.tsParseType(); }); this.semicolon(); return this.finishNode(node, "TSTypeAliasDeclaration"); } tsInNoContext(cb) { const oldContext = this.state.context; this.state.context = [oldContext[0]]; try { return cb(); } finally { this.state.context = oldContext; } } tsInType(cb) { const oldInType = this.state.inType; this.state.inType = true; try { return cb(); } finally { this.state.inType = oldInType; } } tsInDisallowConditionalTypesContext(cb) { const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext; this.state.inDisallowConditionalTypesContext = true; try { return cb(); } finally { this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; } } tsInAllowConditionalTypesContext(cb) { const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext; this.state.inDisallowConditionalTypesContext = false; try { return cb(); } finally { this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; } } tsEatThenParseType(token) { if (this.match(token)) { return this.tsNextThenParseType(); } } tsExpectThenParseType(token) { return this.tsInType(() => { this.expect(token); return this.tsParseType(); }); } tsNextThenParseType() { return this.tsInType(() => { this.next(); return this.tsParseType(); }); } tsParseEnumMember() { const node = this.startNode(); node.id = this.match(131) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true); if (this.eat(29)) { node.initializer = super.parseMaybeAssignAllowIn(); } return this.finishNode(node, "TSEnumMember"); } tsParseEnumDeclaration(node, properties = {}) { if (properties.const) node.const = true; if (properties.declare) node.declare = true; this.expectContextual(124); node.id = this.parseIdentifier(); this.checkIdentifier(node.id, node.const ? _scopeflags.BIND_TS_CONST_ENUM : _scopeflags.BIND_TS_ENUM); this.expect(5); node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)); this.expect(8); return this.finishNode(node, "TSEnumDeclaration"); } tsParseModuleBlock() { const node = this.startNode(); this.scope.enter(_scopeflags.SCOPE_OTHER); this.expect(5); super.parseBlockOrModuleBlockBody(node.body = [], undefined, true, 8); this.scope.exit(); return this.finishNode(node, "TSModuleBlock"); } tsParseModuleOrNamespaceDeclaration(node, nested = false) { node.id = this.parseIdentifier(); if (!nested) { this.checkIdentifier(node.id, _scopeflags.BIND_TS_NAMESPACE); } if (this.eat(16)) { const inner = this.startNode(); this.tsParseModuleOrNamespaceDeclaration(inner, true); node.body = inner; } else { this.scope.enter(_scopeflags.SCOPE_TS_MODULE); this.prodParam.enter(_productionParameter.PARAM); node.body = this.tsParseModuleBlock(); this.prodParam.exit(); this.scope.exit(); } return this.finishNode(node, "TSModuleDeclaration"); } tsParseAmbientExternalModuleDeclaration(node) { if (this.isContextual(110)) { node.global = true; node.id = this.parseIdentifier(); } else if (this.match(131)) { node.id = super.parseStringLiteral(this.state.value); } else { this.unexpected(); } if (this.match(5)) { this.scope.enter(_scopeflags.SCOPE_TS_MODULE); this.prodParam.enter(_productionParameter.PARAM); node.body = this.tsParseModuleBlock(); this.prodParam.exit(); this.scope.exit(); } else { this.semicolon(); } return this.finishNode(node, "TSModuleDeclaration"); } tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier, isExport) { node.isExport = isExport || false; node.id = maybeDefaultIdentifier || this.parseIdentifier(); this.checkIdentifier(node.id, _scopeflags.BIND_FLAGS_TS_IMPORT); this.expect(29); const moduleReference = this.tsParseModuleReference(); if (node.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") { this.raise(TSErrors.ImportAliasHasImportType, { at: moduleReference }); } node.moduleReference = moduleReference; this.semicolon(); return this.finishNode(node, "TSImportEqualsDeclaration"); } tsIsExternalModuleReference() { return this.isContextual(117) && this.lookaheadCharCode() === 40; } tsParseModuleReference() { return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false); } tsParseExternalModuleReference() { const node = this.startNode(); this.expectContextual(117); this.expect(10); if (!this.match(131)) { this.unexpected(); } node.expression = super.parseExprAtom(); this.expect(11); this.sawUnambiguousESM = true; return this.finishNode(node, "TSExternalModuleReference"); } tsLookAhead(f) { const state = this.state.clone(); const res = f(); this.state = state; return res; } tsTryParseAndCatch(f) { const result = this.tryParse(abort => f() || abort()); if (result.aborted || !result.node) return; if (result.error) this.state = result.failState; return result.node; } tsTryParse(f) { const state = this.state.clone(); const result = f(); if (result !== undefined && result !== false) { return result; } this.state = state; } tsTryParseDeclare(nany) { if (this.isLineTerminator()) { return; } let startType = this.state.type; let kind; if (this.isContextual(99)) { startType = 74; kind = "let"; } return this.tsInAmbientContext(() => { switch (startType) { case 68: nany.declare = true; return super.parseFunctionStatement(nany, false, false); case 80: nany.declare = true; return this.parseClass(nany, true, false); case 124: return this.tsParseEnumDeclaration(nany, { declare: true }); case 110: return this.tsParseAmbientExternalModuleDeclaration(nany); case 75: case 74: if (!this.match(75) || !this.isLookaheadContextual("enum")) { nany.declare = true; return this.parseVarStatement(nany, kind || this.state.value, true); } this.expect(75); return this.tsParseEnumDeclaration(nany, { const: true, declare: true }); case 127: { const result = this.tsParseInterfaceDeclaration(nany, { declare: true }); if (result) return result; } default: if ((0, _types.tokenIsIdentifier)(startType)) { return this.tsParseDeclaration(nany, this.state.value, true, null); } } }); } tsTryParseExportDeclaration() { return this.tsParseDeclaration(this.startNode(), this.state.value, true, null); } tsParseExpressionStatement(node, expr, decorators) { switch (expr.name) { case "declare": { const declaration = this.tsTryParseDeclare(node); if (declaration) { declaration.declare = true; } return declaration; } case "global": if (this.match(5)) { this.scope.enter(_scopeflags.SCOPE_TS_MODULE); this.prodParam.enter(_productionParameter.PARAM); const mod = node; mod.global = true; mod.id = expr; mod.body = this.tsParseModuleBlock(); this.scope.exit(); this.prodParam.exit(); return this.finishNode(mod, "TSModuleDeclaration"); } break; default: return this.tsParseDeclaration(node, expr.name, false, decorators); } } tsParseDeclaration(node, value, next, decorators) { switch (value) { case "abstract": if (this.tsCheckLineTerminator(next) && (this.match(80) || (0, _types.tokenIsIdentifier)(this.state.type))) { return this.tsParseAbstractDeclaration(node, decorators); } break; case "module": if (this.tsCheckLineTerminator(next)) { if (this.match(131)) { return this.tsParseAmbientExternalModuleDeclaration(node); } else if ((0, _types.tokenIsIdentifier)(this.state.type)) { return this.tsParseModuleOrNamespaceDeclaration(node); } } break; case "namespace": if (this.tsCheckLineTerminator(next) && (0, _types.tokenIsIdentifier)(this.state.type)) { return this.tsParseModuleOrNamespaceDeclaration(node); } break; case "type": if (this.tsCheckLineTerminator(next) && (0, _types.tokenIsIdentifier)(this.state.type)) { return this.tsParseTypeAliasDeclaration(node); } break; } } tsCheckLineTerminator(next) { if (next) { if (this.hasFollowingLineBreak()) return false; this.next(); return true; } return !this.isLineTerminator(); } tsTryParseGenericAsyncArrowFunction(startLoc) { if (!this.match(47)) return; const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; this.state.maybeInArrowParameters = true; const res = this.tsTryParseAndCatch(() => { const node = this.startNodeAt(startLoc); node.typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier); super.parseFunctionParams(node); node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation(); this.expect(19); return node; }); this.state.maybeInArrowParameters = oldMaybeInArrowParameters; if (!res) return; return super.parseArrowExpression(res, null, true); } tsParseTypeArgumentsInExpression() { if (this.reScan_lt() !== 47) return; return this.tsParseTypeArguments(); } tsParseTypeArguments() { const node = this.startNode(); node.params = this.tsInType(() => this.tsInNoContext(() => { this.expect(47); return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this)); })); if (node.params.length === 0) { this.raise(TSErrors.EmptyTypeArguments, { at: node }); } else if (!this.state.inType && this.curContext() === _context.types.brace) { this.reScan_lt_gt(); } this.expect(48); return this.finishNode(node, "TSTypeParameterInstantiation"); } tsIsDeclarationStart() { return (0, _types.tokenIsTSDeclarationStart)(this.state.type); } isExportDefaultSpecifier() { if (this.tsIsDeclarationStart()) return false; return super.isExportDefaultSpecifier(); } parseAssignableListItem(flags, decorators) { const startLoc = this.state.startLoc; const modified = {}; this.tsParseModifiers({ allowedModifiers: ["public", "private", "protected", "override", "readonly"] }, modified); const accessibility = modified.accessibility; const override = modified.override; const readonly = modified.readonly; if (!(flags & _lval.ParseBindingListFlags.IS_CONSTRUCTOR_PARAMS) && (accessibility || readonly || override)) { this.raise(TSErrors.UnexpectedParameterModifier, { at: startLoc }); } const left = this.parseMaybeDefault(); this.parseAssignableListItemTypes(left, flags); const elt = this.parseMaybeDefault(left.loc.start, left); if (accessibility || readonly || override) { const pp = this.startNodeAt(startLoc); if (decorators.length) { pp.decorators = decorators; } if (accessibility) pp.accessibility = accessibility; if (readonly) pp.readonly = readonly; if (override) pp.override = override; if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") { this.raise(TSErrors.UnsupportedParameterPropertyKind, { at: pp }); } pp.parameter = elt; return this.finishNode(pp, "TSParameterProperty"); } if (decorators.length) { left.decorators = decorators; } return elt; } isSimpleParameter(node) { return node.type === "TSParameterProperty" && super.isSimpleParameter(node.parameter) || super.isSimpleParameter(node); } tsDisallowOptionalPattern(node) { for (const param of node.params) { if (param.type !== "Identifier" && param.optional && !this.state.isAmbientContext) { this.raise(TSErrors.PatternIsOptional, { at: param }); } } } setArrowFunctionParameters(node, params, trailingCommaLoc) { super.setArrowFunctionParameters(node, params, trailingCommaLoc); this.tsDisallowOptionalPattern(node); } parseFunctionBodyAndFinish(node, type, isMethod = false) { if (this.match(14)) { node.returnType = this.tsParseTypeOrTypePredicateAnnotation(14); } const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" || type === "ClassPrivateMethod" ? "TSDeclareMethod" : undefined; if (bodilessType && !this.match(5) && this.isLineTerminator()) { return this.finishNode(node, bodilessType); } if (bodilessType === "TSDeclareFunction" && this.state.isAmbientContext) { this.raise(TSErrors.DeclareFunctionHasImplementation, { at: node }); if (node.declare) { return super.parseFunctionBodyAndFinish(node, bodilessType, isMethod); } } this.tsDisallowOptionalPattern(node); return super.parseFunctionBodyAndFinish(node, type, isMethod); } registerFunctionStatementId(node) { if (!node.body && node.id) { this.checkIdentifier(node.id, _scopeflags.BIND_TS_AMBIENT); } else { super.registerFunctionStatementId(node); } } tsCheckForInvalidTypeCasts(items) { items.forEach(node => { if ((node == null ? void 0 : node.type) === "TSTypeCastExpression") { this.raise(TSErrors.UnexpectedTypeAnnotation, { at: node.typeAnnotation }); } }); } toReferencedList(exprList, isInParens) { this.tsCheckForInvalidTypeCasts(exprList); return exprList; } parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); if (node.type === "ArrayExpression") { this.tsCheckForInvalidTypeCasts(node.elements); } return node; } parseSubscript(base, startLoc, noCalls, state) { if (!this.hasPrecedingLineBreak() && this.match(35)) { this.state.canStartJSXElement = false; this.next(); const nonNullExpression = this.startNodeAt(startLoc); nonNullExpression.expression = base; return this.finishNode(nonNullExpression, "TSNonNullExpression"); } let isOptionalCall = false; if (this.match(18) && this.lookaheadCharCode() === 60) { if (noCalls) { state.stop = true; return base; } state.optionalChainMember = isOptionalCall = true; this.next(); } if (this.match(47) || this.match(51)) { let missingParenErrorLoc; const result = this.tsTryParseAndCatch(() => { if (!noCalls && this.atPossibleAsyncArrow(base)) { const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startLoc); if (asyncArrowFn) { return asyncArrowFn; } } const typeArguments = this.tsParseTypeArgumentsInExpression(); if (!typeArguments) return; if (isOptionalCall && !this.match(10)) { missingParenErrorLoc = this.state.curPosition(); return; } if ((0, _types.tokenIsTemplate)(this.state.type)) { const result = super.parseTaggedTemplateExpression(base, startLoc, state); result.typeParameters = typeArguments; return result; } if (!noCalls && this.eat(10)) { const node = this.startNodeAt(startLoc); node.callee = base; node.arguments = this.parseCallExpressionArguments(11, false); this.tsCheckForInvalidTypeCasts(node.arguments); node.typeParameters = typeArguments; if (state.optionalChainMember) { node.optional = isOptionalCall; } return this.finishCallExpression(node, state.optionalChainMember); } const tokenType = this.state.type; if (tokenType === 48 || tokenType === 52 || tokenType !== 10 && (0, _types.tokenCanStartExpression)(tokenType) && !this.hasPrecedingLineBreak()) { return; } const node = this.startNodeAt(startLoc); node.expression = base; node.typeParameters = typeArguments; return this.finishNode(node, "TSInstantiationExpression"); }); if (missingParenErrorLoc) { this.unexpected(missingParenErrorLoc, 10); } if (result) { if (result.type === "TSInstantiationExpression" && (this.match(16) || this.match(18) && this.lookaheadCharCode() !== 40)) { this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, { at: this.state.startLoc }); } return result; } } return super.parseSubscript(base, startLoc, noCalls, state); } parseNewCallee(node) { var _callee$extra; super.parseNewCallee(node); const { callee } = node; if (callee.type === "TSInstantiationExpression" && !((_callee$extra = callee.extra) != null && _callee$extra.parenthesized)) { node.typeParameters = callee.typeParameters; node.callee = callee.expression; } } parseExprOp(left, leftStartLoc, minPrec) { let isSatisfies; if ((0, _types.tokenOperatorPrecedence)(58) > minPrec && !this.hasPrecedingLineBreak() && (this.isContextual(93) || (isSatisfies = this.isContextual(118)))) { const node = this.startNodeAt(leftStartLoc); node.expression = left; node.typeAnnotation = this.tsInType(() => { this.next(); if (this.match(75)) { if (isSatisfies) { this.raise(_parseError.Errors.UnexpectedKeyword, { at: this.state.startLoc, keyword: "const" }); } return this.tsParseTypeReference(); } return this.tsParseType(); }); this.finishNode(node, isSatisfies ? "TSSatisfiesExpression" : "TSAsExpression"); this.reScan_lt_gt(); return this.parseExprOp(node, leftStartLoc, minPrec); } return super.parseExprOp(left, leftStartLoc, minPrec); } checkReservedWord(word, startLoc, checkKeywords, isBinding) { if (!this.state.isAmbientContext) { super.checkReservedWord(word, startLoc, checkKeywords, isBinding); } } checkImportReflection(node) { super.checkImportReflection(node); if (node.module && node.importKind !== "value") { this.raise(TSErrors.ImportReflectionHasImportType, { at: node.specifiers[0].loc.start }); } } checkDuplicateExports() {} isPotentialImportPhase(isExport) { if (super.isPotentialImportPhase(isExport)) return true; if (this.isContextual(128)) { const ch = this.lookaheadCharCode(); return isExport ? ch === 123 || ch === 42 : ch !== 61; } return !isExport && this.isContextual(87); } applyImportPhase(node, isExport, phase, loc) { super.applyImportPhase(node, isExport, phase, loc); if (isExport) { node.exportKind = phase === "type" ? "type" : "value"; } else { node.importKind = phase === "type" || phase === "typeof" ? phase : "value"; } } parseImport(node) { if (this.match(131)) { node.importKind = "value"; return super.parseImport(node); } let importNode; if ((0, _types.tokenIsIdentifier)(this.state.type) && this.lookaheadCharCode() === 61) { node.importKind = "value"; return this.tsParseImportEqualsDeclaration(node); } else if (this.isContextual(128)) { const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, false); if (this.lookaheadCharCode() === 61) { return this.tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier); } else { importNode = super.parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier); } } else { importNode = super.parseImport(node); } if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") { this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, { at: importNode }); } return importNode; } parseExport(node, decorators) { if (this.match(83)) { this.next(); let maybeDefaultIdentifier = null; if (this.isContextual(128) && this.isPotentialImportPhase(false)) { maybeDefaultIdentifier = this.parseMaybeImportPhase(node, false); } else { node.importKind = "value"; } return this.tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier, true); } else if (this.eat(29)) { const assign = node; assign.expression = super.parseExpression(); this.semicolon(); this.sawUnambiguousESM = true; return this.finishNode(assign, "TSExportAssignment"); } else if (this.eatContextual(93)) { const decl = node; this.expectContextual(126); decl.id = this.parseIdentifier(); this.semicolon(); return this.finishNode(decl, "TSNamespaceExportDeclaration"); } else { return super.parseExport(node, decorators); } } isAbstractClass() { return this.isContextual(122) && this.lookahead().type === 80; } parseExportDefaultExpression() { if (this.isAbstractClass()) { const cls = this.startNode(); this.next(); cls.abstract = true; return this.parseClass(cls, true, true); } if (this.match(127)) { const result = this.tsParseInterfaceDeclaration(this.startNode()); if (result) return result; } return super.parseExportDefaultExpression(); } parseVarStatement(node, kind, allowMissingInitializer = false) { const { isAmbientContext } = this.state; const declaration = super.parseVarStatement(node, kind, allowMissingInitializer || isAmbientContext); if (!isAmbientContext) return declaration; for (const { id, init } of declaration.declarations) { if (!init) continue; if (kind !== "const" || !!id.typeAnnotation) { this.raise(TSErrors.InitializerNotAllowedInAmbientContext, { at: init }); } else if (!isValidAmbientConstInitializer(init, this.hasPlugin("estree"))) { this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, { at: init }); } } return declaration; } parseStatementContent(flags, decorators) { if (this.match(75) && this.isLookaheadContextual("enum")) { const node = this.startNode(); this.expect(75); return this.tsParseEnumDeclaration(node, { const: true }); } if (this.isContextual(124)) { return this.tsParseEnumDeclaration(this.startNode()); } if (this.isContextual(127)) { const result = this.tsParseInterfaceDeclaration(this.startNode()); if (result) return result; } return super.parseStatementContent(flags, decorators); } parseAccessModifier() { return this.tsParseModifier(["public", "protected", "private"]); } tsHasSomeModifiers(member, modifiers) { return modifiers.some(modifier => { if (tsIsAccessModifier(modifier)) { return member.accessibility === modifier; } return !!member[modifier]; }); } tsIsStartOfStaticBlocks() { return this.isContextual(104) && this.lookaheadCharCode() === 123; } parseClassMember(classBody, member, state) { const modifiers = ["declare", "private", "public", "protected", "override", "abstract", "readonly", "static"]; this.tsParseModifiers({ allowedModifiers: modifiers, disallowedModifiers: ["in", "out"], stopOnStartOfClassStaticBlock: true, errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions }, member); const callParseClassMemberWithIsStatic = () => { if (this.tsIsStartOfStaticBlocks()) { this.next(); this.next(); if (this.tsHasSomeModifiers(member, modifiers)) { this.raise(TSErrors.StaticBlockCannotHaveModifier, { at: this.state.curPosition() }); } super.parseClassStaticBlock(classBody, member); } else { this.parseClassMemberWithIsStatic(classBody, member, state, !!member.static); } }; if (member.declare) { this.tsInAmbientContext(callParseClassMemberWithIsStatic); } else { callParseClassMemberWithIsStatic(); } } parseClassMemberWithIsStatic(classBody, member, state, isStatic) { const idx = this.tsTryParseIndexSignature(member); if (idx) { classBody.body.push(idx); if (member.abstract) { this.raise(TSErrors.IndexSignatureHasAbstract, { at: member }); } if (member.accessibility) { this.raise(TSErrors.IndexSignatureHasAccessibility, { at: member, modifier: member.accessibility }); } if (member.declare) { this.raise(TSErrors.IndexSignatureHasDeclare, { at: member }); } if (member.override) { this.raise(TSErrors.IndexSignatureHasOverride, { at: member }); } return; } if (!this.state.inAbstractClass && member.abstract) { this.raise(TSErrors.NonAbstractClassHasAbstractMethod, { at: member }); } if (member.override) { if (!state.hadSuperClass) { this.raise(TSErrors.OverrideNotInSubClass, { at: member }); } } super.parseClassMemberWithIsStatic(classBody, member, state, isStatic); } parsePostMemberNameModifiers(methodOrProp) { const optional = this.eat(17); if (optional) methodOrProp.optional = true; if (methodOrProp.readonly && this.match(10)) { this.raise(TSErrors.ClassMethodHasReadonly, { at: methodOrProp }); } if (methodOrProp.declare && this.match(10)) { this.raise(TSErrors.ClassMethodHasDeclare, { at: methodOrProp }); } } parseExpressionStatement(node, expr, decorators) { const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr, decorators) : undefined; return decl || super.parseExpressionStatement(node, expr, decorators); } shouldParseExportDeclaration() { if (this.tsIsDeclarationStart()) return true; return super.shouldParseExportDeclaration(); } parseConditional(expr, startLoc, refExpressionErrors) { if (!this.state.maybeInArrowParameters || !this.match(17)) { return super.parseConditional(expr, startLoc, refExpressionErrors); } const result = this.tryParse(() => super.parseConditional(expr, startLoc)); if (!result.node) { if (result.error) { super.setOptionalParametersError(refExpressionErrors, result.error); } return expr; } if (result.error) this.state = result.failState; return result.node; } parseParenItem(node, startLoc) { node = super.parseParenItem(node, startLoc); if (this.eat(17)) { node.optional = true; this.resetEndLocation(node); } if (this.match(14)) { const typeCastNode = this.startNodeAt(startLoc); typeCastNode.expression = node; typeCastNode.typeAnnotation = this.tsParseTypeAnnotation(); return this.finishNode(typeCastNode, "TSTypeCastExpression"); } return node; } parseExportDeclaration(node) { if (!this.state.isAmbientContext && this.isContextual(123)) { return this.tsInAmbientContext(() => this.parseExportDeclaration(node)); } const startLoc = this.state.startLoc; const isDeclare = this.eatContextual(123); if (isDeclare && (this.isContextual(123) || !this.shouldParseExportDeclaration())) { throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, { at: this.state.startLoc }); } const isIdentifier = (0, _types.tokenIsIdentifier)(this.state.type); const declaration = isIdentifier && this.tsTryParseExportDeclaration() || super.parseExportDeclaration(node); if (!declaration) return null; if (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare) { node.exportKind = "type"; } if (isDeclare) { this.resetStartLocation(declaration, startLoc); declaration.declare = true; } return declaration; } parseClassId(node, isStatement, optionalId, bindingType) { if ((!isStatement || optionalId) && this.isContextual(111)) { return; } super.parseClassId(node, isStatement, optionalId, node.declare ? _scopeflags.BIND_TS_AMBIENT : _scopeflags.BIND_CLASS); const typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers); if (typeParameters) node.typeParameters = typeParameters; } parseClassPropertyAnnotation(node) { if (!node.optional) { if (this.eat(35)) { node.definite = true; } else if (this.eat(17)) { node.optional = true; } } const type = this.tsTryParseTypeAnnotation(); if (type) node.typeAnnotation = type; } parseClassProperty(node) { this.parseClassPropertyAnnotation(node); if (this.state.isAmbientContext && !(node.readonly && !node.typeAnnotation) && this.match(29)) { this.raise(TSErrors.DeclareClassFieldHasInitializer, { at: this.state.startLoc }); } if (node.abstract && this.match(29)) { const { key } = node; this.raise(TSErrors.AbstractPropertyHasInitializer, { at: this.state.startLoc, propertyName: key.type === "Identifier" && !node.computed ? key.name : `[${this.input.slice(key.start, key.end)}]` }); } return super.parseClassProperty(node); } parseClassPrivateProperty(node) { if (node.abstract) { this.raise(TSErrors.PrivateElementHasAbstract, { at: node }); } if (node.accessibility) { this.raise(TSErrors.PrivateElementHasAccessibility, { at: node, modifier: node.accessibility }); } this.parseClassPropertyAnnotation(node); return super.parseClassPrivateProperty(node); } parseClassAccessorProperty(node) { this.parseClassPropertyAnnotation(node); if (node.optional) { this.raise(TSErrors.AccessorCannotBeOptional, { at: node }); } return super.parseClassAccessorProperty(node); } pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); if (typeParameters && isConstructor) { this.raise(TSErrors.ConstructorHasTypeParameters, { at: typeParameters }); } const { declare = false, kind } = method; if (declare && (kind === "get" || kind === "set")) { this.raise(TSErrors.DeclareAccessor, { at: method, kind }); } if (typeParameters) method.typeParameters = typeParameters; super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); } pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); if (typeParameters) method.typeParameters = typeParameters; super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); } declareClassPrivateMethodInScope(node, kind) { if (node.type === "TSDeclareMethod") return; if (node.type === "MethodDefinition" && !node.value.body) return; super.declareClassPrivateMethodInScope(node, kind); } parseClassSuper(node) { super.parseClassSuper(node); if (node.superClass && (this.match(47) || this.match(51))) { node.superTypeParameters = this.tsParseTypeArgumentsInExpression(); } if (this.eatContextual(111)) { node.implements = this.tsParseHeritageClause("implements"); } } parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); if (typeParameters) prop.typeParameters = typeParameters; return super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); } parseFunctionParams(node, isConstructor) { const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); if (typeParameters) node.typeParameters = typeParameters; super.parseFunctionParams(node, isConstructor); } parseVarId(decl, kind) { super.parseVarId(decl, kind); if (decl.id.type === "Identifier" && !this.hasPrecedingLineBreak() && this.eat(35)) { decl.definite = true; } const type = this.tsTryParseTypeAnnotation(); if (type) { decl.id.typeAnnotation = type; this.resetEndLocation(decl.id); } } parseAsyncArrowFromCallExpression(node, call) { if (this.match(14)) { node.returnType = this.tsParseTypeAnnotation(); } return super.parseAsyncArrowFromCallExpression(node, call); } parseMaybeAssign(refExpressionErrors, afterLeftParse) { var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2; let state; let jsx; let typeCast; if (this.hasPlugin("jsx") && (this.match(140) || this.match(47))) { state = this.state.clone(); jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); if (!jsx.error) return jsx.node; const { context } = this.state; const currentContext = context[context.length - 1]; if (currentContext === _context.types.j_oTag || currentContext === _context.types.j_expr) { context.pop(); } } if (!((_jsx = jsx) != null && _jsx.error) && !this.match(47)) { return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); } if (!state || state === this.state) state = this.state.clone(); let typeParameters; const arrow = this.tryParse(abort => { var _expr$extra, _typeParameters; typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier); const expr = super.parseMaybeAssign(refExpressionErrors, afterLeftParse); if (expr.type !== "ArrowFunctionExpression" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) { abort(); } if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) { this.resetStartLocationFromNode(expr, typeParameters); } expr.typeParameters = typeParameters; ; return expr; }, state); if (!arrow.error && !arrow.aborted) { if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); return arrow.node; } if (!jsx) { assert(!this.hasPlugin("jsx")); typeCast = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); if (!typeCast.error) return typeCast.node; } if ((_jsx2 = jsx) != null && _jsx2.node) { this.state = jsx.failState; return jsx.node; } if (arrow.node) { this.state = arrow.failState; if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); return arrow.node; } if ((_typeCast = typeCast) != null && _typeCast.node) { this.state = typeCast.failState; return typeCast.node; } throw ((_jsx3 = jsx) == null ? void 0 : _jsx3.error) || arrow.error || ((_typeCast2 = typeCast) == null ? void 0 : _typeCast2.error); } reportReservedArrowTypeParam(node) { var _node$extra; if (node.params.length === 1 && !node.params[0].constraint && !((_node$extra = node.extra) != null && _node$extra.trailingComma) && this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) { this.raise(TSErrors.ReservedArrowTypeParam, { at: node }); } } parseMaybeUnary(refExpressionErrors, sawUnary) { if (!this.hasPlugin("jsx") && this.match(47)) { return this.tsParseTypeAssertion(); } return super.parseMaybeUnary(refExpressionErrors, sawUnary); } parseArrow(node) { if (this.match(14)) { const result = this.tryParse(abort => { const returnType = this.tsParseTypeOrTypePredicateAnnotation(14); if (this.canInsertSemicolon() || !this.match(19)) abort(); return returnType; }); if (result.aborted) return; if (!result.thrown) { if (result.error) this.state = result.failState; node.returnType = result.node; } } return super.parseArrow(node); } parseAssignableListItemTypes(param, flags) { if (!(flags & _lval.ParseBindingListFlags.IS_FUNCTION_PARAMS)) return param; if (this.eat(17)) { param.optional = true; } const type = this.tsTryParseTypeAnnotation(); if (type) param.typeAnnotation = type; this.resetEndLocation(param); return param; } isAssignable(node, isBinding) { switch (node.type) { case "TSTypeCastExpression": return this.isAssignable(node.expression, isBinding); case "TSParameterProperty": return true; default: return super.isAssignable(node, isBinding); } } toAssignable(node, isLHS = false) { switch (node.type) { case "ParenthesizedExpression": this.toAssignableParenthesizedExpression(node, isLHS); break; case "TSAsExpression": case "TSSatisfiesExpression": case "TSNonNullExpression": case "TSTypeAssertion": if (isLHS) { this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter, { at: node }); } else { this.raise(TSErrors.UnexpectedTypeCastInParameter, { at: node }); } this.toAssignable(node.expression, isLHS); break; case "AssignmentExpression": if (!isLHS && node.left.type === "TSTypeCastExpression") { node.left = this.typeCastToParameter(node.left); } default: super.toAssignable(node, isLHS); } } toAssignableParenthesizedExpression(node, isLHS) { switch (node.expression.type) { case "TSAsExpression": case "TSSatisfiesExpression": case "TSNonNullExpression": case "TSTypeAssertion": case "ParenthesizedExpression": this.toAssignable(node.expression, isLHS); break; default: super.toAssignable(node, isLHS); } } checkToRestConversion(node, allowPattern) { switch (node.type) { case "TSAsExpression": case "TSSatisfiesExpression": case "TSTypeAssertion": case "TSNonNullExpression": this.checkToRestConversion(node.expression, false); break; default: super.checkToRestConversion(node, allowPattern); } } isValidLVal(type, isUnparenthesizedInAssign, binding) { return getOwn({ TSTypeCastExpression: true, TSParameterProperty: "parameter", TSNonNullExpression: "expression", TSAsExpression: (binding !== _scopeflags.BIND_NONE || !isUnparenthesizedInAssign) && ["expression", true], TSSatisfiesExpression: (binding !== _scopeflags.BIND_NONE || !isUnparenthesizedInAssign) && ["expression", true], TSTypeAssertion: (binding !== _scopeflags.BIND_NONE || !isUnparenthesizedInAssign) && ["expression", true] }, type) || super.isValidLVal(type, isUnparenthesizedInAssign, binding); } parseBindingAtom() { if (this.state.type === 78) { return this.parseIdentifier(true); } return super.parseBindingAtom(); } parseMaybeDecoratorArguments(expr) { if (this.match(47) || this.match(51)) { const typeArguments = this.tsParseTypeArgumentsInExpression(); if (this.match(10)) { const call = super.parseMaybeDecoratorArguments(expr); call.typeParameters = typeArguments; return call; } this.unexpected(null, 10); } return super.parseMaybeDecoratorArguments(expr); } checkCommaAfterRest(close) { if (this.state.isAmbientContext && this.match(12) && this.lookaheadCharCode() === close) { this.next(); return false; } return super.checkCommaAfterRest(close); } isClassMethod() { return this.match(47) || super.isClassMethod(); } isClassProperty() { return this.match(35) || this.match(14) || super.isClassProperty(); } parseMaybeDefault(startLoc, left) { const node = super.parseMaybeDefault(startLoc, left); if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { this.raise(TSErrors.TypeAnnotationAfterAssign, { at: node.typeAnnotation }); } return node; } getTokenFromCode(code) { if (this.state.inType) { if (code === 62) { this.finishOp(48, 1); return; } if (code === 60) { this.finishOp(47, 1); return; } } super.getTokenFromCode(code); } reScan_lt_gt() { const { type } = this.state; if (type === 47) { this.state.pos -= 1; this.readToken_lt(); } else if (type === 48) { this.state.pos -= 1; this.readToken_gt(); } } reScan_lt() { const { type } = this.state; if (type === 51) { this.state.pos -= 2; this.finishOp(47, 1); return 47; } return type; } toAssignableList(exprList, trailingCommaLoc, isLHS) { for (let i = 0; i < exprList.length; i++) { const expr = exprList[i]; if ((expr == null ? void 0 : expr.type) === "TSTypeCastExpression") { exprList[i] = this.typeCastToParameter(expr); } } super.toAssignableList(exprList, trailingCommaLoc, isLHS); } typeCastToParameter(node) { node.expression.typeAnnotation = node.typeAnnotation; this.resetEndLocation(node.expression, node.typeAnnotation.loc.end); return node.expression; } shouldParseArrow(params) { if (this.match(14)) { return params.every(expr => this.isAssignable(expr, true)); } return super.shouldParseArrow(params); } shouldParseAsyncArrow() { return this.match(14) || super.shouldParseAsyncArrow(); } canHaveLeadingDecorator() { return super.canHaveLeadingDecorator() || this.isAbstractClass(); } jsxParseOpeningElementAfterName(node) { if (this.match(47) || this.match(51)) { const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArgumentsInExpression()); if (typeArguments) node.typeParameters = typeArguments; } return super.jsxParseOpeningElementAfterName(node); } getGetterSetterExpectedParamCount(method) { const baseCount = super.getGetterSetterExpectedParamCount(method); const params = this.getObjectOrClassMethodParams(method); const firstParam = params[0]; const hasContextParam = firstParam && this.isThisParam(firstParam); return hasContextParam ? baseCount + 1 : baseCount; } parseCatchClauseParam() { const param = super.parseCatchClauseParam(); const type = this.tsTryParseTypeAnnotation(); if (type) { param.typeAnnotation = type; this.resetEndLocation(param); } return param; } tsInAmbientContext(cb) { const oldIsAmbientContext = this.state.isAmbientContext; this.state.isAmbientContext = true; try { return cb(); } finally { this.state.isAmbientContext = oldIsAmbientContext; } } parseClass(node, isStatement, optionalId) { const oldInAbstractClass = this.state.inAbstractClass; this.state.inAbstractClass = !!node.abstract; try { return super.parseClass(node, isStatement, optionalId); } finally { this.state.inAbstractClass = oldInAbstractClass; } } tsParseAbstractDeclaration(node, decorators) { if (this.match(80)) { node.abstract = true; return this.maybeTakeDecorators(decorators, this.parseClass(node, true, false)); } else if (this.isContextual(127)) { if (!this.hasFollowingLineBreak()) { node.abstract = true; this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, { at: node }); return this.tsParseInterfaceDeclaration(node); } } else { this.unexpected(null, 80); } } parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) { const method = super.parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); if (method.abstract) { const hasBody = this.hasPlugin("estree") ? !!method.value.body : !!method.body; if (hasBody) { const { key } = method; this.raise(TSErrors.AbstractMethodHasImplementation, { at: method, methodName: key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(key.start, key.end)}]` }); } } return method; } tsParseTypeParameterName() { const typeName = this.parseIdentifier(); return typeName.name; } shouldParseAsAmbientContext() { return !!this.getPluginOption("typescript", "dts"); } parse() { if (this.shouldParseAsAmbientContext()) { this.state.isAmbientContext = true; } return super.parse(); } getExpression() { if (this.shouldParseAsAmbientContext()) { this.state.isAmbientContext = true; } return super.getExpression(); } parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) { if (!isString && isMaybeTypeOnly) { this.parseTypeOnlyImportExportSpecifier(node, false, isInTypeExport); return this.finishNode(node, "ExportSpecifier"); } node.exportKind = "value"; return super.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly); } parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { if (!importedIsString && isMaybeTypeOnly) { this.parseTypeOnlyImportExportSpecifier(specifier, true, isInTypeOnlyImport); return this.finishNode(specifier, "ImportSpecifier"); } specifier.importKind = "value"; return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, isInTypeOnlyImport ? _scopeflags.BIND_TS_TYPE_IMPORT : _scopeflags.BIND_FLAGS_TS_IMPORT); } parseTypeOnlyImportExportSpecifier(node, isImport, isInTypeOnlyImportExport) { const leftOfAsKey = isImport ? "imported" : "local"; const rightOfAsKey = isImport ? "local" : "exported"; let leftOfAs = node[leftOfAsKey]; let rightOfAs; let hasTypeSpecifier = false; let canParseAsKeyword = true; const loc = leftOfAs.loc.start; if (this.isContextual(93)) { const firstAs = this.parseIdentifier(); if (this.isContextual(93)) { const secondAs = this.parseIdentifier(); if ((0, _types.tokenIsKeywordOrIdentifier)(this.state.type)) { hasTypeSpecifier = true; leftOfAs = firstAs; rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName(); canParseAsKeyword = false; } else { rightOfAs = secondAs; canParseAsKeyword = false; } } else if ((0, _types.tokenIsKeywordOrIdentifier)(this.state.type)) { canParseAsKeyword = false; rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName(); } else { hasTypeSpecifier = true; leftOfAs = firstAs; } } else if ((0, _types.tokenIsKeywordOrIdentifier)(this.state.type)) { hasTypeSpecifier = true; if (isImport) { leftOfAs = this.parseIdentifier(true); if (!this.isContextual(93)) { this.checkReservedWord(leftOfAs.name, leftOfAs.loc.start, true, true); } } else { leftOfAs = this.parseModuleExportName(); } } if (hasTypeSpecifier && isInTypeOnlyImportExport) { this.raise(isImport ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports, { at: loc }); } node[leftOfAsKey] = leftOfAs; node[rightOfAsKey] = rightOfAs; const kindKey = isImport ? "importKind" : "exportKind"; node[kindKey] = hasTypeSpecifier ? "type" : "value"; if (canParseAsKeyword && this.eatContextual(93)) { node[rightOfAsKey] = isImport ? this.parseIdentifier() : this.parseModuleExportName(); } if (!node[rightOfAsKey]) { node[rightOfAsKey] = (0, _node.cloneIdentifier)(node[leftOfAsKey]); } if (isImport) { this.checkIdentifier(node[rightOfAsKey], hasTypeSpecifier ? _scopeflags.BIND_TS_TYPE_IMPORT : _scopeflags.BIND_FLAGS_TS_IMPORT); } } }; exports.default = _default; function isPossiblyLiteralEnum(expression) { if (expression.type !== "MemberExpression") return false; const { computed, property } = expression; if (computed && property.type !== "StringLiteral" && (property.type !== "TemplateLiteral" || property.expressions.length > 0)) { return false; } return isUncomputedMemberExpressionChain(expression.object); } function isValidAmbientConstInitializer(expression, estree) { var _expression$extra; const { type } = expression; if ((_expression$extra = expression.extra) != null && _expression$extra.parenthesized) { return false; } if (estree) { if (type === "Literal") { const { value } = expression; if (typeof value === "string" || typeof value === "boolean") { return true; } } } else { if (type === "StringLiteral" || type === "BooleanLiteral") { return true; } } if (isNumber(expression, estree) || isNegativeNumber(expression, estree)) { return true; } if (type === "TemplateLiteral" && expression.expressions.length === 0) { return true; } if (isPossiblyLiteralEnum(expression)) { return true; } return false; } function isNumber(expression, estree) { if (estree) { return expression.type === "Literal" && (typeof expression.value === "number" || "bigint" in expression); } return expression.type === "NumericLiteral" || expression.type === "BigIntLiteral"; } function isNegativeNumber(expression, estree) { if (expression.type === "UnaryExpression") { const { operator, argument } = expression; if (operator === "-" && isNumber(argument, estree)) { return true; } } return false; } function isUncomputedMemberExpressionChain(expression) { if (expression.type === "Identifier") return true; if (expression.type !== "MemberExpression" || expression.computed) { return false; } return isUncomputedMemberExpressionChain(expression.object); } //# sourceMappingURL=index.js.map lib/plugins/typescript/index.js.map 0000644 00000747066 15120211212 0013431 0 ustar 00 {"version":3,"names":["_types","require","_context","_location","_scopeflags","_scope","_productionParameter","_parseError","_node","_lval","getOwn","object","key","Object","hasOwnProperty","call","nonNull","x","Error","assert","TSErrors","ParseErrorEnum","AbstractMethodHasImplementation","methodName","AbstractPropertyHasInitializer","propertyName","AccesorCannotDeclareThisParameter","AccesorCannotHaveTypeParameters","AccessorCannotBeOptional","ClassMethodHasDeclare","ClassMethodHasReadonly","ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference","ConstructorHasTypeParameters","DeclareAccessor","kind","DeclareClassFieldHasInitializer","DeclareFunctionHasImplementation","DuplicateAccessibilityModifier","modifier","DuplicateModifier","EmptyHeritageClauseType","token","EmptyTypeArguments","EmptyTypeParameters","ExpectedAmbientAfterExportDeclare","ImportAliasHasImportType","ImportReflectionHasImportType","IncompatibleModifiers","modifiers","IndexSignatureHasAbstract","IndexSignatureHasAccessibility","IndexSignatureHasDeclare","IndexSignatureHasOverride","IndexSignatureHasStatic","InitializerNotAllowedInAmbientContext","InvalidModifierOnTypeMember","InvalidModifierOnTypeParameter","InvalidModifierOnTypeParameterPositions","InvalidModifiersOrder","orderedModifiers","InvalidPropertyAccessAfterInstantiationExpression","InvalidTupleMemberLabel","MissingInterfaceName","MixedLabeledAndUnlabeledElements","NonAbstractClassHasAbstractMethod","NonClassMethodPropertyHasAbstractModifer","OptionalTypeBeforeRequired","OverrideNotInSubClass","PatternIsOptional","PrivateElementHasAbstract","PrivateElementHasAccessibility","ReadonlyForMethodSignature","ReservedArrowTypeParam","ReservedTypeAssertion","SetAccesorCannotHaveOptionalParameter","SetAccesorCannotHaveRestParameter","SetAccesorCannotHaveReturnType","SingleTypeParameterWithoutTrailingComma","typeParameterName","StaticBlockCannotHaveModifier","TupleOptionalAfterType","TypeAnnotationAfterAssign","TypeImportCannotSpecifyDefaultAndNamed","TypeModifierIsUsedInTypeExports","TypeModifierIsUsedInTypeImports","UnexpectedParameterModifier","UnexpectedReadonly","UnexpectedTypeAnnotation","UnexpectedTypeCastInParameter","UnsupportedImportTypeArgument","UnsupportedParameterPropertyKind","UnsupportedSignatureParameterKind","type","keywordTypeFromName","value","undefined","tsIsAccessModifier","tsIsVarianceAnnotations","_default","superClass","TypeScriptParserMixin","constructor","args","tsParseInOutModifiers","tsParseModifiers","bind","allowedModifiers","disallowedModifiers","errorTemplate","tsParseConstModifier","tsParseInOutConstModifiers","getScopeHandler","TypeScriptScopeHandler","tsIsIdentifier","tokenIsIdentifier","state","tsTokenCanFollowModifier","match","isLiteralPropertyName","hasPrecedingLineBreak","tsNextTokenCanFollowModifier","next","tsParseModifier","stopOnStartOfClassStaticBlock","indexOf","tsIsStartOfStaticBlocks","tsTryParse","modified","enforceOrder","loc","before","after","raise","at","incompatible","mod1","mod2","startLoc","concat","accessibility","includes","tsIsListTerminator","tsParseList","parseElement","result","push","tsParseDelimitedList","refTrailingCommaPos","tsParseDelimitedListWorker","expectSuccess","trailingCommaPos","element","eat","lastTokStart","expect","tsParseBracketedList","bracket","skipFirstToken","tsParseImportType","node","startNode","argument","parseExprAtom","qualifier","tsParseEntityName","typeParameters","tsParseTypeArguments","finishNode","allowReservedWords","entity","parseIdentifier","startNodeAtNode","left","right","tsParseTypeReference","typeName","tsParseThisTypePredicate","lhs","parameterName","typeAnnotation","tsParseTypeAnnotation","asserts","tsParseThisTypeNode","tsParseTypeQuery","exprName","tsParseTypeParameter","parseModifiers","name","tsParseTypeParameterName","constraint","tsEatThenParseType","default","tsTryParseTypeParameters","tsParseTypeParameters","unexpected","params","length","addExtra","tsFillSignature","returnToken","signature","returnTokenRequired","paramsKey","returnTypeKey","tsParseBindingListForSignature","tsParseTypeOrTypePredicateAnnotation","list","parseBindingList","ParseBindingListFlags","IS_FUNCTION_PARAMS","pattern","tsParseTypeMemberSemicolon","isLineTerminator","tsParseSignatureMember","tsIsUnambiguouslyIndexSignature","tsTryParseIndexSignature","tsLookAhead","id","resetEndLocation","parameters","tsTryParseTypeAnnotation","tsParsePropertyOrMethodSignature","readonly","optional","nodeAny","method","curPosition","Errors","BadGetterArity","isThisParam","BadSetterArity","firstParameter","property","tsParseTypeMember","createIdentifier","idx","parsePropertyName","computed","tsParseTypeLiteral","members","tsParseObjectTypeMembers","tsIsStartOfMappedType","isContextual","tsParseMappedTypeParameter","tsExpectThenParseType","tsParseMappedType","expectContextual","eatContextual","typeParameter","nameType","tsParseType","tsTryParseType","semicolon","tsParseTupleType","elementTypes","tsParseTupleElementType","seenOptionalElement","labeledElements","forEach","elementNode","_labeledElements","checkType","isLabeled","rest","labeled","label","isWord","tokenIsKeywordOrIdentifier","chAfterWord","lookaheadCharCode","wordName","typeOrLabel","tsParseNonArrayType","startNodeAt","labeledNode","elementType","lastTokStartLoc","optionalTypeNode","restNode","tsParseParenthesizedType","tsParseFunctionOrConstructorType","abstract","tsInAllowConditionalTypesContext","tsParseLiteralTypeNode","literal","tsParseTemplateLiteralType","parseTemplate","parseTemplateSubstitution","inType","tsParseThisTypeOrThisTypePredicate","thisKeyword","nextToken","lookahead","parseMaybeUnary","nodeType","tsParseArrayTypeOrHigher","objectType","indexType","tsParseTypeOperator","operator","tsParseTypeOperatorOrHigher","tsCheckTypeAnnotationForReadOnly","tsParseInferType","tsParseConstraintForInferType","tsInDisallowConditionalTypesContext","inDisallowConditionalTypesContext","isTypeOperator","tokenIsTSTypeOperator","containsEsc","tsParseUnionOrIntersectionType","parseConstituentType","hasLeadingOperator","types","tsParseIntersectionTypeOrHigher","tsParseUnionTypeOrHigher","tsIsStartOfFunctionType","tsIsUnambiguouslyStartOfFunctionType","tsSkipParameterStart","errors","previousErrorCount","parseObjectLike","_unused","ALLOW_EMPTY","_unused2","tsInType","t","tsParseTypePredicateAsserts","thisTypePredicate","resetStartLocationFromNode","typePredicateVariable","tsParseTypePredicatePrefix","tsTryParseTypeOrTypePredicateAnnotation","InvalidEscapedReservedWord","reservedWord","eatColon","tsParseNonConditionalType","extendsType","trueType","falseType","isAbstractConstructorSignature","tsParseTypeAssertion","getPluginOption","expression","tsParseHeritageClause","originalStartLoc","delimitedList","tsParseInterfaceDeclaration","properties","hasFollowingLineBreak","declare","checkIdentifier","BIND_TS_INTERFACE","extends","body","tsParseTypeAliasDeclaration","BIND_TS_TYPE","tsInNoContext","cb","oldContext","context","oldInType","oldInDisallowConditionalTypesContext","tsNextThenParseType","tsParseEnumMember","parseStringLiteral","initializer","parseMaybeAssignAllowIn","tsParseEnumDeclaration","const","BIND_TS_CONST_ENUM","BIND_TS_ENUM","tsParseModuleBlock","scope","enter","SCOPE_OTHER","parseBlockOrModuleBlockBody","exit","tsParseModuleOrNamespaceDeclaration","nested","BIND_TS_NAMESPACE","inner","SCOPE_TS_MODULE","prodParam","PARAM","tsParseAmbientExternalModuleDeclaration","global","tsParseImportEqualsDeclaration","maybeDefaultIdentifier","isExport","BIND_FLAGS_TS_IMPORT","moduleReference","tsParseModuleReference","importKind","tsIsExternalModuleReference","tsParseExternalModuleReference","sawUnambiguousESM","f","clone","res","tsTryParseAndCatch","tryParse","abort","aborted","error","failState","tsTryParseDeclare","nany","startType","tsInAmbientContext","parseFunctionStatement","parseClass","isLookaheadContextual","parseVarStatement","tsParseDeclaration","tsTryParseExportDeclaration","tsParseExpressionStatement","expr","decorators","declaration","mod","tsCheckLineTerminator","tsParseAbstractDeclaration","tsTryParseGenericAsyncArrowFunction","oldMaybeInArrowParameters","maybeInArrowParameters","parseFunctionParams","returnType","parseArrowExpression","tsParseTypeArgumentsInExpression","reScan_lt","curContext","tc","brace","reScan_lt_gt","tsIsDeclarationStart","tokenIsTSDeclarationStart","isExportDefaultSpecifier","parseAssignableListItem","flags","override","IS_CONSTRUCTOR_PARAMS","parseMaybeDefault","parseAssignableListItemTypes","elt","start","pp","parameter","isSimpleParameter","tsDisallowOptionalPattern","param","isAmbientContext","setArrowFunctionParameters","trailingCommaLoc","parseFunctionBodyAndFinish","isMethod","bodilessType","registerFunctionStatementId","BIND_TS_AMBIENT","tsCheckForInvalidTypeCasts","items","toReferencedList","exprList","isInParens","parseArrayLike","close","canBePattern","isTuple","refExpressionErrors","elements","parseSubscript","base","noCalls","canStartJSXElement","nonNullExpression","isOptionalCall","stop","optionalChainMember","missingParenErrorLoc","atPossibleAsyncArrow","asyncArrowFn","typeArguments","tokenIsTemplate","parseTaggedTemplateExpression","callee","arguments","parseCallExpressionArguments","finishCallExpression","tokenType","tokenCanStartExpression","parseNewCallee","_callee$extra","extra","parenthesized","parseExprOp","leftStartLoc","minPrec","isSatisfies","tokenOperatorPrecedence","UnexpectedKeyword","keyword","checkReservedWord","word","checkKeywords","isBinding","checkImportReflection","module","specifiers","checkDuplicateExports","isPotentialImportPhase","ch","applyImportPhase","phase","exportKind","parseImport","importNode","parseMaybeImportPhase","parseImportSpecifiersAndAfter","parseExport","assign","parseExpression","decl","isAbstractClass","parseExportDefaultExpression","cls","allowMissingInitializer","init","declarations","isValidAmbientConstInitializer","hasPlugin","parseStatementContent","parseAccessModifier","tsHasSomeModifiers","member","some","parseClassMember","classBody","callParseClassMemberWithIsStatic","parseClassStaticBlock","parseClassMemberWithIsStatic","static","isStatic","inAbstractClass","hadSuperClass","parsePostMemberNameModifiers","methodOrProp","parseExpressionStatement","shouldParseExportDeclaration","parseConditional","setOptionalParametersError","parseParenItem","typeCastNode","parseExportDeclaration","isDeclare","isIdentifier","resetStartLocation","parseClassId","isStatement","optionalId","bindingType","BIND_CLASS","parseClassPropertyAnnotation","definite","parseClassProperty","input","slice","end","parseClassPrivateProperty","parseClassAccessorProperty","pushClassMethod","isGenerator","isAsync","isConstructor","allowsDirectSuper","pushClassPrivateMethod","declareClassPrivateMethodInScope","parseClassSuper","superTypeParameters","implements","parseObjPropValue","prop","isPattern","isAccessor","parseVarId","parseAsyncArrowFromCallExpression","parseMaybeAssign","afterLeftParse","_jsx","_jsx2","_typeCast","_jsx3","_typeCast2","jsx","typeCast","currentContext","j_oTag","j_expr","pop","arrow","_expr$extra","_typeParameters","reportReservedArrowTypeParam","_node$extra","trailingComma","sawUnary","parseArrow","canInsertSemicolon","thrown","isAssignable","toAssignable","isLHS","toAssignableParenthesizedExpression","expressionScope","recordArrowParameterBindingError","typeCastToParameter","checkToRestConversion","allowPattern","isValidLVal","isUnparenthesizedInAssign","binding","TSTypeCastExpression","TSParameterProperty","TSNonNullExpression","TSAsExpression","BIND_NONE","TSSatisfiesExpression","TSTypeAssertion","parseBindingAtom","parseMaybeDecoratorArguments","checkCommaAfterRest","isClassMethod","isClassProperty","getTokenFromCode","code","finishOp","pos","readToken_lt","readToken_gt","toAssignableList","i","shouldParseArrow","every","shouldParseAsyncArrow","canHaveLeadingDecorator","jsxParseOpeningElementAfterName","getGetterSetterExpectedParamCount","baseCount","getObjectOrClassMethodParams","firstParam","hasContextParam","parseCatchClauseParam","oldIsAmbientContext","oldInAbstractClass","maybeTakeDecorators","parseMethod","allowDirectSuper","inClassScope","hasBody","shouldParseAsAmbientContext","parse","getExpression","parseExportSpecifier","isString","isInTypeExport","isMaybeTypeOnly","parseTypeOnlyImportExportSpecifier","parseImportSpecifier","specifier","importedIsString","isInTypeOnlyImport","BIND_TS_TYPE_IMPORT","isImport","isInTypeOnlyImportExport","leftOfAsKey","rightOfAsKey","leftOfAs","rightOfAs","hasTypeSpecifier","canParseAsKeyword","firstAs","secondAs","parseModuleExportName","kindKey","cloneIdentifier","exports","isPossiblyLiteralEnum","expressions","isUncomputedMemberExpressionChain","estree","_expression$extra","isNumber","isNegativeNumber"],"sources":["../../../src/plugins/typescript/index.ts"],"sourcesContent":["/*:: declare var invariant; */\n\nimport type State from \"../../tokenizer/state\";\nimport {\n tokenIsIdentifier,\n tokenIsTSDeclarationStart,\n tokenIsTSTypeOperator,\n tokenOperatorPrecedence,\n tokenIsKeywordOrIdentifier,\n tt,\n type TokenType,\n tokenIsTemplate,\n tokenCanStartExpression,\n} from \"../../tokenizer/types\";\nimport { types as tc } from \"../../tokenizer/context\";\nimport type * as N from \"../../types\";\nimport type { Position } from \"../../util/location\";\nimport { createPositionWithColumnOffset } from \"../../util/location\";\nimport type Parser from \"../../parser\";\nimport {\n type BindingTypes,\n SCOPE_TS_MODULE,\n SCOPE_OTHER,\n BIND_TS_ENUM,\n BIND_TS_CONST_ENUM,\n BIND_TS_TYPE,\n BIND_TS_INTERFACE,\n BIND_TS_AMBIENT,\n BIND_TS_NAMESPACE,\n BIND_TS_TYPE_IMPORT,\n BIND_CLASS,\n BIND_NONE,\n BIND_FLAGS_TS_IMPORT,\n} from \"../../util/scopeflags\";\nimport TypeScriptScopeHandler from \"./scope\";\nimport * as charCodes from \"charcodes\";\nimport type { ExpressionErrors } from \"../../parser/util\";\nimport type { ParseStatementFlag } from \"../../parser/statement\";\nimport { PARAM } from \"../../util/production-parameter\";\nimport { Errors, ParseErrorEnum } from \"../../parse-error\";\nimport { cloneIdentifier, type Undone } from \"../../parser/node\";\nimport type { Pattern } from \"../../types\";\nimport type { Expression } from \"../../types\";\nimport type { IJSXParserMixin } from \"../jsx\";\nimport { ParseBindingListFlags } from \"../../parser/lval\";\n\nconst getOwn = <T extends {}>(object: T, key: keyof T) =>\n Object.hasOwnProperty.call(object, key) && object[key];\n\ntype TsModifier =\n | \"readonly\"\n | \"abstract\"\n | \"declare\"\n | \"static\"\n | \"override\"\n | \"const\"\n | N.Accessibility\n | N.VarianceAnnotations;\n\nfunction nonNull<T>(x?: T | null): T {\n if (x == null) {\n throw new Error(`Unexpected ${x} value.`);\n }\n return x;\n}\n\nfunction assert(x: boolean): void {\n if (!x) {\n throw new Error(\"Assert fail\");\n }\n}\n\ntype ParsingContext =\n | \"EnumMembers\"\n | \"HeritageClauseElement\"\n | \"TupleElementTypes\"\n | \"TypeMembers\"\n | \"TypeParametersOrArguments\";\n\ntype ModifierBase = {\n accessibility?: N.Accessibility;\n} & {\n [key in TsModifier]?: boolean | undefined | null;\n};\n\n/* eslint sort-keys: \"error\" */\nconst TSErrors = ParseErrorEnum`typescript`({\n AbstractMethodHasImplementation: ({ methodName }: { methodName: string }) =>\n `Method '${methodName}' cannot have an implementation because it is marked abstract.`,\n AbstractPropertyHasInitializer: ({\n propertyName,\n }: {\n propertyName: string;\n }) =>\n `Property '${propertyName}' cannot have an initializer because it is marked abstract.`,\n AccesorCannotDeclareThisParameter:\n \"'get' and 'set' accessors cannot declare 'this' parameters.\",\n AccesorCannotHaveTypeParameters: \"An accessor cannot have type parameters.\",\n AccessorCannotBeOptional:\n \"An 'accessor' property cannot be declared optional.\",\n ClassMethodHasDeclare: \"Class methods cannot have the 'declare' modifier.\",\n ClassMethodHasReadonly: \"Class methods cannot have the 'readonly' modifier.\",\n ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference:\n \"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.\",\n ConstructorHasTypeParameters:\n \"Type parameters cannot appear on a constructor declaration.\",\n DeclareAccessor: ({ kind }: { kind: \"get\" | \"set\" }) =>\n `'declare' is not allowed in ${kind}ters.`,\n DeclareClassFieldHasInitializer:\n \"Initializers are not allowed in ambient contexts.\",\n DeclareFunctionHasImplementation:\n \"An implementation cannot be declared in ambient contexts.\",\n DuplicateAccessibilityModifier:\n // `Accessibility modifier already seen: ${modifier}` would be more helpful.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ({ modifier }: { modifier: N.Accessibility }) =>\n `Accessibility modifier already seen.`,\n DuplicateModifier: ({ modifier }: { modifier: TsModifier }) =>\n `Duplicate modifier: '${modifier}'.`,\n // `token` matches the terminology used by typescript:\n // https://github.com/microsoft/TypeScript/blob/main/src/compiler/types.ts#L2915\n EmptyHeritageClauseType: ({ token }: { token: \"extends\" | \"implements\" }) =>\n `'${token}' list cannot be empty.`,\n EmptyTypeArguments: \"Type argument list cannot be empty.\",\n EmptyTypeParameters: \"Type parameter list cannot be empty.\",\n ExpectedAmbientAfterExportDeclare:\n \"'export declare' must be followed by an ambient declaration.\",\n ImportAliasHasImportType: \"An import alias can not use 'import type'.\",\n ImportReflectionHasImportType:\n \"An `import module` declaration can not use `type` modifier\",\n IncompatibleModifiers: ({\n modifiers,\n }: {\n modifiers: [TsModifier, TsModifier];\n }) =>\n `'${modifiers[0]}' modifier cannot be used with '${modifiers[1]}' modifier.`,\n IndexSignatureHasAbstract:\n \"Index signatures cannot have the 'abstract' modifier.\",\n IndexSignatureHasAccessibility: ({\n modifier,\n }: {\n modifier: N.Accessibility;\n }) =>\n `Index signatures cannot have an accessibility modifier ('${modifier}').`,\n IndexSignatureHasDeclare:\n \"Index signatures cannot have the 'declare' modifier.\",\n IndexSignatureHasOverride:\n \"'override' modifier cannot appear on an index signature.\",\n IndexSignatureHasStatic:\n \"Index signatures cannot have the 'static' modifier.\",\n InitializerNotAllowedInAmbientContext:\n \"Initializers are not allowed in ambient contexts.\",\n InvalidModifierOnTypeMember: ({ modifier }: { modifier: TsModifier }) =>\n `'${modifier}' modifier cannot appear on a type member.`,\n InvalidModifierOnTypeParameter: ({ modifier }: { modifier: TsModifier }) =>\n `'${modifier}' modifier cannot appear on a type parameter.`,\n InvalidModifierOnTypeParameterPositions: ({\n modifier,\n }: {\n modifier: TsModifier;\n }) =>\n `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`,\n InvalidModifiersOrder: ({\n orderedModifiers,\n }: {\n orderedModifiers: [TsModifier, TsModifier];\n }) =>\n `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`,\n InvalidPropertyAccessAfterInstantiationExpression:\n \"Invalid property access after an instantiation expression. \" +\n \"You can either wrap the instantiation expression in parentheses, or delete the type arguments.\",\n InvalidTupleMemberLabel:\n \"Tuple members must be labeled with a simple identifier.\",\n MissingInterfaceName:\n \"'interface' declarations must be followed by an identifier.\",\n MixedLabeledAndUnlabeledElements:\n \"Tuple members must all have names or all not have names.\",\n NonAbstractClassHasAbstractMethod:\n \"Abstract methods can only appear within an abstract class.\",\n NonClassMethodPropertyHasAbstractModifer:\n \"'abstract' modifier can only appear on a class, method, or property declaration.\",\n OptionalTypeBeforeRequired:\n \"A required element cannot follow an optional element.\",\n OverrideNotInSubClass:\n \"This member cannot have an 'override' modifier because its containing class does not extend another class.\",\n PatternIsOptional:\n \"A binding pattern parameter cannot be optional in an implementation signature.\",\n PrivateElementHasAbstract:\n \"Private elements cannot have the 'abstract' modifier.\",\n PrivateElementHasAccessibility: ({\n modifier,\n }: {\n modifier: N.Accessibility;\n }) =>\n `Private elements cannot have an accessibility modifier ('${modifier}').`,\n ReadonlyForMethodSignature:\n \"'readonly' modifier can only appear on a property declaration or index signature.\",\n ReservedArrowTypeParam:\n \"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.\",\n ReservedTypeAssertion:\n \"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.\",\n // TODO: Accesor -> Accessor\n SetAccesorCannotHaveOptionalParameter:\n \"A 'set' accessor cannot have an optional parameter.\",\n SetAccesorCannotHaveRestParameter:\n \"A 'set' accessor cannot have rest parameter.\",\n SetAccesorCannotHaveReturnType:\n \"A 'set' accessor cannot have a return type annotation.\",\n SingleTypeParameterWithoutTrailingComma: ({\n typeParameterName,\n }: {\n typeParameterName: string;\n }) =>\n `Single type parameter ${typeParameterName} should have a trailing comma. Example usage: <${typeParameterName},>.`,\n StaticBlockCannotHaveModifier:\n \"Static class blocks cannot have any modifier.\",\n TupleOptionalAfterType:\n \"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).\",\n TypeAnnotationAfterAssign:\n \"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.\",\n TypeImportCannotSpecifyDefaultAndNamed:\n \"A type-only import can specify a default import or named bindings, but not both.\",\n TypeModifierIsUsedInTypeExports:\n \"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.\",\n TypeModifierIsUsedInTypeImports:\n \"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.\",\n UnexpectedParameterModifier:\n \"A parameter property is only allowed in a constructor implementation.\",\n UnexpectedReadonly:\n \"'readonly' type modifier is only permitted on array and tuple literal types.\",\n UnexpectedTypeAnnotation: \"Did not expect a type annotation here.\",\n UnexpectedTypeCastInParameter: \"Unexpected type cast in parameter position.\",\n UnsupportedImportTypeArgument:\n \"Argument in a type import must be a string literal.\",\n UnsupportedParameterPropertyKind:\n \"A parameter property may not be declared using a binding pattern.\",\n UnsupportedSignatureParameterKind: ({ type }: { type: string }) =>\n `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.`,\n});\n\n/* eslint-disable sort-keys */\n\n// Doesn't handle \"void\" or \"null\" because those are keywords, not identifiers.\n// It also doesn't handle \"intrinsic\", since usually it's not a keyword.\nfunction keywordTypeFromName(value: string): N.TsKeywordTypeType | undefined {\n switch (value) {\n case \"any\":\n return \"TSAnyKeyword\";\n case \"boolean\":\n return \"TSBooleanKeyword\";\n case \"bigint\":\n return \"TSBigIntKeyword\";\n case \"never\":\n return \"TSNeverKeyword\";\n case \"number\":\n return \"TSNumberKeyword\";\n case \"object\":\n return \"TSObjectKeyword\";\n case \"string\":\n return \"TSStringKeyword\";\n case \"symbol\":\n return \"TSSymbolKeyword\";\n case \"undefined\":\n return \"TSUndefinedKeyword\";\n case \"unknown\":\n return \"TSUnknownKeyword\";\n default:\n return undefined;\n }\n}\n\nfunction tsIsAccessModifier(modifier: string): modifier is N.Accessibility {\n return (\n modifier === \"private\" || modifier === \"public\" || modifier === \"protected\"\n );\n}\n\nfunction tsIsVarianceAnnotations(\n modifier: string,\n): modifier is N.VarianceAnnotations {\n return modifier === \"in\" || modifier === \"out\";\n}\n\ntype ClassWithMixin<\n T extends new (...args: any) => any,\n M extends object,\n> = T extends new (...args: infer P) => infer I\n ? new (...args: P) => I & M\n : never;\n\nexport default (superClass: ClassWithMixin<typeof Parser, IJSXParserMixin>) =>\n class TypeScriptParserMixin extends superClass implements Parser {\n getScopeHandler(): {\n new (...args: any): TypeScriptScopeHandler;\n } {\n return TypeScriptScopeHandler;\n }\n\n tsIsIdentifier(): boolean {\n // TODO: actually a bit more complex in TypeScript, but shouldn't matter.\n // See https://github.com/Microsoft/TypeScript/issues/15008\n return tokenIsIdentifier(this.state.type);\n }\n\n tsTokenCanFollowModifier() {\n return (\n (this.match(tt.bracketL) ||\n this.match(tt.braceL) ||\n this.match(tt.star) ||\n this.match(tt.ellipsis) ||\n this.match(tt.privateName) ||\n this.isLiteralPropertyName()) &&\n !this.hasPrecedingLineBreak()\n );\n }\n\n 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 @babel/parser itself. And \"static\".\n // TODO: Would be nice to avoid lookahead. Want a hasLineBreakUpNext() method...\n this.next();\n return this.tsTokenCanFollowModifier();\n }\n\n /** Parses a modifier matching one the given modifier names. */\n tsParseModifier<T extends TsModifier>(\n allowedModifiers: T[],\n stopOnStartOfClassStaticBlock?: boolean,\n ): T | undefined | null {\n if (\n !tokenIsIdentifier(this.state.type) &&\n this.state.type !== tt._in &&\n this.state.type !== tt._const\n ) {\n return undefined;\n }\n\n const modifier = this.state.value;\n if (allowedModifiers.indexOf(modifier) !== -1) {\n if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) {\n return undefined;\n }\n if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) {\n return modifier;\n }\n }\n return undefined;\n }\n\n /** Parses a list of modifiers, in any order.\n * If you need a specific order, you must call this function multiple times:\n * this.tsParseModifiers({ modified: node, allowedModifiers: [\"public\"] });\n * this.tsParseModifiers({ modified: node, allowedModifiers: [\"abstract\", \"readonly\"] });\n */\n tsParseModifiers<N extends ModifierBase>(\n {\n allowedModifiers,\n disallowedModifiers,\n stopOnStartOfClassStaticBlock,\n errorTemplate = TSErrors.InvalidModifierOnTypeMember,\n }: {\n allowedModifiers: readonly TsModifier[];\n disallowedModifiers?: TsModifier[];\n stopOnStartOfClassStaticBlock?: boolean;\n errorTemplate?: typeof TSErrors.InvalidModifierOnTypeMember;\n },\n modified: N,\n ): void {\n const enforceOrder = (\n loc: Position,\n modifier: TsModifier,\n before: TsModifier,\n after: TsModifier,\n ) => {\n if (modifier === before && modified[after]) {\n this.raise(TSErrors.InvalidModifiersOrder, {\n at: loc,\n orderedModifiers: [before, after],\n });\n }\n };\n const incompatible = (\n loc: Position,\n modifier: TsModifier,\n mod1: TsModifier,\n mod2: TsModifier,\n ) => {\n if (\n (modified[mod1] && modifier === mod2) ||\n (modified[mod2] && modifier === mod1)\n ) {\n this.raise(TSErrors.IncompatibleModifiers, {\n at: loc,\n modifiers: [mod1, mod2],\n });\n }\n };\n\n for (;;) {\n const { startLoc } = this.state;\n const modifier: TsModifier | undefined | null = this.tsParseModifier(\n allowedModifiers.concat(disallowedModifiers ?? []),\n stopOnStartOfClassStaticBlock,\n );\n\n if (!modifier) break;\n\n if (tsIsAccessModifier(modifier)) {\n if (modified.accessibility) {\n this.raise(TSErrors.DuplicateAccessibilityModifier, {\n at: startLoc,\n modifier,\n });\n } else {\n enforceOrder(startLoc, modifier, modifier, \"override\");\n enforceOrder(startLoc, modifier, modifier, \"static\");\n enforceOrder(startLoc, modifier, modifier, \"readonly\");\n\n modified.accessibility = modifier;\n }\n } else if (tsIsVarianceAnnotations(modifier)) {\n if (modified[modifier]) {\n this.raise(TSErrors.DuplicateModifier, { at: startLoc, modifier });\n }\n modified[modifier] = true;\n\n enforceOrder(startLoc, modifier, \"in\", \"out\");\n } else {\n if (Object.hasOwnProperty.call(modified, modifier)) {\n this.raise(TSErrors.DuplicateModifier, { at: startLoc, modifier });\n } else {\n enforceOrder(startLoc, modifier, \"static\", \"readonly\");\n enforceOrder(startLoc, modifier, \"static\", \"override\");\n enforceOrder(startLoc, modifier, \"override\", \"readonly\");\n enforceOrder(startLoc, modifier, \"abstract\", \"override\");\n\n incompatible(startLoc, modifier, \"declare\", \"override\");\n incompatible(startLoc, modifier, \"static\", \"abstract\");\n }\n modified[modifier] = true;\n }\n\n if (disallowedModifiers?.includes(modifier)) {\n this.raise(errorTemplate, {\n at: startLoc,\n modifier,\n });\n }\n }\n }\n\n tsIsListTerminator(kind: ParsingContext): boolean {\n switch (kind) {\n case \"EnumMembers\":\n case \"TypeMembers\":\n return this.match(tt.braceR);\n case \"HeritageClauseElement\":\n return this.match(tt.braceL);\n case \"TupleElementTypes\":\n return this.match(tt.bracketR);\n case \"TypeParametersOrArguments\":\n return this.match(tt.gt);\n }\n }\n\n tsParseList<T extends N.Node>(\n kind: ParsingContext,\n parseElement: () => T,\n ): T[] {\n const result: T[] = [];\n while (!this.tsIsListTerminator(kind)) {\n // Skipping \"parseListElement\" from the TS source since that's just for error handling.\n result.push(parseElement());\n }\n return result;\n }\n\n tsParseDelimitedList<T extends N.Node>(\n kind: ParsingContext,\n parseElement: () => T,\n refTrailingCommaPos?: {\n value: number;\n },\n ): T[] {\n return nonNull(\n this.tsParseDelimitedListWorker(\n kind,\n parseElement,\n /* expectSuccess */ true,\n refTrailingCommaPos,\n ),\n );\n }\n\n /**\n * If !expectSuccess, returns undefined instead of failing to parse.\n * If expectSuccess, parseElement should always return a defined value.\n */\n tsParseDelimitedListWorker<T extends N.Node>(\n kind: ParsingContext,\n parseElement: () => T | undefined | null,\n expectSuccess: boolean,\n refTrailingCommaPos?: {\n value: number;\n },\n ): T[] | undefined | null {\n const result = [];\n let trailingCommaPos = -1;\n\n for (;;) {\n if (this.tsIsListTerminator(kind)) {\n break;\n }\n trailingCommaPos = -1;\n\n const element = parseElement();\n if (element == null) {\n return undefined;\n }\n result.push(element);\n\n if (this.eat(tt.comma)) {\n trailingCommaPos = this.state.lastTokStart;\n continue;\n }\n\n if (this.tsIsListTerminator(kind)) {\n break;\n }\n\n if (expectSuccess) {\n // This will fail with an error about a missing comma\n this.expect(tt.comma);\n }\n return undefined;\n }\n\n if (refTrailingCommaPos) {\n refTrailingCommaPos.value = trailingCommaPos;\n }\n\n return result;\n }\n\n tsParseBracketedList<T extends N.Node>(\n kind: ParsingContext,\n parseElement: () => T,\n bracket: boolean,\n skipFirstToken: boolean,\n refTrailingCommaPos?: {\n value: number;\n },\n ): T[] {\n if (!skipFirstToken) {\n if (bracket) {\n this.expect(tt.bracketL);\n } else {\n this.expect(tt.lt);\n }\n }\n\n const result = this.tsParseDelimitedList(\n kind,\n parseElement,\n refTrailingCommaPos,\n );\n\n if (bracket) {\n this.expect(tt.bracketR);\n } else {\n this.expect(tt.gt);\n }\n\n return result;\n }\n\n tsParseImportType(): N.TsImportType {\n const node = this.startNode<N.TsImportType>();\n this.expect(tt._import);\n this.expect(tt.parenL);\n if (!this.match(tt.string)) {\n this.raise(TSErrors.UnsupportedImportTypeArgument, {\n at: this.state.startLoc,\n });\n }\n\n // For compatibility to estree we cannot call parseLiteral directly here\n node.argument = super.parseExprAtom() as N.StringLiteral;\n this.expect(tt.parenR);\n\n if (this.eat(tt.dot)) {\n // In this instance, the entity name will actually itself be a\n // qualifier, so allow it to be a reserved word as well.\n node.qualifier = this.tsParseEntityName();\n }\n if (this.match(tt.lt)) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n return this.finishNode(node, \"TSImportType\");\n }\n\n tsParseEntityName(allowReservedWords: boolean = true): N.TsEntityName {\n let entity: N.TsEntityName = this.parseIdentifier(allowReservedWords);\n while (this.eat(tt.dot)) {\n const node: Undone<N.TsQualifiedName> =\n this.startNodeAtNode<N.TsQualifiedName>(entity);\n node.left = entity;\n node.right = this.parseIdentifier(allowReservedWords);\n entity = this.finishNode(node, \"TSQualifiedName\");\n }\n return entity;\n }\n\n tsParseTypeReference(): N.TsTypeReference {\n const node = this.startNode<N.TsTypeReference>();\n node.typeName = this.tsParseEntityName();\n if (!this.hasPrecedingLineBreak() && this.match(tt.lt)) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n return this.finishNode(node, \"TSTypeReference\");\n }\n\n tsParseThisTypePredicate(lhs: N.TsThisType): N.TsTypePredicate {\n this.next();\n const node = this.startNodeAtNode<N.TsTypePredicate>(lhs);\n node.parameterName = lhs;\n node.typeAnnotation = this.tsParseTypeAnnotation(/* eatColon */ false);\n node.asserts = false;\n return this.finishNode(node, \"TSTypePredicate\");\n }\n\n tsParseThisTypeNode(): N.TsThisType {\n const node = this.startNode<N.TsThisType>();\n this.next();\n return this.finishNode(node, \"TSThisType\");\n }\n\n tsParseTypeQuery(): N.TsTypeQuery {\n const node = this.startNode<N.TsTypeQuery>();\n this.expect(tt._typeof);\n if (this.match(tt._import)) {\n node.exprName = this.tsParseImportType();\n } else {\n node.exprName = this.tsParseEntityName();\n }\n if (!this.hasPrecedingLineBreak() && this.match(tt.lt)) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n return this.finishNode(node, \"TSTypeQuery\");\n }\n\n tsParseInOutModifiers = this.tsParseModifiers.bind(this, {\n allowedModifiers: [\"in\", \"out\"],\n disallowedModifiers: [\n \"const\",\n \"public\",\n \"private\",\n \"protected\",\n \"readonly\",\n \"declare\",\n \"abstract\",\n \"override\",\n ],\n errorTemplate: TSErrors.InvalidModifierOnTypeParameter,\n });\n\n tsParseConstModifier = this.tsParseModifiers.bind(this, {\n allowedModifiers: [\"const\"],\n // for better error recovery\n disallowedModifiers: [\"in\", \"out\"],\n errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions,\n });\n\n tsParseInOutConstModifiers = this.tsParseModifiers.bind(this, {\n allowedModifiers: [\"in\", \"out\", \"const\"],\n disallowedModifiers: [\n \"public\",\n \"private\",\n \"protected\",\n \"readonly\",\n \"declare\",\n \"abstract\",\n \"override\",\n ],\n errorTemplate: TSErrors.InvalidModifierOnTypeParameter,\n });\n\n tsParseTypeParameter(\n parseModifiers: (node: Undone<N.TsTypeParameter>) => void,\n ): N.TsTypeParameter {\n const node = this.startNode<N.TsTypeParameter>();\n\n parseModifiers(node);\n\n node.name = this.tsParseTypeParameterName();\n node.constraint = this.tsEatThenParseType(tt._extends);\n node.default = this.tsEatThenParseType(tt.eq);\n return this.finishNode(node, \"TSTypeParameter\");\n }\n\n tsTryParseTypeParameters(\n parseModifiers: (node: N.TsTypeParameter) => void,\n ): N.TsTypeParameterDeclaration | undefined | null {\n if (this.match(tt.lt)) {\n return this.tsParseTypeParameters(parseModifiers);\n }\n }\n\n tsParseTypeParameters(parseModifiers: (node: N.TsTypeParameter) => void) {\n const node = this.startNode<N.TsTypeParameterDeclaration>();\n\n if (this.match(tt.lt) || this.match(tt.jsxTagStart)) {\n this.next();\n } else {\n this.unexpected();\n }\n\n const refTrailingCommaPos = { value: -1 };\n\n node.params = this.tsParseBracketedList(\n \"TypeParametersOrArguments\",\n // @ts-expect-error refine typings\n this.tsParseTypeParameter.bind(this, parseModifiers),\n /* bracket */ false,\n /* skipFirstToken */ true,\n refTrailingCommaPos,\n );\n if (node.params.length === 0) {\n this.raise(TSErrors.EmptyTypeParameters, { at: node });\n }\n if (refTrailingCommaPos.value !== -1) {\n this.addExtra(node, \"trailingComma\", refTrailingCommaPos.value);\n }\n return this.finishNode(node, \"TSTypeParameterDeclaration\");\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.\n tsFillSignature(\n returnToken: TokenType,\n signature: Undone<N.TsSignatureDeclaration>,\n ): void {\n // Arrow fns *must* have return token (`=>`). Normal functions can omit it.\n const returnTokenRequired = returnToken === tt.arrow;\n\n // https://github.com/babel/babel/issues/9231\n const paramsKey = process.env.BABEL_8_BREAKING ? \"params\" : \"parameters\";\n const returnTypeKey = process.env.BABEL_8_BREAKING\n ? \"returnType\"\n : \"typeAnnotation\";\n\n signature.typeParameters = this.tsTryParseTypeParameters(\n this.tsParseConstModifier,\n );\n this.expect(tt.parenL);\n signature[paramsKey] = this.tsParseBindingListForSignature();\n if (returnTokenRequired) {\n signature[returnTypeKey] =\n this.tsParseTypeOrTypePredicateAnnotation(returnToken);\n } else if (this.match(returnToken)) {\n signature[returnTypeKey] =\n this.tsParseTypeOrTypePredicateAnnotation(returnToken);\n }\n }\n\n tsParseBindingListForSignature(): Array<\n N.Identifier | N.RestElement | N.ObjectPattern | N.ArrayPattern\n > {\n const list = super.parseBindingList(\n tt.parenR,\n charCodes.rightParenthesis,\n ParseBindingListFlags.IS_FUNCTION_PARAMS,\n );\n for (const pattern of list) {\n const { type } = pattern;\n if (type === \"AssignmentPattern\" || type === \"TSParameterProperty\") {\n this.raise(TSErrors.UnsupportedSignatureParameterKind, {\n at: pattern,\n type,\n });\n }\n }\n return list as Exclude<\n (typeof list)[0],\n N.AssignmentPattern | N.TSParameterProperty\n >[];\n }\n\n tsParseTypeMemberSemicolon(): void {\n if (!this.eat(tt.comma) && !this.isLineTerminator()) {\n this.expect(tt.semi);\n }\n }\n\n tsParseSignatureMember(\n kind: \"TSCallSignatureDeclaration\" | \"TSConstructSignatureDeclaration\",\n node: Undone<\n N.TsCallSignatureDeclaration | N.TsConstructSignatureDeclaration\n >,\n ): N.TsCallSignatureDeclaration | N.TsConstructSignatureDeclaration {\n this.tsFillSignature(tt.colon, node);\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(node, kind);\n }\n\n tsIsUnambiguouslyIndexSignature() {\n this.next(); // Skip '{'\n if (tokenIsIdentifier(this.state.type)) {\n this.next();\n return this.match(tt.colon);\n }\n return false;\n }\n\n tsTryParseIndexSignature(\n node: Undone<N.TsIndexSignature>,\n ): N.TsIndexSignature | undefined {\n if (\n !(\n this.match(tt.bracketL) &&\n this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))\n )\n ) {\n return;\n }\n\n this.expect(tt.bracketL);\n const id = this.parseIdentifier();\n id.typeAnnotation = this.tsParseTypeAnnotation();\n this.resetEndLocation(id); // set end position to end of type\n\n this.expect(tt.bracketR);\n node.parameters = [id];\n\n const type = this.tsTryParseTypeAnnotation();\n if (type) node.typeAnnotation = type;\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(node, \"TSIndexSignature\");\n }\n\n tsParsePropertyOrMethodSignature(\n node: N.TsPropertySignature | N.TsMethodSignature,\n readonly: boolean,\n ): N.TsPropertySignature | N.TsMethodSignature {\n if (this.eat(tt.question)) node.optional = true;\n const nodeAny: any = node;\n\n if (this.match(tt.parenL) || this.match(tt.lt)) {\n if (readonly) {\n this.raise(TSErrors.ReadonlyForMethodSignature, { at: node });\n }\n const method: N.TsMethodSignature = nodeAny;\n if (method.kind && this.match(tt.lt)) {\n this.raise(TSErrors.AccesorCannotHaveTypeParameters, {\n at: this.state.curPosition(),\n });\n }\n this.tsFillSignature(tt.colon, method);\n this.tsParseTypeMemberSemicolon();\n const paramsKey = process.env.BABEL_8_BREAKING\n ? \"params\"\n : \"parameters\";\n const returnTypeKey = process.env.BABEL_8_BREAKING\n ? \"returnType\"\n : \"typeAnnotation\";\n if (method.kind === \"get\") {\n if (method[paramsKey].length > 0) {\n this.raise(Errors.BadGetterArity, { at: this.state.curPosition() });\n if (this.isThisParam(method[paramsKey][0])) {\n this.raise(TSErrors.AccesorCannotDeclareThisParameter, {\n at: this.state.curPosition(),\n });\n }\n }\n } else if (method.kind === \"set\") {\n if (method[paramsKey].length !== 1) {\n this.raise(Errors.BadSetterArity, { at: this.state.curPosition() });\n } else {\n const firstParameter = method[paramsKey][0];\n if (this.isThisParam(firstParameter)) {\n this.raise(TSErrors.AccesorCannotDeclareThisParameter, {\n at: this.state.curPosition(),\n });\n }\n if (\n firstParameter.type === \"Identifier\" &&\n firstParameter.optional\n ) {\n this.raise(TSErrors.SetAccesorCannotHaveOptionalParameter, {\n at: this.state.curPosition(),\n });\n }\n if (firstParameter.type === \"RestElement\") {\n this.raise(TSErrors.SetAccesorCannotHaveRestParameter, {\n at: this.state.curPosition(),\n });\n }\n }\n if (method[returnTypeKey]) {\n this.raise(TSErrors.SetAccesorCannotHaveReturnType, {\n at: method[returnTypeKey],\n });\n }\n } else {\n method.kind = \"method\";\n }\n return this.finishNode(method, \"TSMethodSignature\");\n } else {\n const property: N.TsPropertySignature = nodeAny;\n if (readonly) property.readonly = true;\n const type = this.tsTryParseTypeAnnotation();\n if (type) property.typeAnnotation = type;\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(property, \"TSPropertySignature\");\n }\n }\n\n tsParseTypeMember(): N.TsTypeElement {\n const node: any = this.startNode();\n\n if (this.match(tt.parenL) || this.match(tt.lt)) {\n return this.tsParseSignatureMember(\"TSCallSignatureDeclaration\", node);\n }\n\n if (this.match(tt._new)) {\n const id = this.startNode<N.Identifier>();\n this.next();\n if (this.match(tt.parenL) || this.match(tt.lt)) {\n return this.tsParseSignatureMember(\n \"TSConstructSignatureDeclaration\",\n node,\n );\n } else {\n node.key = this.createIdentifier(id, \"new\");\n return this.tsParsePropertyOrMethodSignature(node, false);\n }\n }\n\n this.tsParseModifiers(\n {\n allowedModifiers: [\"readonly\"],\n disallowedModifiers: [\n \"declare\",\n \"abstract\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"override\",\n ],\n },\n node,\n );\n\n const idx = this.tsTryParseIndexSignature(node);\n if (idx) {\n return idx;\n }\n\n super.parsePropertyName(node);\n if (\n !node.computed &&\n node.key.type === \"Identifier\" &&\n (node.key.name === \"get\" || node.key.name === \"set\") &&\n this.tsTokenCanFollowModifier()\n ) {\n node.kind = node.key.name;\n super.parsePropertyName(node);\n }\n return this.tsParsePropertyOrMethodSignature(node, !!node.readonly);\n }\n\n tsParseTypeLiteral(): N.TsTypeLiteral {\n const node = this.startNode<N.TsTypeLiteral>();\n node.members = this.tsParseObjectTypeMembers();\n return this.finishNode(node, \"TSTypeLiteral\");\n }\n\n tsParseObjectTypeMembers(): Array<N.TsTypeElement> {\n this.expect(tt.braceL);\n const members = this.tsParseList(\n \"TypeMembers\",\n this.tsParseTypeMember.bind(this),\n );\n this.expect(tt.braceR);\n return members;\n }\n\n tsIsStartOfMappedType(): boolean {\n this.next();\n if (this.eat(tt.plusMin)) {\n return this.isContextual(tt._readonly);\n }\n if (this.isContextual(tt._readonly)) {\n this.next();\n }\n if (!this.match(tt.bracketL)) {\n return false;\n }\n this.next();\n if (!this.tsIsIdentifier()) {\n return false;\n }\n this.next();\n return this.match(tt._in);\n }\n\n tsParseMappedTypeParameter(): N.TsTypeParameter {\n const node = this.startNode<N.TsTypeParameter>();\n node.name = this.tsParseTypeParameterName();\n node.constraint = this.tsExpectThenParseType(tt._in);\n return this.finishNode(node, \"TSTypeParameter\");\n }\n\n tsParseMappedType(): N.TsMappedType {\n const node = this.startNode<N.TsMappedType>();\n\n this.expect(tt.braceL);\n\n if (this.match(tt.plusMin)) {\n node.readonly = this.state.value;\n this.next();\n this.expectContextual(tt._readonly);\n } else if (this.eatContextual(tt._readonly)) {\n node.readonly = true;\n }\n\n this.expect(tt.bracketL);\n node.typeParameter = this.tsParseMappedTypeParameter();\n node.nameType = this.eatContextual(tt._as) ? this.tsParseType() : null;\n\n this.expect(tt.bracketR);\n\n if (this.match(tt.plusMin)) {\n node.optional = this.state.value;\n this.next();\n this.expect(tt.question);\n } else if (this.eat(tt.question)) {\n node.optional = true;\n }\n\n node.typeAnnotation = this.tsTryParseType();\n this.semicolon();\n this.expect(tt.braceR);\n\n return this.finishNode(node, \"TSMappedType\");\n }\n\n tsParseTupleType(): N.TsTupleType {\n const node = this.startNode<N.TsTupleType>();\n node.elementTypes = this.tsParseBracketedList(\n \"TupleElementTypes\",\n this.tsParseTupleElementType.bind(this),\n /* bracket */ true,\n /* skipFirstToken */ false,\n );\n\n // Validate the elementTypes to ensure that no mandatory elements\n // follow optional elements\n let seenOptionalElement = false;\n let labeledElements: boolean | null = null;\n node.elementTypes.forEach(elementNode => {\n const { type } = elementNode;\n\n if (\n seenOptionalElement &&\n type !== \"TSRestType\" &&\n type !== \"TSOptionalType\" &&\n !(type === \"TSNamedTupleMember\" && elementNode.optional)\n ) {\n this.raise(TSErrors.OptionalTypeBeforeRequired, {\n at: elementNode,\n });\n }\n\n seenOptionalElement ||=\n (type === \"TSNamedTupleMember\" && elementNode.optional) ||\n type === \"TSOptionalType\";\n\n // When checking labels, check the argument of the spread operator\n let checkType = type;\n if (type === \"TSRestType\") {\n elementNode = elementNode.typeAnnotation;\n checkType = elementNode.type;\n }\n\n const isLabeled = checkType === \"TSNamedTupleMember\";\n labeledElements ??= isLabeled;\n if (labeledElements !== isLabeled) {\n this.raise(TSErrors.MixedLabeledAndUnlabeledElements, {\n at: elementNode,\n });\n }\n });\n\n return this.finishNode(node, \"TSTupleType\");\n }\n\n tsParseTupleElementType(): N.TsNamedTupleMember | N.TsType {\n // parses `...TsType[]`\n\n const { startLoc } = this.state;\n\n const rest = this.eat(tt.ellipsis);\n\n let labeled: boolean;\n let label: N.Identifier;\n let optional: boolean;\n let type: N.TsNamedTupleMember | N.TsType;\n\n const isWord = tokenIsKeywordOrIdentifier(this.state.type);\n const chAfterWord = isWord ? this.lookaheadCharCode() : null;\n if (chAfterWord === charCodes.colon) {\n labeled = true;\n optional = false;\n label = this.parseIdentifier(true);\n this.expect(tt.colon);\n type = this.tsParseType();\n } else if (chAfterWord === charCodes.questionMark) {\n optional = true;\n const startLoc = this.state.startLoc;\n const wordName = this.state.value;\n const typeOrLabel = this.tsParseNonArrayType();\n\n if (this.lookaheadCharCode() === charCodes.colon) {\n labeled = true;\n label = this.createIdentifier(\n this.startNodeAt<N.Identifier>(startLoc),\n wordName,\n );\n this.expect(tt.question);\n this.expect(tt.colon);\n type = this.tsParseType();\n } else {\n labeled = false;\n type = typeOrLabel;\n this.expect(tt.question);\n }\n } else {\n type = this.tsParseType();\n optional = this.eat(tt.question);\n // In this case (labeled === true) could be only in invalid label.\n // E.g. [x.y:type]\n // An error is raised while processing node.\n labeled = this.eat(tt.colon);\n }\n\n if (labeled) {\n let labeledNode: Undone<N.TsNamedTupleMember>;\n if (label) {\n labeledNode = this.startNodeAtNode<N.TsNamedTupleMember>(label);\n labeledNode.optional = optional;\n labeledNode.label = label;\n labeledNode.elementType = type;\n\n if (this.eat(tt.question)) {\n labeledNode.optional = true;\n this.raise(TSErrors.TupleOptionalAfterType, {\n at: this.state.lastTokStartLoc,\n });\n }\n } else {\n labeledNode = this.startNodeAtNode<N.TsNamedTupleMember>(type);\n labeledNode.optional = optional;\n this.raise(TSErrors.InvalidTupleMemberLabel, { at: type });\n // @ts-expect-error This produces an invalid AST, but at least we don't drop\n // nodes representing the invalid source.\n labeledNode.label = type;\n labeledNode.elementType = this.tsParseType();\n }\n type = this.finishNode(labeledNode, \"TSNamedTupleMember\");\n } else if (optional) {\n const optionalTypeNode = this.startNodeAtNode<N.TsOptionalType>(type);\n optionalTypeNode.typeAnnotation = type;\n type = this.finishNode(optionalTypeNode, \"TSOptionalType\");\n }\n\n if (rest) {\n const restNode = this.startNodeAt<N.TsRestType>(startLoc);\n restNode.typeAnnotation = type;\n type = this.finishNode(restNode, \"TSRestType\");\n }\n\n return type;\n }\n\n tsParseParenthesizedType(): N.TsParenthesizedType {\n const node = this.startNode<N.TsParenthesizedType>();\n this.expect(tt.parenL);\n node.typeAnnotation = this.tsParseType();\n this.expect(tt.parenR);\n return this.finishNode(node, \"TSParenthesizedType\");\n }\n\n tsParseFunctionOrConstructorType(\n type: \"TSFunctionType\" | \"TSConstructorType\",\n abstract?: boolean,\n ): N.TsFunctionOrConstructorType {\n const node = this.startNode<\n N.TsFunctionOrConstructorType | N.TsConstructorType\n >();\n if (type === \"TSConstructorType\") {\n (node as Undone<N.TsConstructorType>).abstract = !!abstract;\n if (abstract) this.next();\n this.next(); // eat `new`\n }\n this.tsInAllowConditionalTypesContext(() =>\n this.tsFillSignature(tt.arrow, node),\n );\n return this.finishNode(node, type);\n }\n\n tsParseLiteralTypeNode(): N.TsLiteralType {\n const node = this.startNode<N.TsLiteralType>();\n switch (this.state.type) {\n case tt.num:\n case tt.bigint:\n case tt.string:\n case tt._true:\n case tt._false:\n // For compatibility to estree we cannot call parseLiteral directly here\n // @ts-expect-error refine typings\n node.literal = super.parseExprAtom();\n break;\n default:\n this.unexpected();\n }\n return this.finishNode(node, \"TSLiteralType\");\n }\n\n tsParseTemplateLiteralType(): N.TsType {\n const node = this.startNode<N.TsLiteralType>();\n node.literal = super.parseTemplate(false);\n return this.finishNode(node, \"TSLiteralType\");\n }\n\n parseTemplateSubstitution(): N.TsType | N.Node {\n if (this.state.inType) return this.tsParseType();\n return super.parseTemplateSubstitution();\n }\n\n tsParseThisTypeOrThisTypePredicate(): N.TsThisType | N.TsTypePredicate {\n const thisKeyword = this.tsParseThisTypeNode();\n if (this.isContextual(tt._is) && !this.hasPrecedingLineBreak()) {\n return this.tsParseThisTypePredicate(thisKeyword);\n } else {\n return thisKeyword;\n }\n }\n\n tsParseNonArrayType(): N.TsType {\n switch (this.state.type) {\n case tt.string:\n case tt.num:\n case tt.bigint:\n case tt._true:\n case tt._false:\n return this.tsParseLiteralTypeNode();\n case tt.plusMin:\n if (this.state.value === \"-\") {\n const node = this.startNode<N.TsLiteralType>();\n const nextToken = this.lookahead();\n if (nextToken.type !== tt.num && nextToken.type !== tt.bigint) {\n this.unexpected();\n }\n // @ts-expect-error: parseMaybeUnary must returns unary expression\n node.literal = this.parseMaybeUnary();\n return this.finishNode(node, \"TSLiteralType\");\n }\n break;\n case tt._this:\n return this.tsParseThisTypeOrThisTypePredicate();\n case tt._typeof:\n return this.tsParseTypeQuery();\n case tt._import:\n return this.tsParseImportType();\n case tt.braceL:\n return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))\n ? this.tsParseMappedType()\n : this.tsParseTypeLiteral();\n case tt.bracketL:\n return this.tsParseTupleType();\n case tt.parenL:\n if (process.env.BABEL_8_BREAKING) {\n if (!this.options.createParenthesizedExpressions) {\n const startLoc = this.state.startLoc;\n this.next();\n const type = this.tsParseType();\n this.expect(tt.parenR);\n this.addExtra(type, \"parenthesized\", true);\n this.addExtra(type, \"parenStart\", startLoc.index);\n return type;\n }\n }\n\n return this.tsParseParenthesizedType();\n case tt.templateNonTail:\n case tt.templateTail:\n return this.tsParseTemplateLiteralType();\n default: {\n const { type } = this.state;\n if (\n tokenIsIdentifier(type) ||\n type === tt._void ||\n type === tt._null\n ) {\n const nodeType =\n type === tt._void\n ? \"TSVoidKeyword\"\n : type === tt._null\n ? \"TSNullKeyword\"\n : keywordTypeFromName(this.state.value);\n if (\n nodeType !== undefined &&\n this.lookaheadCharCode() !== charCodes.dot\n ) {\n const node = this.startNode<N.TsKeywordType>();\n this.next();\n return this.finishNode(node, nodeType);\n }\n return this.tsParseTypeReference();\n }\n }\n }\n\n this.unexpected();\n }\n\n tsParseArrayTypeOrHigher(): N.TsType {\n let type = this.tsParseNonArrayType();\n while (!this.hasPrecedingLineBreak() && this.eat(tt.bracketL)) {\n if (this.match(tt.bracketR)) {\n const node = this.startNodeAtNode<N.TsArrayType>(type);\n node.elementType = type;\n this.expect(tt.bracketR);\n type = this.finishNode(node, \"TSArrayType\");\n } else {\n const node = this.startNodeAtNode<N.TsIndexedAccessType>(type);\n node.objectType = type;\n node.indexType = this.tsParseType();\n this.expect(tt.bracketR);\n type = this.finishNode(node, \"TSIndexedAccessType\");\n }\n }\n return type;\n }\n\n tsParseTypeOperator(): N.TsTypeOperator {\n const node = this.startNode<N.TsTypeOperator>();\n const operator = this.state.value;\n this.next(); // eat operator\n node.operator = operator;\n node.typeAnnotation = this.tsParseTypeOperatorOrHigher();\n\n if (operator === \"readonly\") {\n this.tsCheckTypeAnnotationForReadOnly(\n // @ts-expect-error todo(flow->ts)\n node,\n );\n }\n\n return this.finishNode(node, \"TSTypeOperator\");\n }\n\n tsCheckTypeAnnotationForReadOnly(node: N.Node) {\n switch (node.typeAnnotation.type) {\n case \"TSTupleType\":\n case \"TSArrayType\":\n return;\n default:\n this.raise(TSErrors.UnexpectedReadonly, { at: node });\n }\n }\n\n tsParseInferType(): N.TsInferType {\n const node = this.startNode<N.TsInferType>();\n this.expectContextual(tt._infer);\n const typeParameter = this.startNode<N.TsTypeParameter>();\n typeParameter.name = this.tsParseTypeParameterName();\n typeParameter.constraint = this.tsTryParse(() =>\n this.tsParseConstraintForInferType(),\n );\n node.typeParameter = this.finishNode(typeParameter, \"TSTypeParameter\");\n return this.finishNode(node, \"TSInferType\");\n }\n\n tsParseConstraintForInferType() {\n if (this.eat(tt._extends)) {\n const constraint = this.tsInDisallowConditionalTypesContext(() =>\n this.tsParseType(),\n );\n if (\n this.state.inDisallowConditionalTypesContext ||\n !this.match(tt.question)\n ) {\n return constraint;\n }\n }\n }\n\n tsParseTypeOperatorOrHigher(): N.TsType {\n const isTypeOperator =\n tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc;\n return isTypeOperator\n ? this.tsParseTypeOperator()\n : this.isContextual(tt._infer)\n ? this.tsParseInferType()\n : this.tsInAllowConditionalTypesContext(() =>\n this.tsParseArrayTypeOrHigher(),\n );\n }\n\n tsParseUnionOrIntersectionType(\n kind: \"TSUnionType\" | \"TSIntersectionType\",\n parseConstituentType: () => N.TsType,\n operator: TokenType,\n ): N.TsType {\n const node = this.startNode<N.TsUnionType | N.TsIntersectionType>();\n const hasLeadingOperator = this.eat(operator);\n const types = [];\n do {\n types.push(parseConstituentType());\n } while (this.eat(operator));\n if (types.length === 1 && !hasLeadingOperator) {\n return types[0];\n }\n node.types = types;\n return this.finishNode(node, kind);\n }\n\n tsParseIntersectionTypeOrHigher(): N.TsType {\n return this.tsParseUnionOrIntersectionType(\n \"TSIntersectionType\",\n this.tsParseTypeOperatorOrHigher.bind(this),\n tt.bitwiseAND,\n );\n }\n\n tsParseUnionTypeOrHigher() {\n return this.tsParseUnionOrIntersectionType(\n \"TSUnionType\",\n this.tsParseIntersectionTypeOrHigher.bind(this),\n tt.bitwiseOR,\n );\n }\n\n tsIsStartOfFunctionType() {\n if (this.match(tt.lt)) {\n return true;\n }\n return (\n this.match(tt.parenL) &&\n this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))\n );\n }\n\n tsSkipParameterStart(): boolean {\n if (tokenIsIdentifier(this.state.type) || this.match(tt._this)) {\n this.next();\n return true;\n }\n\n if (this.match(tt.braceL)) {\n // Return true if we can parse an object pattern without errors\n const { errors } = this.state;\n const previousErrorCount = errors.length;\n try {\n this.parseObjectLike(tt.braceR, true);\n return errors.length === previousErrorCount;\n } catch {\n return false;\n }\n }\n\n if (this.match(tt.bracketL)) {\n this.next();\n // Return true if we can parse an array pattern without errors\n const { errors } = this.state;\n const previousErrorCount = errors.length;\n try {\n super.parseBindingList(\n tt.bracketR,\n charCodes.rightSquareBracket,\n ParseBindingListFlags.ALLOW_EMPTY,\n );\n return errors.length === previousErrorCount;\n } catch {\n return false;\n }\n }\n\n return false;\n }\n\n tsIsUnambiguouslyStartOfFunctionType(): boolean {\n this.next();\n if (this.match(tt.parenR) || this.match(tt.ellipsis)) {\n // ( )\n // ( ...\n return true;\n }\n if (this.tsSkipParameterStart()) {\n if (\n this.match(tt.colon) ||\n this.match(tt.comma) ||\n this.match(tt.question) ||\n this.match(tt.eq)\n ) {\n // ( xxx :\n // ( xxx ,\n // ( xxx ?\n // ( xxx =\n return true;\n }\n if (this.match(tt.parenR)) {\n this.next();\n if (this.match(tt.arrow)) {\n // ( xxx ) =>\n return true;\n }\n }\n }\n return false;\n }\n\n tsParseTypeOrTypePredicateAnnotation(\n returnToken: TokenType,\n ): N.TsTypeAnnotation {\n return this.tsInType(() => {\n const t = this.startNode<N.TsTypeAnnotation>();\n this.expect(returnToken);\n\n const node = this.startNode<N.TsTypePredicate>();\n\n const asserts = !!this.tsTryParse(\n this.tsParseTypePredicateAsserts.bind(this),\n );\n\n if (asserts && this.match(tt._this)) {\n // When asserts is false, thisKeyword is handled by tsParseNonArrayType\n // : asserts this is type\n let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate();\n // if it turns out to be a `TSThisType`, wrap it with `TSTypePredicate`\n // : asserts this\n if (thisTypePredicate.type === \"TSThisType\") {\n node.parameterName = thisTypePredicate;\n node.asserts = true;\n (node as N.TsTypePredicate).typeAnnotation = null;\n thisTypePredicate = this.finishNode(node, \"TSTypePredicate\");\n } else {\n this.resetStartLocationFromNode(thisTypePredicate, node);\n thisTypePredicate.asserts = true;\n }\n t.typeAnnotation = thisTypePredicate;\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n const typePredicateVariable =\n this.tsIsIdentifier() &&\n this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));\n\n if (!typePredicateVariable) {\n if (!asserts) {\n // : type\n return this.tsParseTypeAnnotation(/* eatColon */ false, t);\n }\n\n // : asserts foo\n node.parameterName = this.parseIdentifier();\n node.asserts = asserts;\n (node as N.TsTypePredicate).typeAnnotation = null;\n t.typeAnnotation = this.finishNode(node, \"TSTypePredicate\");\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n // : asserts foo is type\n const type = this.tsParseTypeAnnotation(/* eatColon */ false);\n node.parameterName = typePredicateVariable;\n node.typeAnnotation = type;\n node.asserts = asserts;\n t.typeAnnotation = this.finishNode(node, \"TSTypePredicate\");\n return this.finishNode(t, \"TSTypeAnnotation\");\n });\n }\n\n tsTryParseTypeOrTypePredicateAnnotation(): N.TsTypeAnnotation | undefined {\n if (this.match(tt.colon)) {\n return this.tsParseTypeOrTypePredicateAnnotation(tt.colon);\n }\n }\n\n tsTryParseTypeAnnotation(): N.TsTypeAnnotation | undefined {\n if (this.match(tt.colon)) {\n return this.tsParseTypeAnnotation();\n }\n }\n\n tsTryParseType(): N.TsType | undefined {\n return this.tsEatThenParseType(tt.colon);\n }\n\n tsParseTypePredicatePrefix(): N.Identifier | undefined {\n const id = this.parseIdentifier();\n if (this.isContextual(tt._is) && !this.hasPrecedingLineBreak()) {\n this.next();\n return id;\n }\n }\n\n tsParseTypePredicateAsserts(): boolean {\n if (this.state.type !== tt._asserts) {\n return false;\n }\n const containsEsc = this.state.containsEsc;\n this.next();\n if (!tokenIsIdentifier(this.state.type) && !this.match(tt._this)) {\n return false;\n }\n\n if (containsEsc) {\n this.raise(Errors.InvalidEscapedReservedWord, {\n at: this.state.lastTokStartLoc,\n reservedWord: \"asserts\",\n });\n }\n\n return true;\n }\n\n tsParseTypeAnnotation(\n eatColon = true,\n t: Undone<N.TsTypeAnnotation> = this.startNode<N.TsTypeAnnotation>(),\n ): N.TsTypeAnnotation {\n this.tsInType(() => {\n if (eatColon) this.expect(tt.colon);\n t.typeAnnotation = this.tsParseType();\n });\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n /** Be sure to be in a type context before calling this, using `tsInType`. */\n tsParseType(): N.TsType {\n // Need to set `state.inType` so that we don't parse JSX in a type context.\n assert(this.state.inType);\n const type = this.tsParseNonConditionalType();\n\n if (\n this.state.inDisallowConditionalTypesContext ||\n this.hasPrecedingLineBreak() ||\n !this.eat(tt._extends)\n ) {\n return type;\n }\n const node = this.startNodeAtNode<N.TsConditionalType>(type);\n node.checkType = type;\n\n node.extendsType = this.tsInDisallowConditionalTypesContext(() =>\n this.tsParseNonConditionalType(),\n );\n\n this.expect(tt.question);\n node.trueType = this.tsInAllowConditionalTypesContext(() =>\n this.tsParseType(),\n );\n\n this.expect(tt.colon);\n node.falseType = this.tsInAllowConditionalTypesContext(() =>\n this.tsParseType(),\n );\n\n return this.finishNode(node, \"TSConditionalType\");\n }\n\n isAbstractConstructorSignature(): boolean {\n return (\n this.isContextual(tt._abstract) && this.lookahead().type === tt._new\n );\n }\n\n tsParseNonConditionalType(): N.TsType {\n if (this.tsIsStartOfFunctionType()) {\n return this.tsParseFunctionOrConstructorType(\"TSFunctionType\");\n }\n if (this.match(tt._new)) {\n // As in `new () => Date`\n return this.tsParseFunctionOrConstructorType(\"TSConstructorType\");\n } else if (this.isAbstractConstructorSignature()) {\n // As in `abstract new () => Date`\n return this.tsParseFunctionOrConstructorType(\n \"TSConstructorType\",\n /* abstract */ true,\n );\n }\n return this.tsParseUnionTypeOrHigher();\n }\n\n tsParseTypeAssertion(): N.TsTypeAssertion {\n if (this.getPluginOption(\"typescript\", \"disallowAmbiguousJSXLike\")) {\n this.raise(TSErrors.ReservedTypeAssertion, { at: this.state.startLoc });\n }\n\n const node = this.startNode<N.TsTypeAssertion>();\n node.typeAnnotation = this.tsInType(() => {\n this.next(); // \"<\"\n return this.match(tt._const)\n ? this.tsParseTypeReference()\n : this.tsParseType();\n });\n this.expect(tt.gt);\n node.expression = this.parseMaybeUnary();\n return this.finishNode(node, \"TSTypeAssertion\");\n }\n\n tsParseHeritageClause(\n token: \"extends\" | \"implements\",\n ): Array<N.TsExpressionWithTypeArguments> {\n const originalStartLoc = this.state.startLoc;\n\n const delimitedList = this.tsParseDelimitedList(\n \"HeritageClauseElement\",\n () => {\n const node = this.startNode<N.TsExpressionWithTypeArguments>();\n node.expression = this.tsParseEntityName();\n if (this.match(tt.lt)) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n\n return this.finishNode(node, \"TSExpressionWithTypeArguments\");\n },\n );\n\n if (!delimitedList.length) {\n this.raise(TSErrors.EmptyHeritageClauseType, {\n at: originalStartLoc,\n token,\n });\n }\n\n return delimitedList;\n }\n\n tsParseInterfaceDeclaration(\n node: Undone<N.TsInterfaceDeclaration>,\n properties: {\n declare?: true;\n } = {},\n ): N.TsInterfaceDeclaration | null {\n if (this.hasFollowingLineBreak()) return null;\n this.expectContextual(tt._interface);\n if (properties.declare) node.declare = true;\n if (tokenIsIdentifier(this.state.type)) {\n node.id = this.parseIdentifier();\n this.checkIdentifier(node.id, BIND_TS_INTERFACE);\n } else {\n node.id = null;\n this.raise(TSErrors.MissingInterfaceName, { at: this.state.startLoc });\n }\n\n node.typeParameters = this.tsTryParseTypeParameters(\n this.tsParseInOutConstModifiers,\n );\n if (this.eat(tt._extends)) {\n node.extends = this.tsParseHeritageClause(\"extends\");\n }\n const body = this.startNode<N.TSInterfaceBody>();\n body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this));\n node.body = this.finishNode(body, \"TSInterfaceBody\");\n return this.finishNode(node, \"TSInterfaceDeclaration\");\n }\n\n tsParseTypeAliasDeclaration(\n node: N.TsTypeAliasDeclaration,\n ): N.TsTypeAliasDeclaration {\n node.id = this.parseIdentifier();\n this.checkIdentifier(node.id, BIND_TS_TYPE);\n\n node.typeAnnotation = this.tsInType(() => {\n node.typeParameters = this.tsTryParseTypeParameters(\n this.tsParseInOutModifiers,\n );\n\n this.expect(tt.eq);\n\n if (\n this.isContextual(tt._intrinsic) &&\n this.lookahead().type !== tt.dot\n ) {\n const node = this.startNode<N.TsKeywordType>();\n this.next();\n return this.finishNode(node, \"TSIntrinsicKeyword\");\n }\n\n return this.tsParseType();\n });\n\n this.semicolon();\n return this.finishNode(node, \"TSTypeAliasDeclaration\");\n }\n\n tsInNoContext<T>(cb: () => T): T {\n const oldContext = this.state.context;\n this.state.context = [oldContext[0]];\n try {\n return cb();\n } finally {\n this.state.context = oldContext;\n }\n }\n\n /**\n * Runs `cb` in a type context.\n * This should be called one token *before* the first type token,\n * so that the call to `next()` is run in type context.\n */\n tsInType<T>(cb: () => T): T {\n const oldInType = this.state.inType;\n this.state.inType = true;\n try {\n return cb();\n } finally {\n this.state.inType = oldInType;\n }\n }\n\n tsInDisallowConditionalTypesContext<T>(cb: () => T): T {\n const oldInDisallowConditionalTypesContext =\n this.state.inDisallowConditionalTypesContext;\n this.state.inDisallowConditionalTypesContext = true;\n try {\n return cb();\n } finally {\n this.state.inDisallowConditionalTypesContext =\n oldInDisallowConditionalTypesContext;\n }\n }\n\n tsInAllowConditionalTypesContext<T>(cb: () => T): T {\n const oldInDisallowConditionalTypesContext =\n this.state.inDisallowConditionalTypesContext;\n this.state.inDisallowConditionalTypesContext = false;\n try {\n return cb();\n } finally {\n this.state.inDisallowConditionalTypesContext =\n oldInDisallowConditionalTypesContext;\n }\n }\n\n tsEatThenParseType(token: TokenType): N.TsType | undefined {\n if (this.match(token)) {\n return this.tsNextThenParseType();\n }\n }\n\n tsExpectThenParseType(token: TokenType): N.TsType {\n return this.tsInType(() => {\n this.expect(token);\n return this.tsParseType();\n });\n }\n\n tsNextThenParseType(): N.TsType {\n return this.tsInType(() => {\n this.next();\n return this.tsParseType();\n });\n }\n\n tsParseEnumMember(): N.TsEnumMember {\n const node = this.startNode<N.TsEnumMember>();\n // Computed property names are grammar errors in an enum, so accept just string literal or identifier.\n node.id = this.match(tt.string)\n ? super.parseStringLiteral(this.state.value)\n : this.parseIdentifier(/* liberal */ true);\n if (this.eat(tt.eq)) {\n node.initializer = super.parseMaybeAssignAllowIn();\n }\n return this.finishNode(node, \"TSEnumMember\");\n }\n\n tsParseEnumDeclaration(\n node: Undone<N.TsEnumDeclaration>,\n properties: {\n const?: true;\n declare?: true;\n } = {},\n ): N.TsEnumDeclaration {\n if (properties.const) node.const = true;\n if (properties.declare) node.declare = true;\n this.expectContextual(tt._enum);\n node.id = this.parseIdentifier();\n this.checkIdentifier(\n node.id,\n node.const ? BIND_TS_CONST_ENUM : BIND_TS_ENUM,\n );\n\n this.expect(tt.braceL);\n node.members = this.tsParseDelimitedList(\n \"EnumMembers\",\n this.tsParseEnumMember.bind(this),\n );\n this.expect(tt.braceR);\n return this.finishNode(node, \"TSEnumDeclaration\");\n }\n\n tsParseModuleBlock(): N.TsModuleBlock {\n const node = this.startNode<N.TsModuleBlock>();\n this.scope.enter(SCOPE_OTHER);\n\n this.expect(tt.braceL);\n // Inside of a module block is considered \"top-level\", meaning it can have imports and exports.\n super.parseBlockOrModuleBlockBody(\n (node.body = []),\n /* directives */ undefined,\n /* topLevel */ true,\n /* end */ tt.braceR,\n );\n this.scope.exit();\n return this.finishNode(node, \"TSModuleBlock\");\n }\n\n tsParseModuleOrNamespaceDeclaration(\n node: Undone<N.TsModuleDeclaration>,\n nested: boolean = false,\n ): N.TsModuleDeclaration {\n node.id = this.parseIdentifier();\n\n if (!nested) {\n this.checkIdentifier(node.id, BIND_TS_NAMESPACE);\n }\n\n if (this.eat(tt.dot)) {\n const inner = this.startNode<N.TsModuleDeclaration>();\n this.tsParseModuleOrNamespaceDeclaration(inner, true);\n // @ts-expect-error Fixme: refine typings\n node.body = inner;\n } else {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n node.body = this.tsParseModuleBlock();\n this.prodParam.exit();\n this.scope.exit();\n }\n return this.finishNode(node, \"TSModuleDeclaration\");\n }\n\n tsParseAmbientExternalModuleDeclaration(\n node: N.TsModuleDeclaration,\n ): N.TsModuleDeclaration {\n if (this.isContextual(tt._global)) {\n node.global = true;\n node.id = this.parseIdentifier();\n } else if (this.match(tt.string)) {\n node.id = super.parseStringLiteral(this.state.value);\n } else {\n this.unexpected();\n }\n if (this.match(tt.braceL)) {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n node.body = this.tsParseModuleBlock();\n this.prodParam.exit();\n this.scope.exit();\n } else {\n this.semicolon();\n }\n\n return this.finishNode(node, \"TSModuleDeclaration\");\n }\n\n tsParseImportEqualsDeclaration(\n node: Undone<N.TsImportEqualsDeclaration>,\n maybeDefaultIdentifier?: N.Identifier | null,\n isExport?: boolean,\n ): N.TsImportEqualsDeclaration {\n node.isExport = isExport || false;\n node.id = maybeDefaultIdentifier || this.parseIdentifier();\n this.checkIdentifier(node.id, BIND_FLAGS_TS_IMPORT);\n this.expect(tt.eq);\n const moduleReference = this.tsParseModuleReference();\n if (\n node.importKind === \"type\" &&\n moduleReference.type !== \"TSExternalModuleReference\"\n ) {\n this.raise(TSErrors.ImportAliasHasImportType, {\n at: moduleReference,\n });\n }\n node.moduleReference = moduleReference;\n this.semicolon();\n return this.finishNode(node, \"TSImportEqualsDeclaration\");\n }\n\n tsIsExternalModuleReference(): boolean {\n return (\n this.isContextual(tt._require) &&\n this.lookaheadCharCode() === charCodes.leftParenthesis\n );\n }\n\n tsParseModuleReference(): N.TsModuleReference {\n return this.tsIsExternalModuleReference()\n ? this.tsParseExternalModuleReference()\n : this.tsParseEntityName(/* allowReservedWords */ false);\n }\n\n tsParseExternalModuleReference(): N.TsExternalModuleReference {\n const node = this.startNode<N.TsExternalModuleReference>();\n this.expectContextual(tt._require);\n this.expect(tt.parenL);\n if (!this.match(tt.string)) {\n this.unexpected();\n }\n // For compatibility to estree we cannot call parseLiteral directly here\n node.expression = super.parseExprAtom() as N.StringLiteral;\n this.expect(tt.parenR);\n this.sawUnambiguousESM = true;\n return this.finishNode(node, \"TSExternalModuleReference\");\n }\n\n // Utilities\n\n tsLookAhead<T>(f: () => T): T {\n const state = this.state.clone();\n const res = f();\n this.state = state;\n return res;\n }\n\n tsTryParseAndCatch<T extends N.NodeBase | undefined | null>(\n f: () => T,\n ): T | undefined | null {\n const result = this.tryParse(\n abort =>\n // @ts-expect-error todo(flow->ts)\n f() || abort(),\n );\n\n if (result.aborted || !result.node) return;\n if (result.error) this.state = result.failState;\n // @ts-expect-error refine typings\n return result.node;\n }\n\n tsTryParse<T>(f: () => T | undefined | false): T | undefined {\n const state = this.state.clone();\n const result = f();\n if (result !== undefined && result !== false) {\n return result;\n }\n this.state = state;\n }\n\n tsTryParseDeclare(nany: any): N.Declaration | undefined {\n if (this.isLineTerminator()) {\n return;\n }\n let startType = this.state.type;\n let kind: \"let\" | null;\n\n if (this.isContextual(tt._let)) {\n startType = tt._var;\n kind = \"let\";\n }\n\n // @ts-expect-error refine typings\n return this.tsInAmbientContext(() => {\n switch (startType) {\n case tt._function:\n nany.declare = true;\n return super.parseFunctionStatement(\n nany,\n /* async */ false,\n /* isHangingDeclaration */ false,\n );\n case tt._class:\n // While this is also set by tsParseExpressionStatement, we need to set it\n // before parsing the class declaration to know how to register it in the scope.\n nany.declare = true;\n return this.parseClass(\n nany,\n /* isStatement */ true,\n /* optionalId */ false,\n );\n case tt._enum:\n return this.tsParseEnumDeclaration(nany, { declare: true });\n case tt._global:\n return this.tsParseAmbientExternalModuleDeclaration(nany);\n case tt._const:\n case tt._var:\n if (!this.match(tt._const) || !this.isLookaheadContextual(\"enum\")) {\n nany.declare = true;\n return this.parseVarStatement(\n nany,\n kind || this.state.value,\n true,\n );\n }\n\n // `const enum = 0;` not allowed because \"enum\" is a strict mode reserved word.\n this.expect(tt._const);\n return this.tsParseEnumDeclaration(nany, {\n const: true,\n declare: true,\n });\n case tt._interface: {\n const result = this.tsParseInterfaceDeclaration(nany, {\n declare: true,\n });\n if (result) return result;\n }\n // fallthrough\n default:\n if (tokenIsIdentifier(startType)) {\n return this.tsParseDeclaration(\n nany,\n this.state.value,\n /* next */ true,\n /* decorators */ null,\n );\n }\n }\n });\n }\n\n // Note: this won't be called unless the keyword is allowed in `shouldParseExportDeclaration`.\n tsTryParseExportDeclaration(): N.Declaration | undefined {\n return this.tsParseDeclaration(\n this.startNode(),\n this.state.value,\n /* next */ true,\n /* decorators */ null,\n );\n }\n\n tsParseExpressionStatement(\n node: Undone<N.TsModuleDeclaration>,\n expr: N.Identifier,\n decorators: N.Decorator[] | null,\n ): N.Declaration | undefined {\n switch (expr.name) {\n case \"declare\": {\n const declaration = this.tsTryParseDeclare(node);\n if (declaration) {\n declaration.declare = true;\n }\n return declaration;\n }\n case \"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 (this.match(tt.braceL)) {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n const mod = node;\n mod.global = true;\n mod.id = expr;\n mod.body = this.tsParseModuleBlock();\n this.scope.exit();\n this.prodParam.exit();\n return this.finishNode(mod, \"TSModuleDeclaration\");\n }\n break;\n\n default:\n return this.tsParseDeclaration(\n node,\n expr.name,\n /* next */ false,\n decorators,\n );\n }\n }\n\n // Common to tsTryParseDeclare, tsTryParseExportDeclaration, and tsParseExpressionStatement.\n tsParseDeclaration(\n node: any,\n value: string,\n next: boolean,\n decorators: N.Decorator[] | null,\n ): N.Declaration | undefined | null {\n // no declaration apart from enum can be followed by a line break.\n switch (value) {\n case \"abstract\":\n if (\n this.tsCheckLineTerminator(next) &&\n (this.match(tt._class) || tokenIsIdentifier(this.state.type))\n ) {\n return this.tsParseAbstractDeclaration(node, decorators);\n }\n break;\n\n case \"module\":\n if (this.tsCheckLineTerminator(next)) {\n if (this.match(tt.string)) {\n return this.tsParseAmbientExternalModuleDeclaration(node);\n } else if (tokenIsIdentifier(this.state.type)) {\n return this.tsParseModuleOrNamespaceDeclaration(node);\n }\n }\n break;\n\n case \"namespace\":\n if (\n this.tsCheckLineTerminator(next) &&\n tokenIsIdentifier(this.state.type)\n ) {\n return this.tsParseModuleOrNamespaceDeclaration(node);\n }\n break;\n\n case \"type\":\n if (\n this.tsCheckLineTerminator(next) &&\n tokenIsIdentifier(this.state.type)\n ) {\n return this.tsParseTypeAliasDeclaration(node);\n }\n break;\n }\n }\n\n tsCheckLineTerminator(next: boolean) {\n if (next) {\n if (this.hasFollowingLineBreak()) return false;\n this.next();\n return true;\n }\n return !this.isLineTerminator();\n }\n\n tsTryParseGenericAsyncArrowFunction(\n startLoc: Position,\n ): N.ArrowFunctionExpression | undefined {\n if (!this.match(tt.lt)) return;\n\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n this.state.maybeInArrowParameters = true;\n\n const res: Undone<N.ArrowFunctionExpression> | undefined =\n this.tsTryParseAndCatch(() => {\n const node = this.startNodeAt<N.ArrowFunctionExpression>(startLoc);\n node.typeParameters = this.tsParseTypeParameters(\n this.tsParseConstModifier,\n );\n // Don't use overloaded parseFunctionParams which would look for \"<\" again.\n super.parseFunctionParams(node);\n node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation();\n this.expect(tt.arrow);\n return node;\n });\n\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n\n if (!res) return;\n\n return super.parseArrowExpression(\n res,\n /* params are already set */ null,\n /* async */ true,\n );\n }\n\n // Used when parsing type arguments from ES productions, where the first token\n // has been created without state.inType. Thus we need to rescan the lt token.\n tsParseTypeArgumentsInExpression(): N.TsTypeParameterInstantiation | void {\n if (this.reScan_lt() !== tt.lt) return;\n return this.tsParseTypeArguments();\n }\n\n tsParseTypeArguments(): N.TsTypeParameterInstantiation {\n const node = this.startNode<N.TsTypeParameterInstantiation>();\n node.params = this.tsInType(() =>\n // Temporarily remove a JSX parsing context, which makes us scan different tokens.\n this.tsInNoContext(() => {\n this.expect(tt.lt);\n return this.tsParseDelimitedList(\n \"TypeParametersOrArguments\",\n this.tsParseType.bind(this),\n );\n }),\n );\n if (node.params.length === 0) {\n this.raise(TSErrors.EmptyTypeArguments, { at: node });\n } else if (!this.state.inType && this.curContext() === tc.brace) {\n // rescan `>` when we are no longer in type context and JSX parsing context\n // since it was tokenized when `inType` is `true`.\n this.reScan_lt_gt();\n }\n this.expect(tt.gt);\n return this.finishNode(node, \"TSTypeParameterInstantiation\");\n }\n\n tsIsDeclarationStart(): boolean {\n return tokenIsTSDeclarationStart(this.state.type);\n }\n\n // ======================================================\n // OVERRIDES\n // ======================================================\n\n isExportDefaultSpecifier(): boolean {\n if (this.tsIsDeclarationStart()) return false;\n return super.isExportDefaultSpecifier();\n }\n\n parseAssignableListItem(\n flags: ParseBindingListFlags,\n decorators: N.Decorator[],\n ): N.Pattern | N.TSParameterProperty {\n // Store original location to include modifiers in range\n const startLoc = this.state.startLoc;\n\n const modified: ModifierBase = {};\n this.tsParseModifiers(\n {\n allowedModifiers: [\n \"public\",\n \"private\",\n \"protected\",\n \"override\",\n \"readonly\",\n ],\n },\n modified,\n );\n const accessibility = modified.accessibility;\n const override = modified.override;\n const readonly = modified.readonly;\n if (\n !(flags & ParseBindingListFlags.IS_CONSTRUCTOR_PARAMS) &&\n (accessibility || readonly || override)\n ) {\n this.raise(TSErrors.UnexpectedParameterModifier, { at: startLoc });\n }\n\n const left = this.parseMaybeDefault();\n this.parseAssignableListItemTypes(left, flags);\n const elt = this.parseMaybeDefault(left.loc.start, left);\n if (accessibility || readonly || override) {\n const pp = this.startNodeAt<N.TSParameterProperty>(startLoc);\n if (decorators.length) {\n pp.decorators = decorators;\n }\n if (accessibility) pp.accessibility = accessibility;\n if (readonly) pp.readonly = readonly;\n if (override) pp.override = override;\n if (elt.type !== \"Identifier\" && elt.type !== \"AssignmentPattern\") {\n this.raise(TSErrors.UnsupportedParameterPropertyKind, { at: pp });\n }\n pp.parameter = elt as any as N.Identifier | N.AssignmentPattern;\n return this.finishNode(pp, \"TSParameterProperty\");\n }\n\n if (decorators.length) {\n left.decorators = decorators;\n }\n\n return elt;\n }\n\n isSimpleParameter(node: N.Pattern | N.TSParameterProperty) {\n return (\n (node.type === \"TSParameterProperty\" &&\n super.isSimpleParameter(node.parameter)) ||\n super.isSimpleParameter(node)\n );\n }\n\n tsDisallowOptionalPattern(node: Undone<N.Function>) {\n for (const param of node.params) {\n if (\n param.type !== \"Identifier\" &&\n (param as any).optional &&\n !this.state.isAmbientContext\n ) {\n this.raise(TSErrors.PatternIsOptional, { at: param });\n }\n }\n }\n\n setArrowFunctionParameters(\n node: Undone<N.ArrowFunctionExpression>,\n params: N.Expression[],\n trailingCommaLoc?: Position | null,\n ): void {\n super.setArrowFunctionParameters(node, params, trailingCommaLoc);\n this.tsDisallowOptionalPattern(node);\n }\n\n parseFunctionBodyAndFinish<\n T extends\n | N.Function\n | N.TSDeclareMethod\n | N.TSDeclareFunction\n | N.ClassPrivateMethod,\n >(node: Undone<T>, type: T[\"type\"], isMethod: boolean = false): T {\n if (this.match(tt.colon)) {\n node.returnType = this.tsParseTypeOrTypePredicateAnnotation(tt.colon);\n }\n\n const bodilessType =\n type === \"FunctionDeclaration\"\n ? \"TSDeclareFunction\"\n : type === \"ClassMethod\" || type === \"ClassPrivateMethod\"\n ? \"TSDeclareMethod\"\n : undefined;\n if (bodilessType && !this.match(tt.braceL) && this.isLineTerminator()) {\n return this.finishNode(node, bodilessType);\n }\n if (bodilessType === \"TSDeclareFunction\" && this.state.isAmbientContext) {\n this.raise(TSErrors.DeclareFunctionHasImplementation, { at: node });\n if ((node as Undone<N.FunctionDeclaration>).declare) {\n return super.parseFunctionBodyAndFinish(node, bodilessType, isMethod);\n }\n }\n this.tsDisallowOptionalPattern(node);\n\n return super.parseFunctionBodyAndFinish(node, type, isMethod);\n }\n\n registerFunctionStatementId(node: N.Function): void {\n if (!node.body && node.id) {\n // Function ids are validated after parsing their body.\n // For bodiless function, we need to do it here.\n this.checkIdentifier(node.id, BIND_TS_AMBIENT);\n } else {\n super.registerFunctionStatementId(node);\n }\n }\n\n tsCheckForInvalidTypeCasts(items: Array<N.Expression | undefined | null>) {\n items.forEach(node => {\n if (node?.type === \"TSTypeCastExpression\") {\n this.raise(TSErrors.UnexpectedTypeAnnotation, {\n at: node.typeAnnotation,\n });\n }\n });\n }\n\n toReferencedList(\n exprList: Array<N.Expression | undefined | null>,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n isInParens?: boolean,\n ): Array<N.Expression | undefined | null> {\n // Handles invalid scenarios like: `f(a:b)`, `(a:b);`, and `(a:b,c:d)`.\n //\n // Note that `f<T>(a:b)` goes through a different path and is handled\n // in `parseSubscript` directly.\n this.tsCheckForInvalidTypeCasts(exprList);\n return exprList;\n }\n\n parseArrayLike(\n close: TokenType,\n canBePattern: boolean,\n isTuple: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ArrayExpression | N.TupleExpression {\n const node = super.parseArrayLike(\n close,\n canBePattern,\n isTuple,\n refExpressionErrors,\n );\n\n if (node.type === \"ArrayExpression\") {\n this.tsCheckForInvalidTypeCasts(node.elements);\n }\n\n return node;\n }\n\n parseSubscript(\n base: N.Expression,\n\n startLoc: Position,\n noCalls: boolean | undefined | null,\n state: N.ParseSubscriptState,\n ): N.Expression {\n if (!this.hasPrecedingLineBreak() && this.match(tt.bang)) {\n // When ! is consumed as a postfix operator (non-null assertion),\n // disallow JSX tag forming after. e.g. When parsing `p! < n.p!`\n // `<n.p` can not be a start of JSX tag\n this.state.canStartJSXElement = false;\n this.next();\n\n const nonNullExpression =\n this.startNodeAt<N.TsNonNullExpression>(startLoc);\n nonNullExpression.expression = base;\n return this.finishNode(nonNullExpression, \"TSNonNullExpression\");\n }\n\n let isOptionalCall = false;\n if (\n this.match(tt.questionDot) &&\n this.lookaheadCharCode() === charCodes.lessThan\n ) {\n if (noCalls) {\n state.stop = true;\n return base;\n }\n state.optionalChainMember = isOptionalCall = true;\n this.next();\n }\n\n // handles 'f<<T>'\n if (this.match(tt.lt) || this.match(tt.bitShiftL)) {\n let missingParenErrorLoc;\n // tsTryParseAndCatch is expensive, so avoid if not necessary.\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 result = this.tsTryParseAndCatch(() => {\n if (!noCalls && this.atPossibleAsyncArrow(base)) {\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 =\n this.tsTryParseGenericAsyncArrowFunction(startLoc);\n if (asyncArrowFn) {\n return asyncArrowFn;\n }\n }\n\n const typeArguments = this.tsParseTypeArgumentsInExpression();\n if (!typeArguments) return;\n\n if (isOptionalCall && !this.match(tt.parenL)) {\n missingParenErrorLoc = this.state.curPosition();\n return;\n }\n\n if (tokenIsTemplate(this.state.type)) {\n const result = super.parseTaggedTemplateExpression(\n base,\n\n startLoc,\n state,\n );\n result.typeParameters = typeArguments;\n return result;\n }\n\n if (!noCalls && this.eat(tt.parenL)) {\n const node = this.startNodeAt<\n N.CallExpression | N.OptionalCallExpression\n >(startLoc);\n node.callee = base;\n // possibleAsync always false here, because we would have handled it above.\n // @ts-expect-error (won't be any undefined arguments)\n node.arguments = this.parseCallExpressionArguments(\n tt.parenR,\n /* possibleAsync */ false,\n );\n\n // Handles invalid case: `f<T>(a:b)`\n this.tsCheckForInvalidTypeCasts(node.arguments);\n\n node.typeParameters = typeArguments;\n if (state.optionalChainMember) {\n (node as Undone<N.OptionalCallExpression>).optional =\n isOptionalCall;\n }\n\n return this.finishCallExpression(node, state.optionalChainMember);\n }\n\n const tokenType = this.state.type;\n if (\n // a<b>>c is not (a<b>)>c, but a<(b>>c)\n tokenType === tt.gt ||\n // a<b>>>c is not (a<b>)>>c, but a<(b>>>c)\n tokenType === tt.bitShiftR ||\n // a<b>c is (a<b)>c\n (tokenType !== tt.parenL &&\n tokenCanStartExpression(tokenType) &&\n !this.hasPrecedingLineBreak())\n ) {\n // Bail out.\n return;\n }\n\n const node = this.startNodeAt<N.TsInstantiationExpression>(startLoc);\n node.expression = base;\n node.typeParameters = typeArguments;\n return this.finishNode(node, \"TSInstantiationExpression\");\n });\n\n if (missingParenErrorLoc) {\n this.unexpected(missingParenErrorLoc, tt.parenL);\n }\n\n if (result) {\n if (\n result.type === \"TSInstantiationExpression\" &&\n (this.match(tt.dot) ||\n (this.match(tt.questionDot) &&\n this.lookaheadCharCode() !== charCodes.leftParenthesis))\n ) {\n this.raise(\n TSErrors.InvalidPropertyAccessAfterInstantiationExpression,\n { at: this.state.startLoc },\n );\n }\n return result;\n }\n }\n\n return super.parseSubscript(base, startLoc, noCalls, state);\n }\n\n parseNewCallee(node: N.NewExpression): void {\n super.parseNewCallee(node);\n\n const { callee } = node;\n if (\n callee.type === \"TSInstantiationExpression\" &&\n !callee.extra?.parenthesized\n ) {\n node.typeParameters = callee.typeParameters;\n node.callee = callee.expression;\n }\n }\n\n parseExprOp(\n left: N.Expression,\n leftStartLoc: Position,\n minPrec: number,\n ): N.Expression {\n let isSatisfies: boolean;\n if (\n tokenOperatorPrecedence(tt._in) > minPrec &&\n !this.hasPrecedingLineBreak() &&\n (this.isContextual(tt._as) ||\n (isSatisfies = this.isContextual(tt._satisfies)))\n ) {\n const node = this.startNodeAt<\n N.TsAsExpression | N.TsSatisfiesExpression\n >(leftStartLoc);\n node.expression = left;\n node.typeAnnotation = this.tsInType(() => {\n this.next(); // \"as\" or \"satisfies\"\n if (this.match(tt._const)) {\n if (isSatisfies) {\n this.raise(Errors.UnexpectedKeyword, {\n at: this.state.startLoc,\n keyword: \"const\",\n });\n }\n return this.tsParseTypeReference();\n }\n\n return this.tsParseType();\n });\n this.finishNode(\n node,\n isSatisfies ? \"TSSatisfiesExpression\" : \"TSAsExpression\",\n );\n // rescan `<`, `>` because they were scanned when this.state.inType was true\n this.reScan_lt_gt();\n return this.parseExprOp(\n // @ts-expect-error todo(flow->ts)\n node,\n leftStartLoc,\n minPrec,\n );\n }\n\n return super.parseExprOp(left, leftStartLoc, minPrec);\n }\n\n checkReservedWord(\n word: string,\n startLoc: Position,\n checkKeywords: boolean,\n isBinding: boolean,\n ): void {\n // Strict mode words may be allowed as in `declare namespace N { const static: number; }`.\n // And we have a type checker anyway, so don't bother having the parser do it.\n if (!this.state.isAmbientContext) {\n super.checkReservedWord(word, startLoc, checkKeywords, isBinding);\n }\n }\n\n checkImportReflection(node: Undone<N.ImportDeclaration>) {\n super.checkImportReflection(node);\n if (node.module && node.importKind !== \"value\") {\n this.raise(TSErrors.ImportReflectionHasImportType, {\n at: node.specifiers[0].loc.start,\n });\n }\n }\n\n /*\n Don't bother doing this check in TypeScript code because:\n 1. We may have a nested export statement with the same name:\n export const x = 0;\n export namespace N {\n export const x = 1;\n }\n 2. We have a type checker to warn us about this sort of thing.\n */\n checkDuplicateExports() {}\n\n isPotentialImportPhase(isExport: boolean): boolean {\n if (super.isPotentialImportPhase(isExport)) return true;\n if (this.isContextual(tt._type)) {\n const ch = this.lookaheadCharCode();\n return isExport\n ? ch === charCodes.leftCurlyBrace || ch === charCodes.asterisk\n : ch !== charCodes.equalsTo;\n }\n return !isExport && this.isContextual(tt._typeof);\n }\n\n applyImportPhase(\n node: Undone<N.ImportDeclaration | N.ExportNamedDeclaration>,\n isExport: boolean,\n phase: string | null,\n loc?: Position,\n ): void {\n super.applyImportPhase(node, isExport, phase, loc);\n if (isExport) {\n (node as N.ExportNamedDeclaration).exportKind =\n phase === \"type\" ? \"type\" : \"value\";\n } else {\n (node as N.ImportDeclaration).importKind =\n phase === \"type\" || phase === \"typeof\" ? phase : \"value\";\n }\n }\n\n parseImport(\n node: Undone<N.ImportDeclaration | N.TsImportEqualsDeclaration>,\n ): N.AnyImport {\n if (this.match(tt.string)) {\n node.importKind = \"value\";\n return super.parseImport(node as Undone<N.ImportDeclaration>);\n }\n\n let importNode;\n if (\n tokenIsIdentifier(this.state.type) &&\n this.lookaheadCharCode() === charCodes.equalsTo\n ) {\n node.importKind = \"value\";\n return this.tsParseImportEqualsDeclaration(\n node as Undone<N.TsImportEqualsDeclaration>,\n );\n } else if (this.isContextual(tt._type)) {\n const maybeDefaultIdentifier = this.parseMaybeImportPhase(\n node as Undone<N.ImportDeclaration>,\n /* isExport */ false,\n );\n if (this.lookaheadCharCode() === charCodes.equalsTo) {\n return this.tsParseImportEqualsDeclaration(\n node as Undone<N.TsImportEqualsDeclaration>,\n maybeDefaultIdentifier,\n );\n } else {\n importNode = super.parseImportSpecifiersAndAfter(\n node as Undone<N.ImportDeclaration>,\n maybeDefaultIdentifier,\n );\n }\n } else {\n importNode = super.parseImport(node as Undone<N.ImportDeclaration>);\n }\n\n // `import type` can only be used on imports with named imports or with a\n // default import - but not both\n if (\n importNode.importKind === \"type\" &&\n // @ts-expect-error refine typings\n importNode.specifiers.length > 1 &&\n // @ts-expect-error refine typings\n importNode.specifiers[0].type === \"ImportDefaultSpecifier\"\n ) {\n this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, {\n at: importNode,\n });\n }\n\n return importNode;\n }\n\n parseExport(\n node: Undone<N.Node>,\n decorators: N.Decorator[] | null,\n ): N.AnyExport {\n if (this.match(tt._import)) {\n // `export import A = B;`\n this.next(); // eat `tt._import`\n let maybeDefaultIdentifier: N.Identifier | null = null;\n if (\n this.isContextual(tt._type) &&\n // We pass false here, because we are parsing an `import ... =`\n this.isPotentialImportPhase(/* isExport */ false)\n ) {\n maybeDefaultIdentifier = this.parseMaybeImportPhase(\n node as Undone<N.TsImportEqualsDeclaration>,\n /* isExport */ false,\n );\n } else {\n node.importKind = \"value\";\n }\n return this.tsParseImportEqualsDeclaration(\n node as Undone<N.TsImportEqualsDeclaration>,\n maybeDefaultIdentifier,\n /* isExport */ true,\n );\n } else if (this.eat(tt.eq)) {\n // `export = x;`\n const assign = node as Undone<N.TsExportAssignment>;\n assign.expression = super.parseExpression();\n this.semicolon();\n this.sawUnambiguousESM = true;\n return this.finishNode(assign, \"TSExportAssignment\");\n } else if (this.eatContextual(tt._as)) {\n // `export as namespace A;`\n const decl = node as Undone<N.TsNamespaceExportDeclaration>;\n // See `parseNamespaceExportDeclaration` in TypeScript's own parser\n this.expectContextual(tt._namespace);\n decl.id = this.parseIdentifier();\n this.semicolon();\n return this.finishNode(decl, \"TSNamespaceExportDeclaration\");\n } else {\n return super.parseExport(\n node as Undone<N.ExportAllDeclaration | N.ExportDefaultDeclaration>,\n decorators,\n );\n }\n }\n\n isAbstractClass(): boolean {\n return (\n this.isContextual(tt._abstract) && this.lookahead().type === tt._class\n );\n }\n\n parseExportDefaultExpression(): N.Expression | N.Declaration {\n if (this.isAbstractClass()) {\n const cls = this.startNode<N.Class>();\n this.next(); // Skip \"abstract\"\n cls.abstract = true;\n return this.parseClass(cls, true, true);\n }\n\n // export default interface allowed in:\n // https://github.com/Microsoft/TypeScript/pull/16040\n if (this.match(tt._interface)) {\n const result = this.tsParseInterfaceDeclaration(\n this.startNode<N.TsInterfaceDeclaration>(),\n );\n if (result) return result;\n }\n\n return super.parseExportDefaultExpression();\n }\n\n parseVarStatement(\n node: N.VariableDeclaration,\n kind: \"var\" | \"let\" | \"const\" | \"using\",\n allowMissingInitializer: boolean = false,\n ) {\n const { isAmbientContext } = this.state;\n const declaration = super.parseVarStatement(\n node,\n kind,\n allowMissingInitializer || isAmbientContext,\n );\n\n if (!isAmbientContext) return declaration;\n\n for (const { id, init } of declaration.declarations) {\n // Empty initializer is the easy case that we want.\n if (!init) continue;\n\n // var and let aren't ever allowed initializers.\n if (kind !== \"const\" || !!id.typeAnnotation) {\n this.raise(TSErrors.InitializerNotAllowedInAmbientContext, {\n at: init,\n });\n } else if (\n !isValidAmbientConstInitializer(init, this.hasPlugin(\"estree\"))\n ) {\n this.raise(\n TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference,\n { at: init },\n );\n }\n }\n\n return declaration;\n }\n\n parseStatementContent(\n flags: ParseStatementFlag,\n decorators?: N.Decorator[] | null,\n ): N.Statement {\n if (this.match(tt._const) && this.isLookaheadContextual(\"enum\")) {\n const node = this.startNode<N.TsEnumDeclaration>();\n this.expect(tt._const); // eat 'const'\n return this.tsParseEnumDeclaration(node, { const: true });\n }\n\n if (this.isContextual(tt._enum)) {\n return this.tsParseEnumDeclaration(\n this.startNode<N.TsEnumDeclaration>(),\n );\n }\n\n if (this.isContextual(tt._interface)) {\n const result = this.tsParseInterfaceDeclaration(this.startNode());\n if (result) return result;\n }\n\n return super.parseStatementContent(flags, decorators);\n }\n\n parseAccessModifier(): N.Accessibility | undefined | null {\n return this.tsParseModifier([\"public\", \"protected\", \"private\"]);\n }\n\n tsHasSomeModifiers(member: any, modifiers: readonly TsModifier[]): boolean {\n return modifiers.some(modifier => {\n if (tsIsAccessModifier(modifier)) {\n return member.accessibility === modifier;\n }\n return !!member[modifier];\n });\n }\n\n tsIsStartOfStaticBlocks() {\n return (\n this.isContextual(tt._static) &&\n this.lookaheadCharCode() === charCodes.leftCurlyBrace\n );\n }\n\n parseClassMember(\n classBody: N.ClassBody,\n member: any,\n state: N.ParseClassMemberState,\n ): void {\n const modifiers = [\n \"declare\",\n \"private\",\n \"public\",\n \"protected\",\n \"override\",\n \"abstract\",\n \"readonly\",\n \"static\",\n ] as const;\n this.tsParseModifiers(\n {\n allowedModifiers: modifiers,\n disallowedModifiers: [\"in\", \"out\"],\n stopOnStartOfClassStaticBlock: true,\n errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions,\n },\n member,\n );\n\n const callParseClassMemberWithIsStatic = () => {\n if (this.tsIsStartOfStaticBlocks()) {\n this.next(); // eat \"static\"\n this.next(); // eat \"{\"\n if (this.tsHasSomeModifiers(member, modifiers)) {\n this.raise(TSErrors.StaticBlockCannotHaveModifier, {\n at: this.state.curPosition(),\n });\n }\n super.parseClassStaticBlock(classBody, member as N.StaticBlock);\n } else {\n this.parseClassMemberWithIsStatic(\n classBody,\n member,\n state,\n !!member.static,\n );\n }\n };\n if (member.declare) {\n this.tsInAmbientContext(callParseClassMemberWithIsStatic);\n } else {\n callParseClassMemberWithIsStatic();\n }\n }\n\n parseClassMemberWithIsStatic(\n classBody: N.ClassBody,\n member: Undone<N.ClassMember | N.TsIndexSignature>,\n state: N.ParseClassMemberState,\n isStatic: boolean,\n ): void {\n const idx = this.tsTryParseIndexSignature(\n member as Undone<N.TsIndexSignature>,\n );\n if (idx) {\n classBody.body.push(idx);\n\n if ((member as any).abstract) {\n this.raise(TSErrors.IndexSignatureHasAbstract, { at: member });\n }\n if ((member as any).accessibility) {\n this.raise(TSErrors.IndexSignatureHasAccessibility, {\n at: member,\n modifier: (member as any).accessibility,\n });\n }\n if ((member as any).declare) {\n this.raise(TSErrors.IndexSignatureHasDeclare, { at: member });\n }\n if ((member as any).override) {\n this.raise(TSErrors.IndexSignatureHasOverride, { at: member });\n }\n\n return;\n }\n\n if (!this.state.inAbstractClass && (member as any).abstract) {\n this.raise(TSErrors.NonAbstractClassHasAbstractMethod, {\n at: member,\n });\n }\n\n if ((member as any).override) {\n if (!state.hadSuperClass) {\n this.raise(TSErrors.OverrideNotInSubClass, { at: member });\n }\n }\n\n /*:: invariant(member.type !== \"TSIndexSignature\") */\n\n super.parseClassMemberWithIsStatic(\n classBody,\n member as Undone<N.ClassMember>,\n state,\n isStatic,\n );\n }\n\n parsePostMemberNameModifiers(\n methodOrProp: N.ClassMethod | N.ClassProperty | N.ClassPrivateProperty,\n ): void {\n const optional = this.eat(tt.question);\n if (optional) methodOrProp.optional = true;\n\n if ((methodOrProp as any).readonly && this.match(tt.parenL)) {\n this.raise(TSErrors.ClassMethodHasReadonly, { at: methodOrProp });\n }\n\n if ((methodOrProp as any).declare && this.match(tt.parenL)) {\n this.raise(TSErrors.ClassMethodHasDeclare, { at: methodOrProp });\n }\n }\n\n // Note: The reason we do this in `parseExpressionStatement` 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.\n // @ts-expect-error plugin overrides interfaces\n parseExpressionStatement(\n node: Undone<N.ExpressionStatement>,\n expr: N.Expression,\n decorators: N.Decorator[] | null,\n ): N.Statement {\n const decl =\n expr.type === \"Identifier\"\n ? // @ts-expect-error refine typings\n this.tsParseExpressionStatement(node, expr, decorators)\n : undefined;\n return decl || super.parseExpressionStatement(node, expr, decorators);\n }\n\n // export type\n // Should be true for anything parsed by `tsTryParseExportDeclaration`.\n shouldParseExportDeclaration(): boolean {\n if (this.tsIsDeclarationStart()) return true;\n return super.shouldParseExportDeclaration();\n }\n\n // An apparent conditional expression could actually be an optional parameter in an arrow function.\n parseConditional(\n expr: N.Expression,\n\n startLoc: Position,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.Expression {\n // only do the expensive clone if there is a question mark\n // and if we come from inside parens\n if (!this.state.maybeInArrowParameters || !this.match(tt.question)) {\n return super.parseConditional(\n expr,\n\n startLoc,\n refExpressionErrors,\n );\n }\n\n const result = this.tryParse(() =>\n super.parseConditional(expr, startLoc),\n );\n\n if (!result.node) {\n if (result.error) {\n /*:: invariant(refExpressionErrors != null) */\n super.setOptionalParametersError(refExpressionErrors, result.error);\n }\n\n return expr;\n }\n if (result.error) this.state = result.failState;\n return result.node;\n }\n\n // Note: These \"type casts\" are *not* valid TS expressions.\n // But we parse them here and change them when completing the arrow function.\n parseParenItem(\n node: N.Expression,\n\n startLoc: Position,\n ): N.Expression {\n node = super.parseParenItem(node, startLoc);\n if (this.eat(tt.question)) {\n node.optional = true;\n // Include questionmark in location of node\n // Don't use this.finishNode() as otherwise we might process comments twice and\n // include already consumed parens\n this.resetEndLocation(node);\n }\n\n if (this.match(tt.colon)) {\n const typeCastNode = this.startNodeAt<N.TsTypeCastExpression>(startLoc);\n typeCastNode.expression = node;\n typeCastNode.typeAnnotation = this.tsParseTypeAnnotation();\n\n return this.finishNode(typeCastNode, \"TSTypeCastExpression\");\n }\n\n return node;\n }\n\n parseExportDeclaration(\n node: N.ExportNamedDeclaration,\n ): N.Declaration | undefined | null {\n if (!this.state.isAmbientContext && this.isContextual(tt._declare)) {\n return this.tsInAmbientContext(() => this.parseExportDeclaration(node));\n }\n\n // Store original location\n const startLoc = this.state.startLoc;\n\n const isDeclare = this.eatContextual(tt._declare);\n\n if (\n isDeclare &&\n (this.isContextual(tt._declare) || !this.shouldParseExportDeclaration())\n ) {\n throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, {\n at: this.state.startLoc,\n });\n }\n\n const isIdentifier = tokenIsIdentifier(this.state.type);\n const declaration: N.Declaration | undefined | null =\n (isIdentifier && this.tsTryParseExportDeclaration()) ||\n super.parseExportDeclaration(node);\n\n if (!declaration) return null;\n\n if (\n declaration.type === \"TSInterfaceDeclaration\" ||\n declaration.type === \"TSTypeAliasDeclaration\" ||\n isDeclare\n ) {\n node.exportKind = \"type\";\n }\n\n if (isDeclare) {\n // Reset location to include `declare` in range\n this.resetStartLocation(declaration, startLoc);\n\n declaration.declare = true;\n }\n\n return declaration;\n }\n\n parseClassId(\n node: N.Class,\n isStatement: boolean,\n optionalId?: boolean | null,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n bindingType?: BindingTypes,\n ): void {\n if ((!isStatement || optionalId) && this.isContextual(tt._implements)) {\n return;\n }\n\n super.parseClassId(\n node,\n isStatement,\n optionalId,\n (node as any).declare ? BIND_TS_AMBIENT : BIND_CLASS,\n );\n const typeParameters = this.tsTryParseTypeParameters(\n this.tsParseInOutConstModifiers,\n );\n if (typeParameters) node.typeParameters = typeParameters;\n }\n\n parseClassPropertyAnnotation(\n node: N.ClassProperty | N.ClassPrivateProperty | N.ClassAccessorProperty,\n ): void {\n if (!node.optional) {\n if (this.eat(tt.bang)) {\n node.definite = true;\n } else if (this.eat(tt.question)) {\n node.optional = true;\n }\n }\n\n const type = this.tsTryParseTypeAnnotation();\n if (type) node.typeAnnotation = type;\n }\n\n parseClassProperty(node: N.ClassProperty): N.ClassProperty {\n this.parseClassPropertyAnnotation(node);\n\n if (\n this.state.isAmbientContext &&\n !(node.readonly && !node.typeAnnotation) &&\n this.match(tt.eq)\n ) {\n this.raise(TSErrors.DeclareClassFieldHasInitializer, {\n at: this.state.startLoc,\n });\n }\n if (node.abstract && this.match(tt.eq)) {\n const { key } = node;\n this.raise(TSErrors.AbstractPropertyHasInitializer, {\n at: this.state.startLoc,\n propertyName:\n key.type === \"Identifier\" && !node.computed\n ? key.name\n : `[${this.input.slice(key.start, key.end)}]`,\n });\n }\n\n return super.parseClassProperty(node);\n }\n\n parseClassPrivateProperty(\n node: N.ClassPrivateProperty,\n ): N.ClassPrivateProperty {\n // @ts-expect-error abstract may not index node\n if (node.abstract) {\n this.raise(TSErrors.PrivateElementHasAbstract, { at: node });\n }\n\n // @ts-expect-error accessibility may not index node\n if (node.accessibility) {\n this.raise(TSErrors.PrivateElementHasAccessibility, {\n at: node,\n // @ts-expect-error refine typings\n modifier: node.accessibility,\n });\n }\n\n this.parseClassPropertyAnnotation(node);\n return super.parseClassPrivateProperty(node);\n }\n\n parseClassAccessorProperty(\n node: N.ClassAccessorProperty,\n ): N.ClassAccessorProperty {\n this.parseClassPropertyAnnotation(node);\n if (node.optional) {\n this.raise(TSErrors.AccessorCannotBeOptional, { at: node });\n }\n return super.parseClassAccessorProperty(node);\n }\n\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n const typeParameters = this.tsTryParseTypeParameters(\n this.tsParseConstModifier,\n );\n if (typeParameters && isConstructor) {\n this.raise(TSErrors.ConstructorHasTypeParameters, {\n at: typeParameters,\n });\n }\n\n // @ts-expect-error declare does not exist in ClassMethod\n const { declare = false, kind } = method;\n\n if (declare && (kind === \"get\" || kind === \"set\")) {\n this.raise(TSErrors.DeclareAccessor, { at: method, kind });\n }\n if (typeParameters) method.typeParameters = typeParameters;\n super.pushClassMethod(\n classBody,\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n );\n }\n\n pushClassPrivateMethod(\n classBody: N.ClassBody,\n method: N.ClassPrivateMethod,\n isGenerator: boolean,\n isAsync: boolean,\n ): void {\n const typeParameters = this.tsTryParseTypeParameters(\n this.tsParseConstModifier,\n );\n if (typeParameters) method.typeParameters = typeParameters;\n super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);\n }\n\n declareClassPrivateMethodInScope(\n node: N.ClassPrivateMethod | N.EstreeMethodDefinition | N.TSDeclareMethod,\n kind: number,\n ) {\n if (node.type === \"TSDeclareMethod\") return;\n // This happens when using the \"estree\" plugin.\n if (node.type === \"MethodDefinition\" && !node.value.body) return;\n\n super.declareClassPrivateMethodInScope(node, kind);\n }\n\n parseClassSuper(node: N.Class): void {\n super.parseClassSuper(node);\n // handle `extends f<<T>\n if (node.superClass && (this.match(tt.lt) || this.match(tt.bitShiftL))) {\n // @ts-expect-error refine typings\n node.superTypeParameters = this.tsParseTypeArgumentsInExpression();\n }\n if (this.eatContextual(tt._implements)) {\n node.implements = this.tsParseHeritageClause(\"implements\");\n }\n }\n\n parseObjPropValue(\n prop: Undone<N.ObjectMethod | N.ObjectProperty>,\n startLoc: Position | undefined | null,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ) {\n const typeParameters = this.tsTryParseTypeParameters(\n this.tsParseConstModifier,\n );\n if (typeParameters) prop.typeParameters = typeParameters;\n\n return super.parseObjPropValue(\n prop,\n\n startLoc,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n refExpressionErrors,\n );\n }\n\n parseFunctionParams(node: N.Function, isConstructor: boolean): void {\n const typeParameters = this.tsTryParseTypeParameters(\n this.tsParseConstModifier,\n );\n if (typeParameters) node.typeParameters = typeParameters;\n super.parseFunctionParams(node, isConstructor);\n }\n\n // `let x: number;`\n parseVarId(\n decl: N.VariableDeclarator,\n kind: \"var\" | \"let\" | \"const\" | \"using\",\n ): void {\n super.parseVarId(decl, kind);\n if (\n decl.id.type === \"Identifier\" &&\n !this.hasPrecedingLineBreak() &&\n this.eat(tt.bang)\n ) {\n decl.definite = true;\n }\n\n const type = this.tsTryParseTypeAnnotation();\n if (type) {\n decl.id.typeAnnotation = type;\n this.resetEndLocation(decl.id); // set end position to end of type\n }\n }\n\n // parse the return type of an async arrow function - let foo = (async (): number => {});\n parseAsyncArrowFromCallExpression(\n node: N.ArrowFunctionExpression,\n call: N.CallExpression,\n ): N.ArrowFunctionExpression {\n if (this.match(tt.colon)) {\n node.returnType = this.tsParseTypeAnnotation();\n }\n return super.parseAsyncArrowFromCallExpression(node, call);\n }\n\n parseMaybeAssign(\n refExpressionErrors?: ExpressionErrors | null,\n afterLeftParse?: Function,\n ): N.Expression {\n // Note: When the JSX plugin is on, type assertions (`<T> x`) aren't valid syntax.\n\n let state: State | undefined | null;\n let jsx;\n let typeCast;\n\n if (\n this.hasPlugin(\"jsx\") &&\n (this.match(tt.jsxTagStart) || this.match(tt.lt))\n ) {\n // Prefer to parse JSX if possible. But may be an arrow fn.\n state = this.state.clone();\n\n jsx = this.tryParse(\n () => super.parseMaybeAssign(refExpressionErrors, afterLeftParse),\n state,\n );\n\n /*:: invariant(!jsx.aborted) */\n /*:: invariant(jsx.node != null) */\n if (!jsx.error) return jsx.node;\n\n // Remove `tc.j_expr` or `tc.j_oTag` from context added\n // by parsing `jsxTagStart` to stop the JSX plugin from\n // messing with the tokens\n const { context } = this.state;\n const currentContext = context[context.length - 1];\n if (currentContext === tc.j_oTag || currentContext === tc.j_expr) {\n context.pop();\n }\n }\n\n if (!jsx?.error && !this.match(tt.lt)) {\n return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);\n }\n\n // Either way, we're looking at a '<': tt.jsxTagStart or relational.\n\n // If the state was cloned in the JSX parsing branch above but there\n // have been any error in the tryParse call, this.state is set to state\n // so we still need to clone it.\n if (!state || state === this.state) state = this.state.clone();\n\n let typeParameters: N.TsTypeParameterDeclaration | undefined | null;\n const arrow = this.tryParse(abort => {\n // This is similar to TypeScript's `tryParseParenthesizedArrowFunctionExpression`.\n typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier);\n const expr = super.parseMaybeAssign(\n refExpressionErrors,\n afterLeftParse,\n );\n\n if (\n expr.type !== \"ArrowFunctionExpression\" ||\n expr.extra?.parenthesized\n ) {\n abort();\n }\n\n // Correct TypeScript code should have at least 1 type parameter, but don't crash on bad code.\n if (typeParameters?.params.length !== 0) {\n this.resetStartLocationFromNode(expr, typeParameters);\n }\n expr.typeParameters = typeParameters;\n\n if (process.env.BABEL_8_BREAKING) {\n if (\n this.hasPlugin(\"jsx\") &&\n expr.typeParameters.params.length === 1 &&\n !expr.typeParameters.extra?.trailingComma\n ) {\n // report error if single type parameter used without trailing comma.\n const parameter = expr.typeParameters.params[0];\n if (!parameter.constraint) {\n // A single type parameter must either have constraints\n // or a trailing comma, otherwise it's ambiguous with JSX.\n this.raise(TSErrors.SingleTypeParameterWithoutTrailingComma, {\n at: createPositionWithColumnOffset(parameter.loc.end, 1),\n typeParameterName: parameter.name.name,\n });\n }\n }\n }\n\n return expr;\n }, state);\n\n /*:: invariant(arrow.node != null) */\n if (!arrow.error && !arrow.aborted) {\n // This error is reported outside of the this.tryParse call so that\n // in case of <T>(x) => 2, we don't consider <T>(x) as a type assertion\n // because of this error.\n if (typeParameters) this.reportReservedArrowTypeParam(typeParameters);\n // @ts-expect-error refine typings\n return arrow.node;\n }\n\n if (!jsx) {\n // Try parsing a type cast instead of an arrow function.\n // This will never happen outside of JSX.\n // (Because in JSX the '<' should be a jsxTagStart and not a relational.\n assert(!this.hasPlugin(\"jsx\"));\n\n // This will start with a type assertion (via parseMaybeUnary).\n // But don't directly call `this.tsParseTypeAssertion` because we want to handle any binary after it.\n typeCast = this.tryParse(\n () => super.parseMaybeAssign(refExpressionErrors, afterLeftParse),\n state,\n );\n /*:: invariant(!typeCast.aborted) */\n /*:: invariant(typeCast.node != null) */\n if (!typeCast.error) return typeCast.node;\n }\n\n if (jsx?.node) {\n /*:: invariant(jsx.failState) */\n this.state = jsx.failState;\n return jsx.node;\n }\n\n if (arrow.node) {\n /*:: invariant(arrow.failState) */\n this.state = arrow.failState;\n if (typeParameters) this.reportReservedArrowTypeParam(typeParameters);\n // @ts-expect-error refine typings\n return arrow.node;\n }\n\n if (typeCast?.node) {\n /*:: invariant(typeCast.failState) */\n this.state = typeCast.failState;\n return typeCast.node;\n }\n\n throw jsx?.error || arrow.error || typeCast?.error;\n }\n\n reportReservedArrowTypeParam(node: any) {\n if (\n node.params.length === 1 &&\n !node.params[0].constraint &&\n !node.extra?.trailingComma &&\n this.getPluginOption(\"typescript\", \"disallowAmbiguousJSXLike\")\n ) {\n this.raise(TSErrors.ReservedArrowTypeParam, { at: node });\n }\n }\n\n // Handle type assertions\n parseMaybeUnary(\n refExpressionErrors?: ExpressionErrors | null,\n sawUnary?: boolean,\n ): N.Expression {\n if (!this.hasPlugin(\"jsx\") && this.match(tt.lt)) {\n return this.tsParseTypeAssertion();\n }\n return super.parseMaybeUnary(refExpressionErrors, sawUnary);\n }\n\n parseArrow(\n node: Undone<N.ArrowFunctionExpression>,\n ): Undone<N.ArrowFunctionExpression> | undefined | null {\n if (this.match(tt.colon)) {\n // This is different from how the TS parser does it.\n // TS uses lookahead. The Babel Parser parses it as a parenthesized expression and converts.\n\n const result = this.tryParse(abort => {\n const returnType = this.tsParseTypeOrTypePredicateAnnotation(\n tt.colon,\n );\n if (this.canInsertSemicolon() || !this.match(tt.arrow)) abort();\n return returnType;\n });\n\n if (result.aborted) return;\n\n if (!result.thrown) {\n if (result.error) this.state = result.failState;\n // @ts-expect-error refine typings\n node.returnType = result.node;\n }\n }\n\n return super.parseArrow(node);\n }\n\n // Allow type annotations inside of a parameter list.\n parseAssignableListItemTypes(\n param: N.Pattern,\n flags: ParseBindingListFlags,\n ) {\n if (!(flags & ParseBindingListFlags.IS_FUNCTION_PARAMS)) return param;\n\n if (this.eat(tt.question)) {\n (param as any as N.Identifier).optional = true;\n }\n const type = this.tsTryParseTypeAnnotation();\n if (type) param.typeAnnotation = type;\n this.resetEndLocation(param);\n\n return param;\n }\n\n isAssignable(node: N.Node, isBinding?: boolean): boolean {\n switch (node.type) {\n case \"TSTypeCastExpression\":\n return this.isAssignable(node.expression, isBinding);\n case \"TSParameterProperty\":\n return true;\n default:\n return super.isAssignable(node, isBinding);\n }\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): void {\n switch (node.type) {\n case \"ParenthesizedExpression\":\n this.toAssignableParenthesizedExpression(node, isLHS);\n break;\n case \"TSAsExpression\":\n case \"TSSatisfiesExpression\":\n case \"TSNonNullExpression\":\n case \"TSTypeAssertion\":\n if (isLHS) {\n this.expressionScope.recordArrowParameterBindingError(\n TSErrors.UnexpectedTypeCastInParameter,\n { at: node },\n );\n } else {\n this.raise(TSErrors.UnexpectedTypeCastInParameter, { at: node });\n }\n this.toAssignable(node.expression, isLHS);\n break;\n case \"AssignmentExpression\":\n if (!isLHS && node.left.type === \"TSTypeCastExpression\") {\n node.left = this.typeCastToParameter(node.left);\n }\n /* fall through */\n default:\n super.toAssignable(node, isLHS);\n }\n }\n\n toAssignableParenthesizedExpression(node: N.Node, isLHS: boolean): void {\n switch (node.expression.type) {\n case \"TSAsExpression\":\n case \"TSSatisfiesExpression\":\n case \"TSNonNullExpression\":\n case \"TSTypeAssertion\":\n case \"ParenthesizedExpression\":\n this.toAssignable(node.expression, isLHS);\n break;\n default:\n super.toAssignable(node, isLHS);\n }\n }\n\n checkToRestConversion(node: N.Node, allowPattern: boolean): void {\n switch (node.type) {\n case \"TSAsExpression\":\n case \"TSSatisfiesExpression\":\n case \"TSTypeAssertion\":\n case \"TSNonNullExpression\":\n this.checkToRestConversion(node.expression, false);\n break;\n default:\n super.checkToRestConversion(node, allowPattern);\n }\n }\n\n // @ts-expect-error plugin overrides interfaces\n isValidLVal(\n type:\n | \"TSTypeCastExpression\"\n | \"TSParameterProperty\"\n | \"TSNonNullExpression\"\n | \"TSAsExpression\"\n | \"TSSatisfiesExpression\"\n | \"TSTypeAssertion\",\n isUnparenthesizedInAssign: boolean,\n binding: BindingTypes,\n ) {\n return (\n getOwn(\n {\n // Allow \"typecasts\" to appear on the left of assignment expressions,\n // because it may be in an arrow function.\n // e.g. `const f = (foo: number = 0) => foo;`\n TSTypeCastExpression: true,\n TSParameterProperty: \"parameter\",\n TSNonNullExpression: \"expression\",\n TSAsExpression: (binding !== BIND_NONE ||\n !isUnparenthesizedInAssign) && [\"expression\", true],\n TSSatisfiesExpression: (binding !== BIND_NONE ||\n !isUnparenthesizedInAssign) && [\"expression\", true],\n TSTypeAssertion: (binding !== BIND_NONE ||\n !isUnparenthesizedInAssign) && [\"expression\", true],\n },\n type,\n ) || super.isValidLVal(type, isUnparenthesizedInAssign, binding)\n );\n }\n\n parseBindingAtom(): N.Pattern {\n if (this.state.type === tt._this) {\n return this.parseIdentifier(/* liberal */ true);\n }\n return super.parseBindingAtom();\n }\n\n parseMaybeDecoratorArguments(expr: N.Expression): N.Expression {\n // handles `@f<<T>`\n if (this.match(tt.lt) || this.match(tt.bitShiftL)) {\n const typeArguments = this.tsParseTypeArgumentsInExpression();\n\n if (this.match(tt.parenL)) {\n const call = super.parseMaybeDecoratorArguments(expr);\n call.typeParameters = typeArguments;\n return call;\n }\n\n this.unexpected(null, tt.parenL);\n }\n\n return super.parseMaybeDecoratorArguments(expr);\n }\n\n checkCommaAfterRest(\n close: (typeof charCodes)[keyof typeof charCodes],\n ): boolean {\n if (\n this.state.isAmbientContext &&\n this.match(tt.comma) &&\n this.lookaheadCharCode() === close\n ) {\n this.next();\n return false;\n }\n return super.checkCommaAfterRest(close);\n }\n\n // === === === === === === === === === === === === === === === ===\n // Note: All below methods are duplicates of something in flow.js.\n // Not sure what the best way to combine these is.\n // === === === === === === === === === === === === === === === ===\n\n isClassMethod(): boolean {\n return this.match(tt.lt) || super.isClassMethod();\n }\n\n isClassProperty(): boolean {\n return (\n this.match(tt.bang) || this.match(tt.colon) || super.isClassProperty()\n );\n }\n\n parseMaybeDefault(\n startLoc?: Position | null,\n left?: Pattern | null,\n ): N.Pattern {\n const node = super.parseMaybeDefault(startLoc, left);\n\n if (\n node.type === \"AssignmentPattern\" &&\n node.typeAnnotation &&\n node.right.start < node.typeAnnotation.start\n ) {\n this.raise(TSErrors.TypeAnnotationAfterAssign, {\n at: node.typeAnnotation,\n });\n }\n\n return node;\n }\n\n // ensure that inside types, we bypass the jsx parser plugin\n getTokenFromCode(code: number): void {\n if (this.state.inType) {\n if (code === charCodes.greaterThan) {\n this.finishOp(tt.gt, 1);\n return;\n }\n if (code === charCodes.lessThan) {\n this.finishOp(tt.lt, 1);\n return;\n }\n }\n super.getTokenFromCode(code);\n }\n\n // used after we have finished parsing types\n reScan_lt_gt() {\n const { type } = this.state;\n if (type === tt.lt) {\n this.state.pos -= 1;\n this.readToken_lt();\n } else if (type === tt.gt) {\n this.state.pos -= 1;\n this.readToken_gt();\n }\n }\n\n reScan_lt() {\n const { type } = this.state;\n if (type === tt.bitShiftL) {\n this.state.pos -= 2;\n this.finishOp(tt.lt, 1);\n return tt.lt;\n }\n return type;\n }\n\n toAssignableList(\n exprList: Expression[],\n trailingCommaLoc: Position | undefined | null,\n isLHS: boolean,\n ): void {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if (expr?.type === \"TSTypeCastExpression\") {\n exprList[i] = this.typeCastToParameter(\n expr as N.TsTypeCastExpression,\n );\n }\n }\n super.toAssignableList(exprList, trailingCommaLoc, isLHS);\n }\n\n typeCastToParameter(node: N.TsTypeCastExpression): N.Node {\n node.expression.typeAnnotation = node.typeAnnotation;\n\n this.resetEndLocation(node.expression, node.typeAnnotation.loc.end);\n\n return node.expression;\n }\n\n shouldParseArrow(params: Array<N.Node>) {\n if (this.match(tt.colon)) {\n return params.every(expr => this.isAssignable(expr, true));\n }\n return super.shouldParseArrow(params);\n }\n\n shouldParseAsyncArrow(): boolean {\n return this.match(tt.colon) || super.shouldParseAsyncArrow();\n }\n\n canHaveLeadingDecorator() {\n // Avoid unnecessary lookahead in checking for abstract class unless needed!\n return super.canHaveLeadingDecorator() || this.isAbstractClass();\n }\n\n jsxParseOpeningElementAfterName(\n node: N.JSXOpeningElement,\n ): N.JSXOpeningElement {\n // handles `<Component<<T>`\n if (this.match(tt.lt) || this.match(tt.bitShiftL)) {\n const typeArguments = this.tsTryParseAndCatch(() =>\n // @ts-expect-error: refine typings\n this.tsParseTypeArgumentsInExpression(),\n );\n // @ts-expect-error: refine typings\n if (typeArguments) node.typeParameters = typeArguments;\n }\n return super.jsxParseOpeningElementAfterName(node);\n }\n\n getGetterSetterExpectedParamCount(\n method: N.ObjectMethod | N.ClassMethod,\n ): number {\n const baseCount = super.getGetterSetterExpectedParamCount(method);\n const params = this.getObjectOrClassMethodParams(method);\n const firstParam = params[0];\n const hasContextParam = firstParam && this.isThisParam(firstParam);\n\n return hasContextParam ? baseCount + 1 : baseCount;\n }\n\n parseCatchClauseParam(): N.Pattern {\n const param = super.parseCatchClauseParam();\n const type = this.tsTryParseTypeAnnotation();\n\n if (type) {\n param.typeAnnotation = type;\n this.resetEndLocation(param);\n }\n\n return param;\n }\n\n tsInAmbientContext<T>(cb: () => T): T {\n const oldIsAmbientContext = this.state.isAmbientContext;\n this.state.isAmbientContext = true;\n try {\n return cb();\n } finally {\n this.state.isAmbientContext = oldIsAmbientContext;\n }\n }\n\n parseClass<T extends N.Class>(\n node: Undone<T>,\n isStatement: boolean,\n optionalId?: boolean,\n ): T {\n const oldInAbstractClass = this.state.inAbstractClass;\n this.state.inAbstractClass = !!(node as any).abstract;\n try {\n return super.parseClass(node, isStatement, optionalId);\n } finally {\n this.state.inAbstractClass = oldInAbstractClass;\n }\n }\n\n tsParseAbstractDeclaration(\n node: any,\n decorators: N.Decorator[] | null,\n ): N.ClassDeclaration | N.TsInterfaceDeclaration | undefined | null {\n if (this.match(tt._class)) {\n node.abstract = true;\n return this.maybeTakeDecorators(\n decorators,\n this.parseClass<N.ClassDeclaration>(\n node as N.ClassDeclaration,\n /* isStatement */ true,\n /* optionalId */ false,\n ),\n );\n } else if (this.isContextual(tt._interface)) {\n // for invalid abstract interface\n\n // To avoid\n // abstract interface\n // Foo {}\n if (!this.hasFollowingLineBreak()) {\n node.abstract = true;\n this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, {\n at: node,\n });\n return this.tsParseInterfaceDeclaration(\n node as N.TsInterfaceDeclaration,\n );\n }\n } else {\n this.unexpected(null, tt._class);\n }\n }\n\n parseMethod<\n T extends N.ObjectMethod | N.ClassMethod | N.ClassPrivateMethod,\n >(\n node: Undone<T>,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowDirectSuper: boolean,\n type: T[\"type\"],\n inClassScope?: boolean,\n ) {\n const method = super.parseMethod<T>(\n node,\n isGenerator,\n isAsync,\n isConstructor,\n allowDirectSuper,\n type,\n inClassScope,\n );\n // @ts-expect-error todo(flow->ts) property not defined for all types in union\n if (method.abstract) {\n const hasBody = this.hasPlugin(\"estree\")\n ? // @ts-expect-error estree typings\n !!method.value.body\n : !!method.body;\n if (hasBody) {\n const { key } = method;\n this.raise(TSErrors.AbstractMethodHasImplementation, {\n at: method,\n methodName:\n key.type === \"Identifier\" && !method.computed\n ? key.name\n : `[${this.input.slice(key.start, key.end)}]`,\n });\n }\n }\n return method;\n }\n\n tsParseTypeParameterName(): N.Identifier | string {\n const typeName: N.Identifier = this.parseIdentifier();\n return process.env.BABEL_8_BREAKING ? typeName : typeName.name;\n }\n\n shouldParseAsAmbientContext(): boolean {\n return !!this.getPluginOption(\"typescript\", \"dts\");\n }\n\n parse() {\n if (this.shouldParseAsAmbientContext()) {\n this.state.isAmbientContext = true;\n }\n return super.parse();\n }\n\n getExpression() {\n if (this.shouldParseAsAmbientContext()) {\n this.state.isAmbientContext = true;\n }\n return super.getExpression();\n }\n\n parseExportSpecifier(\n node: Undone<N.ExportSpecifier>,\n isString: boolean,\n isInTypeExport: boolean,\n isMaybeTypeOnly: boolean,\n ) {\n if (!isString && isMaybeTypeOnly) {\n this.parseTypeOnlyImportExportSpecifier(\n node,\n /* isImport */ false,\n isInTypeExport,\n );\n return this.finishNode<N.ExportSpecifier>(node, \"ExportSpecifier\");\n }\n node.exportKind = \"value\";\n return super.parseExportSpecifier(\n node,\n isString,\n isInTypeExport,\n isMaybeTypeOnly,\n );\n }\n\n parseImportSpecifier(\n specifier: Undone<N.ImportSpecifier>,\n importedIsString: boolean,\n isInTypeOnlyImport: boolean,\n isMaybeTypeOnly: boolean,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n bindingType: BindingTypes | undefined,\n ): N.ImportSpecifier {\n if (!importedIsString && isMaybeTypeOnly) {\n this.parseTypeOnlyImportExportSpecifier(\n specifier,\n /* isImport */ true,\n isInTypeOnlyImport,\n );\n return this.finishNode<N.ImportSpecifier>(specifier, \"ImportSpecifier\");\n }\n specifier.importKind = \"value\";\n return super.parseImportSpecifier(\n specifier,\n importedIsString,\n isInTypeOnlyImport,\n isMaybeTypeOnly,\n isInTypeOnlyImport ? BIND_TS_TYPE_IMPORT : BIND_FLAGS_TS_IMPORT,\n );\n }\n\n parseTypeOnlyImportExportSpecifier(\n node: any,\n isImport: boolean,\n isInTypeOnlyImportExport: boolean,\n ): void {\n const leftOfAsKey = isImport ? \"imported\" : \"local\";\n const rightOfAsKey = isImport ? \"local\" : \"exported\";\n\n let leftOfAs = node[leftOfAsKey];\n let rightOfAs;\n\n let hasTypeSpecifier = false;\n let canParseAsKeyword = true;\n\n const loc = leftOfAs.loc.start;\n\n // https://github.com/microsoft/TypeScript/blob/fc4f9d83d5939047aa6bb2a43965c6e9bbfbc35b/src/compiler/parser.ts#L7411-L7456\n // import { type } from \"mod\"; - hasTypeSpecifier: false, leftOfAs: type\n // import { type as } from \"mod\"; - hasTypeSpecifier: true, leftOfAs: as\n // import { type as as } from \"mod\"; - hasTypeSpecifier: false, leftOfAs: type, rightOfAs: as\n // import { type as as as } from \"mod\"; - hasTypeSpecifier: true, leftOfAs: as, rightOfAs: as\n if (this.isContextual(tt._as)) {\n // { type as ...? }\n const firstAs = this.parseIdentifier();\n if (this.isContextual(tt._as)) {\n // { type as as ...? }\n const secondAs = this.parseIdentifier();\n if (tokenIsKeywordOrIdentifier(this.state.type)) {\n // { type as as something }\n hasTypeSpecifier = true;\n leftOfAs = firstAs;\n rightOfAs = isImport\n ? this.parseIdentifier()\n : this.parseModuleExportName();\n canParseAsKeyword = false;\n } else {\n // { type as as }\n rightOfAs = secondAs;\n canParseAsKeyword = false;\n }\n } else if (tokenIsKeywordOrIdentifier(this.state.type)) {\n // { type as something }\n canParseAsKeyword = false;\n rightOfAs = isImport\n ? this.parseIdentifier()\n : this.parseModuleExportName();\n } else {\n // { type as }\n hasTypeSpecifier = true;\n leftOfAs = firstAs;\n }\n } else if (tokenIsKeywordOrIdentifier(this.state.type)) {\n // { type something ...? }\n hasTypeSpecifier = true;\n if (isImport) {\n leftOfAs = this.parseIdentifier(true);\n if (!this.isContextual(tt._as)) {\n this.checkReservedWord(\n leftOfAs.name,\n leftOfAs.loc.start,\n true,\n true,\n );\n }\n } else {\n leftOfAs = this.parseModuleExportName();\n }\n }\n if (hasTypeSpecifier && isInTypeOnlyImportExport) {\n this.raise(\n isImport\n ? TSErrors.TypeModifierIsUsedInTypeImports\n : TSErrors.TypeModifierIsUsedInTypeExports,\n { at: loc },\n );\n }\n\n node[leftOfAsKey] = leftOfAs;\n node[rightOfAsKey] = rightOfAs;\n\n const kindKey = isImport ? \"importKind\" : \"exportKind\";\n node[kindKey] = hasTypeSpecifier ? \"type\" : \"value\";\n\n if (canParseAsKeyword && this.eatContextual(tt._as)) {\n node[rightOfAsKey] = isImport\n ? this.parseIdentifier()\n : this.parseModuleExportName();\n }\n if (!node[rightOfAsKey]) {\n node[rightOfAsKey] = cloneIdentifier(node[leftOfAsKey]);\n }\n if (isImport) {\n this.checkIdentifier(\n node[rightOfAsKey],\n hasTypeSpecifier ? BIND_TS_TYPE_IMPORT : BIND_FLAGS_TS_IMPORT,\n );\n }\n }\n };\n\nfunction isPossiblyLiteralEnum(expression: N.Expression): boolean {\n if (expression.type !== \"MemberExpression\") return false;\n\n const { computed, property } = expression;\n\n if (\n computed &&\n property.type !== \"StringLiteral\" &&\n (property.type !== \"TemplateLiteral\" || property.expressions.length > 0)\n ) {\n return false;\n }\n\n return isUncomputedMemberExpressionChain(expression.object);\n}\n\n// If a const declaration has no type annotation and is initialized to\n// a string literal, numeric literal, or enum reference, then it is\n// allowed. In an ideal world, we'd check whether init was *actually* an\n// enum reference, but we allow anything that \"could be\" a literal enum\n// in `isPossiblyLiteralEnum` since we don't have all the information\n// that the typescript compiler has.\nfunction isValidAmbientConstInitializer(\n expression: N.Expression,\n estree: boolean,\n): boolean {\n const { type } = expression;\n if (expression.extra?.parenthesized) {\n return false;\n }\n if (estree) {\n if (type === \"Literal\") {\n const { value } = expression;\n if (typeof value === \"string\" || typeof value === \"boolean\") {\n return true;\n }\n }\n } else {\n if (type === \"StringLiteral\" || type === \"BooleanLiteral\") {\n return true;\n }\n }\n if (isNumber(expression, estree) || isNegativeNumber(expression, estree)) {\n return true;\n }\n if (type === \"TemplateLiteral\" && expression.expressions.length === 0) {\n return true;\n }\n if (isPossiblyLiteralEnum(expression)) {\n return true;\n }\n return false;\n}\n\nfunction isNumber(expression: N.Expression, estree: boolean): boolean {\n if (estree) {\n return (\n expression.type === \"Literal\" &&\n (typeof expression.value === \"number\" || \"bigint\" in expression)\n );\n }\n return (\n expression.type === \"NumericLiteral\" || expression.type === \"BigIntLiteral\"\n );\n}\n\nfunction isNegativeNumber(expression: N.Expression, estree: boolean): boolean {\n if (expression.type === \"UnaryExpression\") {\n const { operator, argument } = expression as N.UnaryExpression;\n if (operator === \"-\" && isNumber(argument, estree)) {\n return true;\n }\n }\n return false;\n}\n\nfunction isUncomputedMemberExpressionChain(expression: N.Expression): boolean {\n if (expression.type === \"Identifier\") return true;\n if (expression.type !== \"MemberExpression\" || expression.computed) {\n return false;\n }\n\n return isUncomputedMemberExpressionChain(expression.object);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAWA,IAAAC,QAAA,GAAAD,OAAA;AAGA,IAAAE,SAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AAeA,IAAAI,MAAA,GAAAJ,OAAA;AAIA,IAAAK,oBAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AAIA,IAAAQ,KAAA,GAAAR,OAAA;AAEA,MAAMS,MAAM,GAAGA,CAAeC,MAAS,EAAEC,GAAY,KACnDC,MAAM,CAACC,cAAc,CAACC,IAAI,CAACJ,MAAM,EAAEC,GAAG,CAAC,IAAID,MAAM,CAACC,GAAG,CAAC;AAYxD,SAASI,OAAOA,CAAIC,CAAY,EAAK;EACnC,IAAIA,CAAC,IAAI,IAAI,EAAE;IACb,MAAM,IAAIC,KAAK,CAAE,cAAaD,CAAE,SAAQ,CAAC;EAC3C;EACA,OAAOA,CAAC;AACV;AAEA,SAASE,MAAMA,CAACF,CAAU,EAAQ;EAChC,IAAI,CAACA,CAAC,EAAE;IACN,MAAM,IAAIC,KAAK,CAAC,aAAa,CAAC;EAChC;AACF;AAgBA,MAAME,QAAQ,GAAG,IAAAC,0BAAc,CAAC,YAAW,CAAC;EAC1CC,+BAA+B,EAAEA,CAAC;IAAEC;EAAmC,CAAC,KACrE,WAAUA,UAAW,gEAA+D;EACvFC,8BAA8B,EAAEA,CAAC;IAC/BC;EAGF,CAAC,KACE,aAAYA,YAAa,6DAA4D;EACxFC,iCAAiC,EAC/B,6DAA6D;EAC/DC,+BAA+B,EAAE,0CAA0C;EAC3EC,wBAAwB,EACtB,qDAAqD;EACvDC,qBAAqB,EAAE,mDAAmD;EAC1EC,sBAAsB,EAAE,oDAAoD;EAC5EC,mEAAmE,EACjE,4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Ae;AAE/E;AAEA,SAASslB,gBAAgBA,CAAC5V,UAAwB,EAAEyV,MAAe,EAAW;EAC5E,IAAIzV,UAAU,CAAC1P,IAAI,KAAK,iBAAiB,EAAE;IACzC,MAAM;MAAE+M,QAAQ;MAAE1I;IAAS,CAAC,GAAGqL,UAA+B;IAC9D,IAAI3C,QAAQ,KAAK,GAAG,IAAIsY,QAAQ,CAAChhB,QAAQ,EAAE8gB,MAAM,CAAC,EAAE;MAClD,OAAO,IAAI;IACb;EACF;EACA,OAAO,KAAK;AACd;AAEA,SAASD,iCAAiCA,CAACxV,UAAwB,EAAW;EAC5E,IAAIA,UAAU,CAAC1P,IAAI,KAAK,YAAY,EAAE,OAAO,IAAI;EACjD,IAAI0P,UAAU,CAAC1P,IAAI,KAAK,kBAAkB,IAAI0P,UAAU,CAACzG,QAAQ,EAAE;IACjE,OAAO,KAAK;EACd;EAEA,OAAOic,iCAAiC,CAACxV,UAAU,CAAC3U,MAAM,CAAC;AAC7D"} lib/plugins/typescript/scope.js 0000644 00000007071 15120211212 0012640 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _scope = require("../../util/scope"); var _scopeflags = require("../../util/scopeflags"); var _parseError = require("../../parse-error"); class TypeScriptScope extends _scope.Scope { constructor(...args) { super(...args); this.types = new Set(); this.enums = new Set(); this.constEnums = new Set(); this.classes = new Set(); this.exportOnlyBindings = new Set(); } } class TypeScriptScopeHandler extends _scope.default { constructor(...args) { super(...args); this.importsStack = []; } createScope(flags) { this.importsStack.push(new Set()); return new TypeScriptScope(flags); } enter(flags) { if (flags == _scopeflags.SCOPE_TS_MODULE) { this.importsStack.push(new Set()); } super.enter(flags); } exit() { const flags = super.exit(); if (flags == _scopeflags.SCOPE_TS_MODULE) { this.importsStack.pop(); } return flags; } hasImport(name, allowShadow) { const len = this.importsStack.length; if (this.importsStack[len - 1].has(name)) { return true; } if (!allowShadow && len > 1) { for (let i = 0; i < len - 1; i++) { if (this.importsStack[i].has(name)) return true; } } return false; } declareName(name, bindingType, loc) { if (bindingType & _scopeflags.BIND_FLAGS_TS_IMPORT) { if (this.hasImport(name, true)) { this.parser.raise(_parseError.Errors.VarRedeclaration, { at: loc, identifierName: name }); } this.importsStack[this.importsStack.length - 1].add(name); return; } const scope = this.currentScope(); if (bindingType & _scopeflags.BIND_FLAGS_TS_EXPORT_ONLY) { this.maybeExportDefined(scope, name); scope.exportOnlyBindings.add(name); return; } super.declareName(name, bindingType, loc); if (bindingType & _scopeflags.BIND_KIND_TYPE) { if (!(bindingType & _scopeflags.BIND_KIND_VALUE)) { this.checkRedeclarationInScope(scope, name, bindingType, loc); this.maybeExportDefined(scope, name); } scope.types.add(name); } if (bindingType & _scopeflags.BIND_FLAGS_TS_ENUM) scope.enums.add(name); if (bindingType & _scopeflags.BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.add(name); if (bindingType & _scopeflags.BIND_FLAGS_CLASS) scope.classes.add(name); } isRedeclaredInScope(scope, name, bindingType) { if (scope.enums.has(name)) { if (bindingType & _scopeflags.BIND_FLAGS_TS_ENUM) { const isConst = !!(bindingType & _scopeflags.BIND_FLAGS_TS_CONST_ENUM); const wasConst = scope.constEnums.has(name); return isConst !== wasConst; } return true; } if (bindingType & _scopeflags.BIND_FLAGS_CLASS && scope.classes.has(name)) { if (scope.lexical.has(name)) { return !!(bindingType & _scopeflags.BIND_KIND_VALUE); } else { return false; } } if (bindingType & _scopeflags.BIND_KIND_TYPE && scope.types.has(name)) { return true; } return super.isRedeclaredInScope(scope, name, bindingType); } checkLocalExport(id) { const { name } = id; if (this.hasImport(name)) return; const len = this.scopeStack.length; for (let i = len - 1; i >= 0; i--) { const scope = this.scopeStack[i]; if (scope.types.has(name) || scope.exportOnlyBindings.has(name)) return; } super.checkLocalExport(id); } } exports.default = TypeScriptScopeHandler; //# sourceMappingURL=scope.js.map lib/plugins/typescript/scope.js.map 0000644 00000022467 15120211212 0013422 0 ustar 00 {"version":3,"names":["_scope","require","_scopeflags","_parseError","TypeScriptScope","Scope","constructor","args","types","Set","enums","constEnums","classes","exportOnlyBindings","TypeScriptScopeHandler","ScopeHandler","importsStack","createScope","flags","push","enter","SCOPE_TS_MODULE","exit","pop","hasImport","name","allowShadow","len","length","has","i","declareName","bindingType","loc","BIND_FLAGS_TS_IMPORT","parser","raise","Errors","VarRedeclaration","at","identifierName","add","scope","currentScope","BIND_FLAGS_TS_EXPORT_ONLY","maybeExportDefined","BIND_KIND_TYPE","BIND_KIND_VALUE","checkRedeclarationInScope","BIND_FLAGS_TS_ENUM","BIND_FLAGS_TS_CONST_ENUM","BIND_FLAGS_CLASS","isRedeclaredInScope","isConst","wasConst","lexical","checkLocalExport","id","scopeStack","exports","default"],"sources":["../../../src/plugins/typescript/scope.ts"],"sourcesContent":["import type { Position } from \"../../util/location\";\nimport ScopeHandler, { Scope } from \"../../util/scope\";\nimport {\n BIND_KIND_TYPE,\n BIND_FLAGS_TS_ENUM,\n BIND_FLAGS_TS_CONST_ENUM,\n BIND_FLAGS_TS_EXPORT_ONLY,\n BIND_KIND_VALUE,\n BIND_FLAGS_CLASS,\n type ScopeFlags,\n type BindingTypes,\n BIND_FLAGS_TS_IMPORT,\n SCOPE_TS_MODULE,\n} from \"../../util/scopeflags\";\nimport type * as N from \"../../types\";\nimport { Errors } from \"../../parse-error\";\n\nclass TypeScriptScope extends Scope {\n types: Set<string> = new Set();\n\n // enums (which are also in .types)\n enums: Set<string> = new Set();\n\n // const enums (which are also in .enums and .types)\n constEnums: Set<string> = new Set();\n\n // classes (which are also in .lexical) and interface (which are also in .types)\n classes: Set<string> = new Set();\n\n // namespaces and ambient functions (or classes) are too difficult to track,\n // especially without type analysis.\n // We need to track them anyway, to avoid \"X is not defined\" errors\n // when exporting them.\n exportOnlyBindings: Set<string> = new Set();\n}\n\n// See https://github.com/babel/babel/pull/9766#discussion_r268920730 for an\n// explanation of how typescript handles scope.\n\nexport default class TypeScriptScopeHandler extends ScopeHandler<TypeScriptScope> {\n importsStack: Set<string>[] = [];\n\n createScope(flags: ScopeFlags): TypeScriptScope {\n this.importsStack.push(new Set()); // Always keep the top-level scope for export checks.\n\n return new TypeScriptScope(flags);\n }\n\n enter(flags: number): void {\n if (flags == SCOPE_TS_MODULE) {\n this.importsStack.push(new Set());\n }\n\n super.enter(flags);\n }\n\n exit() {\n const flags = super.exit();\n\n if (flags == SCOPE_TS_MODULE) {\n this.importsStack.pop();\n }\n\n return flags;\n }\n\n hasImport(name: string, allowShadow?: boolean) {\n const len = this.importsStack.length;\n if (this.importsStack[len - 1].has(name)) {\n return true;\n }\n if (!allowShadow && len > 1) {\n for (let i = 0; i < len - 1; i++) {\n if (this.importsStack[i].has(name)) return true;\n }\n }\n return false;\n }\n\n declareName(name: string, bindingType: BindingTypes, loc: Position) {\n if (bindingType & BIND_FLAGS_TS_IMPORT) {\n if (this.hasImport(name, true)) {\n this.parser.raise(Errors.VarRedeclaration, {\n at: loc,\n identifierName: name,\n });\n }\n this.importsStack[this.importsStack.length - 1].add(name);\n return;\n }\n\n const scope = this.currentScope();\n if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) {\n this.maybeExportDefined(scope, name);\n scope.exportOnlyBindings.add(name);\n return;\n }\n\n super.declareName(name, bindingType, loc);\n\n if (bindingType & BIND_KIND_TYPE) {\n if (!(bindingType & BIND_KIND_VALUE)) {\n // \"Value\" bindings have already been registered by the superclass.\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n this.maybeExportDefined(scope, name);\n }\n scope.types.add(name);\n }\n if (bindingType & BIND_FLAGS_TS_ENUM) scope.enums.add(name);\n if (bindingType & BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.add(name);\n if (bindingType & BIND_FLAGS_CLASS) scope.classes.add(name);\n }\n\n isRedeclaredInScope(\n scope: TypeScriptScope,\n name: string,\n bindingType: BindingTypes,\n ): boolean {\n if (scope.enums.has(name)) {\n if (bindingType & BIND_FLAGS_TS_ENUM) {\n // Enums can be merged with other enums if they are both\n // const or both non-const.\n const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM);\n const wasConst = scope.constEnums.has(name);\n return isConst !== wasConst;\n }\n return true;\n }\n if (bindingType & BIND_FLAGS_CLASS && scope.classes.has(name)) {\n if (scope.lexical.has(name)) {\n // Classes can be merged with interfaces\n return !!(bindingType & BIND_KIND_VALUE);\n } else {\n // Interface can be merged with other classes or interfaces\n return false;\n }\n }\n if (bindingType & BIND_KIND_TYPE && scope.types.has(name)) {\n return true;\n }\n\n return super.isRedeclaredInScope(scope, name, bindingType);\n }\n\n checkLocalExport(id: N.Identifier) {\n const { name } = id;\n\n if (this.hasImport(name)) return;\n\n const len = this.scopeStack.length;\n for (let i = len - 1; i >= 0; i--) {\n const scope = this.scopeStack[i];\n if (scope.types.has(name) || scope.exportOnlyBindings.has(name)) return;\n }\n\n super.checkLocalExport(id);\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAaA,IAAAE,WAAA,GAAAF,OAAA;AAEA,MAAMG,eAAe,SAASC,YAAK,CAAC;EAAAC,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAA,KAClCC,KAAK,GAAgB,IAAIC,GAAG,CAAC,CAAC;IAAA,KAG9BC,KAAK,GAAgB,IAAID,GAAG,CAAC,CAAC;IAAA,KAG9BE,UAAU,GAAgB,IAAIF,GAAG,CAAC,CAAC;IAAA,KAGnCG,OAAO,GAAgB,IAAIH,GAAG,CAAC,CAAC;IAAA,KAMhCI,kBAAkB,GAAgB,IAAIJ,GAAG,CAAC,CAAC;EAAA;AAC7C;AAKe,MAAMK,sBAAsB,SAASC,cAAY,CAAkB;EAAAT,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAA,KAChFS,YAAY,GAAkB,EAAE;EAAA;EAEhCC,WAAWA,CAACC,KAAiB,EAAmB;IAC9C,IAAI,CAACF,YAAY,CAACG,IAAI,CAAC,IAAIV,GAAG,CAAC,CA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AEA,KAAK,CAAC+B,gBAAgB,CAACC,EAAE,CAAC;EAC5B;AACF;AAACE,OAAA,CAAAC,OAAA,GAAA9C,sBAAA"} lib/plugins/v8intrinsic.js 0000644 00000001643 15120211212 0011600 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _types = require("../tokenizer/types"); var _default = superClass => class V8IntrinsicMixin extends superClass { parseV8Intrinsic() { if (this.match(54)) { const v8IntrinsicStartLoc = this.state.startLoc; const node = this.startNode(); this.next(); if ((0, _types.tokenIsIdentifier)(this.state.type)) { const name = this.parseIdentifierName(); const identifier = this.createIdentifier(node, name); identifier.type = "V8IntrinsicIdentifier"; if (this.match(10)) { return identifier; } } this.unexpected(v8IntrinsicStartLoc); } } parseExprAtom(refExpressionErrors) { return this.parseV8Intrinsic() || super.parseExprAtom(refExpressionErrors); } }; exports.default = _default; //# sourceMappingURL=v8intrinsic.js.map lib/plugins/v8intrinsic.js.map 0000644 00000005147 15120211212 0012357 0 ustar 00 {"version":3,"names":["_types","require","_default","superClass","V8IntrinsicMixin","parseV8Intrinsic","match","v8IntrinsicStartLoc","state","startLoc","node","startNode","next","tokenIsIdentifier","type","name","parseIdentifierName","identifier","createIdentifier","unexpected","parseExprAtom","refExpressionErrors","exports","default"],"sources":["../../src/plugins/v8intrinsic.ts"],"sourcesContent":["import type Parser from \"../parser\";\nimport { tokenIsIdentifier, tt } from \"../tokenizer/types\";\nimport type * as N from \"../types\";\nimport type { ExpressionErrors } from \"../parser/util\";\n\nexport default (superClass: typeof Parser) =>\n class V8IntrinsicMixin extends superClass implements Parser {\n parseV8Intrinsic(): N.Expression {\n if (this.match(tt.modulo)) {\n const v8IntrinsicStartLoc = this.state.startLoc;\n // let the `loc` of Identifier starts from `%`\n const node = this.startNode<N.Identifier>();\n this.next(); // eat '%'\n if (tokenIsIdentifier(this.state.type)) {\n const name = this.parseIdentifierName();\n const identifier = this.createIdentifier(node, name);\n // @ts-expect-error: avoid mutating AST types\n identifier.type = \"V8IntrinsicIdentifier\";\n if (this.match(tt.parenL)) {\n return identifier;\n }\n }\n this.unexpected(v8IntrinsicStartLoc);\n }\n }\n\n /* ============================================================ *\n * parser/expression.js *\n * ============================================================ */\n\n parseExprAtom(refExpressionErrors?: ExpressionErrors | null): N.Expression {\n return (\n this.parseV8Intrinsic() || super.parseExprAtom(refExpressionErrors)\n );\n }\n };\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAA2D,IAAAC,QAAA,GAI3CC,UAAyB,IACvC,MAAMC,gBAAgB,SAASD,UAAU,CAAmB;EAC1DE,gBAAgBA,CAAA,EAAiB;IAC/B,IAAI,IAAI,CAACC,KAAK,GAAU,CAAC,EAAE;MACzB,MAAMC,mBAAmB,GAAG,IAAI,CAACC,KAAK,CAACC,QAAQ;MAE/C,MAAMC,IAAI,GAAG,IAAI,CAACC,SAAS,CAAe,CAAC;MAC3C,IAAI,CAACC,IAAI,CAAC,CAAC;MACX,IAAI,IAAAC,wBAAiB,EAAC,IAAI,CAACL,KAAK,CAACM,IAAI,CAAC,EAAE;QACtC,MAAMC,IAAI,GAAG,IAAI,CAACC,mBAAmB,CAAC,CAAC;QACvC,MAAMC,UAAU,GAAG,IAAI,CAACC,gBAAgB,CAACR,IAAI,EAAEK,IAAI,CAAC;QAEpDE,UAAU,CAACH,IAAI,GAAG,uBAAuB;QACzC,IAAI,IAAI,CAACR,KAAK,GAAU,CAAC,EAAE;UACzB,OAAOW,UAAU;QACnB;MACF;MACA,IAAI,CAACE,UAAU,CAACZ,mBAAmB,CAAC;IACtC;EACF;EAMAa,aAAaA,CAACC,mBAA6C,EAAgB;IACzE,OACE,IAAI,CAAChB,gBAAgB,CAAC,CAAC,IAAI,KAAK,CAACe,aAAa,CAACC,mBAAmB,CAAC;EAEvE;AACF,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAArB,QAAA"} lib/tokenizer/context.js 0000644 00000001156 15120211212 0011334 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.types = exports.TokContext = void 0; class TokContext { constructor(token, preserveSpace) { this.token = void 0; this.preserveSpace = void 0; this.token = token; this.preserveSpace = !!preserveSpace; } } exports.TokContext = TokContext; const types = { brace: new TokContext("{"), j_oTag: new TokContext("<tag"), j_cTag: new TokContext("</tag"), j_expr: new TokContext("<tag>...</tag>", true) }; exports.types = types; { types.template = new TokContext("`", true); } //# sourceMappingURL=context.js.map lib/tokenizer/context.js.map 0000644 00000002727 15120211212 0012115 0 ustar 00 {"version":3,"names":["TokContext","constructor","token","preserveSpace","exports","types","brace","j_oTag","j_cTag","j_expr","template"],"sources":["../../src/tokenizer/context.ts"],"sourcesContent":["// The token context is used in JSX plugin to track\n// jsx tag / jsx text / normal JavaScript expression\n\nexport class TokContext {\n constructor(token: string, preserveSpace?: boolean) {\n this.token = token;\n this.preserveSpace = !!preserveSpace;\n }\n\n token: string;\n preserveSpace: boolean;\n}\n\nconst types: {\n [key: string]: TokContext;\n} = {\n brace: new TokContext(\"{\"), // normal JavaScript expression\n j_oTag: new TokContext(\"<tag\"), // JSX opening tag\n j_cTag: new TokContext(\"</tag\"), // JSX closing tag\n j_expr: new TokContext(\"<tag>...</tag>\", true), // JSX expressions\n};\n\nif (!process.env.BABEL_8_BREAKING) {\n types.template = new TokContext(\"`\", true);\n}\n\nexport { types };\n"],"mappings":";;;;;;AAGO,MAAMA,UAAU,CAAC;EACtBC,WAAWA,CAACC,KAAa,EAAEC,aAAuB,EAAE;IAAA,KAKpDD,KAAK;IAAA,KACLC,aAAa;IALX,IAAI,CAACD,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,aAAa,GAAG,CAAC,CAACA,aAAa;EACtC;AAIF;AAACC,OAAA,CAAAJ,UAAA,GAAAA,UAAA;AAED,MAAMK,KAEL,GAAG;EACFC,KAAK,EAAE,IAAIN,UAAU,CAAC,GAAG,CAAC;EAC1BO,MAAM,EAAE,IAAIP,UAAU,CAAC,MAAM,CAAC;EAC9BQ,MAAM,EAAE,IAAIR,UAAU,CAAC,OAAO,CAAC;EAC/BS,MAAM,EAAE,IAAIT,UAAU,CAAC,gBAAgB,EAAE,IAAI;AAC/C,CAAC;AAACI,OAAA,CAAAC,KAAA,GAAAA,KAAA;AAEiC;EACjCA,KAAK,CAACK,QAAQ,GAAG,IAAIV,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC;AAC5C"} lib/tokenizer/index.js 0000644 00000103207 15120211212 0010757 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.Token = void 0; var _location = require("../util/location"); var _comments = require("../parser/comments"); var _identifier = require("../util/identifier"); var _types = require("./types"); var _parseError = require("../parse-error"); var _whitespace = require("../util/whitespace"); var _state = require("./state"); var _helperStringParser = require("@babel/helper-string-parser"); const _excluded = ["at"], _excluded2 = ["at"]; function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function buildPosition(pos, lineStart, curLine) { return new _location.Position(curLine, pos - lineStart, pos); } const VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100, 118]); class Token { constructor(state) { this.type = state.type; this.value = state.value; this.start = state.start; this.end = state.end; this.loc = new _location.SourceLocation(state.startLoc, state.endLoc); } } exports.Token = Token; class Tokenizer extends _comments.default { constructor(options, input) { super(); this.isLookahead = void 0; this.tokens = []; this.errorHandlers_readInt = { invalidDigit: (pos, lineStart, curLine, radix) => { if (!this.options.errorRecovery) return false; this.raise(_parseError.Errors.InvalidDigit, { at: buildPosition(pos, lineStart, curLine), radix }); return true; }, numericSeparatorInEscapeSequence: this.errorBuilder(_parseError.Errors.NumericSeparatorInEscapeSequence), unexpectedNumericSeparator: this.errorBuilder(_parseError.Errors.UnexpectedNumericSeparator) }; this.errorHandlers_readCodePoint = Object.assign({}, this.errorHandlers_readInt, { invalidEscapeSequence: this.errorBuilder(_parseError.Errors.InvalidEscapeSequence), invalidCodePoint: this.errorBuilder(_parseError.Errors.InvalidCodePoint) }); this.errorHandlers_readStringContents_string = Object.assign({}, this.errorHandlers_readCodePoint, { strictNumericEscape: (pos, lineStart, curLine) => { this.recordStrictModeErrors(_parseError.Errors.StrictNumericEscape, { at: buildPosition(pos, lineStart, curLine) }); }, unterminated: (pos, lineStart, curLine) => { throw this.raise(_parseError.Errors.UnterminatedString, { at: buildPosition(pos - 1, lineStart, curLine) }); } }); this.errorHandlers_readStringContents_template = Object.assign({}, this.errorHandlers_readCodePoint, { strictNumericEscape: this.errorBuilder(_parseError.Errors.StrictNumericEscape), unterminated: (pos, lineStart, curLine) => { throw this.raise(_parseError.Errors.UnterminatedTemplate, { at: buildPosition(pos, lineStart, curLine) }); } }); this.state = new _state.default(); this.state.init(options); this.input = input; this.length = input.length; this.isLookahead = false; } pushToken(token) { this.tokens.length = this.state.tokensLength; this.tokens.push(token); ++this.state.tokensLength; } next() { this.checkKeywordEscapes(); if (this.options.tokens) { this.pushToken(new Token(this.state)); } this.state.lastTokStart = this.state.start; this.state.lastTokEndLoc = this.state.endLoc; this.state.lastTokStartLoc = this.state.startLoc; this.nextToken(); } eat(type) { if (this.match(type)) { this.next(); return true; } else { return false; } } match(type) { return this.state.type === type; } createLookaheadState(state) { return { pos: state.pos, value: null, type: state.type, start: state.start, end: state.end, context: [this.curContext()], inType: state.inType, startLoc: state.startLoc, lastTokEndLoc: state.lastTokEndLoc, curLine: state.curLine, lineStart: state.lineStart, curPosition: state.curPosition }; } lookahead() { const old = this.state; this.state = this.createLookaheadState(old); this.isLookahead = true; this.nextToken(); this.isLookahead = false; const curr = this.state; this.state = old; return curr; } nextTokenStart() { return this.nextTokenStartSince(this.state.pos); } nextTokenStartSince(pos) { _whitespace.skipWhiteSpace.lastIndex = pos; return _whitespace.skipWhiteSpace.test(this.input) ? _whitespace.skipWhiteSpace.lastIndex : pos; } lookaheadCharCode() { return this.input.charCodeAt(this.nextTokenStart()); } nextTokenInLineStart() { return this.nextTokenInLineStartSince(this.state.pos); } nextTokenInLineStartSince(pos) { _whitespace.skipWhiteSpaceInLine.lastIndex = pos; return _whitespace.skipWhiteSpaceInLine.test(this.input) ? _whitespace.skipWhiteSpaceInLine.lastIndex : pos; } lookaheadInLineCharCode() { return this.input.charCodeAt(this.nextTokenInLineStart()); } codePointAtPos(pos) { let cp = this.input.charCodeAt(pos); if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) { const trail = this.input.charCodeAt(pos); if ((trail & 0xfc00) === 0xdc00) { cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); } } return cp; } setStrict(strict) { this.state.strict = strict; if (strict) { this.state.strictErrors.forEach(([toParseError, at]) => this.raise(toParseError, { at })); this.state.strictErrors.clear(); } } curContext() { return this.state.context[this.state.context.length - 1]; } nextToken() { this.skipSpace(); this.state.start = this.state.pos; if (!this.isLookahead) this.state.startLoc = this.state.curPosition(); if (this.state.pos >= this.length) { this.finishToken(137); return; } this.getTokenFromCode(this.codePointAtPos(this.state.pos)); } skipBlockComment(commentEnd) { let startLoc; if (!this.isLookahead) startLoc = this.state.curPosition(); const start = this.state.pos; const end = this.input.indexOf(commentEnd, start + 2); if (end === -1) { throw this.raise(_parseError.Errors.UnterminatedComment, { at: this.state.curPosition() }); } this.state.pos = end + commentEnd.length; _whitespace.lineBreakG.lastIndex = start + 2; while (_whitespace.lineBreakG.test(this.input) && _whitespace.lineBreakG.lastIndex <= end) { ++this.state.curLine; this.state.lineStart = _whitespace.lineBreakG.lastIndex; } if (this.isLookahead) return; const comment = { type: "CommentBlock", value: this.input.slice(start + 2, end), start, end: end + commentEnd.length, loc: new _location.SourceLocation(startLoc, this.state.curPosition()) }; if (this.options.tokens) this.pushToken(comment); return comment; } skipLineComment(startSkip) { const start = this.state.pos; let startLoc; if (!this.isLookahead) startLoc = this.state.curPosition(); let ch = this.input.charCodeAt(this.state.pos += startSkip); if (this.state.pos < this.length) { while (!(0, _whitespace.isNewLine)(ch) && ++this.state.pos < this.length) { ch = this.input.charCodeAt(this.state.pos); } } if (this.isLookahead) return; const end = this.state.pos; const value = this.input.slice(start + startSkip, end); const comment = { type: "CommentLine", value, start, end, loc: new _location.SourceLocation(startLoc, this.state.curPosition()) }; if (this.options.tokens) this.pushToken(comment); return comment; } skipSpace() { const spaceStart = this.state.pos; const comments = []; loop: while (this.state.pos < this.length) { const ch = this.input.charCodeAt(this.state.pos); switch (ch) { case 32: case 160: case 9: ++this.state.pos; break; case 13: if (this.input.charCodeAt(this.state.pos + 1) === 10) { ++this.state.pos; } case 10: case 8232: case 8233: ++this.state.pos; ++this.state.curLine; this.state.lineStart = this.state.pos; break; case 47: switch (this.input.charCodeAt(this.state.pos + 1)) { case 42: { const comment = this.skipBlockComment("*/"); if (comment !== undefined) { this.addComment(comment); if (this.options.attachComment) comments.push(comment); } break; } case 47: { const comment = this.skipLineComment(2); if (comment !== undefined) { this.addComment(comment); if (this.options.attachComment) comments.push(comment); } break; } default: break loop; } break; default: if ((0, _whitespace.isWhitespace)(ch)) { ++this.state.pos; } else if (ch === 45 && !this.inModule && this.options.annexB) { const pos = this.state.pos; if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) { const comment = this.skipLineComment(3); if (comment !== undefined) { this.addComment(comment); if (this.options.attachComment) comments.push(comment); } } else { break loop; } } else if (ch === 60 && !this.inModule && this.options.annexB) { const pos = this.state.pos; if (this.input.charCodeAt(pos + 1) === 33 && this.input.charCodeAt(pos + 2) === 45 && this.input.charCodeAt(pos + 3) === 45) { const comment = this.skipLineComment(4); if (comment !== undefined) { this.addComment(comment); if (this.options.attachComment) comments.push(comment); } } else { break loop; } } else { break loop; } } } if (comments.length > 0) { const end = this.state.pos; const commentWhitespace = { start: spaceStart, end, comments, leadingNode: null, trailingNode: null, containingNode: null }; this.state.commentStack.push(commentWhitespace); } } finishToken(type, val) { this.state.end = this.state.pos; this.state.endLoc = this.state.curPosition(); const prevType = this.state.type; this.state.type = type; this.state.value = val; if (!this.isLookahead) { this.updateContext(prevType); } } replaceToken(type) { this.state.type = type; this.updateContext(); } readToken_numberSign() { if (this.state.pos === 0 && this.readToken_interpreter()) { return; } const nextPos = this.state.pos + 1; const next = this.codePointAtPos(nextPos); if (next >= 48 && next <= 57) { throw this.raise(_parseError.Errors.UnexpectedDigitAfterHash, { at: this.state.curPosition() }); } if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) { this.expectPlugin("recordAndTuple"); if (this.getPluginOption("recordAndTuple", "syntaxType") === "bar") { throw this.raise(next === 123 ? _parseError.Errors.RecordExpressionHashIncorrectStartSyntaxType : _parseError.Errors.TupleExpressionHashIncorrectStartSyntaxType, { at: this.state.curPosition() }); } this.state.pos += 2; if (next === 123) { this.finishToken(7); } else { this.finishToken(1); } } else if ((0, _identifier.isIdentifierStart)(next)) { ++this.state.pos; this.finishToken(136, this.readWord1(next)); } else if (next === 92) { ++this.state.pos; this.finishToken(136, this.readWord1()); } else { this.finishOp(27, 1); } } readToken_dot() { const next = this.input.charCodeAt(this.state.pos + 1); if (next >= 48 && next <= 57) { this.readNumber(true); return; } if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) { this.state.pos += 3; this.finishToken(21); } else { ++this.state.pos; this.finishToken(16); } } readToken_slash() { const next = this.input.charCodeAt(this.state.pos + 1); if (next === 61) { this.finishOp(31, 2); } else { this.finishOp(56, 1); } } readToken_interpreter() { if (this.state.pos !== 0 || this.length < 2) return false; let ch = this.input.charCodeAt(this.state.pos + 1); if (ch !== 33) return false; const start = this.state.pos; this.state.pos += 1; while (!(0, _whitespace.isNewLine)(ch) && ++this.state.pos < this.length) { ch = this.input.charCodeAt(this.state.pos); } const value = this.input.slice(start + 2, this.state.pos); this.finishToken(28, value); return true; } readToken_mult_modulo(code) { let type = code === 42 ? 55 : 54; let width = 1; let next = this.input.charCodeAt(this.state.pos + 1); if (code === 42 && next === 42) { width++; next = this.input.charCodeAt(this.state.pos + 2); type = 57; } if (next === 61 && !this.state.inType) { width++; type = code === 37 ? 33 : 30; } this.finishOp(type, width); } readToken_pipe_amp(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (next === code) { if (this.input.charCodeAt(this.state.pos + 2) === 61) { this.finishOp(30, 3); } else { this.finishOp(code === 124 ? 41 : 42, 2); } return; } if (code === 124) { if (next === 62) { this.finishOp(39, 2); return; } if (this.hasPlugin("recordAndTuple") && next === 125) { if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { throw this.raise(_parseError.Errors.RecordExpressionBarIncorrectEndSyntaxType, { at: this.state.curPosition() }); } this.state.pos += 2; this.finishToken(9); return; } if (this.hasPlugin("recordAndTuple") && next === 93) { if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { throw this.raise(_parseError.Errors.TupleExpressionBarIncorrectEndSyntaxType, { at: this.state.curPosition() }); } this.state.pos += 2; this.finishToken(4); return; } } if (next === 61) { this.finishOp(30, 2); return; } this.finishOp(code === 124 ? 43 : 45, 1); } readToken_caret() { const next = this.input.charCodeAt(this.state.pos + 1); if (next === 61 && !this.state.inType) { this.finishOp(32, 2); } else if (next === 94 && this.hasPlugin(["pipelineOperator", { proposal: "hack", topicToken: "^^" }])) { this.finishOp(37, 2); const lookaheadCh = this.input.codePointAt(this.state.pos); if (lookaheadCh === 94) { this.unexpected(); } } else { this.finishOp(44, 1); } } readToken_atSign() { const next = this.input.charCodeAt(this.state.pos + 1); if (next === 64 && this.hasPlugin(["pipelineOperator", { proposal: "hack", topicToken: "@@" }])) { this.finishOp(38, 2); } else { this.finishOp(26, 1); } } readToken_plus_min(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (next === code) { this.finishOp(34, 2); return; } if (next === 61) { this.finishOp(30, 2); } else { this.finishOp(53, 1); } } readToken_lt() { const { pos } = this.state; const next = this.input.charCodeAt(pos + 1); if (next === 60) { if (this.input.charCodeAt(pos + 2) === 61) { this.finishOp(30, 3); return; } this.finishOp(51, 2); return; } if (next === 61) { this.finishOp(49, 2); return; } this.finishOp(47, 1); } readToken_gt() { const { pos } = this.state; const next = this.input.charCodeAt(pos + 1); if (next === 62) { const size = this.input.charCodeAt(pos + 2) === 62 ? 3 : 2; if (this.input.charCodeAt(pos + size) === 61) { this.finishOp(30, size + 1); return; } this.finishOp(52, size); return; } if (next === 61) { this.finishOp(49, 2); return; } this.finishOp(48, 1); } readToken_eq_excl(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (next === 61) { this.finishOp(46, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2); return; } if (code === 61 && next === 62) { this.state.pos += 2; this.finishToken(19); return; } this.finishOp(code === 61 ? 29 : 35, 1); } readToken_question() { const next = this.input.charCodeAt(this.state.pos + 1); const next2 = this.input.charCodeAt(this.state.pos + 2); if (next === 63) { if (next2 === 61) { this.finishOp(30, 3); } else { this.finishOp(40, 2); } } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) { this.state.pos += 2; this.finishToken(18); } else { ++this.state.pos; this.finishToken(17); } } getTokenFromCode(code) { switch (code) { case 46: this.readToken_dot(); return; case 40: ++this.state.pos; this.finishToken(10); return; case 41: ++this.state.pos; this.finishToken(11); return; case 59: ++this.state.pos; this.finishToken(13); return; case 44: ++this.state.pos; this.finishToken(12); return; case 91: if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { throw this.raise(_parseError.Errors.TupleExpressionBarIncorrectStartSyntaxType, { at: this.state.curPosition() }); } this.state.pos += 2; this.finishToken(2); } else { ++this.state.pos; this.finishToken(0); } return; case 93: ++this.state.pos; this.finishToken(3); return; case 123: if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { throw this.raise(_parseError.Errors.RecordExpressionBarIncorrectStartSyntaxType, { at: this.state.curPosition() }); } this.state.pos += 2; this.finishToken(6); } else { ++this.state.pos; this.finishToken(5); } return; case 125: ++this.state.pos; this.finishToken(8); return; case 58: if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) { this.finishOp(15, 2); } else { ++this.state.pos; this.finishToken(14); } return; case 63: this.readToken_question(); return; case 96: this.readTemplateToken(); return; case 48: { const next = this.input.charCodeAt(this.state.pos + 1); if (next === 120 || next === 88) { this.readRadixNumber(16); return; } if (next === 111 || next === 79) { this.readRadixNumber(8); return; } if (next === 98 || next === 66) { this.readRadixNumber(2); return; } } case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: this.readNumber(false); return; case 34: case 39: this.readString(code); return; case 47: this.readToken_slash(); return; case 37: case 42: this.readToken_mult_modulo(code); return; case 124: case 38: this.readToken_pipe_amp(code); return; case 94: this.readToken_caret(); return; case 43: case 45: this.readToken_plus_min(code); return; case 60: this.readToken_lt(); return; case 62: this.readToken_gt(); return; case 61: case 33: this.readToken_eq_excl(code); return; case 126: this.finishOp(36, 1); return; case 64: this.readToken_atSign(); return; case 35: this.readToken_numberSign(); return; case 92: this.readWord(); return; default: if ((0, _identifier.isIdentifierStart)(code)) { this.readWord(code); return; } } throw this.raise(_parseError.Errors.InvalidOrUnexpectedToken, { at: this.state.curPosition(), unexpected: String.fromCodePoint(code) }); } finishOp(type, size) { const str = this.input.slice(this.state.pos, this.state.pos + size); this.state.pos += size; this.finishToken(type, str); } readRegexp() { const startLoc = this.state.startLoc; const start = this.state.start + 1; let escaped, inClass; let { pos } = this.state; for (;; ++pos) { if (pos >= this.length) { throw this.raise(_parseError.Errors.UnterminatedRegExp, { at: (0, _location.createPositionWithColumnOffset)(startLoc, 1) }); } const ch = this.input.charCodeAt(pos); if ((0, _whitespace.isNewLine)(ch)) { throw this.raise(_parseError.Errors.UnterminatedRegExp, { at: (0, _location.createPositionWithColumnOffset)(startLoc, 1) }); } if (escaped) { escaped = false; } else { if (ch === 91) { inClass = true; } else if (ch === 93 && inClass) { inClass = false; } else if (ch === 47 && !inClass) { break; } escaped = ch === 92; } } const content = this.input.slice(start, pos); ++pos; let mods = ""; const nextPos = () => (0, _location.createPositionWithColumnOffset)(startLoc, pos + 2 - start); while (pos < this.length) { const cp = this.codePointAtPos(pos); const char = String.fromCharCode(cp); if (VALID_REGEX_FLAGS.has(cp)) { if (cp === 118) { if (mods.includes("u")) { this.raise(_parseError.Errors.IncompatibleRegExpUVFlags, { at: nextPos() }); } } else if (cp === 117) { if (mods.includes("v")) { this.raise(_parseError.Errors.IncompatibleRegExpUVFlags, { at: nextPos() }); } } if (mods.includes(char)) { this.raise(_parseError.Errors.DuplicateRegExpFlags, { at: nextPos() }); } } else if ((0, _identifier.isIdentifierChar)(cp) || cp === 92) { this.raise(_parseError.Errors.MalformedRegExpFlags, { at: nextPos() }); } else { break; } ++pos; mods += char; } this.state.pos = pos; this.finishToken(135, { pattern: content, flags: mods }); } readInt(radix, len, forceLen = false, allowNumSeparator = true) { const { n, pos } = (0, _helperStringParser.readInt)(this.input, this.state.pos, this.state.lineStart, this.state.curLine, radix, len, forceLen, allowNumSeparator, this.errorHandlers_readInt, false); this.state.pos = pos; return n; } readRadixNumber(radix) { const startLoc = this.state.curPosition(); let isBigInt = false; this.state.pos += 2; const val = this.readInt(radix); if (val == null) { this.raise(_parseError.Errors.InvalidDigit, { at: (0, _location.createPositionWithColumnOffset)(startLoc, 2), radix }); } const next = this.input.charCodeAt(this.state.pos); if (next === 110) { ++this.state.pos; isBigInt = true; } else if (next === 109) { throw this.raise(_parseError.Errors.InvalidDecimal, { at: startLoc }); } if ((0, _identifier.isIdentifierStart)(this.codePointAtPos(this.state.pos))) { throw this.raise(_parseError.Errors.NumberIdentifier, { at: this.state.curPosition() }); } if (isBigInt) { const str = this.input.slice(startLoc.index, this.state.pos).replace(/[_n]/g, ""); this.finishToken(133, str); return; } this.finishToken(132, val); } readNumber(startsWithDot) { const start = this.state.pos; const startLoc = this.state.curPosition(); let isFloat = false; let isBigInt = false; let isDecimal = false; let hasExponent = false; let isOctal = false; if (!startsWithDot && this.readInt(10) === null) { this.raise(_parseError.Errors.InvalidNumber, { at: this.state.curPosition() }); } const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48; if (hasLeadingZero) { const integer = this.input.slice(start, this.state.pos); this.recordStrictModeErrors(_parseError.Errors.StrictOctalLiteral, { at: startLoc }); if (!this.state.strict) { const underscorePos = integer.indexOf("_"); if (underscorePos > 0) { this.raise(_parseError.Errors.ZeroDigitNumericSeparator, { at: (0, _location.createPositionWithColumnOffset)(startLoc, underscorePos) }); } } isOctal = hasLeadingZero && !/[89]/.test(integer); } let next = this.input.charCodeAt(this.state.pos); if (next === 46 && !isOctal) { ++this.state.pos; this.readInt(10); isFloat = true; next = this.input.charCodeAt(this.state.pos); } if ((next === 69 || next === 101) && !isOctal) { next = this.input.charCodeAt(++this.state.pos); if (next === 43 || next === 45) { ++this.state.pos; } if (this.readInt(10) === null) { this.raise(_parseError.Errors.InvalidOrMissingExponent, { at: startLoc }); } isFloat = true; hasExponent = true; next = this.input.charCodeAt(this.state.pos); } if (next === 110) { if (isFloat || hasLeadingZero) { this.raise(_parseError.Errors.InvalidBigIntLiteral, { at: startLoc }); } ++this.state.pos; isBigInt = true; } if (next === 109) { this.expectPlugin("decimal", this.state.curPosition()); if (hasExponent || hasLeadingZero) { this.raise(_parseError.Errors.InvalidDecimal, { at: startLoc }); } ++this.state.pos; isDecimal = true; } if ((0, _identifier.isIdentifierStart)(this.codePointAtPos(this.state.pos))) { throw this.raise(_parseError.Errors.NumberIdentifier, { at: this.state.curPosition() }); } const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, ""); if (isBigInt) { this.finishToken(133, str); return; } if (isDecimal) { this.finishToken(134, str); return; } const val = isOctal ? parseInt(str, 8) : parseFloat(str); this.finishToken(132, val); } readCodePoint(throwOnInvalid) { const { code, pos } = (0, _helperStringParser.readCodePoint)(this.input, this.state.pos, this.state.lineStart, this.state.curLine, throwOnInvalid, this.errorHandlers_readCodePoint); this.state.pos = pos; return code; } readString(quote) { const { str, pos, curLine, lineStart } = (0, _helperStringParser.readStringContents)(quote === 34 ? "double" : "single", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_string); this.state.pos = pos + 1; this.state.lineStart = lineStart; this.state.curLine = curLine; this.finishToken(131, str); } readTemplateContinuation() { if (!this.match(8)) { this.unexpected(null, 8); } this.state.pos--; this.readTemplateToken(); } readTemplateToken() { const opening = this.input[this.state.pos]; const { str, firstInvalidLoc, pos, curLine, lineStart } = (0, _helperStringParser.readStringContents)("template", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_template); this.state.pos = pos + 1; this.state.lineStart = lineStart; this.state.curLine = curLine; if (firstInvalidLoc) { this.state.firstInvalidTemplateEscapePos = new _location.Position(firstInvalidLoc.curLine, firstInvalidLoc.pos - firstInvalidLoc.lineStart, firstInvalidLoc.pos); } if (this.input.codePointAt(pos) === 96) { this.finishToken(24, firstInvalidLoc ? null : opening + str + "`"); } else { this.state.pos++; this.finishToken(25, firstInvalidLoc ? null : opening + str + "${"); } } recordStrictModeErrors(toParseError, { at }) { const index = at.index; if (this.state.strict && !this.state.strictErrors.has(index)) { this.raise(toParseError, { at }); } else { this.state.strictErrors.set(index, [toParseError, at]); } } readWord1(firstCode) { this.state.containsEsc = false; let word = ""; const start = this.state.pos; let chunkStart = this.state.pos; if (firstCode !== undefined) { this.state.pos += firstCode <= 0xffff ? 1 : 2; } while (this.state.pos < this.length) { const ch = this.codePointAtPos(this.state.pos); if ((0, _identifier.isIdentifierChar)(ch)) { this.state.pos += ch <= 0xffff ? 1 : 2; } else if (ch === 92) { this.state.containsEsc = true; word += this.input.slice(chunkStart, this.state.pos); const escStart = this.state.curPosition(); const identifierCheck = this.state.pos === start ? _identifier.isIdentifierStart : _identifier.isIdentifierChar; if (this.input.charCodeAt(++this.state.pos) !== 117) { this.raise(_parseError.Errors.MissingUnicodeEscape, { at: this.state.curPosition() }); chunkStart = this.state.pos - 1; continue; } ++this.state.pos; const esc = this.readCodePoint(true); if (esc !== null) { if (!identifierCheck(esc)) { this.raise(_parseError.Errors.EscapedCharNotAnIdentifier, { at: escStart }); } word += String.fromCodePoint(esc); } chunkStart = this.state.pos; } else { break; } } return word + this.input.slice(chunkStart, this.state.pos); } readWord(firstCode) { const word = this.readWord1(firstCode); const type = _types.keywords.get(word); if (type !== undefined) { this.finishToken(type, (0, _types.tokenLabelName)(type)); } else { this.finishToken(130, word); } } checkKeywordEscapes() { const { type } = this.state; if ((0, _types.tokenIsKeyword)(type) && this.state.containsEsc) { this.raise(_parseError.Errors.InvalidEscapedReservedWord, { at: this.state.startLoc, reservedWord: (0, _types.tokenLabelName)(type) }); } } raise(toParseError, raiseProperties) { const { at } = raiseProperties, details = _objectWithoutPropertiesLoose(raiseProperties, _excluded); const loc = at instanceof _location.Position ? at : at.loc.start; const error = toParseError({ loc, details }); if (!this.options.errorRecovery) throw error; if (!this.isLookahead) this.state.errors.push(error); return error; } raiseOverwrite(toParseError, raiseProperties) { const { at } = raiseProperties, details = _objectWithoutPropertiesLoose(raiseProperties, _excluded2); const loc = at instanceof _location.Position ? at : at.loc.start; const pos = loc.index; const errors = this.state.errors; for (let i = errors.length - 1; i >= 0; i--) { const error = errors[i]; if (error.loc.index === pos) { return errors[i] = toParseError({ loc, details }); } if (error.loc.index < pos) break; } return this.raise(toParseError, raiseProperties); } updateContext(prevType) {} unexpected(loc, type) { throw this.raise(_parseError.Errors.UnexpectedToken, { expected: type ? (0, _types.tokenLabelName)(type) : null, at: loc != null ? loc : this.state.startLoc }); } expectPlugin(pluginName, loc) { if (this.hasPlugin(pluginName)) { return true; } throw this.raise(_parseError.Errors.MissingPlugin, { at: loc != null ? loc : this.state.startLoc, missingPlugin: [pluginName] }); } expectOnePlugin(pluginNames) { if (!pluginNames.some(name => this.hasPlugin(name))) { throw this.raise(_parseError.Errors.MissingOneOfPlugins, { at: this.state.startLoc, missingPlugin: pluginNames }); } } errorBuilder(error) { return (pos, lineStart, curLine) => { this.raise(error, { at: buildPosition(pos, lineStart, curLine) }); }; } } exports.default = Tokenizer; //# sourceMappingURL=index.js.map lib/tokenizer/index.js.map 0000644 00000264415 15120211212 0011544 0 ustar 00 {"version":3,"names":["_location","require","_comments","_identifier","_types","_parseError","_whitespace","_state","_helperStringParser","_excluded","_excluded2","_objectWithoutPropertiesLoose","source","excluded","target","sourceKeys","Object","keys","key","i","length","indexOf","buildPosition","pos","lineStart","curLine","Position","VALID_REGEX_FLAGS","Set","Token","constructor","state","type","value","start","end","loc","SourceLocation","startLoc","endLoc","exports","Tokenizer","CommentsParser","options","input","isLookahead","tokens","errorHandlers_readInt","invalidDigit","radix","errorRecovery","raise","Errors","InvalidDigit","at","numericSeparatorInEscapeSequence","errorBuilder","NumericSeparatorInEscapeSequence","unexpectedNumericSeparator","UnexpectedNumericSeparator","errorHandlers_readCodePoint","assign","invalidEscapeSequence","InvalidEscapeSequence","invalidCodePoint","InvalidCodePoint","errorHandlers_readStringContents_string","strictNumericEscape","recordStrictModeErrors","StrictNumericEscape","unterminated","UnterminatedString","errorHandlers_readStringContents_template","UnterminatedTemplate","State","init","pushToken","token","tokensLength","push","next","checkKeywordEscapes","lastTokStart","lastTokEndLoc","lastTokStartLoc","nextToken","eat","match","createLookaheadState","context","curContext","inType","curPosition","lookahead","old","curr","nextTokenStart","nextTokenStartSince","skipWhiteSpace","lastIndex","test","lookaheadCharCode","charCodeAt","nextTokenInLineStart","nextTokenInLineStartSince","skipWhiteSpaceInLine","lookaheadInLineCharCode","codePointAtPos","cp","trail","setStrict","strict","strictErrors","forEach","toParseError","clear","skipSpace","finishToken","getTokenFromCode","skipBlockComment","commentEnd","UnterminatedComment","lineBreakG","comment","slice","skipLineComment","startSkip","ch","isNewLine","spaceStart","comments","loop","undefined","addComment","attachComment","isWhitespace","inModule","annexB","commentWhitespace","leadingNode","trailingNode","containingNode","commentStack","val","prevType","updateContext","replaceToken","readToken_numberSign","readToken_interpreter","nextPos","UnexpectedDigitAfterHash","hasPlugin","expectPlugin","getPluginOption","RecordExpressionHashIncorrectStartSyntaxType","TupleExpressionHashIncorrectStartSyntaxType","isIdentifierStart","readWord1","finishOp","readToken_dot","readNumber","readToken_slash","readToken_mult_modulo","code","width","readToken_pipe_amp","RecordExpressionBarIncorrectEndSyntaxType","TupleExpressionBarIncorrectEndSyntaxType","readToken_caret","proposal","topicToken","lookaheadCh","codePointAt","unexpected","readToken_atSign","readToken_plus_min","readToken_lt","readToken_gt","size","readToken_eq_excl","readToken_question","next2","TupleExpressionBarIncorrectStartSyntaxType","RecordExpressionBarIncorrectStartSyntaxType","readTemplateToken","readRadixNumber","readString","readWord","InvalidOrUnexpectedToken","String","fromCodePoint","str","readRegexp","escaped","inClass","UnterminatedRegExp","createPositionWithColumnOffset","content","mods","char","fromCharCode","has","includes","IncompatibleRegExpUVFlags","DuplicateRegExpFlags","isIdentifierChar","MalformedRegExpFlags","pattern","flags","readInt","len","forceLen","allowNumSeparator","n","isBigInt","InvalidDecimal","NumberIdentifier","index","replace","startsWithDot","isFloat","isDecimal","hasExponent","isOctal","InvalidNumber","hasLeadingZero","integer","StrictOctalLiteral","underscorePos","ZeroDigitNumericSeparator","InvalidOrMissingExponent","InvalidBigIntLiteral","parseInt","parseFloat","readCodePoint","throwOnInvalid","quote","readStringContents","readTemplateContinuation","opening","firstInvalidLoc","firstInvalidTemplateEscapePos","set","firstCode","containsEsc","word","chunkStart","escStart","identifierCheck","MissingUnicodeEscape","esc","EscapedCharNotAnIdentifier","keywordTypes","get","tokenLabelName","tokenIsKeyword","InvalidEscapedReservedWord","reservedWord","raiseProperties","details","error","errors","raiseOverwrite","UnexpectedToken","expected","pluginName","MissingPlugin","missingPlugin","expectOnePlugin","pluginNames","some","name","MissingOneOfPlugins","default"],"sources":["../../src/tokenizer/index.ts"],"sourcesContent":["/*:: declare var invariant; */\n\nimport type { Options } from \"../options\";\nimport {\n Position,\n SourceLocation,\n createPositionWithColumnOffset,\n} from \"../util/location\";\nimport CommentsParser, { type CommentWhitespace } from \"../parser/comments\";\nimport type * as N from \"../types\";\nimport * as charCodes from \"charcodes\";\nimport { isIdentifierStart, isIdentifierChar } from \"../util/identifier\";\nimport {\n tokenIsKeyword,\n tokenLabelName,\n tt,\n keywords as keywordTypes,\n type TokenType,\n} from \"./types\";\nimport type { TokContext } from \"./context\";\nimport {\n Errors,\n type ParseError,\n type ParseErrorConstructor,\n type RaiseProperties,\n} from \"../parse-error\";\nimport {\n lineBreakG,\n isNewLine,\n isWhitespace,\n skipWhiteSpace,\n skipWhiteSpaceInLine,\n} from \"../util/whitespace\";\nimport State from \"./state\";\nimport type { LookaheadState, DeferredStrictError } from \"./state\";\n\nimport {\n readInt,\n readCodePoint,\n readStringContents,\n type IntErrorHandlers,\n type CodePointErrorHandlers,\n type StringContentsErrorHandlers,\n} from \"@babel/helper-string-parser\";\n\nimport type { Plugin } from \"../typings\";\n\nfunction buildPosition(pos: number, lineStart: number, curLine: number) {\n return new Position(curLine, pos - lineStart, pos);\n}\n\nconst VALID_REGEX_FLAGS = new Set([\n charCodes.lowercaseG,\n charCodes.lowercaseM,\n charCodes.lowercaseS,\n charCodes.lowercaseI,\n charCodes.lowercaseY,\n charCodes.lowercaseU,\n charCodes.lowercaseD,\n charCodes.lowercaseV,\n]);\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nexport class Token {\n constructor(state: State) {\n this.type = state.type;\n this.value = state.value;\n this.start = state.start;\n this.end = state.end;\n this.loc = new SourceLocation(state.startLoc, state.endLoc);\n }\n\n declare type: TokenType;\n declare value: any;\n declare start: number;\n declare end: number;\n declare loc: SourceLocation;\n}\n\n// ## Tokenizer\n\nexport default abstract class Tokenizer extends CommentsParser {\n isLookahead: boolean;\n\n // Token store.\n tokens: Array<Token | N.Comment> = [];\n\n constructor(options: Options, input: string) {\n super();\n this.state = new State();\n this.state.init(options);\n this.input = input;\n this.length = input.length;\n this.isLookahead = false;\n }\n\n pushToken(token: Token | N.Comment) {\n // Pop out invalid tokens trapped by try-catch parsing.\n // Those parsing branches are mainly created by typescript and flow plugins.\n this.tokens.length = this.state.tokensLength;\n this.tokens.push(token);\n ++this.state.tokensLength;\n }\n\n // Move to the next token\n\n next(): void {\n this.checkKeywordEscapes();\n if (this.options.tokens) {\n this.pushToken(new Token(this.state));\n }\n\n this.state.lastTokStart = this.state.start;\n this.state.lastTokEndLoc = this.state.endLoc;\n this.state.lastTokStartLoc = this.state.startLoc;\n this.nextToken();\n }\n\n eat(type: TokenType): boolean {\n if (this.match(type)) {\n this.next();\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Whether current token matches given type\n */\n match(type: TokenType): boolean {\n return this.state.type === type;\n }\n\n /**\n * Create a LookaheadState from current parser state\n */\n createLookaheadState(state: State): LookaheadState {\n return {\n pos: state.pos,\n value: null,\n type: state.type,\n start: state.start,\n end: state.end,\n context: [this.curContext()],\n inType: state.inType,\n startLoc: state.startLoc,\n lastTokEndLoc: state.lastTokEndLoc,\n curLine: state.curLine,\n lineStart: state.lineStart,\n curPosition: state.curPosition,\n };\n }\n\n /**\n * lookahead peeks the next token, skipping changes to token context and\n * comment stack. For performance it returns a limited LookaheadState\n * instead of full parser state.\n *\n * The { column, line } Loc info is not included in lookahead since such usage\n * is rare. Although it may return other location properties e.g. `curLine` and\n * `lineStart`, these properties are not listed in the LookaheadState interface\n * and thus the returned value is _NOT_ reliable.\n *\n * The tokenizer should make best efforts to avoid using any parser state\n * other than those defined in LookaheadState\n */\n lookahead(): LookaheadState {\n const old = this.state;\n // @ts-expect-error For performance we use a simplified tokenizer state structure\n this.state = this.createLookaheadState(old);\n\n this.isLookahead = true;\n this.nextToken();\n this.isLookahead = false;\n\n const curr = this.state;\n this.state = old;\n return curr;\n }\n\n nextTokenStart(): number {\n return this.nextTokenStartSince(this.state.pos);\n }\n\n nextTokenStartSince(pos: number): number {\n skipWhiteSpace.lastIndex = pos;\n return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos;\n }\n\n lookaheadCharCode(): number {\n return this.input.charCodeAt(this.nextTokenStart());\n }\n\n /**\n * Similar to nextToken, but it will stop at line break when it is seen before the next token\n *\n * @returns {number} position of the next token start or line break, whichever is seen first.\n * @memberof Tokenizer\n */\n nextTokenInLineStart(): number {\n return this.nextTokenInLineStartSince(this.state.pos);\n }\n\n nextTokenInLineStartSince(pos: number): number {\n skipWhiteSpaceInLine.lastIndex = pos;\n return skipWhiteSpaceInLine.test(this.input)\n ? skipWhiteSpaceInLine.lastIndex\n : pos;\n }\n\n /**\n * Similar to lookaheadCharCode, but it will return the char code of line break if it is\n * seen before the next token\n *\n * @returns {number} char code of the next token start or line break, whichever is seen first.\n * @memberof Tokenizer\n */\n lookaheadInLineCharCode(): number {\n return this.input.charCodeAt(this.nextTokenInLineStart());\n }\n\n codePointAtPos(pos: number): number {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `input` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = this.input.charCodeAt(pos);\n if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) {\n const trail = this.input.charCodeAt(pos);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n return cp;\n }\n\n // Toggle strict mode. Re-reads the next number or string to please\n // pedantic tests (`\"use strict\"; 010;` should fail).\n\n setStrict(strict: boolean): void {\n this.state.strict = strict;\n if (strict) {\n // Throw an error for any string decimal escape found before/immediately\n // after a \"use strict\" directive. Strict mode will be set at parse\n // time for any literals that occur after the next node of the strict\n // directive.\n this.state.strictErrors.forEach(([toParseError, at]) =>\n this.raise(toParseError, { at }),\n );\n this.state.strictErrors.clear();\n }\n }\n\n curContext(): TokContext {\n return this.state.context[this.state.context.length - 1];\n }\n\n // Read a single token, updating the parser object's token-related properties.\n nextToken(): void {\n this.skipSpace();\n this.state.start = this.state.pos;\n if (!this.isLookahead) this.state.startLoc = this.state.curPosition();\n if (this.state.pos >= this.length) {\n this.finishToken(tt.eof);\n return;\n }\n\n this.getTokenFromCode(this.codePointAtPos(this.state.pos));\n }\n\n // Skips a block comment, whose end is marked by commentEnd.\n // *-/ is used by the Flow plugin, when parsing block comments nested\n // inside Flow comments.\n skipBlockComment(commentEnd: \"*/\" | \"*-/\"): N.CommentBlock | undefined {\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n const start = this.state.pos;\n const end = this.input.indexOf(commentEnd, start + 2);\n if (end === -1) {\n // We have to call this again here because startLoc may not be set...\n // This seems to be for performance reasons:\n // https://github.com/babel/babel/commit/acf2a10899f696a8aaf34df78bf9725b5ea7f2da\n throw this.raise(Errors.UnterminatedComment, {\n at: this.state.curPosition(),\n });\n }\n\n this.state.pos = end + commentEnd.length;\n lineBreakG.lastIndex = start + 2;\n while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) {\n ++this.state.curLine;\n this.state.lineStart = lineBreakG.lastIndex;\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n /*:: invariant(startLoc) */\n\n const comment: N.CommentBlock = {\n type: \"CommentBlock\",\n value: this.input.slice(start + 2, end),\n start,\n end: end + commentEnd.length,\n loc: new SourceLocation(startLoc, this.state.curPosition()),\n };\n if (this.options.tokens) this.pushToken(comment);\n return comment;\n }\n\n skipLineComment(startSkip: number): N.CommentLine | undefined {\n const start = this.state.pos;\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n let ch = this.input.charCodeAt((this.state.pos += startSkip));\n if (this.state.pos < this.length) {\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n /*:: invariant(startLoc) */\n\n const end = this.state.pos;\n const value = this.input.slice(start + startSkip, end);\n\n const comment: N.CommentLine = {\n type: \"CommentLine\",\n value,\n start,\n end,\n loc: new SourceLocation(startLoc, this.state.curPosition()),\n };\n if (this.options.tokens) this.pushToken(comment);\n return comment;\n }\n\n // Called at the start of the parse and after every token. Skips\n // whitespace and comments, and.\n\n skipSpace(): void {\n const spaceStart = this.state.pos;\n const comments = [];\n loop: while (this.state.pos < this.length) {\n const ch = this.input.charCodeAt(this.state.pos);\n switch (ch) {\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.tab:\n ++this.state.pos;\n break;\n case charCodes.carriageReturn:\n if (\n this.input.charCodeAt(this.state.pos + 1) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n }\n // fall through\n case charCodes.lineFeed:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n ++this.state.pos;\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n break;\n\n case charCodes.slash:\n switch (this.input.charCodeAt(this.state.pos + 1)) {\n case charCodes.asterisk: {\n const comment = this.skipBlockComment(\"*/\");\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n break;\n }\n\n case charCodes.slash: {\n const comment = this.skipLineComment(2);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n break;\n }\n\n default:\n break loop;\n }\n break;\n\n default:\n if (isWhitespace(ch)) {\n ++this.state.pos;\n } else if (\n ch === charCodes.dash &&\n !this.inModule &&\n this.options.annexB\n ) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.dash &&\n this.input.charCodeAt(pos + 2) === charCodes.greaterThan &&\n (spaceStart === 0 || this.state.lineStart > spaceStart)\n ) {\n // A `-->` line comment\n const comment = this.skipLineComment(3);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n } else {\n break loop;\n }\n } else if (\n ch === charCodes.lessThan &&\n !this.inModule &&\n this.options.annexB\n ) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.exclamationMark &&\n this.input.charCodeAt(pos + 2) === charCodes.dash &&\n this.input.charCodeAt(pos + 3) === charCodes.dash\n ) {\n // `<!--`, an XML-style comment that should be interpreted as a line comment\n const comment = this.skipLineComment(4);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n } else {\n break loop;\n }\n } else {\n break loop;\n }\n }\n }\n\n if (comments.length > 0) {\n const end = this.state.pos;\n const commentWhitespace: CommentWhitespace = {\n start: spaceStart,\n end,\n comments,\n leadingNode: null,\n trailingNode: null,\n containingNode: null,\n };\n this.state.commentStack.push(commentWhitespace);\n }\n }\n\n // Called at the end of every token. Sets `end`, `val`, and\n // maintains `context` and `canStartJSXElement`, and skips the space after\n // the token, so that the next one's `start` will point at the\n // right position.\n\n finishToken(type: TokenType, val?: any): void {\n this.state.end = this.state.pos;\n this.state.endLoc = this.state.curPosition();\n const prevType = this.state.type;\n this.state.type = type;\n this.state.value = val;\n\n if (!this.isLookahead) {\n this.updateContext(prevType);\n }\n }\n\n replaceToken(type: TokenType): void {\n this.state.type = type;\n // @ts-expect-error the prevType of updateContext is required\n // only when the new type is tt.slash/tt.jsxTagEnd\n this.updateContext();\n }\n\n // ### Token reading\n\n // This is the function that is called to fetch the next token. It\n // is somewhat obscure, because it works in character codes rather\n // than characters, and because operator parsing has been inlined\n // into it.\n //\n // All in the name of speed.\n\n // number sign is \"#\"\n readToken_numberSign(): void {\n if (this.state.pos === 0 && this.readToken_interpreter()) {\n return;\n }\n\n const nextPos = this.state.pos + 1;\n const next = this.codePointAtPos(nextPos);\n if (next >= charCodes.digit0 && next <= charCodes.digit9) {\n throw this.raise(Errors.UnexpectedDigitAfterHash, {\n at: this.state.curPosition(),\n });\n }\n\n if (\n next === charCodes.leftCurlyBrace ||\n (next === charCodes.leftSquareBracket && this.hasPlugin(\"recordAndTuple\"))\n ) {\n // When we see `#{`, it is likely to be a hash record.\n // However we don't yell at `#[` since users may intend to use \"computed private fields\",\n // which is not allowed in the spec. Throwing expecting recordAndTuple is\n // misleading\n this.expectPlugin(\"recordAndTuple\");\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") === \"bar\") {\n throw this.raise(\n next === charCodes.leftCurlyBrace\n ? Errors.RecordExpressionHashIncorrectStartSyntaxType\n : Errors.TupleExpressionHashIncorrectStartSyntaxType,\n { at: this.state.curPosition() },\n );\n }\n\n this.state.pos += 2;\n if (next === charCodes.leftCurlyBrace) {\n // #{\n this.finishToken(tt.braceHashL);\n } else {\n // #[\n this.finishToken(tt.bracketHashL);\n }\n } else if (isIdentifierStart(next)) {\n ++this.state.pos;\n this.finishToken(tt.privateName, this.readWord1(next));\n } else if (next === charCodes.backslash) {\n ++this.state.pos;\n this.finishToken(tt.privateName, this.readWord1());\n } else {\n this.finishOp(tt.hash, 1);\n }\n }\n\n readToken_dot(): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next >= charCodes.digit0 && next <= charCodes.digit9) {\n this.readNumber(true);\n return;\n }\n\n if (\n next === charCodes.dot &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.dot\n ) {\n this.state.pos += 3;\n this.finishToken(tt.ellipsis);\n } else {\n ++this.state.pos;\n this.finishToken(tt.dot);\n }\n }\n\n readToken_slash(): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.slashAssign, 2);\n } else {\n this.finishOp(tt.slash, 1);\n }\n }\n\n readToken_interpreter(): boolean {\n if (this.state.pos !== 0 || this.length < 2) return false;\n\n let ch = this.input.charCodeAt(this.state.pos + 1);\n if (ch !== charCodes.exclamationMark) return false;\n\n const start = this.state.pos;\n this.state.pos += 1;\n\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n\n const value = this.input.slice(start + 2, this.state.pos);\n\n this.finishToken(tt.interpreterDirective, value);\n\n return true;\n }\n\n readToken_mult_modulo(code: number): void {\n // '%' or '*'\n let type = code === charCodes.asterisk ? tt.star : tt.modulo;\n let width = 1;\n let next = this.input.charCodeAt(this.state.pos + 1);\n\n // Exponentiation operator '**'\n if (code === charCodes.asterisk && next === charCodes.asterisk) {\n width++;\n next = this.input.charCodeAt(this.state.pos + 2);\n type = tt.exponent;\n }\n\n // '%=' or '*='\n if (next === charCodes.equalsTo && !this.state.inType) {\n width++;\n // `tt.moduloAssign` is only needed to support % as a Hack-pipe topic token.\n // If the proposal ends up choosing a different token,\n // it can be merged with tt.assign.\n type = code === charCodes.percentSign ? tt.moduloAssign : tt.assign;\n }\n\n this.finishOp(type, width);\n }\n\n readToken_pipe_amp(code: number): void {\n // '||' '&&' '||=' '&&='\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next === code) {\n if (this.input.charCodeAt(this.state.pos + 2) === charCodes.equalsTo) {\n this.finishOp(tt.assign, 3);\n } else {\n this.finishOp(\n code === charCodes.verticalBar ? tt.logicalOR : tt.logicalAND,\n 2,\n );\n }\n return;\n }\n\n if (code === charCodes.verticalBar) {\n // '|>'\n if (next === charCodes.greaterThan) {\n this.finishOp(tt.pipeline, 2);\n return;\n }\n // '|}'\n if (\n this.hasPlugin(\"recordAndTuple\") &&\n next === charCodes.rightCurlyBrace\n ) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType, {\n at: this.state.curPosition(),\n });\n }\n this.state.pos += 2;\n this.finishToken(tt.braceBarR);\n return;\n }\n\n // '|]'\n if (\n this.hasPlugin(\"recordAndTuple\") &&\n next === charCodes.rightSquareBracket\n ) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, {\n at: this.state.curPosition(),\n });\n }\n this.state.pos += 2;\n this.finishToken(tt.bracketBarR);\n return;\n }\n }\n\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n return;\n }\n\n this.finishOp(\n code === charCodes.verticalBar ? tt.bitwiseOR : tt.bitwiseAND,\n 1,\n );\n }\n\n readToken_caret(): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n // '^='\n if (next === charCodes.equalsTo && !this.state.inType) {\n // `tt.xorAssign` is only needed to support ^ as a Hack-pipe topic token.\n // If the proposal ends up choosing a different token,\n // it can be merged with tt.assign.\n this.finishOp(tt.xorAssign, 2);\n }\n // '^^'\n else if (\n next === charCodes.caret &&\n // If the ^^ token is not enabled, we don't throw but parse two single ^s\n // because it could be a ^ hack token followed by a ^ binary operator.\n this.hasPlugin([\n \"pipelineOperator\",\n { proposal: \"hack\", topicToken: \"^^\" },\n ])\n ) {\n this.finishOp(tt.doubleCaret, 2);\n\n // `^^^` is forbidden and must be separated by a space.\n const lookaheadCh = this.input.codePointAt(this.state.pos);\n if (lookaheadCh === charCodes.caret) {\n this.unexpected();\n }\n }\n // '^'\n else {\n this.finishOp(tt.bitwiseXOR, 1);\n }\n }\n\n readToken_atSign(): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n // '@@'\n if (\n next === charCodes.atSign &&\n this.hasPlugin([\n \"pipelineOperator\",\n { proposal: \"hack\", topicToken: \"@@\" },\n ])\n ) {\n this.finishOp(tt.doubleAt, 2);\n }\n // '@'\n else {\n this.finishOp(tt.at, 1);\n }\n }\n\n readToken_plus_min(code: number): void {\n // '+-'\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next === code) {\n this.finishOp(tt.incDec, 2);\n return;\n }\n\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n } else {\n this.finishOp(tt.plusMin, 1);\n }\n }\n\n readToken_lt(): void {\n // '<'\n const { pos } = this.state;\n const next = this.input.charCodeAt(pos + 1);\n\n if (next === charCodes.lessThan) {\n if (this.input.charCodeAt(pos + 2) === charCodes.equalsTo) {\n this.finishOp(tt.assign, 3);\n return;\n }\n this.finishOp(tt.bitShiftL, 2);\n return;\n }\n\n if (next === charCodes.equalsTo) {\n // <=\n this.finishOp(tt.relational, 2);\n return;\n }\n\n this.finishOp(tt.lt, 1);\n }\n\n readToken_gt(): void {\n // '>'\n const { pos } = this.state;\n const next = this.input.charCodeAt(pos + 1);\n\n if (next === charCodes.greaterThan) {\n const size =\n this.input.charCodeAt(pos + 2) === charCodes.greaterThan ? 3 : 2;\n if (this.input.charCodeAt(pos + size) === charCodes.equalsTo) {\n this.finishOp(tt.assign, size + 1);\n return;\n }\n this.finishOp(tt.bitShiftR, size);\n return;\n }\n\n if (next === charCodes.equalsTo) {\n // <= | >=\n this.finishOp(tt.relational, 2);\n return;\n }\n\n this.finishOp(tt.gt, 1);\n }\n\n readToken_eq_excl(code: number): void {\n // '=!'\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next === charCodes.equalsTo) {\n this.finishOp(\n tt.equality,\n this.input.charCodeAt(this.state.pos + 2) === charCodes.equalsTo\n ? 3\n : 2,\n );\n return;\n }\n if (code === charCodes.equalsTo && next === charCodes.greaterThan) {\n // '=>'\n this.state.pos += 2;\n this.finishToken(tt.arrow);\n return;\n }\n this.finishOp(code === charCodes.equalsTo ? tt.eq : tt.bang, 1);\n }\n\n readToken_question(): void {\n // '?'\n const next = this.input.charCodeAt(this.state.pos + 1);\n const next2 = this.input.charCodeAt(this.state.pos + 2);\n if (next === charCodes.questionMark) {\n if (next2 === charCodes.equalsTo) {\n // '??='\n this.finishOp(tt.assign, 3);\n } else {\n // '??'\n this.finishOp(tt.nullishCoalescing, 2);\n }\n } else if (\n next === charCodes.dot &&\n !(next2 >= charCodes.digit0 && next2 <= charCodes.digit9)\n ) {\n // '.' not followed by a number\n this.state.pos += 2;\n this.finishToken(tt.questionDot);\n } else {\n ++this.state.pos;\n this.finishToken(tt.question);\n }\n }\n\n getTokenFromCode(code: number): void {\n switch (code) {\n // The interpretation of a dot depends on whether it is followed\n // by a digit or another two dots.\n\n case charCodes.dot:\n this.readToken_dot();\n return;\n // Punctuation tokens.\n case charCodes.leftParenthesis:\n ++this.state.pos;\n this.finishToken(tt.parenL);\n return;\n case charCodes.rightParenthesis:\n ++this.state.pos;\n this.finishToken(tt.parenR);\n return;\n case charCodes.semicolon:\n ++this.state.pos;\n this.finishToken(tt.semi);\n return;\n case charCodes.comma:\n ++this.state.pos;\n this.finishToken(tt.comma);\n return;\n case charCodes.leftSquareBracket:\n if (\n this.hasPlugin(\"recordAndTuple\") &&\n this.input.charCodeAt(this.state.pos + 1) === charCodes.verticalBar\n ) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(\n Errors.TupleExpressionBarIncorrectStartSyntaxType,\n { at: this.state.curPosition() },\n );\n }\n\n // [|\n this.state.pos += 2;\n this.finishToken(tt.bracketBarL);\n } else {\n ++this.state.pos;\n this.finishToken(tt.bracketL);\n }\n return;\n case charCodes.rightSquareBracket:\n ++this.state.pos;\n this.finishToken(tt.bracketR);\n return;\n case charCodes.leftCurlyBrace:\n if (\n this.hasPlugin(\"recordAndTuple\") &&\n this.input.charCodeAt(this.state.pos + 1) === charCodes.verticalBar\n ) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(\n Errors.RecordExpressionBarIncorrectStartSyntaxType,\n { at: this.state.curPosition() },\n );\n }\n\n // {|\n this.state.pos += 2;\n this.finishToken(tt.braceBarL);\n } else {\n ++this.state.pos;\n this.finishToken(tt.braceL);\n }\n return;\n case charCodes.rightCurlyBrace:\n ++this.state.pos;\n this.finishToken(tt.braceR);\n return;\n\n case charCodes.colon:\n if (\n this.hasPlugin(\"functionBind\") &&\n this.input.charCodeAt(this.state.pos + 1) === charCodes.colon\n ) {\n this.finishOp(tt.doubleColon, 2);\n } else {\n ++this.state.pos;\n this.finishToken(tt.colon);\n }\n return;\n\n case charCodes.questionMark:\n this.readToken_question();\n return;\n\n case charCodes.graveAccent:\n this.readTemplateToken();\n return;\n\n case charCodes.digit0: {\n const next = this.input.charCodeAt(this.state.pos + 1);\n // '0x', '0X' - hex number\n if (next === charCodes.lowercaseX || next === charCodes.uppercaseX) {\n this.readRadixNumber(16);\n return;\n }\n // '0o', '0O' - octal number\n if (next === charCodes.lowercaseO || next === charCodes.uppercaseO) {\n this.readRadixNumber(8);\n return;\n }\n // '0b', '0B' - binary number\n if (next === charCodes.lowercaseB || next === charCodes.uppercaseB) {\n this.readRadixNumber(2);\n return;\n }\n }\n // Anything else beginning with a digit is an integer, octal\n // number, or float. (fall through)\n case charCodes.digit1:\n case charCodes.digit2:\n case charCodes.digit3:\n case charCodes.digit4:\n case charCodes.digit5:\n case charCodes.digit6:\n case charCodes.digit7:\n case charCodes.digit8:\n case charCodes.digit9:\n this.readNumber(false);\n return;\n\n // Quotes produce strings.\n case charCodes.quotationMark:\n case charCodes.apostrophe:\n this.readString(code);\n return;\n\n // Operators are parsed inline in tiny state machines. '=' (charCodes.equalsTo) is\n // often referred to. `finishOp` simply skips the amount of\n // characters it is given as second argument, and returns a token\n // of the type given by its first argument.\n\n case charCodes.slash:\n this.readToken_slash();\n return;\n\n case charCodes.percentSign:\n case charCodes.asterisk:\n this.readToken_mult_modulo(code);\n return;\n\n case charCodes.verticalBar:\n case charCodes.ampersand:\n this.readToken_pipe_amp(code);\n return;\n\n case charCodes.caret:\n this.readToken_caret();\n return;\n\n case charCodes.plusSign:\n case charCodes.dash:\n this.readToken_plus_min(code);\n return;\n\n case charCodes.lessThan:\n this.readToken_lt();\n return;\n\n case charCodes.greaterThan:\n this.readToken_gt();\n return;\n\n case charCodes.equalsTo:\n case charCodes.exclamationMark:\n this.readToken_eq_excl(code);\n return;\n\n case charCodes.tilde:\n this.finishOp(tt.tilde, 1);\n return;\n\n case charCodes.atSign:\n this.readToken_atSign();\n return;\n\n case charCodes.numberSign:\n this.readToken_numberSign();\n return;\n\n case charCodes.backslash:\n this.readWord();\n return;\n\n default:\n if (isIdentifierStart(code)) {\n this.readWord(code);\n return;\n }\n }\n\n throw this.raise(Errors.InvalidOrUnexpectedToken, {\n at: this.state.curPosition(),\n unexpected: String.fromCodePoint(code),\n });\n }\n\n finishOp(type: TokenType, size: number): void {\n const str = this.input.slice(this.state.pos, this.state.pos + size);\n this.state.pos += size;\n this.finishToken(type, str);\n }\n\n readRegexp(): void {\n const startLoc = this.state.startLoc;\n const start = this.state.start + 1;\n let escaped, inClass;\n let { pos } = this.state;\n for (; ; ++pos) {\n if (pos >= this.length) {\n // FIXME: explain\n throw this.raise(Errors.UnterminatedRegExp, {\n at: createPositionWithColumnOffset(startLoc, 1),\n });\n }\n const ch = this.input.charCodeAt(pos);\n if (isNewLine(ch)) {\n throw this.raise(Errors.UnterminatedRegExp, {\n at: createPositionWithColumnOffset(startLoc, 1),\n });\n }\n if (escaped) {\n escaped = false;\n } else {\n if (ch === charCodes.leftSquareBracket) {\n inClass = true;\n } else if (ch === charCodes.rightSquareBracket && inClass) {\n inClass = false;\n } else if (ch === charCodes.slash && !inClass) {\n break;\n }\n escaped = ch === charCodes.backslash;\n }\n }\n const content = this.input.slice(start, pos);\n ++pos;\n\n let mods = \"\";\n\n const nextPos = () =>\n // (pos + 1) + 1 - start\n createPositionWithColumnOffset(startLoc, pos + 2 - start);\n\n while (pos < this.length) {\n const cp = this.codePointAtPos(pos);\n // It doesn't matter if cp > 0xffff, the loop will either throw or break because we check on cp\n const char = String.fromCharCode(cp);\n\n // @ts-expect-error VALID_REGEX_FLAGS.has should accept expanded type: number\n if (VALID_REGEX_FLAGS.has(cp)) {\n if (cp === charCodes.lowercaseV) {\n if (mods.includes(\"u\")) {\n this.raise(Errors.IncompatibleRegExpUVFlags, { at: nextPos() });\n }\n } else if (cp === charCodes.lowercaseU) {\n if (mods.includes(\"v\")) {\n this.raise(Errors.IncompatibleRegExpUVFlags, { at: nextPos() });\n }\n }\n if (mods.includes(char)) {\n this.raise(Errors.DuplicateRegExpFlags, { at: nextPos() });\n }\n } else if (isIdentifierChar(cp) || cp === charCodes.backslash) {\n this.raise(Errors.MalformedRegExpFlags, { at: nextPos() });\n } else {\n break;\n }\n\n ++pos;\n mods += char;\n }\n this.state.pos = pos;\n\n this.finishToken(tt.regexp, {\n pattern: content,\n flags: mods,\n });\n }\n\n // Read an integer in the given radix. Return null if zero digits\n // were read, the integer value otherwise. When `len` is given, this\n // will return `null` unless the integer has exactly `len` digits.\n // When `forceLen` is `true`, it means that we already know that in case\n // of a malformed number we have to skip `len` characters anyway, instead\n // of bailing out early. For example, in \"\\u{123Z}\" we want to read up to }\n // anyway, while in \"\\u00Z\" we will stop at Z instead of consuming four\n // characters (and thus the closing quote).\n\n readInt(\n radix: number,\n len?: number,\n forceLen: boolean = false,\n allowNumSeparator: boolean | \"bail\" = true,\n ): number | null {\n const { n, pos } = readInt(\n this.input,\n this.state.pos,\n this.state.lineStart,\n this.state.curLine,\n radix,\n len,\n forceLen,\n allowNumSeparator,\n this.errorHandlers_readInt,\n /* bailOnError */ false,\n );\n this.state.pos = pos;\n return n;\n }\n\n readRadixNumber(radix: number): void {\n const startLoc = this.state.curPosition();\n let isBigInt = false;\n\n this.state.pos += 2; // 0x\n const val = this.readInt(radix);\n if (val == null) {\n this.raise(Errors.InvalidDigit, {\n // Numeric literals can't have newlines, so this is safe to do.\n at: createPositionWithColumnOffset(startLoc, 2),\n radix,\n });\n }\n const next = this.input.charCodeAt(this.state.pos);\n\n if (next === charCodes.lowercaseN) {\n ++this.state.pos;\n isBigInt = true;\n } else if (next === charCodes.lowercaseM) {\n throw this.raise(Errors.InvalidDecimal, { at: startLoc });\n }\n\n if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {\n throw this.raise(Errors.NumberIdentifier, {\n at: this.state.curPosition(),\n });\n }\n\n if (isBigInt) {\n const str = this.input\n .slice(startLoc.index, this.state.pos)\n .replace(/[_n]/g, \"\");\n this.finishToken(tt.bigint, str);\n return;\n }\n\n this.finishToken(tt.num, val);\n }\n\n // Read an integer, octal integer, or floating-point number.\n\n readNumber(startsWithDot: boolean): void {\n const start = this.state.pos;\n const startLoc = this.state.curPosition();\n let isFloat = false;\n let isBigInt = false;\n let isDecimal = false;\n let hasExponent = false;\n let isOctal = false;\n\n if (!startsWithDot && this.readInt(10) === null) {\n this.raise(Errors.InvalidNumber, { at: this.state.curPosition() });\n }\n const hasLeadingZero =\n this.state.pos - start >= 2 &&\n this.input.charCodeAt(start) === charCodes.digit0;\n\n if (hasLeadingZero) {\n const integer = this.input.slice(start, this.state.pos);\n this.recordStrictModeErrors(Errors.StrictOctalLiteral, { at: startLoc });\n if (!this.state.strict) {\n // disallow numeric separators in non octal decimals and legacy octal likes\n const underscorePos = integer.indexOf(\"_\");\n if (underscorePos > 0) {\n // Numeric literals can't have newlines, so this is safe to do.\n this.raise(Errors.ZeroDigitNumericSeparator, {\n at: createPositionWithColumnOffset(startLoc, underscorePos),\n });\n }\n }\n isOctal = hasLeadingZero && !/[89]/.test(integer);\n }\n\n let next = this.input.charCodeAt(this.state.pos);\n if (next === charCodes.dot && !isOctal) {\n ++this.state.pos;\n this.readInt(10);\n isFloat = true;\n next = this.input.charCodeAt(this.state.pos);\n }\n\n if (\n (next === charCodes.uppercaseE || next === charCodes.lowercaseE) &&\n !isOctal\n ) {\n next = this.input.charCodeAt(++this.state.pos);\n if (next === charCodes.plusSign || next === charCodes.dash) {\n ++this.state.pos;\n }\n if (this.readInt(10) === null) {\n this.raise(Errors.InvalidOrMissingExponent, { at: startLoc });\n }\n isFloat = true;\n hasExponent = true;\n next = this.input.charCodeAt(this.state.pos);\n }\n\n if (next === charCodes.lowercaseN) {\n // disallow floats, legacy octal syntax and non octal decimals\n // new style octal (\"0o\") is handled in this.readRadixNumber\n if (isFloat || hasLeadingZero) {\n this.raise(Errors.InvalidBigIntLiteral, { at: startLoc });\n }\n ++this.state.pos;\n isBigInt = true;\n }\n\n if (next === charCodes.lowercaseM) {\n this.expectPlugin(\"decimal\", this.state.curPosition());\n if (hasExponent || hasLeadingZero) {\n this.raise(Errors.InvalidDecimal, { at: startLoc });\n }\n ++this.state.pos;\n isDecimal = true;\n }\n\n if (isIdentifierStart(this.codePointAtPos(this.state.pos))) {\n throw this.raise(Errors.NumberIdentifier, {\n at: this.state.curPosition(),\n });\n }\n\n // remove \"_\" for numeric literal separator, and trailing `m` or `n`\n const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, \"\");\n\n if (isBigInt) {\n this.finishToken(tt.bigint, str);\n return;\n }\n\n if (isDecimal) {\n this.finishToken(tt.decimal, str);\n return;\n }\n\n const val = isOctal ? parseInt(str, 8) : parseFloat(str);\n this.finishToken(tt.num, val);\n }\n\n // Read a string value, interpreting backslash-escapes.\n\n readCodePoint(throwOnInvalid: boolean): number | null {\n const { code, pos } = readCodePoint(\n this.input,\n this.state.pos,\n this.state.lineStart,\n this.state.curLine,\n throwOnInvalid,\n this.errorHandlers_readCodePoint,\n );\n this.state.pos = pos;\n return code;\n }\n\n readString(quote: number): void {\n const { str, pos, curLine, lineStart } = readStringContents(\n quote === charCodes.quotationMark ? \"double\" : \"single\",\n this.input,\n this.state.pos + 1, // skip the quote\n this.state.lineStart,\n this.state.curLine,\n this.errorHandlers_readStringContents_string,\n );\n this.state.pos = pos + 1; // skip the quote\n this.state.lineStart = lineStart;\n this.state.curLine = curLine;\n this.finishToken(tt.string, str);\n }\n\n // Reads template continuation `}...`\n readTemplateContinuation(): void {\n if (!this.match(tt.braceR)) {\n this.unexpected(null, tt.braceR);\n }\n // rewind pos to `}`\n this.state.pos--;\n this.readTemplateToken();\n }\n\n // Reads template string tokens.\n readTemplateToken(): void {\n const opening = this.input[this.state.pos];\n const { str, firstInvalidLoc, pos, curLine, lineStart } =\n readStringContents(\n \"template\",\n this.input,\n this.state.pos + 1, // skip '`' or `}`\n this.state.lineStart,\n this.state.curLine,\n this.errorHandlers_readStringContents_template,\n );\n this.state.pos = pos + 1; // skip '`' or `$`\n this.state.lineStart = lineStart;\n this.state.curLine = curLine;\n\n if (firstInvalidLoc) {\n this.state.firstInvalidTemplateEscapePos = new Position(\n firstInvalidLoc.curLine,\n firstInvalidLoc.pos - firstInvalidLoc.lineStart,\n firstInvalidLoc.pos,\n );\n }\n\n if (this.input.codePointAt(pos) === charCodes.graveAccent) {\n this.finishToken(\n tt.templateTail,\n firstInvalidLoc ? null : opening + str + \"`\",\n );\n } else {\n this.state.pos++; // skip '{'\n this.finishToken(\n tt.templateNonTail,\n firstInvalidLoc ? null : opening + str + \"${\",\n );\n }\n }\n\n recordStrictModeErrors(\n toParseError: DeferredStrictError,\n { at }: { at: Position },\n ) {\n const index = at.index;\n\n if (this.state.strict && !this.state.strictErrors.has(index)) {\n this.raise(toParseError, { at });\n } else {\n this.state.strictErrors.set(index, [toParseError, at]);\n }\n }\n\n // Read an identifier, and return it as a string. Sets `this.state.containsEsc`\n // to whether the word contained a '\\u' escape.\n //\n // Incrementally adds only escaped chars, adding other chunks as-is\n // as a micro-optimization.\n //\n // When `firstCode` is given, it assumes it is always an identifier start and\n // will skip reading start position again\n\n readWord1(firstCode?: number): string {\n this.state.containsEsc = false;\n let word = \"\";\n const start = this.state.pos;\n let chunkStart = this.state.pos;\n if (firstCode !== undefined) {\n this.state.pos += firstCode <= 0xffff ? 1 : 2;\n }\n\n while (this.state.pos < this.length) {\n const ch = this.codePointAtPos(this.state.pos);\n if (isIdentifierChar(ch)) {\n this.state.pos += ch <= 0xffff ? 1 : 2;\n } else if (ch === charCodes.backslash) {\n this.state.containsEsc = true;\n\n word += this.input.slice(chunkStart, this.state.pos);\n const escStart = this.state.curPosition();\n const identifierCheck =\n this.state.pos === start ? isIdentifierStart : isIdentifierChar;\n\n if (this.input.charCodeAt(++this.state.pos) !== charCodes.lowercaseU) {\n this.raise(Errors.MissingUnicodeEscape, {\n at: this.state.curPosition(),\n });\n chunkStart = this.state.pos - 1;\n continue;\n }\n\n ++this.state.pos;\n const esc = this.readCodePoint(true);\n if (esc !== null) {\n if (!identifierCheck(esc)) {\n this.raise(Errors.EscapedCharNotAnIdentifier, { at: escStart });\n }\n\n word += String.fromCodePoint(esc);\n }\n chunkStart = this.state.pos;\n } else {\n break;\n }\n }\n return word + this.input.slice(chunkStart, this.state.pos);\n }\n\n // Read an identifier or keyword token. Will check for reserved\n // words when necessary.\n\n readWord(firstCode?: number): void {\n const word = this.readWord1(firstCode);\n const type = keywordTypes.get(word);\n if (type !== undefined) {\n // We don't use word as state.value here because word is a dynamic string\n // while token label is a shared constant string\n this.finishToken(type, tokenLabelName(type));\n } else {\n this.finishToken(tt.name, word);\n }\n }\n\n checkKeywordEscapes(): void {\n const { type } = this.state;\n if (tokenIsKeyword(type) && this.state.containsEsc) {\n this.raise(Errors.InvalidEscapedReservedWord, {\n at: this.state.startLoc,\n reservedWord: tokenLabelName(type),\n });\n }\n }\n\n /**\n * Raise a `ParseError` given the appropriate properties. If passed a\n * `Position` for the `at` property, raises the `ParseError` at that location.\n * Otherwise, if passed a `Node`, raises the `ParseError` at the start\n * location of that `Node`.\n *\n * If `errorRecovery` is `true`, the error is pushed to the errors array and\n * returned. If `errorRecovery` is `false`, the error is instead thrown.\n */\n raise<ErrorDetails>(\n toParseError: ParseErrorConstructor<ErrorDetails>,\n raiseProperties: RaiseProperties<ErrorDetails>,\n ): ParseError<ErrorDetails> {\n const { at, ...details } = raiseProperties;\n const loc = at instanceof Position ? at : at.loc.start;\n // @ts-expect-error: refine details typing\n const error = toParseError({ loc, details });\n\n if (!this.options.errorRecovery) throw error;\n if (!this.isLookahead) this.state.errors.push(error);\n\n return error;\n }\n\n /**\n * If `errorRecovery` is `false`, this method behaves identically to `raise`.\n * If `errorRecovery` is `true`, this method will first see if there is\n * already an error stored at the same `Position`, and replaces it with the\n * one generated here.\n */\n raiseOverwrite<ErrorDetails>(\n toParseError: ParseErrorConstructor<ErrorDetails>,\n raiseProperties: RaiseProperties<ErrorDetails>,\n ): ParseError<ErrorDetails> | never {\n const { at, ...details } = raiseProperties;\n const loc = at instanceof Position ? at : at.loc.start;\n const pos = loc.index;\n const errors = this.state.errors;\n\n for (let i = errors.length - 1; i >= 0; i--) {\n const error = errors[i];\n if (error.loc.index === pos) {\n // @ts-expect-error: refine details typing\n return (errors[i] = toParseError({ loc, details }));\n }\n if (error.loc.index < pos) break;\n }\n\n return this.raise(toParseError, raiseProperties);\n }\n\n // updateContext is used by the jsx plugin\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n updateContext(prevType: TokenType): void {}\n\n // Raise an unexpected token error. Can take the expected token type.\n unexpected(loc?: Position | null, type?: TokenType): void {\n throw this.raise(Errors.UnexpectedToken, {\n expected: type ? tokenLabelName(type) : null,\n at: loc != null ? loc : this.state.startLoc,\n });\n }\n\n expectPlugin(pluginName: Plugin, loc?: Position): true {\n if (this.hasPlugin(pluginName)) {\n return true;\n }\n\n throw this.raise(Errors.MissingPlugin, {\n at: loc != null ? loc : this.state.startLoc,\n missingPlugin: [pluginName],\n });\n }\n\n expectOnePlugin(pluginNames: Plugin[]): void {\n if (!pluginNames.some(name => this.hasPlugin(name))) {\n throw this.raise(Errors.MissingOneOfPlugins, {\n at: this.state.startLoc,\n missingPlugin: pluginNames,\n });\n }\n }\n\n errorBuilder(error: ParseErrorConstructor<{}>) {\n return (pos: number, lineStart: number, curLine: number) => {\n this.raise(error, {\n at: buildPosition(pos, lineStart, curLine),\n });\n };\n }\n\n errorHandlers_readInt: IntErrorHandlers = {\n invalidDigit: (pos, lineStart, curLine, radix) => {\n if (!this.options.errorRecovery) return false;\n\n this.raise(Errors.InvalidDigit, {\n at: buildPosition(pos, lineStart, curLine),\n radix,\n });\n // Continue parsing the number as if there was no invalid digit.\n return true;\n },\n numericSeparatorInEscapeSequence: this.errorBuilder(\n Errors.NumericSeparatorInEscapeSequence,\n ),\n unexpectedNumericSeparator: this.errorBuilder(\n Errors.UnexpectedNumericSeparator,\n ),\n };\n\n errorHandlers_readCodePoint: CodePointErrorHandlers = {\n ...this.errorHandlers_readInt,\n invalidEscapeSequence: this.errorBuilder(Errors.InvalidEscapeSequence),\n invalidCodePoint: this.errorBuilder(Errors.InvalidCodePoint),\n };\n\n errorHandlers_readStringContents_string: StringContentsErrorHandlers = {\n ...this.errorHandlers_readCodePoint,\n strictNumericEscape: (pos, lineStart, curLine) => {\n this.recordStrictModeErrors(Errors.StrictNumericEscape, {\n at: buildPosition(pos, lineStart, curLine),\n });\n },\n unterminated: (pos, lineStart, curLine) => {\n throw this.raise(Errors.UnterminatedString, {\n // Report the error at the string quote\n at: buildPosition(pos - 1, lineStart, curLine),\n });\n },\n };\n\n errorHandlers_readStringContents_template: StringContentsErrorHandlers = {\n ...this.errorHandlers_readCodePoint,\n strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape),\n unterminated: (pos, lineStart, curLine) => {\n throw this.raise(Errors.UnterminatedTemplate, {\n at: buildPosition(pos, lineStart, curLine),\n });\n },\n };\n}\n"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AAGA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAQA,IAAAI,WAAA,GAAAJ,OAAA;AAMA,IAAAK,WAAA,GAAAL,OAAA;AAOA,IAAAM,MAAA,GAAAN,OAAA;AAGA,IAAAO,mBAAA,GAAAP,OAAA;AAOqC,MAAAQ,SAAA;EAAAC,UAAA;AAAA,SAAAC,8BAAAC,MAAA,EAAAC,QAAA,QAAAD,MAAA,yBAAAE,MAAA,WAAAC,UAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAL,MAAA,OAAAM,GAAA,EAAAC,CAAA,OAAAA,CAAA,MAAAA,CAAA,GAAAJ,UAAA,CAAAK,MAAA,EAAAD,CAAA,MAAAD,GAAA,GAAAH,UAAA,CAAAI,CAAA,OAA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E;MACrCpN,EAAE,EAAElB,GAAG,IAAI,IAAI,GAAGA,GAAG,GAAG,IAAI,CAACL,KAAK,CAACO,QAAQ;MAC3CqO,aAAa,EAAE,CAACF,UAAU;IAC5B,CAAC,CAAC;EACJ;EAEAG,eAAeA,CAACC,WAAqB,EAAQ;IAC3C,IAAI,CAACA,WAAW,CAACC,IAAI,CAACC,IAAI,IAAI,IAAI,CAACxH,SAAS,CAACwH,IAAI,CAAC,CAAC,EAAE;MACnD,MAAM,IAAI,CAAC5N,KAAK,CAACC,kBAAM,CAAC4N,mBAAmB,EAAE;QAC3C1N,EAAE,EAAE,IAAI,CAACvB,KAAK,CAACO,QAAQ;QACvBqO,aAAa,EAAEE;MACjB,CAAC,CAAC;IACJ;EACF;EAEArN,YAAYA,CAAC4M,KAAgC,EAAE;IAC7C,OAAO,CAAC7O,GAAW,EAAEC,SAAiB,EAAEC,OAAe,KAAK;MAC1D,IAAI,CAAC0B,KAAK,CAACiN,KAAK,EAAE;QAChB9M,EAAE,EAAEhC,aAAa,CAACC,GAAG,EAAEC,SAAS,EAAEC,OAAO;MAC3C,CAAC,CAAC;IACJ,CAAC;EACH;AAmDF;AAACe,OAAA,CAAAyO,OAAA,GAAAxO,SAAA"} lib/tokenizer/state.js 0000644 00000004330 15120211212 0010765 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _location = require("../util/location"); var _context = require("./context"); var _types = require("./types"); class State { constructor() { this.strict = void 0; this.curLine = void 0; this.lineStart = void 0; this.startLoc = void 0; this.endLoc = void 0; this.errors = []; this.potentialArrowAt = -1; this.noArrowAt = []; this.noArrowParamsConversionAt = []; this.maybeInArrowParameters = false; this.inType = false; this.noAnonFunctionType = false; this.hasFlowComment = false; this.isAmbientContext = false; this.inAbstractClass = false; this.inDisallowConditionalTypesContext = false; this.topicContext = { maxNumOfResolvableTopics: 0, maxTopicIndex: null }; this.soloAwait = false; this.inFSharpPipelineDirectBody = false; this.labels = []; this.comments = []; this.commentStack = []; this.pos = 0; this.type = 137; this.value = null; this.start = 0; this.end = 0; this.lastTokEndLoc = null; this.lastTokStartLoc = null; this.lastTokStart = 0; this.context = [_context.types.brace]; this.canStartJSXElement = true; this.containsEsc = false; this.firstInvalidTemplateEscapePos = null; this.strictErrors = new Map(); this.tokensLength = 0; } init({ strictMode, sourceType, startLine, startColumn }) { this.strict = strictMode === false ? false : strictMode === true ? true : sourceType === "module"; this.curLine = startLine; this.lineStart = -startColumn; this.startLoc = this.endLoc = new _location.Position(startLine, startColumn, 0); } curPosition() { return new _location.Position(this.curLine, this.pos - this.lineStart, this.pos); } clone(skipArrays) { const state = new State(); const keys = Object.keys(this); for (let i = 0, length = keys.length; i < length; i++) { const key = keys[i]; let val = this[key]; if (!skipArrays && Array.isArray(val)) { val = val.slice(); } state[key] = val; } return state; } } exports.default = State; //# sourceMappingURL=state.js.map lib/tokenizer/state.js.map 0000644 00000022006 15120211212 0011541 0 ustar 00 {"version":3,"names":["_location","require","_context","_types","State","constructor","strict","curLine","lineStart","startLoc","endLoc","errors","potentialArrowAt","noArrowAt","noArrowParamsConversionAt","maybeInArrowParameters","inType","noAnonFunctionType","hasFlowComment","isAmbientContext","inAbstractClass","inDisallowConditionalTypesContext","topicContext","maxNumOfResolvableTopics","maxTopicIndex","soloAwait","inFSharpPipelineDirectBody","labels","comments","commentStack","pos","type","value","start","end","lastTokEndLoc","lastTokStartLoc","lastTokStart","context","ct","brace","canStartJSXElement","containsEsc","firstInvalidTemplateEscapePos","strictErrors","Map","tokensLength","init","strictMode","sourceType","startLine","startColumn","Position","curPosition","clone","skipArrays","state","keys","Object","i","length","key","val","Array","isArray","slice","exports","default"],"sources":["../../src/tokenizer/state.ts"],"sourcesContent":["import type { Options } from \"../options\";\nimport type * as N from \"../types\";\nimport type { CommentWhitespace } from \"../parser/comments\";\nimport { Position } from \"../util/location\";\n\nimport { types as ct, type TokContext } from \"./context\";\nimport { tt, type TokenType } from \"./types\";\nimport type { Errors } from \"../parse-error\";\nimport type { ParseError } from \"../parse-error\";\n\nexport type DeferredStrictError =\n | typeof Errors.StrictNumericEscape\n | typeof Errors.StrictOctalLiteral;\n\ntype TopicContextState = {\n // When a topic binding has been currently established,\n // then this is 1. Otherwise, it is 0. This is forwards compatible\n // with a future plugin for multiple lexical topics.\n maxNumOfResolvableTopics: number;\n // When a topic binding has been currently established, and if that binding\n // has been used as a topic reference `#`, then this is 0. Otherwise, it is\n // `null`. This is forwards compatible with a future plugin for multiple\n // lexical topics.\n maxTopicIndex: null | 0;\n};\n\nexport default class State {\n strict: boolean;\n curLine: number;\n lineStart: number;\n\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n startLoc: Position;\n endLoc: Position;\n\n init({ strictMode, sourceType, startLine, startColumn }: Options): void {\n this.strict =\n strictMode === false\n ? false\n : strictMode === true\n ? true\n : sourceType === \"module\";\n\n this.curLine = startLine;\n this.lineStart = -startColumn;\n this.startLoc = this.endLoc = new Position(startLine, startColumn, 0);\n }\n\n errors: ParseError<any>[] = [];\n\n // Used to signify the start of a potential arrow function\n potentialArrowAt: number = -1;\n\n // Used to signify the start of an expression which looks like a\n // typed arrow function, but it isn't\n // e.g. a ? (b) : c => d\n // ^\n noArrowAt: number[] = [];\n\n // Used to signify the start of an expression whose params, if it looks like\n // an arrow function, shouldn't be converted to assignable nodes.\n // This is used to defer the validation of typed arrow functions inside\n // conditional expressions.\n // e.g. a ? (b) : c => d\n // ^\n noArrowParamsConversionAt: number[] = [];\n\n // Flags to track\n maybeInArrowParameters: boolean = false;\n inType: boolean = false;\n noAnonFunctionType: boolean = false;\n hasFlowComment: boolean = false;\n isAmbientContext: boolean = false;\n inAbstractClass: boolean = false;\n inDisallowConditionalTypesContext: boolean = false;\n\n // For the Hack-style pipelines plugin\n topicContext: TopicContextState = {\n maxNumOfResolvableTopics: 0,\n maxTopicIndex: null,\n };\n\n // For the F#-style pipelines plugin\n soloAwait: boolean = false;\n inFSharpPipelineDirectBody: boolean = false;\n\n // Labels in scope.\n labels: Array<{\n kind: \"loop\" | \"switch\" | undefined | null;\n name?: string | null;\n statementStart?: number;\n }> = [];\n\n // Comment store for Program.comments\n comments: Array<N.Comment> = [];\n\n // Comment attachment store\n commentStack: Array<CommentWhitespace> = [];\n\n // The current position of the tokenizer in the input.\n pos: number = 0;\n\n // Properties of the current token:\n // Its type\n type: TokenType = tt.eof;\n\n // For tokens that include more information than their type, the value\n value: any = null;\n\n // Its start and end offset\n start: number = 0;\n end: number = 0;\n\n // Position information for the previous token\n // this is initialized when generating the second token.\n lastTokEndLoc: Position = null;\n // this is initialized when generating the second token.\n lastTokStartLoc: Position = null;\n lastTokStart: number = 0;\n\n // The context stack is used to track whether the apostrophe \"`\" starts\n // or ends a string template\n context: Array<TokContext> = [ct.brace];\n // Used to track whether a JSX element is allowed to form\n canStartJSXElement: boolean = true;\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n containsEsc: boolean = false;\n\n // Used to track invalid escape sequences in template literals,\n // that must be reported if the template is not tagged.\n firstInvalidTemplateEscapePos: null | Position = null;\n\n // This property is used to track the following errors\n // - StrictNumericEscape\n // - StrictOctalLiteral\n //\n // in a literal that occurs prior to/immediately after a \"use strict\" directive.\n\n // todo(JLHwung): set strictErrors to null and avoid recording string errors\n // after a non-directive is parsed\n strictErrors: Map<number, [DeferredStrictError, Position]> = new Map();\n\n // Tokens length in token store\n tokensLength: number = 0;\n\n curPosition(): Position {\n return new Position(this.curLine, this.pos - this.lineStart, this.pos);\n }\n\n clone(skipArrays?: boolean): State {\n const state = new State();\n const keys = Object.keys(this) as (keyof State)[];\n for (let i = 0, length = keys.length; i < length; i++) {\n const key = keys[i];\n let val = this[key];\n\n if (!skipArrays && Array.isArray(val)) {\n val = val.slice();\n }\n\n // @ts-expect-error val must conform to S[key]\n state[key] = val;\n }\n\n return state;\n }\n}\n\nexport type LookaheadState = {\n pos: number;\n value: any;\n type: TokenType;\n start: number;\n end: number;\n context: TokContext[];\n startLoc: Position;\n lastTokEndLoc: Position;\n curLine: number;\n lineStart: number;\n curPosition: () => Position;\n /* Used only in readToken_mult_modulo */\n inType: boolean;\n // These boolean properties are not initialized in createLookaheadState()\n // instead they will only be set by the tokenizer\n containsEsc?: boolean;\n};\n"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAoBe,MAAMG,KAAK,CAAC;EAAAC,YAAA;IAAA,KACzBC,MAAM;IAAA,KACNC,OAAO;IAAA,KACPC,SAAS;IAAA,KAITC,QAAQ;IAAA,KACRC,MAAM;IAAA,KAeNC,MAAM,GAAsB,EAAE;IAAA,KAG9BC,gBAAgB,GAAW,CAAC,CAAC;IAAA,KAM7BC,SAAS,GAAa,EAAE;IAAA,KAQxBC,yBAAyB,GAAa,EAAE;IAAA,KAGxCC,sBAAsB,GAAY,KAAK;IAAA,KACvCC,MAAM,GAAY,KAAK;IAAA,KACvBC,kBAAkB,GAAY,KAAK;IAAA,KACnCC,cAAc,GAAY,KAAK;IAAA,KAC/BC,gBAAgB,GAAY,KAAK;IAAA,KACjCC,eAAe,GAAY,KAAK;IAAA,KAChCC,iCAAiC,GAAY,KAAK;IAAA,KAGlDC,YAAY,GAAsB;MAChCC,wBAAwB,EAAE,CAAC;MAC3BC,aAAa,EAAE;IACjB,CAAC;IAAA,KAGDC,SAAS,GAAY,KAAK;IAAA,KAC1BC,0BAA0B,GAAY,KAAK;IAAA,KAG3CC,MAAM,GAID,EAAE;IAAA,KAGPC,QAAQ,GAAqB,EAAE;IAAA,KAG/BC,YAAY,GAA6B,EAAE;IAAA,KAG3CC,GAAG,GAAW,CAAC;IAAA,KAIfC,IAAI;IAAA,KAGJC,KAAK,GAAQ,IAAI;IAAA,KAGjBC,KAAK,GAAW,CAAC;IAAA,KACjBC,GAAG,GAAW,CAAC;IAAA,KAIfC,aAAa,GAAa,IAAI;IAA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CAAC;MACnB,IAAIG,GAAG,GAAG,IAAI,CAACD,GAAG,CAAC;MAEnB,IAAI,CAACN,UAAU,IAAIQ,KAAK,CAACC,OAAO,CAACF,GAAG,CAAC,EAAE;QACrCA,GAAG,GAAGA,GAAG,CAACG,KAAK,CAAC,CAAC;MACnB;MAGAT,KAAK,CAACK,GAAG,CAAC,GAAGC,GAAG;IAClB;IAEA,OAAON,KAAK;EACd;AACF;AAACU,OAAA,CAAAC,OAAA,GAAA/D,KAAA"} lib/tokenizer/types.js 0000644 00000033740 15120211212 0011020 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExportedTokenType = void 0; exports.getExportedToken = getExportedToken; exports.isTokenType = isTokenType; exports.keywords = void 0; exports.tokenCanStartExpression = tokenCanStartExpression; exports.tokenComesBeforeExpression = tokenComesBeforeExpression; exports.tokenIsAssignment = tokenIsAssignment; exports.tokenIsBinaryOperator = tokenIsBinaryOperator; exports.tokenIsFlowInterfaceOrTypeOrOpaque = tokenIsFlowInterfaceOrTypeOrOpaque; exports.tokenIsIdentifier = tokenIsIdentifier; exports.tokenIsKeyword = tokenIsKeyword; exports.tokenIsKeywordOrIdentifier = tokenIsKeywordOrIdentifier; exports.tokenIsLiteralPropertyName = tokenIsLiteralPropertyName; exports.tokenIsLoop = tokenIsLoop; exports.tokenIsOperator = tokenIsOperator; exports.tokenIsPostfix = tokenIsPostfix; exports.tokenIsPrefix = tokenIsPrefix; exports.tokenIsRightAssociative = tokenIsRightAssociative; exports.tokenIsTSDeclarationStart = tokenIsTSDeclarationStart; exports.tokenIsTSTypeOperator = tokenIsTSTypeOperator; exports.tokenIsTemplate = tokenIsTemplate; exports.tokenKeywordOrIdentifierIsKeyword = tokenKeywordOrIdentifierIsKeyword; exports.tokenLabelName = tokenLabelName; exports.tokenOperatorPrecedence = tokenOperatorPrecedence; exports.tt = exports.tokenTypes = void 0; var _context = require("./context"); const beforeExpr = true; const startsExpr = true; const isLoop = true; const isAssign = true; const prefix = true; const postfix = true; class ExportedTokenType { constructor(label, conf = {}) { this.label = void 0; this.keyword = void 0; this.beforeExpr = void 0; this.startsExpr = void 0; this.rightAssociative = void 0; this.isLoop = void 0; this.isAssign = void 0; this.prefix = void 0; this.postfix = void 0; this.binop = void 0; this.label = label; this.keyword = conf.keyword; this.beforeExpr = !!conf.beforeExpr; this.startsExpr = !!conf.startsExpr; this.rightAssociative = !!conf.rightAssociative; this.isLoop = !!conf.isLoop; this.isAssign = !!conf.isAssign; this.prefix = !!conf.prefix; this.postfix = !!conf.postfix; this.binop = conf.binop != null ? conf.binop : null; { this.updateContext = null; } } } exports.ExportedTokenType = ExportedTokenType; const keywords = new Map(); exports.keywords = keywords; function createKeyword(name, options = {}) { options.keyword = name; const token = createToken(name, options); keywords.set(name, token); return token; } function createBinop(name, binop) { return createToken(name, { beforeExpr, binop }); } let tokenTypeCounter = -1; const tokenTypes = []; exports.tokenTypes = tokenTypes; const tokenLabels = []; const tokenBinops = []; const tokenBeforeExprs = []; const tokenStartsExprs = []; const tokenPrefixes = []; function createToken(name, options = {}) { var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix; ++tokenTypeCounter; tokenLabels.push(name); tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1); tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false); tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false); tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false); tokenTypes.push(new ExportedTokenType(name, options)); return tokenTypeCounter; } function createKeywordLike(name, options = {}) { var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2; ++tokenTypeCounter; keywords.set(name, tokenTypeCounter); tokenLabels.push(name); tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1); tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false); tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false); tokenPrefixes.push((_options$prefix2 = options.prefix) != null ? _options$prefix2 : false); tokenTypes.push(new ExportedTokenType("name", options)); return tokenTypeCounter; } const tt = { bracketL: createToken("[", { beforeExpr, startsExpr }), bracketHashL: createToken("#[", { beforeExpr, startsExpr }), bracketBarL: createToken("[|", { beforeExpr, startsExpr }), bracketR: createToken("]"), bracketBarR: createToken("|]"), braceL: createToken("{", { beforeExpr, startsExpr }), braceBarL: createToken("{|", { beforeExpr, startsExpr }), braceHashL: createToken("#{", { beforeExpr, startsExpr }), braceR: createToken("}"), braceBarR: createToken("|}"), parenL: createToken("(", { beforeExpr, startsExpr }), parenR: createToken(")"), comma: createToken(",", { beforeExpr }), semi: createToken(";", { beforeExpr }), colon: createToken(":", { beforeExpr }), doubleColon: createToken("::", { beforeExpr }), dot: createToken("."), question: createToken("?", { beforeExpr }), questionDot: createToken("?."), arrow: createToken("=>", { beforeExpr }), template: createToken("template"), ellipsis: createToken("...", { beforeExpr }), backQuote: createToken("`", { startsExpr }), dollarBraceL: createToken("${", { beforeExpr, startsExpr }), templateTail: createToken("...`", { startsExpr }), templateNonTail: createToken("...${", { beforeExpr, startsExpr }), at: createToken("@"), hash: createToken("#", { startsExpr }), interpreterDirective: createToken("#!..."), eq: createToken("=", { beforeExpr, isAssign }), assign: createToken("_=", { beforeExpr, isAssign }), slashAssign: createToken("_=", { beforeExpr, isAssign }), xorAssign: createToken("_=", { beforeExpr, isAssign }), moduloAssign: createToken("_=", { beforeExpr, isAssign }), incDec: createToken("++/--", { prefix, postfix, startsExpr }), bang: createToken("!", { beforeExpr, prefix, startsExpr }), tilde: createToken("~", { beforeExpr, prefix, startsExpr }), doubleCaret: createToken("^^", { startsExpr }), doubleAt: createToken("@@", { startsExpr }), pipeline: createBinop("|>", 0), nullishCoalescing: createBinop("??", 1), logicalOR: createBinop("||", 1), logicalAND: createBinop("&&", 2), bitwiseOR: createBinop("|", 3), bitwiseXOR: createBinop("^", 4), bitwiseAND: createBinop("&", 5), equality: createBinop("==/!=/===/!==", 6), lt: createBinop("</>/<=/>=", 7), gt: createBinop("</>/<=/>=", 7), relational: createBinop("</>/<=/>=", 7), bitShift: createBinop("<</>>/>>>", 8), bitShiftL: createBinop("<</>>/>>>", 8), bitShiftR: createBinop("<</>>/>>>", 8), plusMin: createToken("+/-", { beforeExpr, binop: 9, prefix, startsExpr }), modulo: createToken("%", { binop: 10, startsExpr }), star: createToken("*", { binop: 10 }), slash: createBinop("/", 10), exponent: createToken("**", { beforeExpr, binop: 11, rightAssociative: true }), _in: createKeyword("in", { beforeExpr, binop: 7 }), _instanceof: createKeyword("instanceof", { beforeExpr, binop: 7 }), _break: createKeyword("break"), _case: createKeyword("case", { beforeExpr }), _catch: createKeyword("catch"), _continue: createKeyword("continue"), _debugger: createKeyword("debugger"), _default: createKeyword("default", { beforeExpr }), _else: createKeyword("else", { beforeExpr }), _finally: createKeyword("finally"), _function: createKeyword("function", { startsExpr }), _if: createKeyword("if"), _return: createKeyword("return", { beforeExpr }), _switch: createKeyword("switch"), _throw: createKeyword("throw", { beforeExpr, prefix, startsExpr }), _try: createKeyword("try"), _var: createKeyword("var"), _const: createKeyword("const"), _with: createKeyword("with"), _new: createKeyword("new", { beforeExpr, startsExpr }), _this: createKeyword("this", { startsExpr }), _super: createKeyword("super", { startsExpr }), _class: createKeyword("class", { startsExpr }), _extends: createKeyword("extends", { beforeExpr }), _export: createKeyword("export"), _import: createKeyword("import", { startsExpr }), _null: createKeyword("null", { startsExpr }), _true: createKeyword("true", { startsExpr }), _false: createKeyword("false", { startsExpr }), _typeof: createKeyword("typeof", { beforeExpr, prefix, startsExpr }), _void: createKeyword("void", { beforeExpr, prefix, startsExpr }), _delete: createKeyword("delete", { beforeExpr, prefix, startsExpr }), _do: createKeyword("do", { isLoop, beforeExpr }), _for: createKeyword("for", { isLoop }), _while: createKeyword("while", { isLoop }), _as: createKeywordLike("as", { startsExpr }), _assert: createKeywordLike("assert", { startsExpr }), _async: createKeywordLike("async", { startsExpr }), _await: createKeywordLike("await", { startsExpr }), _from: createKeywordLike("from", { startsExpr }), _get: createKeywordLike("get", { startsExpr }), _let: createKeywordLike("let", { startsExpr }), _meta: createKeywordLike("meta", { startsExpr }), _of: createKeywordLike("of", { startsExpr }), _sent: createKeywordLike("sent", { startsExpr }), _set: createKeywordLike("set", { startsExpr }), _static: createKeywordLike("static", { startsExpr }), _using: createKeywordLike("using", { startsExpr }), _yield: createKeywordLike("yield", { startsExpr }), _asserts: createKeywordLike("asserts", { startsExpr }), _checks: createKeywordLike("checks", { startsExpr }), _exports: createKeywordLike("exports", { startsExpr }), _global: createKeywordLike("global", { startsExpr }), _implements: createKeywordLike("implements", { startsExpr }), _intrinsic: createKeywordLike("intrinsic", { startsExpr }), _infer: createKeywordLike("infer", { startsExpr }), _is: createKeywordLike("is", { startsExpr }), _mixins: createKeywordLike("mixins", { startsExpr }), _proto: createKeywordLike("proto", { startsExpr }), _require: createKeywordLike("require", { startsExpr }), _satisfies: createKeywordLike("satisfies", { startsExpr }), _keyof: createKeywordLike("keyof", { startsExpr }), _readonly: createKeywordLike("readonly", { startsExpr }), _unique: createKeywordLike("unique", { startsExpr }), _abstract: createKeywordLike("abstract", { startsExpr }), _declare: createKeywordLike("declare", { startsExpr }), _enum: createKeywordLike("enum", { startsExpr }), _module: createKeywordLike("module", { startsExpr }), _namespace: createKeywordLike("namespace", { startsExpr }), _interface: createKeywordLike("interface", { startsExpr }), _type: createKeywordLike("type", { startsExpr }), _opaque: createKeywordLike("opaque", { startsExpr }), name: createToken("name", { startsExpr }), string: createToken("string", { startsExpr }), num: createToken("num", { startsExpr }), bigint: createToken("bigint", { startsExpr }), decimal: createToken("decimal", { startsExpr }), regexp: createToken("regexp", { startsExpr }), privateName: createToken("#name", { startsExpr }), eof: createToken("eof"), jsxName: createToken("jsxName"), jsxText: createToken("jsxText", { beforeExpr: true }), jsxTagStart: createToken("jsxTagStart", { startsExpr: true }), jsxTagEnd: createToken("jsxTagEnd"), placeholder: createToken("%%", { startsExpr: true }) }; exports.tt = tt; function tokenIsIdentifier(token) { return token >= 93 && token <= 130; } function tokenKeywordOrIdentifierIsKeyword(token) { return token <= 92; } function tokenIsKeywordOrIdentifier(token) { return token >= 58 && token <= 130; } function tokenIsLiteralPropertyName(token) { return token >= 58 && token <= 134; } function tokenComesBeforeExpression(token) { return tokenBeforeExprs[token]; } function tokenCanStartExpression(token) { return tokenStartsExprs[token]; } function tokenIsAssignment(token) { return token >= 29 && token <= 33; } function tokenIsFlowInterfaceOrTypeOrOpaque(token) { return token >= 127 && token <= 129; } function tokenIsLoop(token) { return token >= 90 && token <= 92; } function tokenIsKeyword(token) { return token >= 58 && token <= 92; } function tokenIsOperator(token) { return token >= 39 && token <= 59; } function tokenIsPostfix(token) { return token === 34; } function tokenIsPrefix(token) { return tokenPrefixes[token]; } function tokenIsTSTypeOperator(token) { return token >= 119 && token <= 121; } function tokenIsTSDeclarationStart(token) { return token >= 122 && token <= 128; } function tokenLabelName(token) { return tokenLabels[token]; } function tokenOperatorPrecedence(token) { return tokenBinops[token]; } function tokenIsBinaryOperator(token) { return tokenBinops[token] !== -1; } function tokenIsRightAssociative(token) { return token === 57; } function tokenIsTemplate(token) { return token >= 24 && token <= 25; } function getExportedToken(token) { return tokenTypes[token]; } function isTokenType(obj) { return typeof obj === "number"; } { tokenTypes[8].updateContext = context => { context.pop(); }; tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = context => { context.push(_context.types.brace); }; tokenTypes[22].updateContext = context => { if (context[context.length - 1] === _context.types.template) { context.pop(); } else { context.push(_context.types.template); } }; tokenTypes[140].updateContext = context => { context.push(_context.types.j_expr, _context.types.j_oTag); }; } //# sourceMappingURL=types.js.map lib/tokenizer/types.js.map 0000644 00000102525 15120211212 0011572 0 ustar 00 {"version":3,"names":["_context","require","beforeExpr","startsExpr","isLoop","isAssign","prefix","postfix","ExportedTokenType","constructor","label","conf","keyword","rightAssociative","binop","updateContext","exports","keywords","Map","createKeyword","name","options","token","createToken","set","createBinop","tokenTypeCounter","tokenTypes","tokenLabels","tokenBinops","tokenBeforeExprs","tokenStartsExprs","tokenPrefixes","_options$binop","_options$beforeExpr","_options$startsExpr","_options$prefix","push","createKeywordLike","_options$binop2","_options$beforeExpr2","_options$startsExpr2","_options$prefix2","tt","bracketL","bracketHashL","bracketBarL","bracketR","bracketBarR","braceL","braceBarL","braceHashL","braceR","braceBarR","parenL","parenR","comma","semi","colon","doubleColon","dot","question","questionDot","arrow","template","ellipsis","backQuote","dollarBraceL","templateTail","templateNonTail","at","hash","interpreterDirective","eq","assign","slashAssign","xorAssign","moduloAssign","incDec","bang","tilde","doubleCaret","doubleAt","pipeline","nullishCoalescing","logicalOR","logicalAND","bitwiseOR","bitwiseXOR","bitwiseAND","equality","lt","gt","relational","bitShift","bitShiftL","bitShiftR","plusMin","modulo","star","slash","exponent","_in","_instanceof","_break","_case","_catch","_continue","_debugger","_default","_else","_finally","_function","_if","_return","_switch","_throw","_try","_var","_const","_with","_new","_this","_super","_class","_extends","_export","_import","_null","_true","_false","_typeof","_void","_delete","_do","_for","_while","_as","_assert","_async","_await","_from","_get","_let","_meta","_of","_sent","_set","_static","_using","_yield","_asserts","_checks","_exports","_global","_implements","_intrinsic","_infer","_is","_mixins","_proto","_require","_satisfies","_keyof","_readonly","_unique","_abstract","_declare","_enum","_module","_namespace","_interface","_type","_opaque","string","num","bigint","decimal","regexp","privateName","eof","jsxName","jsxText","jsxTagStart","jsxTagEnd","placeholder","tokenIsIdentifier","tokenKeywordOrIdentifierIsKeyword","tokenIsKeywordOrIdentifier","tokenIsLiteralPropertyName","tokenComesBeforeExpression","tokenCanStartExpression","tokenIsAssignment","tokenIsFlowInterfaceOrTypeOrOpaque","tokenIsLoop","tokenIsKeyword","tokenIsOperator","tokenIsPostfix","tokenIsPrefix","tokenIsTSTypeOperator","tokenIsTSDeclarationStart","tokenLabelName","tokenOperatorPrecedence","tokenIsBinaryOperator","tokenIsRightAssociative","tokenIsTemplate","getExportedToken","isTokenType","obj","context","pop","tc","brace","length","j_expr","j_oTag"],"sources":["../../src/tokenizer/types.ts"],"sourcesContent":["import { types as tc, type TokContext } from \"./context\";\n// ## Token types\n\n// The assignment of fine-grained, information-carrying type objects\n// allows the tokenizer to store the information it has about a\n// token in a way that is very cheap for the parser to look up.\n\n// All token type variables start with an underscore, to make them\n// easy to recognize.\n\n// The `beforeExpr` property is used to disambiguate between 1) binary\n// expression (<) and JSX Tag start (<name>); 2) object literal and JSX\n// texts. It is set on the `updateContext` function in the JSX plugin.\n\n// The `startsExpr` property is used to determine whether an expression\n// may be the “argument” subexpression of a `yield` expression or\n// `yield` statement. It is set on all token types that may be at the\n// start of a subexpression.\n\n// `isLoop` marks a keyword as starting a loop, which is important\n// to know when parsing a label, in order to allow or disallow\n// continue jumps to that label.\n\nconst beforeExpr = true;\nconst startsExpr = true;\nconst isLoop = true;\nconst isAssign = true;\nconst prefix = true;\nconst postfix = true;\n\ntype TokenOptions = {\n keyword?: string;\n beforeExpr?: boolean;\n startsExpr?: boolean;\n rightAssociative?: boolean;\n isLoop?: boolean;\n isAssign?: boolean;\n prefix?: boolean;\n postfix?: boolean;\n binop?: number | null;\n};\n\n// Internally the tokenizer stores token as a number\nexport type TokenType = number;\n\n// The `ExportedTokenType` is exported via `tokTypes` and accessible\n// when `tokens: true` is enabled. Unlike internal token type, it provides\n// metadata of the tokens.\nexport class ExportedTokenType {\n label: string;\n keyword: string | undefined | null;\n beforeExpr: boolean;\n startsExpr: boolean;\n rightAssociative: boolean;\n isLoop: boolean;\n isAssign: boolean;\n prefix: boolean;\n postfix: boolean;\n binop: number | undefined | null;\n // todo(Babel 8): remove updateContext from exposed token layout\n declare updateContext:\n | ((context: Array<TokContext>) => void)\n | undefined\n | null;\n\n constructor(label: string, conf: TokenOptions = {}) {\n this.label = label;\n this.keyword = conf.keyword;\n this.beforeExpr = !!conf.beforeExpr;\n this.startsExpr = !!conf.startsExpr;\n this.rightAssociative = !!conf.rightAssociative;\n this.isLoop = !!conf.isLoop;\n this.isAssign = !!conf.isAssign;\n this.prefix = !!conf.prefix;\n this.postfix = !!conf.postfix;\n this.binop = conf.binop != null ? conf.binop : null;\n if (!process.env.BABEL_8_BREAKING) {\n this.updateContext = null;\n }\n }\n}\n\n// A map from keyword/keyword-like string value to the token type\nexport const keywords = new Map<string, TokenType>();\n\nfunction createKeyword(name: string, options: TokenOptions = {}): TokenType {\n options.keyword = name;\n const token = createToken(name, options);\n keywords.set(name, token);\n return token;\n}\n\nfunction createBinop(name: string, binop: number) {\n return createToken(name, { beforeExpr, binop });\n}\n\nlet tokenTypeCounter = -1;\nexport const tokenTypes: ExportedTokenType[] = [];\nconst tokenLabels: string[] = [];\nconst tokenBinops: number[] = [];\nconst tokenBeforeExprs: boolean[] = [];\nconst tokenStartsExprs: boolean[] = [];\nconst tokenPrefixes: boolean[] = [];\n\nfunction createToken(name: string, options: TokenOptions = {}): TokenType {\n ++tokenTypeCounter;\n tokenLabels.push(name);\n tokenBinops.push(options.binop ?? -1);\n tokenBeforeExprs.push(options.beforeExpr ?? false);\n tokenStartsExprs.push(options.startsExpr ?? false);\n tokenPrefixes.push(options.prefix ?? false);\n tokenTypes.push(new ExportedTokenType(name, options));\n\n return tokenTypeCounter;\n}\n\nfunction createKeywordLike(\n name: string,\n options: TokenOptions = {},\n): TokenType {\n ++tokenTypeCounter;\n keywords.set(name, tokenTypeCounter);\n tokenLabels.push(name);\n tokenBinops.push(options.binop ?? -1);\n tokenBeforeExprs.push(options.beforeExpr ?? false);\n tokenStartsExprs.push(options.startsExpr ?? false);\n tokenPrefixes.push(options.prefix ?? false);\n // In the exported token type, we set the label as \"name\" for backward compatibility with Babel 7\n tokenTypes.push(new ExportedTokenType(\"name\", options));\n\n return tokenTypeCounter;\n}\n\n// For performance the token type helpers depend on the following declarations order.\n// When adding new token types, please also check if the token helpers need update.\n\nexport type InternalTokenTypes = typeof tt;\n\nexport const tt = {\n // Punctuation token types.\n bracketL: createToken(\"[\", { beforeExpr, startsExpr }),\n bracketHashL: createToken(\"#[\", { beforeExpr, startsExpr }),\n bracketBarL: createToken(\"[|\", { beforeExpr, startsExpr }),\n bracketR: createToken(\"]\"),\n bracketBarR: createToken(\"|]\"),\n braceL: createToken(\"{\", { beforeExpr, startsExpr }),\n braceBarL: createToken(\"{|\", { beforeExpr, startsExpr }),\n braceHashL: createToken(\"#{\", { beforeExpr, startsExpr }),\n braceR: createToken(\"}\"),\n braceBarR: createToken(\"|}\"),\n parenL: createToken(\"(\", { beforeExpr, startsExpr }),\n parenR: createToken(\")\"),\n comma: createToken(\",\", { beforeExpr }),\n semi: createToken(\";\", { beforeExpr }),\n colon: createToken(\":\", { beforeExpr }),\n doubleColon: createToken(\"::\", { beforeExpr }),\n dot: createToken(\".\"),\n question: createToken(\"?\", { beforeExpr }),\n questionDot: createToken(\"?.\"),\n arrow: createToken(\"=>\", { beforeExpr }),\n template: createToken(\"template\"),\n ellipsis: createToken(\"...\", { beforeExpr }),\n backQuote: createToken(\"`\", { startsExpr }),\n dollarBraceL: createToken(\"${\", { beforeExpr, startsExpr }),\n // start: isTemplate\n templateTail: createToken(\"...`\", { startsExpr }),\n templateNonTail: createToken(\"...${\", { beforeExpr, startsExpr }),\n // end: isTemplate\n at: createToken(\"@\"),\n hash: createToken(\"#\", { startsExpr }),\n\n // Special hashbang token.\n interpreterDirective: createToken(\"#!...\"),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n // start: isAssign\n eq: createToken(\"=\", { beforeExpr, isAssign }),\n assign: createToken(\"_=\", { beforeExpr, isAssign }),\n slashAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n // These are only needed to support % and ^ as a Hack-pipe topic token.\n // When the proposal settles on a token, the others can be merged with\n // tt.assign.\n xorAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n moduloAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n // end: isAssign\n\n incDec: createToken(\"++/--\", { prefix, postfix, startsExpr }),\n bang: createToken(\"!\", { beforeExpr, prefix, startsExpr }),\n tilde: createToken(\"~\", { beforeExpr, prefix, startsExpr }),\n\n // More possible topic tokens.\n // When the proposal settles on a token, at least one of these may be removed.\n doubleCaret: createToken(\"^^\", { startsExpr }),\n doubleAt: createToken(\"@@\", { startsExpr }),\n\n // start: isBinop\n pipeline: createBinop(\"|>\", 0),\n nullishCoalescing: createBinop(\"??\", 1),\n logicalOR: createBinop(\"||\", 1),\n logicalAND: createBinop(\"&&\", 2),\n bitwiseOR: createBinop(\"|\", 3),\n bitwiseXOR: createBinop(\"^\", 4),\n bitwiseAND: createBinop(\"&\", 5),\n equality: createBinop(\"==/!=/===/!==\", 6),\n lt: createBinop(\"</>/<=/>=\", 7),\n gt: createBinop(\"</>/<=/>=\", 7),\n relational: createBinop(\"</>/<=/>=\", 7),\n bitShift: createBinop(\"<</>>/>>>\", 8),\n bitShiftL: createBinop(\"<</>>/>>>\", 8),\n bitShiftR: createBinop(\"<</>>/>>>\", 8),\n plusMin: createToken(\"+/-\", { beforeExpr, binop: 9, prefix, startsExpr }),\n // startsExpr: required by v8intrinsic plugin\n modulo: createToken(\"%\", { binop: 10, startsExpr }),\n // unset `beforeExpr` as it can be `function *`\n star: createToken(\"*\", { binop: 10 }),\n slash: createBinop(\"/\", 10),\n exponent: createToken(\"**\", {\n beforeExpr,\n binop: 11,\n rightAssociative: true,\n }),\n\n // Keywords\n // Don't forget to update packages/babel-helper-validator-identifier/src/keyword.js\n // when new keywords are added\n // start: isLiteralPropertyName\n // start: isKeyword\n _in: createKeyword(\"in\", { beforeExpr, binop: 7 }),\n _instanceof: createKeyword(\"instanceof\", { beforeExpr, binop: 7 }),\n // end: isBinop\n _break: createKeyword(\"break\"),\n _case: createKeyword(\"case\", { beforeExpr }),\n _catch: createKeyword(\"catch\"),\n _continue: createKeyword(\"continue\"),\n _debugger: createKeyword(\"debugger\"),\n _default: createKeyword(\"default\", { beforeExpr }),\n _else: createKeyword(\"else\", { beforeExpr }),\n _finally: createKeyword(\"finally\"),\n _function: createKeyword(\"function\", { startsExpr }),\n _if: createKeyword(\"if\"),\n _return: createKeyword(\"return\", { beforeExpr }),\n _switch: createKeyword(\"switch\"),\n _throw: createKeyword(\"throw\", { beforeExpr, prefix, startsExpr }),\n _try: createKeyword(\"try\"),\n _var: createKeyword(\"var\"),\n _const: createKeyword(\"const\"),\n _with: createKeyword(\"with\"),\n _new: createKeyword(\"new\", { beforeExpr, startsExpr }),\n _this: createKeyword(\"this\", { startsExpr }),\n _super: createKeyword(\"super\", { startsExpr }),\n _class: createKeyword(\"class\", { startsExpr }),\n _extends: createKeyword(\"extends\", { beforeExpr }),\n _export: createKeyword(\"export\"),\n _import: createKeyword(\"import\", { startsExpr }),\n _null: createKeyword(\"null\", { startsExpr }),\n _true: createKeyword(\"true\", { startsExpr }),\n _false: createKeyword(\"false\", { startsExpr }),\n _typeof: createKeyword(\"typeof\", { beforeExpr, prefix, startsExpr }),\n _void: createKeyword(\"void\", { beforeExpr, prefix, startsExpr }),\n _delete: createKeyword(\"delete\", { beforeExpr, prefix, startsExpr }),\n // start: isLoop\n _do: createKeyword(\"do\", { isLoop, beforeExpr }),\n _for: createKeyword(\"for\", { isLoop }),\n _while: createKeyword(\"while\", { isLoop }),\n // end: isLoop\n // end: isKeyword\n\n // Primary literals\n // start: isIdentifier\n _as: createKeywordLike(\"as\", { startsExpr }),\n _assert: createKeywordLike(\"assert\", { startsExpr }),\n _async: createKeywordLike(\"async\", { startsExpr }),\n _await: createKeywordLike(\"await\", { startsExpr }),\n _from: createKeywordLike(\"from\", { startsExpr }),\n _get: createKeywordLike(\"get\", { startsExpr }),\n _let: createKeywordLike(\"let\", { startsExpr }),\n _meta: createKeywordLike(\"meta\", { startsExpr }),\n _of: createKeywordLike(\"of\", { startsExpr }),\n _sent: createKeywordLike(\"sent\", { startsExpr }),\n _set: createKeywordLike(\"set\", { startsExpr }),\n _static: createKeywordLike(\"static\", { startsExpr }),\n _using: createKeywordLike(\"using\", { startsExpr }),\n _yield: createKeywordLike(\"yield\", { startsExpr }),\n\n // Flow and TypeScript Keywordlike\n _asserts: createKeywordLike(\"asserts\", { startsExpr }),\n _checks: createKeywordLike(\"checks\", { startsExpr }),\n _exports: createKeywordLike(\"exports\", { startsExpr }),\n _global: createKeywordLike(\"global\", { startsExpr }),\n _implements: createKeywordLike(\"implements\", { startsExpr }),\n _intrinsic: createKeywordLike(\"intrinsic\", { startsExpr }),\n _infer: createKeywordLike(\"infer\", { startsExpr }),\n _is: createKeywordLike(\"is\", { startsExpr }),\n _mixins: createKeywordLike(\"mixins\", { startsExpr }),\n _proto: createKeywordLike(\"proto\", { startsExpr }),\n _require: createKeywordLike(\"require\", { startsExpr }),\n _satisfies: createKeywordLike(\"satisfies\", { startsExpr }),\n // start: isTSTypeOperator\n _keyof: createKeywordLike(\"keyof\", { startsExpr }),\n _readonly: createKeywordLike(\"readonly\", { startsExpr }),\n _unique: createKeywordLike(\"unique\", { startsExpr }),\n // end: isTSTypeOperator\n // start: isTSDeclarationStart\n _abstract: createKeywordLike(\"abstract\", { startsExpr }),\n _declare: createKeywordLike(\"declare\", { startsExpr }),\n _enum: createKeywordLike(\"enum\", { startsExpr }),\n _module: createKeywordLike(\"module\", { startsExpr }),\n _namespace: createKeywordLike(\"namespace\", { startsExpr }),\n // start: isFlowInterfaceOrTypeOrOpaque\n _interface: createKeywordLike(\"interface\", { startsExpr }),\n _type: createKeywordLike(\"type\", { startsExpr }),\n // end: isTSDeclarationStart\n _opaque: createKeywordLike(\"opaque\", { startsExpr }),\n // end: isFlowInterfaceOrTypeOrOpaque\n name: createToken(\"name\", { startsExpr }),\n // end: isIdentifier\n\n string: createToken(\"string\", { startsExpr }),\n num: createToken(\"num\", { startsExpr }),\n bigint: createToken(\"bigint\", { startsExpr }),\n decimal: createToken(\"decimal\", { startsExpr }),\n // end: isLiteralPropertyName\n regexp: createToken(\"regexp\", { startsExpr }),\n privateName: createToken(\"#name\", { startsExpr }),\n eof: createToken(\"eof\"),\n\n // jsx plugin\n jsxName: createToken(\"jsxName\"),\n jsxText: createToken(\"jsxText\", { beforeExpr: true }),\n jsxTagStart: createToken(\"jsxTagStart\", { startsExpr: true }),\n jsxTagEnd: createToken(\"jsxTagEnd\"),\n\n // placeholder plugin\n placeholder: createToken(\"%%\", { startsExpr: true }),\n} as const;\n\nexport function tokenIsIdentifier(token: TokenType): boolean {\n return token >= tt._as && token <= tt.name;\n}\n\nexport function tokenKeywordOrIdentifierIsKeyword(token: TokenType): boolean {\n // we can remove the token >= tt._in check when we\n // know a token is either keyword or identifier\n return token <= tt._while;\n}\n\nexport function tokenIsKeywordOrIdentifier(token: TokenType): boolean {\n return token >= tt._in && token <= tt.name;\n}\n\nexport function tokenIsLiteralPropertyName(token: TokenType): boolean {\n return token >= tt._in && token <= tt.decimal;\n}\n\nexport function tokenComesBeforeExpression(token: TokenType): boolean {\n return tokenBeforeExprs[token];\n}\n\nexport function tokenCanStartExpression(token: TokenType): boolean {\n return tokenStartsExprs[token];\n}\n\nexport function tokenIsAssignment(token: TokenType): boolean {\n return token >= tt.eq && token <= tt.moduloAssign;\n}\n\nexport function tokenIsFlowInterfaceOrTypeOrOpaque(token: TokenType): boolean {\n return token >= tt._interface && token <= tt._opaque;\n}\n\nexport function tokenIsLoop(token: TokenType): boolean {\n return token >= tt._do && token <= tt._while;\n}\n\nexport function tokenIsKeyword(token: TokenType): boolean {\n return token >= tt._in && token <= tt._while;\n}\n\nexport function tokenIsOperator(token: TokenType): boolean {\n return token >= tt.pipeline && token <= tt._instanceof;\n}\n\nexport function tokenIsPostfix(token: TokenType): boolean {\n return token === tt.incDec;\n}\n\nexport function tokenIsPrefix(token: TokenType): boolean {\n return tokenPrefixes[token];\n}\n\nexport function tokenIsTSTypeOperator(token: TokenType): boolean {\n return token >= tt._keyof && token <= tt._unique;\n}\n\nexport function tokenIsTSDeclarationStart(token: TokenType): boolean {\n return token >= tt._abstract && token <= tt._type;\n}\n\nexport function tokenLabelName(token: TokenType): string {\n return tokenLabels[token];\n}\n\nexport function tokenOperatorPrecedence(token: TokenType): number {\n return tokenBinops[token];\n}\n\nexport function tokenIsBinaryOperator(token: TokenType): boolean {\n return tokenBinops[token] !== -1;\n}\n\nexport function tokenIsRightAssociative(token: TokenType): boolean {\n return token === tt.exponent;\n}\n\nexport function tokenIsTemplate(token: TokenType): boolean {\n return token >= tt.templateTail && token <= tt.templateNonTail;\n}\n\nexport function getExportedToken(token: TokenType): ExportedTokenType {\n return tokenTypes[token];\n}\n\nexport function isTokenType(obj: any): boolean {\n return typeof obj === \"number\";\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n tokenTypes[tt.braceR].updateContext = context => {\n context.pop();\n };\n\n tokenTypes[tt.braceL].updateContext =\n tokenTypes[tt.braceHashL].updateContext =\n tokenTypes[tt.dollarBraceL].updateContext =\n context => {\n context.push(tc.brace);\n };\n\n tokenTypes[tt.backQuote].updateContext = context => {\n if (context[context.length - 1] === tc.template) {\n context.pop();\n } else {\n context.push(tc.template);\n }\n };\n\n tokenTypes[tt.jsxTagStart].updateContext = context => {\n context.push(tc.j_expr, tc.j_oTag);\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAuBA,MAAMC,UAAU,GAAG,IAAI;AACvB,MAAMC,UAAU,GAAG,IAAI;AACvB,MAAMC,MAAM,GAAG,IAAI;AACnB,MAAMC,QAAQ,GAAG,IAAI;AACrB,MAAMC,MAAM,GAAG,IAAI;AACnB,MAAMC,OAAO,GAAG,IAAI;AAoBb,MAAMC,iBAAiB,CAAC;EAiB7BC,WAAWA,CAACC,KAAa,EAAEC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aAAa,GAAGkM,OAAO,IAAI;IAClD,IAAIA,OAAO,CAACA,OAAO,CAACI,MAAM,GAAG,CAAC,CAAC,KAAKF,cAAE,CAACnJ,QAAQ,EAAE;MAC/CiJ,OAAO,CAACC,GAAG,CAAC,CAAC;IACf,CAAC,MAAM;MACLD,OAAO,CAAC5K,IAAI,CAAC8K,cAAE,CAACnJ,QAAQ,CAAC;IAC3B;EACF,CAAC;EAEDrC,UAAU,KAAgB,CAACZ,aAAa,GAAGkM,OAAO,IAAI;IACpDA,OAAO,CAAC5K,IAAI,CAAC8K,cAAE,CAACG,MAAM,EAAEH,cAAE,CAACI,MAAM,CAAC;EACpC,CAAC;AACH"} lib/util/class-scope.js 0000644 00000005255 15120211212 0011033 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.ClassScope = void 0; var _scopeflags = require("./scopeflags"); var _parseError = require("../parse-error"); class ClassScope { constructor() { this.privateNames = new Set(); this.loneAccessors = new Map(); this.undefinedPrivateNames = new Map(); } } exports.ClassScope = ClassScope; class ClassScopeHandler { constructor(parser) { this.parser = void 0; this.stack = []; this.undefinedPrivateNames = new Map(); this.parser = parser; } current() { return this.stack[this.stack.length - 1]; } enter() { this.stack.push(new ClassScope()); } exit() { const oldClassScope = this.stack.pop(); const current = this.current(); for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) { if (current) { if (!current.undefinedPrivateNames.has(name)) { current.undefinedPrivateNames.set(name, loc); } } else { this.parser.raise(_parseError.Errors.InvalidPrivateFieldResolution, { at: loc, identifierName: name }); } } } declarePrivateName(name, elementType, loc) { const { privateNames, loneAccessors, undefinedPrivateNames } = this.current(); let redefined = privateNames.has(name); if (elementType & _scopeflags.CLASS_ELEMENT_KIND_ACCESSOR) { const accessor = redefined && loneAccessors.get(name); if (accessor) { const oldStatic = accessor & _scopeflags.CLASS_ELEMENT_FLAG_STATIC; const newStatic = elementType & _scopeflags.CLASS_ELEMENT_FLAG_STATIC; const oldKind = accessor & _scopeflags.CLASS_ELEMENT_KIND_ACCESSOR; const newKind = elementType & _scopeflags.CLASS_ELEMENT_KIND_ACCESSOR; redefined = oldKind === newKind || oldStatic !== newStatic; if (!redefined) loneAccessors.delete(name); } else if (!redefined) { loneAccessors.set(name, elementType); } } if (redefined) { this.parser.raise(_parseError.Errors.PrivateNameRedeclaration, { at: loc, identifierName: name }); } privateNames.add(name); undefinedPrivateNames.delete(name); } usePrivateName(name, loc) { let classScope; for (classScope of this.stack) { if (classScope.privateNames.has(name)) return; } if (classScope) { classScope.undefinedPrivateNames.set(name, loc); } else { this.parser.raise(_parseError.Errors.InvalidPrivateFieldResolution, { at: loc, identifierName: name }); } } } exports.default = ClassScopeHandler; //# sourceMappingURL=class-scope.js.map lib/util/class-scope.js.map 0000644 00000015157 15120211212 0011611 0 ustar 00 {"version":3,"names":["_scopeflags","require","_parseError","ClassScope","constructor","privateNames","Set","loneAccessors","Map","undefinedPrivateNames","exports","ClassScopeHandler","parser","stack","current","length","enter","push","exit","oldClassScope","pop","name","loc","Array","from","has","set","raise","Errors","InvalidPrivateFieldResolution","at","identifierName","declarePrivateName","elementType","redefined","CLASS_ELEMENT_KIND_ACCESSOR","accessor","get","oldStatic","CLASS_ELEMENT_FLAG_STATIC","newStatic","oldKind","newKind","delete","PrivateNameRedeclaration","add","usePrivateName","classScope","default"],"sources":["../../src/util/class-scope.ts"],"sourcesContent":["import {\n CLASS_ELEMENT_KIND_ACCESSOR,\n CLASS_ELEMENT_FLAG_STATIC,\n type ClassElementTypes,\n} from \"./scopeflags\";\nimport type { Position } from \"./location\";\nimport { Errors } from \"../parse-error\";\nimport type Tokenizer from \"../tokenizer\";\n\nexport class ClassScope {\n // A list of private named declared in the current class\n privateNames: Set<string> = new Set();\n\n // A list of private getters of setters without their counterpart\n loneAccessors: Map<string, ClassElementTypes> = new Map();\n\n // A list of private names used before being defined, mapping to\n // their position.\n undefinedPrivateNames: Map<string, Position> = new Map();\n}\n\nexport default class ClassScopeHandler {\n parser: Tokenizer;\n stack: Array<ClassScope> = [];\n undefinedPrivateNames: Map<string, Position> = new Map();\n\n constructor(parser: Tokenizer) {\n this.parser = parser;\n }\n\n current(): ClassScope {\n return this.stack[this.stack.length - 1];\n }\n\n enter() {\n this.stack.push(new ClassScope());\n }\n\n exit() {\n const oldClassScope = this.stack.pop();\n\n // Migrate the usage of not yet defined private names to the outer\n // class scope, or raise an error if we reached the top-level scope.\n\n const current = this.current();\n\n // Array.from is needed because this is compiled to an array-like for loop\n for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) {\n if (current) {\n if (!current.undefinedPrivateNames.has(name)) {\n current.undefinedPrivateNames.set(name, loc);\n }\n } else {\n this.parser.raise(Errors.InvalidPrivateFieldResolution, {\n at: loc,\n identifierName: name,\n });\n }\n }\n }\n\n declarePrivateName(\n name: string,\n elementType: ClassElementTypes,\n loc: Position,\n ) {\n const { privateNames, loneAccessors, undefinedPrivateNames } =\n this.current();\n let redefined = privateNames.has(name);\n\n if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) {\n const accessor = redefined && loneAccessors.get(name);\n if (accessor) {\n const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC;\n const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC;\n\n const oldKind = accessor & CLASS_ELEMENT_KIND_ACCESSOR;\n const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR;\n\n // The private name can be duplicated only if it is used by\n // two accessors with different kind (get and set), and if\n // they have the same placement (static or not).\n redefined = oldKind === newKind || oldStatic !== newStatic;\n\n if (!redefined) loneAccessors.delete(name);\n } else if (!redefined) {\n loneAccessors.set(name, elementType);\n }\n }\n\n if (redefined) {\n this.parser.raise(Errors.PrivateNameRedeclaration, {\n at: loc,\n identifierName: name,\n });\n }\n\n privateNames.add(name);\n undefinedPrivateNames.delete(name);\n }\n\n usePrivateName(name: string, loc: Position) {\n let classScope;\n for (classScope of this.stack) {\n if (classScope.privateNames.has(name)) return;\n }\n\n if (classScope) {\n classScope.undefinedPrivateNames.set(name, loc);\n } else {\n // top-level\n this.parser.raise(Errors.InvalidPrivateFieldResolution, {\n at: loc,\n identifierName: name,\n });\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAMA,IAAAC,WAAA,GAAAD,OAAA;AAGO,MAAME,UAAU,CAAC;EAAAC,YAAA;IAAA,KAEtBC,YAAY,GAAgB,IAAIC,GAAG,CAAC,CAAC;IAAA,KAGrCC,aAAa,GAAmC,IAAIC,GAAG,CAAC,CAAC;IAAA,KAIzDC,qBAAqB,GAA0B,IAAID,GAAG,CAAC,CAAC;EAAA;AAC1D;AAACE,OAAA,CAAAP,UAAA,GAAAA,UAAA;AAEc,MAAMQ,iBAAiB,CAAC;EAKrCP,WAAWA,CAACQ,MAAiB,EAAE;IAAA,KAJ/BA,MAAM;IAAA,KACNC,KAAK,GAAsB,EAAE;IAAA,KAC7BJ,qBAAqB,GAA0B,IAAID,GAAG,CAAC,CAAC;IAGtD,IAAI,CAACI,MAAM,GAAGA,MAAM;EACtB;EAEAE,OAAOA,CAAA,EAAe;IACpB,OAAO,IAAI,CAACD,KAAK,CAAC,IAAI,CAACA,KAAK,CAACE,MAAM,GAAG,CAAC,CAAC;EAC1C;EAEAC,KAAKA,CAAA,EAAG;IACN,IAAI,CAACH,KAAK,CAACI,IAAI,CAAC,IAAId,UAAU,CAAC,CAAC,CAAC;EACnC;EAEAe,IAAIA,CAAA,EAAG;IACL,MAAMC,aAAa,GAAG,IAAI,CAACN,KAAK,CAACO,GAAG,CAAC,CAAC;IAKtC,MAAMN,OAAO,GAAG,IAAI,CAACA,OAAO,CAAC,CAAC;IAG9B,KAAK,MAAM,CAACO,IAAI,EAAEC,GAAG,CAAC,IAAIC,KAAK,CAACC,IAAI,CAACL,aAAa,CAACV,qBAAqB,CAAC,EAAE;MACzE,IAAIK,OAAO,EAAE;QACX,IAAI,CAACA,OAAO,CAACL,qBAAqB,CAACgB,GAAG,CAACJ,IA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CAAC,CAAC;IACJ;IAEAhB,YAAY,CAACwC,GAAG,CAACxB,IAAI,CAAC;IACtBZ,qBAAqB,CAACkC,MAAM,CAACtB,IAAI,CAAC;EACpC;EAEAyB,cAAcA,CAACzB,IAAY,EAAEC,GAAa,EAAE;IAC1C,IAAIyB,UAAU;IACd,KAAKA,UAAU,IAAI,IAAI,CAAClC,KAAK,EAAE;MAC7B,IAAIkC,UAAU,CAAC1C,YAAY,CAACoB,GAAG,CAACJ,IAAI,CAAC,EAAE;IACzC;IAEA,IAAI0B,UAAU,EAAE;MACdA,UAAU,CAACtC,qBAAqB,CAACiB,GAAG,CAACL,IAAI,EAAEC,GAAG,CAAC;IACjD,CAAC,MAAM;MAEL,IAAI,CAACV,MAAM,CAACe,KAAK,CAACC,kBAAM,CAACC,6BAA6B,EAAE;QACtDC,EAAE,EAAER,GAAG;QACPS,cAAc,EAAEV;MAClB,CAAC,CAAC;IACJ;EACF;AACF;AAACX,OAAA,CAAAsC,OAAA,GAAArC,iBAAA"} lib/util/expression-scope.js 0000644 00000007437 15120211212 0012131 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; exports.newArrowHeadScope = newArrowHeadScope; exports.newAsyncArrowScope = newAsyncArrowScope; exports.newExpressionScope = newExpressionScope; exports.newParameterDeclarationScope = newParameterDeclarationScope; var _parseError = require("../parse-error"); const kExpression = 0, kMaybeArrowParameterDeclaration = 1, kMaybeAsyncArrowParameterDeclaration = 2, kParameterDeclaration = 3; class ExpressionScope { constructor(type = kExpression) { this.type = void 0; this.type = type; } canBeArrowParameterDeclaration() { return this.type === kMaybeAsyncArrowParameterDeclaration || this.type === kMaybeArrowParameterDeclaration; } isCertainlyParameterDeclaration() { return this.type === kParameterDeclaration; } } class ArrowHeadParsingScope extends ExpressionScope { constructor(type) { super(type); this.declarationErrors = new Map(); } recordDeclarationError(ParsingErrorClass, { at }) { const index = at.index; this.declarationErrors.set(index, [ParsingErrorClass, at]); } clearDeclarationError(index) { this.declarationErrors.delete(index); } iterateErrors(iterator) { this.declarationErrors.forEach(iterator); } } class ExpressionScopeHandler { constructor(parser) { this.parser = void 0; this.stack = [new ExpressionScope()]; this.parser = parser; } enter(scope) { this.stack.push(scope); } exit() { this.stack.pop(); } recordParameterInitializerError(toParseError, { at: node }) { const origin = { at: node.loc.start }; const { stack } = this; let i = stack.length - 1; let scope = stack[i]; while (!scope.isCertainlyParameterDeclaration()) { if (scope.canBeArrowParameterDeclaration()) { scope.recordDeclarationError(toParseError, origin); } else { return; } scope = stack[--i]; } this.parser.raise(toParseError, origin); } recordArrowParameterBindingError(error, { at: node }) { const { stack } = this; const scope = stack[stack.length - 1]; const origin = { at: node.loc.start }; if (scope.isCertainlyParameterDeclaration()) { this.parser.raise(error, origin); } else if (scope.canBeArrowParameterDeclaration()) { scope.recordDeclarationError(error, origin); } else { return; } } recordAsyncArrowParametersError({ at }) { const { stack } = this; let i = stack.length - 1; let scope = stack[i]; while (scope.canBeArrowParameterDeclaration()) { if (scope.type === kMaybeAsyncArrowParameterDeclaration) { scope.recordDeclarationError(_parseError.Errors.AwaitBindingIdentifier, { at }); } scope = stack[--i]; } } validateAsPattern() { const { stack } = this; const currentScope = stack[stack.length - 1]; if (!currentScope.canBeArrowParameterDeclaration()) return; currentScope.iterateErrors(([toParseError, loc]) => { this.parser.raise(toParseError, { at: loc }); let i = stack.length - 2; let scope = stack[i]; while (scope.canBeArrowParameterDeclaration()) { scope.clearDeclarationError(loc.index); scope = stack[--i]; } }); } } exports.default = ExpressionScopeHandler; function newParameterDeclarationScope() { return new ExpressionScope(kParameterDeclaration); } function newArrowHeadScope() { return new ArrowHeadParsingScope(kMaybeArrowParameterDeclaration); } function newAsyncArrowScope() { return new ArrowHeadParsingScope(kMaybeAsyncArrowParameterDeclaration); } function newExpressionScope() { return new ExpressionScope(); } //# sourceMappingURL=expression-scope.js.map lib/util/expression-scope.js.map 0000644 00000031461 15120211212 0012677 0 ustar 00 {"version":3,"names":["_parseError","require","kExpression","kMaybeArrowParameterDeclaration","kMaybeAsyncArrowParameterDeclaration","kParameterDeclaration","ExpressionScope","constructor","type","canBeArrowParameterDeclaration","isCertainlyParameterDeclaration","ArrowHeadParsingScope","declarationErrors","Map","recordDeclarationError","ParsingErrorClass","at","index","set","clearDeclarationError","delete","iterateErrors","iterator","forEach","ExpressionScopeHandler","parser","stack","enter","scope","push","exit","pop","recordParameterInitializerError","toParseError","node","origin","loc","start","i","length","raise","recordArrowParameterBindingError","error","recordAsyncArrowParametersError","Errors","AwaitBindingIdentifier","validateAsPattern","currentScope","exports","default","newParameterDeclarationScope","newArrowHeadScope","newAsyncArrowScope","newExpressionScope"],"sources":["../../src/util/expression-scope.ts"],"sourcesContent":["import { Errors, type ParseErrorConstructor } from \"../parse-error\";\nimport type { Position } from \"./location\";\nimport type { Node } from \"../types\";\nimport type Tokenizer from \"../tokenizer\";\n\n/**\n * @module util/expression-scope\n\nExpressionScope is used to track declaration errors in these ambiguous patterns:\n\n- CoverParenthesizedExpressionAndArrowParameterList\n e.g. we don't know if `({ x })` is an parenthesized expression or an\n arrow function parameters until we see an `=>` after `)`.\n\n- CoverCallExpressionAndAsyncArrowHead\n e.g. we don't know if `async({ x })` is a call expression or an async arrow\n function parameters until we see an `=>` after `)`\n\nThe following declaration errors (@see parser-errors/standard) will be recorded in\nsome expression scopes and thrown later when we know what the ambiguous pattern is\n\n- AwaitBindingIdentifier\n- AwaitExpressionFormalParameter\n- YieldInParameter\n- InvalidParenthesizedAssignment when parenthesized is an identifier\n\nThere are four different expression scope\n- Expression\n A general scope that represents program / function body / static block. No errors\n will be recorded nor thrown in this scope.\n\n- MaybeArrowParameterDeclaration\n A scope that represents ambiguous arrow head e.g. `(x)`. Errors will be recorded\n alongside parent scopes and thrown when `ExpressionScopeHandler#validateAsPattern`\n is called.\n\n- MaybeAsyncArrowParameterDeclaration\n A scope that represents ambiguous async arrow head e.g. `async(x)`. Errors will\n be recorded alongside parent scopes and thrown when\n `ExpressionScopeHandler#validateAsPattern` is called.\n\n- ParameterDeclaration\n A scope that represents unambiguous function parameters `function(x)`. Errors\n recorded in this scope will be thrown immediately. No errors will be recorded in\n this scope.\n\n// @see {@link https://docs.google.com/document/d/1FAvEp9EUK-G8kHfDIEo_385Hs2SUBCYbJ5H-NnLvq8M|V8 Expression Scope design docs}\n */\n\nconst kExpression = 0,\n kMaybeArrowParameterDeclaration = 1,\n kMaybeAsyncArrowParameterDeclaration = 2,\n kParameterDeclaration = 3;\n\ntype ExpressionScopeType = 0 | 1 | 2 | 3;\n\nclass ExpressionScope {\n type: ExpressionScopeType;\n\n constructor(type: ExpressionScopeType = kExpression) {\n this.type = type;\n }\n\n canBeArrowParameterDeclaration(): this is ArrowHeadParsingScope {\n return (\n this.type === kMaybeAsyncArrowParameterDeclaration ||\n this.type === kMaybeArrowParameterDeclaration\n );\n }\n\n isCertainlyParameterDeclaration() {\n return this.type === kParameterDeclaration;\n }\n}\n\ntype ArrowHeadParsingParameterInitializerError =\n | typeof Errors.AwaitExpressionFormalParameter\n | typeof Errors.YieldInParameter;\ntype ArrowHeadParsingDeclarationError =\n | ArrowHeadParsingParameterInitializerError\n | typeof Errors.InvalidParenthesizedAssignment\n | typeof Errors.AwaitBindingIdentifier;\n\nclass ArrowHeadParsingScope extends ExpressionScope {\n declarationErrors: Map<number, [ParseErrorConstructor<{}>, Position]> =\n new Map();\n constructor(type: 1 | 2) {\n super(type);\n }\n recordDeclarationError(\n ParsingErrorClass: ParseErrorConstructor<{}>,\n {\n at,\n }: {\n at: Position;\n },\n ) {\n const index = at.index;\n\n this.declarationErrors.set(index, [ParsingErrorClass, at]);\n }\n clearDeclarationError(index: number) {\n this.declarationErrors.delete(index);\n }\n iterateErrors(\n iterator: (a: [ArrowHeadParsingDeclarationError, Position]) => void,\n ) {\n this.declarationErrors.forEach(iterator);\n }\n}\n\nexport default class ExpressionScopeHandler {\n parser: Tokenizer;\n stack: Array<ExpressionScope> = [new ExpressionScope()];\n\n constructor(parser: Tokenizer) {\n this.parser = parser;\n }\n enter(scope: ExpressionScope) {\n this.stack.push(scope);\n }\n\n exit() {\n this.stack.pop();\n }\n\n /**\n * Record likely parameter initializer errors\n *\n * When current scope is a ParameterDeclaration, the error will be thrown immediately,\n * otherwise it will be recorded to any ancestry MaybeArrowParameterDeclaration and\n * MaybeAsyncArrowParameterDeclaration scope until an Expression scope is seen.\n */\n recordParameterInitializerError(\n toParseError: ArrowHeadParsingParameterInitializerError,\n {\n at: node,\n }: {\n at: Node;\n },\n ): void {\n const origin = { at: node.loc.start };\n const { stack } = this;\n let i = stack.length - 1;\n let scope: ExpressionScope = stack[i];\n while (!scope.isCertainlyParameterDeclaration()) {\n if (scope.canBeArrowParameterDeclaration()) {\n scope.recordDeclarationError(toParseError, origin);\n } else {\n /*:: invariant(scope.type == kExpression) */\n // Type-Expression is the boundary where initializer error can populate to\n return;\n }\n scope = stack[--i];\n }\n this.parser.raise(toParseError, origin);\n }\n\n /**\n * Record errors that must be thrown if the current pattern ends up being an arrow\n * function parameter. This is used to record parenthesized identifiers, and to record\n * \"a as T\" and \"<T> a\" type assertions when parsing typescript.\n *\n * A parenthesized identifier (or type assertion) in LHS can be ambiguous because the assignment\n * can be transformed to an assignable later, but not vice versa:\n * For example, in `([(a) = []] = []) => {}`, we think `(a) = []` is an LHS in `[(a) = []]`,\n * an LHS within `[(a) = []] = []`. However the LHS chain is then transformed by toAssignable,\n * and we should throw assignment `(a)`, which is only valid in LHS. Hence we record the\n * location of parenthesized `(a)` to current scope if it is one of MaybeArrowParameterDeclaration\n * and MaybeAsyncArrowParameterDeclaration\n *\n * Unlike `recordParameterInitializerError`, we don't record to ancestry scope because we\n * validate arrow head parsing scope before exit, and then the LHS will be unambiguous:\n * For example, in `( x = ( [(a) = []] = [] ) ) => {}`, we should not record `(a)` in `( x = ... ) =>`\n * arrow scope because when we finish parsing `( [(a) = []] = [] )`, it is an unambiguous assignment\n * expression and can not be cast to pattern\n */\n recordArrowParameterBindingError(\n error: ParseErrorConstructor<{}>,\n {\n at: node,\n }: {\n at: Node;\n },\n ): void {\n const { stack } = this;\n const scope: ExpressionScope = stack[stack.length - 1];\n const origin = { at: node.loc.start };\n if (scope.isCertainlyParameterDeclaration()) {\n this.parser.raise(error, origin);\n } else if (scope.canBeArrowParameterDeclaration()) {\n scope.recordDeclarationError(error, origin);\n } else {\n return;\n }\n }\n\n /**\n * Record likely async arrow parameter errors\n *\n * Errors will be recorded to any ancestry MaybeAsyncArrowParameterDeclaration\n * scope until an Expression scope is seen.\n */\n recordAsyncArrowParametersError({ at }: { at: Position }): void {\n const { stack } = this;\n let i = stack.length - 1;\n let scope: ExpressionScope = stack[i];\n while (scope.canBeArrowParameterDeclaration()) {\n if (scope.type === kMaybeAsyncArrowParameterDeclaration) {\n scope.recordDeclarationError(Errors.AwaitBindingIdentifier, { at });\n }\n scope = stack[--i];\n }\n }\n\n validateAsPattern(): void {\n const { stack } = this;\n const currentScope = stack[stack.length - 1];\n if (!currentScope.canBeArrowParameterDeclaration()) return;\n currentScope.iterateErrors(([toParseError, loc]) => {\n this.parser.raise(toParseError, { at: loc });\n // iterate from parent scope\n let i = stack.length - 2;\n let scope = stack[i];\n while (scope.canBeArrowParameterDeclaration()) {\n scope.clearDeclarationError(loc.index);\n scope = stack[--i];\n }\n });\n }\n}\n\nexport function newParameterDeclarationScope() {\n return new ExpressionScope(kParameterDeclaration);\n}\n\nexport function newArrowHeadScope() {\n return new ArrowHeadParsingScope(kMaybeArrowParameterDeclaration);\n}\n\nexport function newAsyncArrowScope() {\n return new ArrowHeadParsingScope(kMaybeAsyncArrowParameterDeclaration);\n}\n\nexport function newExpressionScope() {\n return new ExpressionScope();\n}\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAiDA,MAAMC,WAAW,GAAG,CAAC;EACnBC,+BAA+B,GAAG,CAAC;EACnCC,oCAAoC,GAAG,CAAC;EACxCC,qBAAqB,GAAG,CAAC;AAI3B,MAAMC,eAAe,CAAC;EA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BA,CAAA,EAAG;EAC7C,OAAO,IAAI5C,eAAe,CAACD,qBAAqB,CAAC;AACnD;AAEO,SAAS8C,iBAAiBA,CAAA,EAAG;EAClC,OAAO,IAAIxC,qBAAqB,CAACR,+BAA+B,CAAC;AACnE;AAEO,SAASiD,kBAAkBA,CAAA,EAAG;EACnC,OAAO,IAAIzC,qBAAqB,CAACP,oCAAoC,CAAC;AACxE;AAEO,SAASiD,kBAAkBA,CAAA,EAAG;EACnC,OAAO,IAAI/C,eAAe,CAAC,CAAC;AAC9B"} lib/util/identifier.js 0000644 00000004404 15120211212 0010734 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.canBeReservedWord = canBeReservedWord; Object.defineProperty(exports, "isIdentifierChar", { enumerable: true, get: function () { return _helperValidatorIdentifier.isIdentifierChar; } }); Object.defineProperty(exports, "isIdentifierStart", { enumerable: true, get: function () { return _helperValidatorIdentifier.isIdentifierStart; } }); exports.isIteratorStart = isIteratorStart; Object.defineProperty(exports, "isKeyword", { enumerable: true, get: function () { return _helperValidatorIdentifier.isKeyword; } }); Object.defineProperty(exports, "isReservedWord", { enumerable: true, get: function () { return _helperValidatorIdentifier.isReservedWord; } }); Object.defineProperty(exports, "isStrictBindOnlyReservedWord", { enumerable: true, get: function () { return _helperValidatorIdentifier.isStrictBindOnlyReservedWord; } }); Object.defineProperty(exports, "isStrictBindReservedWord", { enumerable: true, get: function () { return _helperValidatorIdentifier.isStrictBindReservedWord; } }); Object.defineProperty(exports, "isStrictReservedWord", { enumerable: true, get: function () { return _helperValidatorIdentifier.isStrictReservedWord; } }); exports.keywordRelationalOperator = void 0; var _helperValidatorIdentifier = require("@babel/helper-validator-identifier"); const keywordRelationalOperator = /^in(stanceof)?$/; exports.keywordRelationalOperator = keywordRelationalOperator; function isIteratorStart(current, next, next2) { return current === 64 && next === 64 && (0, _helperValidatorIdentifier.isIdentifierStart)(next2); } const reservedWordLikeSet = new Set(["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete", "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "eval", "arguments", "enum", "await"]); function canBeReservedWord(word) { return reservedWordLikeSet.has(word); } //# sourceMappingURL=identifier.js.map lib/util/identifier.js.map 0000644 00000006051 15120211213 0011511 0 ustar 00 {"version":3,"names":["_helperValidatorIdentifier","require","keywordRelationalOperator","exports","isIteratorStart","current","next","next2","isIdentifierStart","reservedWordLikeSet","Set","canBeReservedWord","word","has"],"sources":["../../src/util/identifier.ts"],"sourcesContent":["/* eslint max-len: 0 */\n\nimport * as charCodes from \"charcodes\";\nimport { isIdentifierStart } from \"@babel/helper-validator-identifier\";\n\nexport {\n isIdentifierStart,\n isIdentifierChar,\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"@babel/helper-validator-identifier\";\n\nexport const keywordRelationalOperator = /^in(stanceof)?$/;\n\n// Test whether a current state character code and next character code is @\n\nexport function isIteratorStart(\n current: number,\n next: number,\n next2: number,\n): boolean {\n return (\n current === charCodes.atSign &&\n next === charCodes.atSign &&\n isIdentifierStart(next2)\n );\n}\n\n// This is the comprehensive set of JavaScript reserved words\n// If a word is in this set, it could be a reserved word,\n// depending on sourceType/strictMode/binding info. In other words\n// if a word is not in this set, it is not a reserved word under\n// any circumstance.\nconst reservedWordLikeSet = new Set([\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n // strict\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n // strictBind\n \"eval\",\n \"arguments\",\n // reservedWorkLike\n \"enum\",\n \"await\",\n]);\n\nexport function canBeReservedWord(word: string): boolean {\n return reservedWordLikeSet.has(word);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,0BAAA,GAAAC,OAAA;AAYO,MAAMC,yBAAyB,GAAG,iBAAiB;AAACC,OAAA,CAAAD,yBAAA,GAAAA,yBAAA;AAIpD,SAASE,eAAeA,CAC7BC,OAAe,EACfC,IAAY,EACZC,KAAa,EACJ;EACT,OACEF,OAAO,OAAqB,IAC5BC,IAAI,OAAqB,IACzB,IAAAE,4CAAiB,EAACD,KAAK,CAAC;AAE5B;AAOA,MAAME,mBAAmB,GAAG,IAAIC,GAAG,CAAC,CAClC,OAAO,EACP,MAAM,EACN,OAAO,EACP,UAAU,EACV,UAAU,EACV,SAAS,EACT,IAAI,EACJ,MAAM,EACN,SAAS,EACT,KAAK,EACL,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,KAAK,EACL,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,QAAQ,EAER,YAAY,EACZ,WAAW,EACX,KAAK,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,EAEP,MAAM,EACN,WAAW,EAEX,MAAM,EACN,OAAO,CACR,CAAC;AAEK,SAASC,iBAAiBA,CAACC,IAAY,EAAW;EACvD,OAAOH,mBAAmB,CAACI,GAAG,CAACD,IAAI,CAAC;AACtC"} lib/util/location.js 0000644 00000001635 15120211213 0010426 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SourceLocation = exports.Position = void 0; exports.createPositionWithColumnOffset = createPositionWithColumnOffset; class Position { constructor(line, col, index) { this.line = void 0; this.column = void 0; this.index = void 0; this.line = line; this.column = col; this.index = index; } } exports.Position = Position; class SourceLocation { constructor(start, end) { this.start = void 0; this.end = void 0; this.filename = void 0; this.identifierName = void 0; this.start = start; this.end = end; } } exports.SourceLocation = SourceLocation; function createPositionWithColumnOffset(position, columnOffset) { const { line, column, index } = position; return new Position(line, column + columnOffset, index + columnOffset); } //# sourceMappingURL=location.js.map lib/util/location.js.map 0000644 00000004164 15120211213 0011202 0 ustar 00 {"version":3,"names":["Position","constructor","line","col","index","column","exports","SourceLocation","start","end","filename","identifierName","createPositionWithColumnOffset","position","columnOffset"],"sources":["../../src/util/location.ts"],"sourcesContent":["export type Pos = {\n start: number;\n};\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nexport class Position {\n line: number;\n column: number;\n index: number;\n\n constructor(line: number, col: number, index: number) {\n this.line = line;\n this.column = col;\n this.index = index;\n }\n}\n\nexport class SourceLocation {\n start: Position;\n end: Position;\n filename: string;\n identifierName: string | undefined | null;\n\n constructor(start: Position, end?: Position) {\n this.start = start;\n // (may start as null, but initialized later)\n this.end = end;\n }\n}\n\n/**\n * creates a new position with a non-zero column offset from the given position.\n * This function should be only be used when we create AST node out of the token\n * boundaries, such as TemplateElement ends before tt.templateNonTail. This\n * function does not skip whitespaces.\n */\nexport function createPositionWithColumnOffset(\n position: Position,\n columnOffset: number,\n) {\n const { line, column, index } = position;\n return new Position(line, column + columnOffset, index + columnOffset);\n}\n"],"mappings":";;;;;;;AAOO,MAAMA,QAAQ,CAAC;EAKpBC,WAAWA,CAACC,IAAY,EAAEC,GAAW,EAAEC,KAAa,EAAE;IAAA,KAJtDF,IAAI;IAAA,KACJG,MAAM;IAAA,KACND,KAAK;IAGH,IAAI,CAACF,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACG,MAAM,GAAGF,GAAG;IACjB,IAAI,CAACC,KAAK,GAAGA,KAAK;EACpB;AACF;AAACE,OAAA,CAAAN,QAAA,GAAAA,QAAA;AAEM,MAAMO,cAAc,CAAC;EAM1BN,WAAWA,CAACO,KAAe,EAAEC,GAAc,EAAE;IAAA,KAL7CD,KAAK;IAAA,KACLC,GAAG;IAAA,KACHC,QAAQ;IAAA,KACRC,cAAc;IAGZ,IAAI,CAACH,KAAK,GAAGA,KAAK;IAElB,IAAI,CAACC,GAAG,GAAGA,GAAG;EAChB;AACF;AAACH,OAAA,CAAAC,cAAA,GAAAA,cAAA;AAQM,SAASK,8BAA8BA,CAC5CC,QAAkB,EAClBC,YAAoB,EACpB;EACA,MAAM;IAAEZ,IAAI;IAAEG,MAAM;IAAED;EAAM,CAAC,GAAGS,QAAQ;EACxC,OAAO,IAAIb,QAAQ,CAACE,IAAI,EAAEG,MAAM,GAAGS,YAAY,EAAEV,KAAK,GAAGU,YAAY,CAAC;AACxE"} lib/util/production-parameter.js 0000644 00000002373 15120211213 0012762 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.PARAM_YIELD = exports.PARAM_RETURN = exports.PARAM_IN = exports.PARAM_AWAIT = exports.PARAM = void 0; exports.functionFlags = functionFlags; const PARAM = 0b0000, PARAM_YIELD = 0b0001, PARAM_AWAIT = 0b0010, PARAM_RETURN = 0b0100, PARAM_IN = 0b1000; exports.PARAM_IN = PARAM_IN; exports.PARAM_RETURN = PARAM_RETURN; exports.PARAM_AWAIT = PARAM_AWAIT; exports.PARAM_YIELD = PARAM_YIELD; exports.PARAM = PARAM; class ProductionParameterHandler { constructor() { this.stacks = []; } enter(flags) { this.stacks.push(flags); } exit() { this.stacks.pop(); } currentFlags() { return this.stacks[this.stacks.length - 1]; } get hasAwait() { return (this.currentFlags() & PARAM_AWAIT) > 0; } get hasYield() { return (this.currentFlags() & PARAM_YIELD) > 0; } get hasReturn() { return (this.currentFlags() & PARAM_RETURN) > 0; } get hasIn() { return (this.currentFlags() & PARAM_IN) > 0; } } exports.default = ProductionParameterHandler; function functionFlags(isAsync, isGenerator) { return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0); } //# sourceMappingURL=production-parameter.js.map lib/util/production-parameter.js.map 0000644 00000007444 15120211213 0013542 0 ustar 00 {"version":3,"names":["PARAM","PARAM_YIELD","PARAM_AWAIT","PARAM_RETURN","PARAM_IN","exports","ProductionParameterHandler","constructor","stacks","enter","flags","push","exit","pop","currentFlags","length","hasAwait","hasYield","hasReturn","hasIn","default","functionFlags","isAsync","isGenerator"],"sources":["../../src/util/production-parameter.ts"],"sourcesContent":["export const // Initial Parameter flags\n PARAM = 0b0000,\n // track [Yield] production parameter\n PARAM_YIELD = 0b0001,\n // track [Await] production parameter\n PARAM_AWAIT = 0b0010,\n // track [Return] production parameter\n PARAM_RETURN = 0b0100,\n PARAM_IN = 0b1000; // track [In] production parameter\n\n// ProductionParameterHandler is a stack fashioned production parameter tracker\n// https://tc39.es/ecma262/#sec-grammar-notation\n// The tracked parameters are defined above.\n//\n// Whenever [+Await]/[+Yield] appears in the right-hand sides of a production,\n// we must enter a new tracking stack. For example when parsing\n//\n// AsyncFunctionDeclaration [Yield, Await]:\n// async [no LineTerminator here] function BindingIdentifier[?Yield, ?Await]\n// ( FormalParameters[~Yield, +Await] ) { AsyncFunctionBody }\n//\n// we must follow such process:\n//\n// 1. parse async keyword\n// 2. parse function keyword\n// 3. parse bindingIdentifier <= inherit current parameters: [?Await]\n// 4. enter new stack with (PARAM_AWAIT)\n// 5. parse formal parameters <= must have [Await] parameter [+Await]\n// 6. parse function body\n// 7. exit current stack\n\nexport type ParamKind = number;\n\n// todo(flow->ts) - check if more granular type can be used,\n// type below is not good because things like PARAM_AWAIT|PARAM_YIELD are not included\n// export type ParamKind =\n// | typeof PARAM\n// | typeof PARAM_AWAIT\n// | typeof PARAM_IN\n// | typeof PARAM_RETURN\n// | typeof PARAM_YIELD;\n\nexport default class ProductionParameterHandler {\n stacks: Array<number> = [];\n enter(flags: number) {\n this.stacks.push(flags);\n }\n\n exit() {\n this.stacks.pop();\n }\n\n currentFlags(): number {\n return this.stacks[this.stacks.length - 1];\n }\n\n get hasAwait(): boolean {\n return (this.currentFlags() & PARAM_AWAIT) > 0;\n }\n\n get hasYield(): boolean {\n return (this.currentFlags() & PARAM_YIELD) > 0;\n }\n\n get hasReturn(): boolean {\n return (this.currentFlags() & PARAM_RETURN) > 0;\n }\n\n get hasIn(): boolean {\n return (this.currentFlags() & PARAM_IN) > 0;\n }\n}\n\nexport function functionFlags(\n isAsync: boolean,\n isGenerator: boolean,\n): ParamKind {\n return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0);\n}\n"],"mappings":";;;;;;;AAAO,MACLA,KAAK,GAAG,MAAM;EAEdC,WAAW,GAAG,MAAM;EAEpBC,WAAW,GAAG,MAAM;EAEpBC,YAAY,GAAG,MAAM;EACrBC,QAAQ,GAAG,MAAM;AAACC,OAAA,CAAAD,QAAA,GAAAA,QAAA;AAAAC,OAAA,CAAAF,YAAA,GAAAA,YAAA;AAAAE,OAAA,CAAAH,WAAA,GAAAA,WAAA;AAAAG,OAAA,CAAAJ,WAAA,GAAAA,WAAA;AAAAI,OAAA,CAAAL,KAAA,GAAAA,KAAA;AAkCL,MAAMM,0BAA0B,CAAC;EAAAC,YAAA;IAAA,KAC9CC,MAAM,GAAkB,EAAE;EAAA;EAC1BC,KAAKA,CAACC,KAAa,EAAE;IACnB,IAAI,CAACF,MAAM,CAACG,IAAI,CAACD,KAAK,CAAC;EACzB;EAEAE,IAAIA,CAAA,EAAG;IACL,IAAI,CAACJ,MAAM,CAACK,GAAG,CAAC,CAAC;EACnB;EAEAC,YAAYA,CAAA,EAAW;IACrB,OAAO,IAAI,CAACN,MAAM,CAAC,IAAI,CAACA,MAAM,CAACO,MAAM,GAAG,CAAC,CAAC;EAC5C;EAEA,IAAIC,QAAQA,CAAA,EAAY;IACtB,OAAO,CAAC,IAAI,CAACF,YAAY,CAAC,CAAC,GAAGZ,WAAW,IAAI,CAAC;EAChD;EAEA,IAAIe,QAAQA,CAAA,EAAY;IACtB,OAAO,CAAC,IAAI,CAACH,YAAY,CAAC,CAAC,GAAGb,WAAW,IAAI,CAAC;EAChD;EAEA,IAAIiB,SAASA,CAAA,EAAY;IACvB,OAAO,CAAC,IAAI,CAACJ,YAAY,CAAC,CAAC,GAAGX,YAAY,IAAI,CAAC;EACjD;EAEA,IAAIgB,KAAKA,CAAA,EAAY;IACnB,OAAO,CAAC,IAAI,CAACL,YAAY,CAAC,CAAC,GAAGV,QAAQ,IAAI,CAAC;EAC7C;AACF;AAACC,OAAA,CAAAe,OAAA,GAAAd,0BAAA;AAEM,SAASe,aAAaA,CAC3BC,OAAgB,EAChBC,WAAoB,EACT;EACX,OAAO,CAACD,OAAO,GAAGpB,WAAW,GAAG,CAAC,KAAKqB,WAAW,GAAGtB,WAAW,GAAG,CAAC,CAAC;AACtE"} lib/util/scope.js 0000644 00000012232 15120211213 0007722 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.Scope = void 0; var _scopeflags = require("./scopeflags"); var _parseError = require("../parse-error"); class Scope { constructor(flags) { this.var = new Set(); this.lexical = new Set(); this.functions = new Set(); this.flags = flags; } } exports.Scope = Scope; class ScopeHandler { constructor(parser, inModule) { this.parser = void 0; this.scopeStack = []; this.inModule = void 0; this.undefinedExports = new Map(); this.parser = parser; this.inModule = inModule; } get inTopLevel() { return (this.currentScope().flags & _scopeflags.SCOPE_PROGRAM) > 0; } get inFunction() { return (this.currentVarScopeFlags() & _scopeflags.SCOPE_FUNCTION) > 0; } get allowSuper() { return (this.currentThisScopeFlags() & _scopeflags.SCOPE_SUPER) > 0; } get allowDirectSuper() { return (this.currentThisScopeFlags() & _scopeflags.SCOPE_DIRECT_SUPER) > 0; } get inClass() { return (this.currentThisScopeFlags() & _scopeflags.SCOPE_CLASS) > 0; } get inClassAndNotInNonArrowFunction() { const flags = this.currentThisScopeFlags(); return (flags & _scopeflags.SCOPE_CLASS) > 0 && (flags & _scopeflags.SCOPE_FUNCTION) === 0; } get inStaticBlock() { for (let i = this.scopeStack.length - 1;; i--) { const { flags } = this.scopeStack[i]; if (flags & _scopeflags.SCOPE_STATIC_BLOCK) { return true; } if (flags & (_scopeflags.SCOPE_VAR | _scopeflags.SCOPE_CLASS)) { return false; } } } get inNonArrowFunction() { return (this.currentThisScopeFlags() & _scopeflags.SCOPE_FUNCTION) > 0; } get treatFunctionsAsVar() { return this.treatFunctionsAsVarInScope(this.currentScope()); } createScope(flags) { return new Scope(flags); } enter(flags) { this.scopeStack.push(this.createScope(flags)); } exit() { const scope = this.scopeStack.pop(); return scope.flags; } treatFunctionsAsVarInScope(scope) { return !!(scope.flags & (_scopeflags.SCOPE_FUNCTION | _scopeflags.SCOPE_STATIC_BLOCK) || !this.parser.inModule && scope.flags & _scopeflags.SCOPE_PROGRAM); } declareName(name, bindingType, loc) { let scope = this.currentScope(); if (bindingType & _scopeflags.BIND_SCOPE_LEXICAL || bindingType & _scopeflags.BIND_SCOPE_FUNCTION) { this.checkRedeclarationInScope(scope, name, bindingType, loc); if (bindingType & _scopeflags.BIND_SCOPE_FUNCTION) { scope.functions.add(name); } else { scope.lexical.add(name); } if (bindingType & _scopeflags.BIND_SCOPE_LEXICAL) { this.maybeExportDefined(scope, name); } } else if (bindingType & _scopeflags.BIND_SCOPE_VAR) { for (let i = this.scopeStack.length - 1; i >= 0; --i) { scope = this.scopeStack[i]; this.checkRedeclarationInScope(scope, name, bindingType, loc); scope.var.add(name); this.maybeExportDefined(scope, name); if (scope.flags & _scopeflags.SCOPE_VAR) break; } } if (this.parser.inModule && scope.flags & _scopeflags.SCOPE_PROGRAM) { this.undefinedExports.delete(name); } } maybeExportDefined(scope, name) { if (this.parser.inModule && scope.flags & _scopeflags.SCOPE_PROGRAM) { this.undefinedExports.delete(name); } } checkRedeclarationInScope(scope, name, bindingType, loc) { if (this.isRedeclaredInScope(scope, name, bindingType)) { this.parser.raise(_parseError.Errors.VarRedeclaration, { at: loc, identifierName: name }); } } isRedeclaredInScope(scope, name, bindingType) { if (!(bindingType & _scopeflags.BIND_KIND_VALUE)) return false; if (bindingType & _scopeflags.BIND_SCOPE_LEXICAL) { return scope.lexical.has(name) || scope.functions.has(name) || scope.var.has(name); } if (bindingType & _scopeflags.BIND_SCOPE_FUNCTION) { return scope.lexical.has(name) || !this.treatFunctionsAsVarInScope(scope) && scope.var.has(name); } return scope.lexical.has(name) && !(scope.flags & _scopeflags.SCOPE_SIMPLE_CATCH && scope.lexical.values().next().value === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name); } checkLocalExport(id) { const { name } = id; const topLevelScope = this.scopeStack[0]; if (!topLevelScope.lexical.has(name) && !topLevelScope.var.has(name) && !topLevelScope.functions.has(name)) { this.undefinedExports.set(name, id.loc.start); } } currentScope() { return this.scopeStack[this.scopeStack.length - 1]; } currentVarScopeFlags() { for (let i = this.scopeStack.length - 1;; i--) { const { flags } = this.scopeStack[i]; if (flags & _scopeflags.SCOPE_VAR) { return flags; } } } currentThisScopeFlags() { for (let i = this.scopeStack.length - 1;; i--) { const { flags } = this.scopeStack[i]; if (flags & (_scopeflags.SCOPE_VAR | _scopeflags.SCOPE_CLASS) && !(flags & _scopeflags.SCOPE_ARROW)) { return flags; } } } } exports.default = ScopeHandler; //# sourceMappingURL=scope.js.map lib/util/scope.js.map 0000644 00000032764 15120211213 0010512 0 ustar 00 {"version":3,"names":["_scopeflags","require","_parseError","Scope","constructor","flags","var","Set","lexical","functions","exports","ScopeHandler","parser","inModule","scopeStack","undefinedExports","Map","inTopLevel","currentScope","SCOPE_PROGRAM","inFunction","currentVarScopeFlags","SCOPE_FUNCTION","allowSuper","currentThisScopeFlags","SCOPE_SUPER","allowDirectSuper","SCOPE_DIRECT_SUPER","inClass","SCOPE_CLASS","inClassAndNotInNonArrowFunction","inStaticBlock","i","length","SCOPE_STATIC_BLOCK","SCOPE_VAR","inNonArrowFunction","treatFunctionsAsVar","treatFunctionsAsVarInScope","createScope","enter","push","exit","scope","pop","declareName","name","bindingType","loc","BIND_SCOPE_LEXICAL","BIND_SCOPE_FUNCTION","checkRedeclarationInScope","add","maybeExportDefined","BIND_SCOPE_VAR","delete","isRedeclaredInScope","raise","Errors","VarRedeclaration","at","identifierName","BIND_KIND_VALUE","has","SCOPE_SIMPLE_CATCH","values","next","value","checkLocalExport","id","topLevelScope","set","start","SCOPE_ARROW","default"],"sources":["../../src/util/scope.ts"],"sourcesContent":["import {\n SCOPE_ARROW,\n SCOPE_DIRECT_SUPER,\n SCOPE_FUNCTION,\n SCOPE_SIMPLE_CATCH,\n SCOPE_SUPER,\n SCOPE_PROGRAM,\n SCOPE_VAR,\n SCOPE_CLASS,\n SCOPE_STATIC_BLOCK,\n BIND_SCOPE_FUNCTION,\n BIND_SCOPE_VAR,\n BIND_SCOPE_LEXICAL,\n BIND_KIND_VALUE,\n type ScopeFlags,\n type BindingTypes,\n} from \"./scopeflags\";\nimport type { Position } from \"./location\";\nimport type * as N from \"../types\";\nimport { Errors } from \"../parse-error\";\nimport type Tokenizer from \"../tokenizer\";\n\n// Start an AST node, attaching a start offset.\nexport class Scope {\n declare flags: ScopeFlags;\n // A set of var-declared names in the current lexical scope\n var: Set<string> = new Set();\n // A set of lexically-declared names in the current lexical scope\n lexical: Set<string> = new Set();\n // A set of lexically-declared FunctionDeclaration names in the current lexical scope\n functions: Set<string> = new Set();\n\n constructor(flags: ScopeFlags) {\n this.flags = flags;\n }\n}\n\n// The functions in this module keep track of declared variables in the\n// current scope in order to detect duplicate variable names.\nexport default class ScopeHandler<IScope extends Scope = Scope> {\n parser: Tokenizer;\n scopeStack: Array<IScope> = [];\n inModule: boolean;\n undefinedExports: Map<string, Position> = new Map();\n\n constructor(parser: Tokenizer, inModule: boolean) {\n this.parser = parser;\n this.inModule = inModule;\n }\n\n get inTopLevel() {\n return (this.currentScope().flags & SCOPE_PROGRAM) > 0;\n }\n get inFunction() {\n return (this.currentVarScopeFlags() & SCOPE_FUNCTION) > 0;\n }\n get allowSuper() {\n return (this.currentThisScopeFlags() & SCOPE_SUPER) > 0;\n }\n get allowDirectSuper() {\n return (this.currentThisScopeFlags() & SCOPE_DIRECT_SUPER) > 0;\n }\n get inClass() {\n return (this.currentThisScopeFlags() & SCOPE_CLASS) > 0;\n }\n get inClassAndNotInNonArrowFunction() {\n const flags = this.currentThisScopeFlags();\n return (flags & SCOPE_CLASS) > 0 && (flags & SCOPE_FUNCTION) === 0;\n }\n get inStaticBlock() {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (flags & SCOPE_STATIC_BLOCK) {\n return true;\n }\n if (flags & (SCOPE_VAR | SCOPE_CLASS)) {\n // function body, module body, class property initializers\n return false;\n }\n }\n }\n get inNonArrowFunction() {\n return (this.currentThisScopeFlags() & SCOPE_FUNCTION) > 0;\n }\n get treatFunctionsAsVar() {\n return this.treatFunctionsAsVarInScope(this.currentScope());\n }\n\n createScope(flags: ScopeFlags): Scope {\n return new Scope(flags);\n }\n\n enter(flags: ScopeFlags) {\n /*:: +createScope: (flags: ScopeFlags) => IScope; */\n // @ts-expect-error This method will be overwritten by subclasses\n this.scopeStack.push(this.createScope(flags));\n }\n\n exit(): ScopeFlags {\n const scope = this.scopeStack.pop();\n return scope.flags;\n }\n\n // The spec says:\n // > At the top level of a function, or script, function declarations are\n // > treated like var declarations rather than like lexical declarations.\n treatFunctionsAsVarInScope(scope: IScope): boolean {\n return !!(\n scope.flags & (SCOPE_FUNCTION | SCOPE_STATIC_BLOCK) ||\n (!this.parser.inModule && scope.flags & SCOPE_PROGRAM)\n );\n }\n\n declareName(name: string, bindingType: BindingTypes, loc: Position) {\n let scope = this.currentScope();\n if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n\n if (bindingType & BIND_SCOPE_FUNCTION) {\n scope.functions.add(name);\n } else {\n scope.lexical.add(name);\n }\n\n if (bindingType & BIND_SCOPE_LEXICAL) {\n this.maybeExportDefined(scope, name);\n }\n } else if (bindingType & BIND_SCOPE_VAR) {\n for (let i = this.scopeStack.length - 1; i >= 0; --i) {\n scope = this.scopeStack[i];\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n scope.var.add(name);\n this.maybeExportDefined(scope, name);\n\n if (scope.flags & SCOPE_VAR) break;\n }\n }\n if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n maybeExportDefined(scope: IScope, name: string) {\n if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n checkRedeclarationInScope(\n scope: IScope,\n name: string,\n bindingType: BindingTypes,\n loc: Position,\n ) {\n if (this.isRedeclaredInScope(scope, name, bindingType)) {\n this.parser.raise(Errors.VarRedeclaration, {\n at: loc,\n identifierName: name,\n });\n }\n }\n\n isRedeclaredInScope(\n scope: IScope,\n name: string,\n bindingType: BindingTypes,\n ): boolean {\n if (!(bindingType & BIND_KIND_VALUE)) return false;\n\n if (bindingType & BIND_SCOPE_LEXICAL) {\n return (\n scope.lexical.has(name) ||\n scope.functions.has(name) ||\n scope.var.has(name)\n );\n }\n\n if (bindingType & BIND_SCOPE_FUNCTION) {\n return (\n scope.lexical.has(name) ||\n (!this.treatFunctionsAsVarInScope(scope) && scope.var.has(name))\n );\n }\n\n return (\n (scope.lexical.has(name) &&\n // Annex B.3.4\n // https://tc39.es/ecma262/#sec-variablestatements-in-catch-blocks\n !(\n scope.flags & SCOPE_SIMPLE_CATCH &&\n scope.lexical.values().next().value === name\n )) ||\n (!this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name))\n );\n }\n\n checkLocalExport(id: N.Identifier) {\n const { name } = id;\n const topLevelScope = this.scopeStack[0];\n if (\n !topLevelScope.lexical.has(name) &&\n !topLevelScope.var.has(name) &&\n // In strict mode, scope.functions will always be empty.\n // Modules are strict by default, but the `scriptMode` option\n // can overwrite this behavior.\n !topLevelScope.functions.has(name)\n ) {\n this.undefinedExports.set(name, id.loc.start);\n }\n }\n\n currentScope(): IScope {\n return this.scopeStack[this.scopeStack.length - 1];\n }\n\n currentVarScopeFlags(): ScopeFlags {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (flags & SCOPE_VAR) {\n return flags;\n }\n }\n }\n\n // Could be useful for `arguments`, `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\n currentThisScopeFlags(): ScopeFlags {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (flags & (SCOPE_VAR | SCOPE_CLASS) && !(flags & SCOPE_ARROW)) {\n return flags;\n }\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAmBA,IAAAC,WAAA,GAAAD,OAAA;AAIO,MAAME,KAAK,CAAC;EASjBC,WAAWA,CAACC,KAAiB,EAAE;IAAA,KAN/BC,GAAG,GAAgB,IAAIC,GAAG,CAAC,CAAC;IAAA,KAE5BC,OAAO,GAAgB,IAAID,GAAG,CAAC,CAAC;IAAA,KAEhCE,SAAS,GAAgB,IAAIF,GAAG,CAAC,CAAC;IAGhC,IAAI,CAACF,KAAK,GAAGA,KAAK;EACpB;AACF;AAACK,OAAA,CAAAP,KAAA,GAAAA,KAAA;AAIc,MAAMQ,YAAY,CAA+B;EAM9DP,WAAWA,CAACQ,MAAiB,EAAEC,QAAiB,EAAE;IAAA,KALlDD,MAAM;IAAA,KACNE,UAAU,GAAkB,EAAE;IAAA,KAC9BD,QAAQ;IAAA,KACRE,gBAAgB,GAA0B,IAAIC,GAAG,CAAC,CAAC;IAGjD,IAAI,CAACJ,MAAM,GAAGA,MAAM;IACpB,IA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B,IAAI,CAAC,IAI5B,CAACwB,aAAa,CAAC7D,SAAS,CAACsD,GAAG,CAACjB,IAAI,CAAC,EAClC;MACA,IAAI,CAAC/B,gBAAgB,CAACwD,GAAG,CAACzB,IAAI,EAAEuB,EAAE,CAACrB,GAAG,CAACwB,KAAK,CAAC;IAC/C;EACF;EAEAtD,YAAYA,CAAA,EAAW;IACrB,OAAO,IAAI,CAACJ,UAAU,CAAC,IAAI,CAACA,UAAU,CAACmB,MAAM,GAAG,CAAC,CAAC;EACpD;EAEAZ,oBAAoBA,CAAA,EAAe;IACjC,KAAK,IAAIW,CAAC,GAAG,IAAI,CAAClB,UAAU,CAACmB,MAAM,GAAG,CAAC,GAAID,CAAC,EAAE,EAAE;MAC9C,MAAM;QAAE3B;MAAM,CAAC,GAAG,IAAI,CAACS,UAAU,CAACkB,CAAC,CAAC;MACpC,IAAI3B,KAAK,GAAG8B,qBAAS,EAAE;QACrB,OAAO9B,KAAK;MACd;IACF;EACF;EAGAmB,qBAAqBA,CAAA,EAAe;IAClC,KAAK,IAAIQ,CAAC,GAAG,IAAI,CAAClB,UAAU,CAACmB,MAAM,GAAG,CAAC,GAAID,CAAC,EAAE,EAAE;MAC9C,MAAM;QAAE3B;MAAM,CAAC,GAAG,IAAI,CAACS,UAAU,CAACkB,CAAC,CAAC;MACpC,IAAI3B,KAAK,IAAI8B,qBAAS,GAAGN,uBAAW,CAAC,IAAI,EAAExB,KAAK,GAAGoE,uBAAW,CAAC,EAAE;QAC/D,OAAOpE,KAAK;MACd;IACF;EACF;AACF;AAACK,OAAA,CAAAgE,OAAA,GAAA/D,YAAA"} lib/util/scopeflags.js 0000644 00000014500 15120211213 0010737 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SCOPE_VAR = exports.SCOPE_TS_MODULE = exports.SCOPE_SUPER = exports.SCOPE_STATIC_BLOCK = exports.SCOPE_SIMPLE_CATCH = exports.SCOPE_PROGRAM = exports.SCOPE_OTHER = exports.SCOPE_FUNCTION = exports.SCOPE_DIRECT_SUPER = exports.SCOPE_CLASS = exports.SCOPE_ARROW = exports.CLASS_ELEMENT_STATIC_SETTER = exports.CLASS_ELEMENT_STATIC_GETTER = exports.CLASS_ELEMENT_OTHER = exports.CLASS_ELEMENT_KIND_SETTER = exports.CLASS_ELEMENT_KIND_GETTER = exports.CLASS_ELEMENT_KIND_ACCESSOR = exports.CLASS_ELEMENT_INSTANCE_SETTER = exports.CLASS_ELEMENT_INSTANCE_GETTER = exports.CLASS_ELEMENT_FLAG_STATIC = exports.BIND_VAR = exports.BIND_TS_TYPE_IMPORT = exports.BIND_TS_TYPE = exports.BIND_TS_NAMESPACE = exports.BIND_TS_INTERFACE = exports.BIND_TS_ENUM = exports.BIND_TS_CONST_ENUM = exports.BIND_TS_AMBIENT = exports.BIND_SCOPE_VAR = exports.BIND_SCOPE_OUTSIDE = exports.BIND_SCOPE_LEXICAL = exports.BIND_SCOPE_FUNCTION = exports.BIND_OUTSIDE = exports.BIND_NONE = exports.BIND_LEXICAL = exports.BIND_KIND_VALUE = exports.BIND_KIND_TYPE = exports.BIND_FUNCTION = exports.BIND_FLOW_DECLARE_FN = exports.BIND_FLAGS_TS_IMPORT = exports.BIND_FLAGS_TS_EXPORT_ONLY = exports.BIND_FLAGS_TS_ENUM = exports.BIND_FLAGS_TS_CONST_ENUM = exports.BIND_FLAGS_NO_LET_IN_LEXICAL = exports.BIND_FLAGS_NONE = exports.BIND_FLAGS_FLOW_DECLARE_FN = exports.BIND_FLAGS_CLASS = exports.BIND_CLASS = exports.BIND_CATCH_PARAM = void 0; const SCOPE_OTHER = 0b000000000, SCOPE_PROGRAM = 0b000000001, SCOPE_FUNCTION = 0b000000010, SCOPE_ARROW = 0b000000100, SCOPE_SIMPLE_CATCH = 0b000001000, SCOPE_SUPER = 0b000010000, SCOPE_DIRECT_SUPER = 0b000100000, SCOPE_CLASS = 0b001000000, SCOPE_STATIC_BLOCK = 0b010000000, SCOPE_TS_MODULE = 0b100000000, SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_STATIC_BLOCK | SCOPE_TS_MODULE; exports.SCOPE_VAR = SCOPE_VAR; exports.SCOPE_TS_MODULE = SCOPE_TS_MODULE; exports.SCOPE_STATIC_BLOCK = SCOPE_STATIC_BLOCK; exports.SCOPE_CLASS = SCOPE_CLASS; exports.SCOPE_DIRECT_SUPER = SCOPE_DIRECT_SUPER; exports.SCOPE_SUPER = SCOPE_SUPER; exports.SCOPE_SIMPLE_CATCH = SCOPE_SIMPLE_CATCH; exports.SCOPE_ARROW = SCOPE_ARROW; exports.SCOPE_FUNCTION = SCOPE_FUNCTION; exports.SCOPE_PROGRAM = SCOPE_PROGRAM; exports.SCOPE_OTHER = SCOPE_OTHER; const BIND_KIND_VALUE = 0b0000000000001, BIND_KIND_TYPE = 0b0000000000010, BIND_SCOPE_VAR = 0b0000000000100, BIND_SCOPE_LEXICAL = 0b0000000001000, BIND_SCOPE_FUNCTION = 0b0000000010000, BIND_SCOPE_OUTSIDE = 0b0000000100000, BIND_FLAGS_NONE = 0b00000001000000, BIND_FLAGS_CLASS = 0b00000010000000, BIND_FLAGS_TS_ENUM = 0b00000100000000, BIND_FLAGS_TS_CONST_ENUM = 0b00001000000000, BIND_FLAGS_TS_EXPORT_ONLY = 0b00010000000000, BIND_FLAGS_FLOW_DECLARE_FN = 0b00100000000000, BIND_FLAGS_TS_IMPORT = 0b01000000000000, BIND_FLAGS_NO_LET_IN_LEXICAL = 0b10000000000000; exports.BIND_FLAGS_NO_LET_IN_LEXICAL = BIND_FLAGS_NO_LET_IN_LEXICAL; exports.BIND_FLAGS_TS_IMPORT = BIND_FLAGS_TS_IMPORT; exports.BIND_FLAGS_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN; exports.BIND_FLAGS_TS_EXPORT_ONLY = BIND_FLAGS_TS_EXPORT_ONLY; exports.BIND_FLAGS_TS_CONST_ENUM = BIND_FLAGS_TS_CONST_ENUM; exports.BIND_FLAGS_TS_ENUM = BIND_FLAGS_TS_ENUM; exports.BIND_FLAGS_CLASS = BIND_FLAGS_CLASS; exports.BIND_FLAGS_NONE = BIND_FLAGS_NONE; exports.BIND_SCOPE_OUTSIDE = BIND_SCOPE_OUTSIDE; exports.BIND_SCOPE_FUNCTION = BIND_SCOPE_FUNCTION; exports.BIND_SCOPE_LEXICAL = BIND_SCOPE_LEXICAL; exports.BIND_SCOPE_VAR = BIND_SCOPE_VAR; exports.BIND_KIND_TYPE = BIND_KIND_TYPE; exports.BIND_KIND_VALUE = BIND_KIND_VALUE; const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS | BIND_FLAGS_NO_LET_IN_LEXICAL, BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | BIND_FLAGS_NO_LET_IN_LEXICAL, BIND_CATCH_PARAM = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0, BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0, BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0, BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS, BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0, BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM | BIND_FLAGS_NO_LET_IN_LEXICAL, BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY, BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE, BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE, BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM, BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY, BIND_TS_TYPE_IMPORT = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_TS_IMPORT, BIND_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN; exports.BIND_FLOW_DECLARE_FN = BIND_FLOW_DECLARE_FN; exports.BIND_TS_TYPE_IMPORT = BIND_TS_TYPE_IMPORT; exports.BIND_TS_NAMESPACE = BIND_TS_NAMESPACE; exports.BIND_TS_CONST_ENUM = BIND_TS_CONST_ENUM; exports.BIND_OUTSIDE = BIND_OUTSIDE; exports.BIND_NONE = BIND_NONE; exports.BIND_TS_AMBIENT = BIND_TS_AMBIENT; exports.BIND_TS_ENUM = BIND_TS_ENUM; exports.BIND_TS_TYPE = BIND_TS_TYPE; exports.BIND_TS_INTERFACE = BIND_TS_INTERFACE; exports.BIND_FUNCTION = BIND_FUNCTION; exports.BIND_VAR = BIND_VAR; exports.BIND_CATCH_PARAM = BIND_CATCH_PARAM; exports.BIND_LEXICAL = BIND_LEXICAL; exports.BIND_CLASS = BIND_CLASS; const CLASS_ELEMENT_FLAG_STATIC = 0b100, CLASS_ELEMENT_KIND_GETTER = 0b010, CLASS_ELEMENT_KIND_SETTER = 0b001, CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER; exports.CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_ACCESSOR; exports.CLASS_ELEMENT_KIND_SETTER = CLASS_ELEMENT_KIND_SETTER; exports.CLASS_ELEMENT_KIND_GETTER = CLASS_ELEMENT_KIND_GETTER; exports.CLASS_ELEMENT_FLAG_STATIC = CLASS_ELEMENT_FLAG_STATIC; const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC, CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC, CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER, CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER, CLASS_ELEMENT_OTHER = 0; exports.CLASS_ELEMENT_OTHER = CLASS_ELEMENT_OTHER; exports.CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_INSTANCE_SETTER; exports.CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_INSTANCE_GETTER; exports.CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_STATIC_SETTER; exports.CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_STATIC_GETTER; //# sourceMappingURL=scopeflags.js.map lib/util/scopeflags.js.map 0000644 00000024045 15120211213 0011520 0 ustar 00 {"version":3,"names":["SCOPE_OTHER","SCOPE_PROGRAM","SCOPE_FUNCTION","SCOPE_ARROW","SCOPE_SIMPLE_CATCH","SCOPE_SUPER","SCOPE_DIRECT_SUPER","SCOPE_CLASS","SCOPE_STATIC_BLOCK","SCOPE_TS_MODULE","SCOPE_VAR","exports","BIND_KIND_VALUE","BIND_KIND_TYPE","BIND_SCOPE_VAR","BIND_SCOPE_LEXICAL","BIND_SCOPE_FUNCTION","BIND_SCOPE_OUTSIDE","BIND_FLAGS_NONE","BIND_FLAGS_CLASS","BIND_FLAGS_TS_ENUM","BIND_FLAGS_TS_CONST_ENUM","BIND_FLAGS_TS_EXPORT_ONLY","BIND_FLAGS_FLOW_DECLARE_FN","BIND_FLAGS_TS_IMPORT","BIND_FLAGS_NO_LET_IN_LEXICAL","BIND_CLASS","BIND_LEXICAL","BIND_CATCH_PARAM","BIND_VAR","BIND_FUNCTION","BIND_TS_INTERFACE","BIND_TS_TYPE","BIND_TS_ENUM","BIND_TS_AMBIENT","BIND_NONE","BIND_OUTSIDE","BIND_TS_CONST_ENUM","BIND_TS_NAMESPACE","BIND_TS_TYPE_IMPORT","BIND_FLOW_DECLARE_FN","CLASS_ELEMENT_FLAG_STATIC","CLASS_ELEMENT_KIND_GETTER","CLASS_ELEMENT_KIND_SETTER","CLASS_ELEMENT_KIND_ACCESSOR","CLASS_ELEMENT_STATIC_GETTER","CLASS_ELEMENT_STATIC_SETTER","CLASS_ELEMENT_INSTANCE_GETTER","CLASS_ELEMENT_INSTANCE_SETTER","CLASS_ELEMENT_OTHER"],"sources":["../../src/util/scopeflags.ts"],"sourcesContent":["// Each scope gets a bitset that may contain these flags\n// prettier-ignore\nexport const SCOPE_OTHER = 0b000000000,\n SCOPE_PROGRAM = 0b000000001,\n SCOPE_FUNCTION = 0b000000010,\n SCOPE_ARROW = 0b000000100,\n SCOPE_SIMPLE_CATCH = 0b000001000,\n SCOPE_SUPER = 0b000010000,\n SCOPE_DIRECT_SUPER = 0b000100000,\n SCOPE_CLASS = 0b001000000,\n SCOPE_STATIC_BLOCK = 0b010000000,\n SCOPE_TS_MODULE = 0b100000000,\n SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_STATIC_BLOCK | SCOPE_TS_MODULE;\n\nexport type ScopeFlags =\n | typeof SCOPE_OTHER\n | typeof SCOPE_PROGRAM\n | typeof SCOPE_FUNCTION\n | typeof SCOPE_VAR\n | typeof SCOPE_ARROW\n | typeof SCOPE_SIMPLE_CATCH\n | typeof SCOPE_SUPER\n | typeof SCOPE_DIRECT_SUPER\n | typeof SCOPE_CLASS\n | typeof SCOPE_STATIC_BLOCK;\n\n// These flags are meant to be _only_ used inside the Scope class (or subclasses).\n// prettier-ignore\nexport const BIND_KIND_VALUE = 0b0000000_0000_01,\n BIND_KIND_TYPE = 0b0000000_0000_10,\n // Used in checkLVal and declareName to determine the type of a binding\n BIND_SCOPE_VAR = 0b0000000_0001_00, // Var-style binding\n BIND_SCOPE_LEXICAL = 0b0000000_0010_00, // Let- or const-style binding\n BIND_SCOPE_FUNCTION = 0b0000000_0100_00, // Function declaration\n BIND_SCOPE_OUTSIDE = 0b0000000_1000_00, // Special case for function names as\n // bound inside the function\n // Misc flags\n BIND_FLAGS_NONE = 0b00000001_0000_00,\n BIND_FLAGS_CLASS = 0b00000010_0000_00,\n BIND_FLAGS_TS_ENUM = 0b00000100_0000_00,\n BIND_FLAGS_TS_CONST_ENUM = 0b00001000_0000_00,\n BIND_FLAGS_TS_EXPORT_ONLY = 0b00010000_0000_00,\n BIND_FLAGS_FLOW_DECLARE_FN = 0b00100000_0000_00,\n BIND_FLAGS_TS_IMPORT = 0b01000000_0000_00,\n // Whether \"let\" should be allowed in bound names in sloppy mode\n BIND_FLAGS_NO_LET_IN_LEXICAL = 0b10000000_0000_00;\n\n// These flags are meant to be _only_ used by Scope consumers\n// prettier-ignore\n/* = is value? | is type? | scope | misc flags */\nexport const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS|BIND_FLAGS_NO_LET_IN_LEXICAL,\n BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | BIND_FLAGS_NO_LET_IN_LEXICAL,\n BIND_CATCH_PARAM = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0 ,\n BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0 ,\n BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0 ,\n BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS ,\n BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0 ,\n BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM|BIND_FLAGS_NO_LET_IN_LEXICAL,\n BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,\n // These bindings don't introduce anything in the scope. They are used for assignments and\n // function expressions IDs.\n BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE ,\n BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE ,\n\n BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM ,\n BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,\n BIND_TS_TYPE_IMPORT= 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_TS_IMPORT ,\n\n BIND_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN;\n\nexport type BindingTypes =\n | typeof BIND_NONE\n | typeof BIND_OUTSIDE\n | typeof BIND_VAR\n | typeof BIND_LEXICAL\n | typeof BIND_CLASS\n | typeof BIND_FUNCTION\n | typeof BIND_TS_INTERFACE\n | typeof BIND_TS_TYPE\n | typeof BIND_TS_ENUM\n | typeof BIND_TS_AMBIENT\n | typeof BIND_TS_NAMESPACE;\n\n// prettier-ignore\nexport const CLASS_ELEMENT_FLAG_STATIC = 0b1_00,\n CLASS_ELEMENT_KIND_GETTER = 0b0_10,\n CLASS_ELEMENT_KIND_SETTER = 0b0_01,\n CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER;\n\n// prettier-ignore\nexport const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER,\n CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER,\n CLASS_ELEMENT_OTHER = 0;\n\nexport type ClassElementTypes =\n | typeof CLASS_ELEMENT_STATIC_GETTER\n | typeof CLASS_ELEMENT_STATIC_SETTER\n | typeof CLASS_ELEMENT_INSTANCE_GETTER\n | typeof CLASS_ELEMENT_INSTANCE_SETTER\n | typeof CLASS_ELEMENT_OTHER;\n"],"mappings":";;;;;;AAEO,MA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AAAhC,OAAA,CAAA+B,yBAAA,GAAAA,yBAAA;AAAA/B,OAAA,CAAA8B,yBAAA,GAAAA,yBAAA;AAG1F,MAAMI,2BAA2B,GAAKH,yBAAyB,GAAGD,yBAAyB;EACrFK,2BAA2B,GAAKH,yBAAyB,GAAGF,yBAAyB;EACrFM,6BAA6B,GAAGL,yBAAyB;EACzDM,6BAA6B,GAAGL,yBAAyB;EACzDM,mBAAmB,GAAa,CAAC;AAACtC,OAAA,CAAAsC,mBAAA,GAAAA,mBAAA;AAAAtC,OAAA,CAAAqC,6BAAA,GAAAA,6BAAA;AAAArC,OAAA,CAAAoC,6BAAA,GAAAA,6BAAA;AAAApC,OAAA,CAAAmC,2BAAA,GAAAA,2BAAA;AAAAnC,OAAA,CAAAkC,2BAAA,GAAAA,2BAAA"} lib/util/whitespace.js 0000644 00000003013 15120211213 0010742 0 ustar 00 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isNewLine = isNewLine; exports.isWhitespace = isWhitespace; exports.skipWhiteSpaceToLineBreak = exports.skipWhiteSpaceInLine = exports.skipWhiteSpace = exports.lineBreakG = exports.lineBreak = void 0; const lineBreak = /\r\n?|[\n\u2028\u2029]/; exports.lineBreak = lineBreak; const lineBreakG = new RegExp(lineBreak.source, "g"); exports.lineBreakG = lineBreakG; function isNewLine(code) { switch (code) { case 10: case 13: case 8232: case 8233: return true; default: return false; } } const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; exports.skipWhiteSpace = skipWhiteSpace; const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g; exports.skipWhiteSpaceInLine = skipWhiteSpaceInLine; const skipWhiteSpaceToLineBreak = new RegExp("(?=(" + skipWhiteSpaceInLine.source + "))\\1" + /(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source, "y"); exports.skipWhiteSpaceToLineBreak = skipWhiteSpaceToLineBreak; function isWhitespace(code) { switch (code) { case 0x0009: case 0x000b: case 0x000c: case 32: case 160: case 5760: case 0x2000: case 0x2001: case 0x2002: case 0x2003: case 0x2004: case 0x2005: case 0x2006: case 0x2007: case 0x2008: case 0x2009: case 0x200a: case 0x202f: case 0x205f: case 0x3000: case 0xfeff: return true; default: return false; } } //# sourceMappingURL=whitespace.js.map lib/util/whitespace.js.map 0000644 00000007421 15120211213 0011525 0 ustar 00 {"version":3,"names":["lineBreak","exports","lineBreakG","RegExp","source","isNewLine","code","skipWhiteSpace","skipWhiteSpaceInLine","skipWhiteSpaceToLineBreak","isWhitespace"],"sources":["../../src/util/whitespace.ts"],"sourcesContent":["import * as charCodes from \"charcodes\";\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\nexport const lineBreak = /\\r\\n?|[\\n\\u2028\\u2029]/;\nexport const lineBreakG = new RegExp(lineBreak.source, \"g\");\n\n// https://tc39.github.io/ecma262/#sec-line-terminators\nexport function isNewLine(code: number): boolean {\n switch (code) {\n case charCodes.lineFeed:\n case charCodes.carriageReturn:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return true;\n\n default:\n return false;\n }\n}\n\nexport const skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n\nexport const skipWhiteSpaceInLine =\n /(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*/g;\n\n// Skip whitespace and single-line comments, including /* no newline here */.\n// After this RegExp matches, its lastIndex points to a line terminator, or\n// the start of multi-line comment (which is effectively a line terminator),\n// or the end of string.\nexport const skipWhiteSpaceToLineBreak = new RegExp(\n // Unfortunately JS doesn't support Perl's atomic /(?>pattern)/ or\n // possessive quantifiers, so we use a trick to prevent backtracking\n // when the look-ahead for line terminator fails.\n \"(?=(\" +\n // Capture the whitespace and comments that should be skipped inside\n // a look-ahead assertion, and then re-match the group as a unit.\n skipWhiteSpaceInLine.source +\n \"))\\\\1\" +\n // Look-ahead for either line terminator, start of multi-line comment,\n // or end of string.\n /(?=[\\n\\r\\u2028\\u2029]|\\/\\*(?!.*?\\*\\/)|$)/.source,\n \"y\", // sticky\n);\n\n// https://tc39.github.io/ecma262/#sec-white-space\nexport function isWhitespace(code: number): boolean {\n switch (code) {\n case 0x0009: // CHARACTER TABULATION\n case 0x000b: // LINE TABULATION\n case 0x000c: // FORM FEED\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.oghamSpaceMark:\n case 0x2000: // EN QUAD\n case 0x2001: // EM QUAD\n case 0x2002: // EN SPACE\n case 0x2003: // EM SPACE\n case 0x2004: // THREE-PER-EM SPACE\n case 0x2005: // FOUR-PER-EM SPACE\n case 0x2006: // SIX-PER-EM SPACE\n case 0x2007: // FIGURE SPACE\n case 0x2008: // PUNCTUATION SPACE\n case 0x2009: // THIN SPACE\n case 0x200a: // HAIR SPACE\n case 0x202f: // NARROW NO-BREAK SPACE\n case 0x205f: // MEDIUM MATHEMATICAL SPACE\n case 0x3000: // IDEOGRAPHIC SPACE\n case 0xfeff: // ZERO WIDTH NO-BREAK SPACE\n return true;\n\n default:\n return false;\n }\n}\n"],"mappings":";;;;;;;;AAIO,MAAMA,SAAS,GAAG,wBAAwB;AAACC,OAAA,CAAAD,SAAA,GAAAA,SAAA;AAC3C,MAAME,UAAU,GAAG,IAAIC,MAAM,CAACH,SAAS,CAACI,MAAM,EAAE,GAAG,CAAC;AAACH,OAAA,CAAAC,UAAA,GAAAA,UAAA;AAGrD,SAASG,SAASA,CAACC,IAAY,EAAW;EAC/C,QAAQA,IAAI;IACV;IACA;IACA;IACA;MACE,OAAO,IAAI;IAEb;MACE,OAAO,KAAK;EAChB;AACF;AAEO,MAAMC,cAAc,GAAG,+BAA+B;AAACN,OAAA,CAAAM,cAAA,GAAAA,cAAA;AAEvD,MAAMC,oBAAoB,GAC/B,gDAAgD;AAACP,OAAA,CAAAO,oBAAA,GAAAA,oBAAA;AAM5C,MAAMC,yBAAyB,GAAG,IAAIN,MAAM,CAIjD,MAAM,GAGJK,oBAAoB,CAACJ,MAAM,GAC3B,OAAO,GAGP,0CAA0C,CAACA,MAAM,EACnD,GACF,CAAC;AAACH,OAAA,CAAAQ,yBAAA,GAAAA,yBAAA;AAGK,SAASC,YAAYA,CAACJ,IAAY,EAAW;EAClD,QAAQA,IAAI;IACV,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX;IACA;IACA;IACA,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;MACT,OAAO,IAAI;IAEb;MACE,OAAO,KAAK;EAChB;AACF"} package.json 0000644 00000002255 15120211213 0007022 0 ustar 00 { "name": "@babel/parser", "version": "7.22.5", "description": "A JavaScript parser", "author": "The Babel Team (https://babel.dev/team)", "homepage": "https://babel.dev/docs/en/next/babel-parser", "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A+parser+%28babylon%29%22+is%3Aopen", "license": "MIT", "publishConfig": { "access": "public" }, "keywords": [ "babel", "javascript", "parser", "tc39", "ecmascript", "@babel/parser" ], "repository": { "type": "git", "url": "https://github.com/babel/babel.git", "directory": "packages/babel-parser" }, "main": "./lib/index.js", "types": "./typings/babel-parser.d.ts", "files": [ "bin", "lib", "typings/babel-parser.d.ts", "index.cjs" ], "engines": { "node": ">=6.0.0" }, "devDependencies": { "@babel/code-frame": "^7.22.5", "@babel/helper-check-duplicate-nodes": "^7.22.5", "@babel/helper-fixtures": "^7.22.5", "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.5", "charcodes": "^0.2.0" }, "bin": "./bin/babel-parser.js", "type": "commonjs" } typings/babel-parser.d.ts 0000644 00000016011 15120211213 0011355 0 ustar 00 // This file is auto-generated! Do not modify it directly. /* eslint-disable import/no-extraneous-dependencies, @typescript-eslint/consistent-type-imports, prettier/prettier */ import * as _babel_types from '@babel/types'; type Plugin = | "asyncDoExpressions" | "asyncGenerators" | "bigInt" | "classPrivateMethods" | "classPrivateProperties" | "classProperties" | "classStaticBlock" // Enabled by default | "decimal" | "decorators-legacy" | "decoratorAutoAccessors" | "destructuringPrivate" | "doExpressions" | "dynamicImport" | "explicitResourceManagement" | "exportDefaultFrom" | "exportNamespaceFrom" // deprecated | "flow" | "flowComments" | "functionBind" | "functionSent" | "importMeta" | "jsx" | "logicalAssignment" | "importAssertions" // deprecated | "importAttributes" | "importReflection" | "moduleBlocks" | "moduleStringNames" | "nullishCoalescingOperator" | "numericSeparator" | "objectRestSpread" | "optionalCatchBinding" | "optionalChaining" | "partialApplication" | "placeholders" | "privateIn" // Enabled by default | "regexpUnicodeSets" // Enabled by default | "throwExpressions" | "topLevelAwait" | "v8intrinsic" | ParserPluginWithOptions[0]; type ParserPluginWithOptions = | ["decorators", DecoratorsPluginOptions] | ["estree", { classFeatures?: boolean }] | ["importAttributes", { deprecatedAssertSyntax: boolean }] // @deprecated | ["moduleAttributes", { version: "may-2020" }] | ["pipelineOperator", PipelineOperatorPluginOptions] | ["recordAndTuple", RecordAndTuplePluginOptions] | ["flow", FlowPluginOptions] | ["typescript", TypeScriptPluginOptions]; type PluginConfig = Plugin | ParserPluginWithOptions; interface DecoratorsPluginOptions { decoratorsBeforeExport?: boolean; allowCallParenthesized?: boolean; } interface PipelineOperatorPluginOptions { proposal: "minimal" | "fsharp" | "hack" | "smart"; topicToken?: "%" | "#" | "@@" | "^^" | "^"; } interface RecordAndTuplePluginOptions { syntaxType: "bar" | "hash"; } interface FlowPluginOptions { all?: boolean; enums?: boolean; } interface TypeScriptPluginOptions { dts?: boolean; disallowAmbiguousJSXLike?: boolean; } // Type definitions for @babel/parser // Project: https://github.com/babel/babel/tree/main/packages/babel-parser // Definitions by: Troy Gerwien <https://github.com/yortus> // Marvin Hagemeister <https://github.com/marvinhagemeister> // Avi Vahl <https://github.com/AviVahl> // TypeScript Version: 2.9 /** * Parse the provided code as an entire ECMAScript program. */ declare function parse( input: string, options?: ParserOptions ): ParseResult<_babel_types.File>; /** * Parse the provided code as a single expression. */ declare function parseExpression( input: string, options?: ParserOptions ): ParseResult<_babel_types.Expression>; interface ParserOptions { /** * By default, import and export declarations can only appear at a program's top level. * Setting this option to true allows them anywhere where a statement is allowed. */ allowImportExportEverywhere?: boolean; /** * By default, await use is not allowed outside of an async function. * Set this to true to accept such code. */ allowAwaitOutsideFunction?: boolean; /** * By default, a return statement at the top level raises an error. * Set this to true to accept such code. */ allowReturnOutsideFunction?: boolean; /** * By default, new.target use is not allowed outside of a function or class. * Set this to true to accept such code. */ allowNewTargetOutsideFunction?: boolean; allowSuperOutsideMethod?: boolean; /** * By default, exported identifiers must refer to a declared variable. * Set this to true to allow export statements to reference undeclared variables. */ allowUndeclaredExports?: boolean; /** * By default, Babel parser JavaScript code according to Annex B syntax. * Set this to `false` to disable such behavior. */ annexB?: boolean; /** * By default, Babel attaches comments to adjacent AST nodes. * When this option is set to false, comments are not attached. * It can provide up to 30% performance improvement when the input code has many comments. * @babel/eslint-parser will set it for you. * It is not recommended to use attachComment: false with Babel transform, * as doing so removes all the comments in output code, and renders annotations such as * /* istanbul ignore next *\/ nonfunctional. */ attachComment?: boolean; /** * By default, Babel always throws an error when it finds some invalid code. * When this option is set to true, it will store the parsing error and * try to continue parsing the invalid input file. */ errorRecovery?: boolean; /** * Indicate the mode the code should be parsed in. * Can be one of "script", "module", or "unambiguous". Defaults to "script". * "unambiguous" will make @babel/parser attempt to guess, based on the presence * of ES6 import or export statements. * Files with ES6 imports and exports are considered "module" and are otherwise "script". */ sourceType?: "script" | "module" | "unambiguous"; /** * Correlate output AST nodes with their source filename. * Useful when generating code and source maps from the ASTs of multiple input files. */ sourceFilename?: string; /** * By default, the first line of code parsed is treated as line 1. * You can provide a line number to alternatively start with. * Useful for integration with other source tools. */ startLine?: number; /** * By default, the parsed code is treated as if it starts from line 1, column 0. * You can provide a column number to alternatively start with. * Useful for integration with other source tools. */ startColumn?: number; /** * Array containing the plugins that you want to enable. */ plugins?: ParserPlugin[]; /** * Should the parser work in strict mode. * Defaults to true if sourceType === 'module'. Otherwise, false. */ strictMode?: boolean; /** * Adds a ranges property to each node: [node.start, node.end] */ ranges?: boolean; /** * Adds all parsed tokens to a tokens property on the File node. */ tokens?: boolean; /** * By default, the parser adds information about parentheses by setting * `extra.parenthesized` to `true` as needed. * When this option is `true` the parser creates `ParenthesizedExpression` * AST nodes instead of using the `extra` property. */ createParenthesizedExpressions?: boolean; } type ParserPlugin = PluginConfig; declare const tokTypes: { // todo(flow->ts) real token type [name: string]: any; }; interface ParseError { code: string; reasonCode: string; } type ParseResult<Result> = Result & { errors: ParseError[]; }; export { DecoratorsPluginOptions, FlowPluginOptions, ParseError, ParseResult, ParserOptions, ParserPlugin, ParserPluginWithOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions, TypeScriptPluginOptions, parse, parseExpression, tokTypes };
Coded With 💗 by
0x6ick