Refactored code structure

This commit is contained in:
2024-07-03 11:39:24 +02:00
parent ed03f6a802
commit feebfe65bb
54 changed files with 583 additions and 450 deletions

View File

@ -1,10 +1,10 @@
package ast
import (
"git.akyoto.dev/cli/q/src/build/errors"
"git.akyoto.dev/cli/q/src/build/expression"
"git.akyoto.dev/cli/q/src/build/keyword"
"git.akyoto.dev/cli/q/src/build/token"
"git.akyoto.dev/cli/q/src/errors"
)
// Parse generates an AST from a list of tokens.
@ -75,7 +75,7 @@ func toASTNode(tokens token.List) (Node, error) {
name := expr.Children[0].Token
value := expr.Children[1]
return &Assign{Name: name, Value: value}, nil
return &Assign{Name: name, Value: value, Operator: expr.Token}, nil
case IsFunctionCall(expr):
return &Call{Expression: expr}, nil