fix: default to precedence 1 for custom operators

This commit is contained in:
Jason Etcovitch
2021-02-05 23:57:36 +08:00
committed by Jun Yang
parent dce75a1a22
commit 20f559e545
2 changed files with 9 additions and 1 deletions
+2 -1
View File
@@ -25,6 +25,7 @@ export class OperatorToken extends Token {
this.operator = this.getText()
}
getPrecedence () {
return precedence[this.getText()]
const key = this.getText()
return key in precedence ? precedence[key] : 1
}
}