From 45f5ea33988e4bd029bbdf95e92ba4f65b5b2fe2 Mon Sep 17 00:00:00 2001 From: MrLetsplay Date: Thu, 4 Apr 2024 20:11:01 +0200 Subject: [PATCH] Fix expression parsing --- parser.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parser.go b/parser.go index d0478a2..ac46991 100644 --- a/parser.go +++ b/parser.go @@ -615,7 +615,7 @@ func (p *Parser) tryUnaryExpression() (*Expression, error) { } } - return nil, nil + return p.tryPrimaryExpression() } func (p *Parser) tryBinaryExpression0(opFunc func() (*Expression, error), operators ...Operator) (*Expression, error) { @@ -652,7 +652,7 @@ func (p *Parser) tryBinaryExpression0(opFunc func() (*Expression, error), operat } func (p *Parser) tryMultiplicativeExpression() (*Expression, error) { - return p.tryBinaryExpression0(p.tryPrimaryExpression, Operator_Multiply, Operator_Divide, Operator_Modulo) + return p.tryBinaryExpression0(p.tryUnaryExpression, Operator_Multiply, Operator_Divide, Operator_Modulo) } func (p *Parser) tryAdditiveExpression() (*Expression, error) {