Improved server example
This commit is contained in:
@ -2,6 +2,7 @@ package core
|
||||
|
||||
import (
|
||||
"git.akyoto.dev/cli/q/src/asm"
|
||||
"git.akyoto.dev/cli/q/src/errors"
|
||||
"git.akyoto.dev/cli/q/src/expression"
|
||||
"git.akyoto.dev/cli/q/src/types"
|
||||
)
|
||||
@ -11,6 +12,11 @@ func (f *Function) CompileDelete(root *expression.Expression) error {
|
||||
parameters := root.Children[1:]
|
||||
variableName := parameters[0].Token.Text(f.File.Bytes)
|
||||
variable := f.VariableByName(variableName)
|
||||
|
||||
if variable == nil {
|
||||
return errors.New(&errors.UnknownIdentifier{Name: variableName}, f.File, parameters[0].Token.Position)
|
||||
}
|
||||
|
||||
defer f.UseVariable(variable)
|
||||
f.SaveRegister(f.CPU.Input[0])
|
||||
f.SaveRegister(f.CPU.Input[1])
|
||||
|
Reference in New Issue
Block a user