Explicit labels for tokenTypes (#9761)

* Explicit labels for tokenTypes

* Fix test

* Fix test
This commit is contained in:
Daniel Tschinder 2019-03-25 14:23:16 -07:00 committed by GitHub
parent aaefc83a6c
commit d720c6cfff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -144,9 +144,9 @@ export const types: { [name: string]: TokenType } = {
bitwiseOR: createBinop("|", 3),
bitwiseXOR: createBinop("^", 4),
bitwiseAND: createBinop("&", 5),
equality: createBinop("==/!=", 6),
relational: createBinop("</>", 7),
bitShift: createBinop("<</>>", 8),
equality: createBinop("==/!=/===/!==", 6),
relational: createBinop("</>/<=/>=", 7),
bitShift: createBinop("<</>>/>>>", 8),
plusMin: new TokenType("+/-", { beforeExpr, binop: 9, prefix, startsExpr }),
modulo: createBinop("%", 10),
star: createBinop("*", 10),

View File

@ -1,4 +1,3 @@
{
"presets": [["react", {}, "before"], "typescript", ["react", {}, "after"]],
"throws": "Unexpected token, expected \"</>\" (1:6)"
"throws": "Unexpected token, expected \"</>/<=/>=\" (1:6)"
}