|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
624 bytes
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 | import {augmentError, initParser, state} from "./traverser/base";
|
|---|
| 4 | import {parseFile} from "./traverser/index";
|
|---|
| 5 |
|
|---|
| 6 | export class File {
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 | constructor(tokens, scopes) {
|
|---|
| 11 | this.tokens = tokens;
|
|---|
| 12 | this.scopes = scopes;
|
|---|
| 13 | }
|
|---|
| 14 | }
|
|---|
| 15 |
|
|---|
| 16 | export function parse(
|
|---|
| 17 | input,
|
|---|
| 18 | isJSXEnabled,
|
|---|
| 19 | isTypeScriptEnabled,
|
|---|
| 20 | isFlowEnabled,
|
|---|
| 21 | ) {
|
|---|
| 22 | if (isFlowEnabled && isTypeScriptEnabled) {
|
|---|
| 23 | throw new Error("Cannot combine flow and typescript plugins.");
|
|---|
| 24 | }
|
|---|
| 25 | initParser(input, isJSXEnabled, isTypeScriptEnabled, isFlowEnabled);
|
|---|
| 26 | const result = parseFile();
|
|---|
| 27 | if (state.error) {
|
|---|
| 28 | throw augmentError(state.error);
|
|---|
| 29 | }
|
|---|
| 30 | return result;
|
|---|
| 31 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.