Added placeholders for type casts

This commit is contained in:
2025-02-27 00:18:34 +01:00
parent bbf2970c4e
commit ae6530aadb
19 changed files with 61 additions and 42 deletions

View File

@ -6,6 +6,7 @@ import (
"git.urbach.dev/cli/q/src/errors"
"git.urbach.dev/cli/q/src/expression"
"git.urbach.dev/cli/q/src/token"
"git.urbach.dev/cli/q/src/types"
)
// CompileDefinition compiles a variable definition.
@ -30,6 +31,10 @@ func (f *Function) CompileDefinition(node *ast.Define) error {
return errors.New(errors.UntypedExpression, f.File, node.Expression.Token.End())
}
if typ == types.AnyInt {
typ = types.Int
}
variable.Type = typ
f.AddVariable(variable)
return nil