Add number literal type annotations for flow

This commit is contained in:
Franky Chung
2015-07-19 12:01:40 +09:00
parent 49f18bb8ba
commit f3c7ef6707
2 changed files with 208 additions and 0 deletions

View File

@@ -505,6 +505,12 @@ pp.flowParsePrimaryType = function () {
this.next();
return this.finishNode(node, "StringLiteralTypeAnnotation");
case tt.num:
node.value = this.value;
node.raw = this.input.slice(this.start, this.end);
this.next();
return this.finishNode(node, "NumberLiteralTypeAnnotation");
default:
if (this.type.keyword === "typeof") {
return this.flowParseTypeofType();