Add support for flow's export type * from (#617)
This commit is contained in:
@@ -1283,7 +1283,10 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
|
||||
parseExport(node: N.ExportNamedDeclaration): N.ExportNamedDeclaration {
|
||||
node = super.parseExport(node);
|
||||
if (node.type === "ExportNamedDeclaration") {
|
||||
if (
|
||||
node.type === "ExportNamedDeclaration" ||
|
||||
node.type === "ExportAllDeclaration"
|
||||
) {
|
||||
node.exportKind = node.exportKind || "value";
|
||||
}
|
||||
return node;
|
||||
@@ -1315,6 +1318,22 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
}
|
||||
}
|
||||
|
||||
shouldParseExportStar(): boolean {
|
||||
return (
|
||||
super.shouldParseExportStar() ||
|
||||
(this.isContextual("type") && this.lookahead().type === tt.star)
|
||||
);
|
||||
}
|
||||
|
||||
parseExportStar(node: N.ExportNamedDeclaration, allowNamed: boolean): void {
|
||||
if (this.eatContextual("type")) {
|
||||
node.exportKind = "type";
|
||||
allowNamed = false;
|
||||
}
|
||||
|
||||
return super.parseExportStar(node, allowNamed);
|
||||
}
|
||||
|
||||
parseClassId(node: N.Class, isStatement: boolean, optionalId: ?boolean) {
|
||||
super.parseClassId(node, isStatement, optionalId);
|
||||
if (this.isRelational("<")) {
|
||||
|
||||
Reference in New Issue
Block a user