Merge branch 'master' of github.com:babel/babel

This commit is contained in:
Sebastian McKenzie
2015-06-02 16:18:13 +01:00
5 changed files with 40 additions and 6 deletions

View File

@@ -415,6 +415,9 @@ pp.flow_identToTypeAnnotation = function (start, node, id) {
case "boolean":
return this.finishNode(node, "BooleanTypeAnnotation")
case "mixed":
return this.finishNode(node, "MixedTypeAnnotation")
case "number":
return this.finishNode(node, "NumberTypeAnnotation")

View File

@@ -103,6 +103,10 @@ export function IntersectionTypeAnnotation(node, print) {
print.join(node.types, { separator: " & " });
}
export function MixedTypeAnnotation() {
this.push("mixed");
}
export function NullableTypeAnnotation(node, print) {
this.push("?");
print.plain(node.typeAnnotation);

View File

@@ -93,6 +93,7 @@
"InterfaceExtends": ["Flow"],
"InterfaceDeclaration": ["Flow", "Statement", "Declaration"],
"IntersectionTypeAnnotation": ["Flow"],
"MixedTypeAnnotation": ["Flow"],
"NullableTypeAnnotation": ["Flow"],
"NumberTypeAnnotation": ["Flow"],
"StringLiteralTypeAnnotation": ["Flow"],

View File

@@ -91,6 +91,7 @@
"InterfaceExtends": ["id", "typeParameters"],
"InterfaceDeclaration": ["id", "typeParameters", "extends", "body"],
"IntersectionTypeAnnotation": ["types"],
"MixedTypeAnnotation": [],
"NullableTypeAnnotation": ["typeAnnotation"],
"NumberTypeAnnotation": [],
"StringLiteralTypeAnnotation": [],