Simplified file structure

This commit is contained in:
2024-08-07 19:39:10 +02:00
parent 1b13539b22
commit 66569446b1
219 changed files with 453 additions and 457 deletions

View File

@ -0,0 +1,21 @@
package core
import (
"git.akyoto.dev/cli/q/src/asm"
"git.akyoto.dev/cli/q/src/cpu"
"git.akyoto.dev/cli/q/src/errors"
"git.akyoto.dev/cli/q/src/token"
)
// ExecuteRegister performs an operation on a single register.
func (f *Function) ExecuteRegister(operation token.Token, register cpu.Register) error {
switch operation.Kind {
case token.Negate:
f.Register(asm.NEGATE, register)
default:
return errors.New(&errors.InvalidOperator{Operator: operation.Text(f.File.Bytes)}, f.File, operation.Position)
}
return nil
}