Fixed incorrect division results

This commit is contained in:
2025-02-22 12:54:23 +01:00
parent 7598411c8f
commit c088697446
11 changed files with 150 additions and 94 deletions

View File

@ -5,6 +5,7 @@ import (
"git.akyoto.dev/cli/q/src/ast"
"git.akyoto.dev/cli/q/src/errors"
"git.akyoto.dev/cli/q/src/expression"
"git.akyoto.dev/cli/q/src/token"
)
// CompileDefinition compiles a variable definition.
@ -34,6 +35,10 @@ func (f *Function) CompileDefinition(node *ast.Define) error {
return nil
}
if left.Token.Kind == token.Separator && right.Token.Kind == token.Div {
return f.CompileAssignDivision(node.Expression)
}
if !ast.IsFunctionCall(right) {
return errors.New(errors.NotImplemented, f.File, node.Expression.Token.Position)
}