Fixed incorrect division results
This commit is contained in:
parent
65b74046e1
commit
a75aad52f6
11 changed files with 150 additions and 94 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue