Fix export statement parsing
Closes
MODIFY
packages/@romejs/js-ast-utils/doesNodeMatchPattern.ts
packages/@romejs/js-ast-utils/doesNodeMatchPattern.ts
@@ -53,7 +53,7 @@ export default function doesNodeMatchPattern(
const {parts: expectedParts, hasDoubleStar} = split(match);
// Fast path for single part pattern matching
- if (expectedParts.length === 1 && expectedParts[0] !== '*' && !hasDoubleStar) {
+ if (expectedParts.length === 1 && expectedParts[0] !== "*" && !hasDoubleStar) {
return isIdentifierish(node) && node.name === expectedParts[0];
}

MODIFY
packages/@romejs/js-parser/parser/modules.ts
packages/@romejs/js-parser/parser/modules.ts
@@ -383,10 +383,13 @@ function parseExportDeclaration(
}
function isExportDefaultSpecifier(parser: JSParser): boolean {
+ // export Foo from "mod"
+ // export Foo, {Bar} from "mod"
const lookahead = parser.lookaheadState();
if (
- lookahead.tokenType === tt.comma ||
- (lookahead.tokenType === tt.name && lookahead.tokenValue === "from")
+ parser.match(tt.name) &&
+ (lookahead.tokenType === tt.comma ||
+ (lookahead.tokenType === tt.name && lookahead.tokenValue === "from"))
) {
return true;
}

Fix export statement parsing

Closes #412