From bca885be88c364864f3c79927b62558c6b6cdf7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Ahnfelt-R=C3=B8nne?= Date: Thu, 24 Sep 2020 19:38:41 +0200 Subject: [PATCH] Fixed operator parsing bug reported by brianush1 --- .../scala/com/github/ahnfelt/topshell/language/Parser.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/com/github/ahnfelt/topshell/language/Parser.scala b/src/main/scala/com/github/ahnfelt/topshell/language/Parser.scala index 3df3a69..f678bf6 100644 --- a/src/main/scala/com/github/ahnfelt/topshell/language/Parser.scala +++ b/src/main/scala/com/github/ahnfelt/topshell/language/Parser.scala @@ -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) }