add some more flow types

This commit is contained in:
Henry Zhu
2015-12-18 01:19:06 -05:00
parent 97fd9d65e7
commit 5f0ece0bdb
4 changed files with 10 additions and 6 deletions

View File

@@ -26,7 +26,9 @@ export class TokContext {
override: ?Function;
}
export const types = {
export const types: {
[key: string]: TokContext;
} = {
b_stat: new TokContext("{", false),
b_expr: new TokContext("{", true),
b_tmpl: new TokContext("${", true),
@@ -57,7 +59,7 @@ tt.parenR.updateContext = tt.braceR.updateContext = function () {
tt.name.updateContext = function (prevType) {
this.state.exprAllowed = false;
if (prevType === tt._let || prevType === tt._const || prevType === tt._var) {
if (lineBreak.test(this.input.slice(this.state.end))) {
this.state.exprAllowed = true;

View File

@@ -1,3 +1,5 @@
/* @noflow */
import type { TokenType } from "./types";
import { isIdentifierStart, isIdentifierChar, isKeyword } from "../util/identifier";
import { types as tt, keywords as keywordTypes } from "./types";