Skip to content

Commit

Permalink
Fixed operator parsing bug reported by brianush1
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahnfelt committed Sep 24, 2020
1 parent a140c11 commit bca885b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ class Parser(file : String, tokens : Array[Token]) {

private def parseBinary(operators : Seq[String], parseOperand : () => Term) : Term = {
var result = parseOperand()
val operator = current.raw
while(operators.contains(current.raw)) {
val c = skip("operator")
val operator = current.raw
val c = skip("operator", Some(operator))
val argument = parseOperand()
result = EBinary(c.at, operator, result, argument)
}
Expand Down

0 comments on commit bca885b

Please sign in to comment.