Fix expression parsing

This commit is contained in:
MrLetsplay 2024-04-04 20:11:01 +02:00
parent f5168a73bf
commit 45f5ea3398
Signed by: mr
SSH Key Fingerprint: SHA256:92jBH80vpXyaZHjaIl47pjRq+Yt7XGTArqQg1V7hSqg

View File

@ -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) {