Add number literal type annotations for flow

This commit is contained in:
Franky Chung
2015-07-19 12:01:40 +09:00
parent faa6ce1a08
commit 0876209847
6 changed files with 228 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();