Added more tests
This commit is contained in:
parent
1e7a1399d3
commit
5abe8acc70
4 changed files with 22 additions and 7 deletions
|
@ -5,12 +5,11 @@ import (
|
|||
"git.akyoto.dev/cli/q/src/build/errors"
|
||||
"git.akyoto.dev/cli/q/src/build/expression"
|
||||
"git.akyoto.dev/cli/q/src/build/sizeof"
|
||||
"git.akyoto.dev/cli/q/src/build/token"
|
||||
)
|
||||
|
||||
// ExpressionToMemory puts the result of an expression into the specified memory address.
|
||||
func (f *Function) ExpressionToMemory(node *expression.Expression, memory asm.Memory) error {
|
||||
if node.IsLeaf() && (node.Token.Kind == token.Number || node.Token.Kind == token.Rune) {
|
||||
if node.IsLeaf() && node.Token.IsNumeric() {
|
||||
number, err := f.Number(node.Token)
|
||||
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue