fix type-to-string conv. + fix binary type check + add modulo + rework import (now include)
Some checks failed
/ test (push) Failing after 41s

This commit is contained in:
Neemek 2026-07-13 23:34:19 +02:00
parent 91baf28fdf
commit 575fd8e37a
Signed by: neemek
GPG key ID: 84FFE4D7D40AB25E
7 changed files with 131 additions and 91 deletions

View file

@ -43,6 +43,7 @@ const (
AccessNodeType
AliasNodeType
IndexNodeType
IncludeNodeType
BreakpointNodeType
)
@ -294,6 +295,7 @@ const (
BinarySubtraction
BinaryMultiplication
BinaryDivision
BinaryModulo
BinaryBooleanAnd
BinaryBooleanOr
@ -317,6 +319,8 @@ func (n BinaryOperation) Symbol() string {
return "*"
case BinaryDivision:
return "/"
case BinaryModulo:
return "%"
case BinaryEquality:
return "=="
case BinaryInequality:
@ -690,6 +694,25 @@ func (n AliasNode) Bounds() (Pos, Pos) {
return n.start, n.end
}
type IncludeNode struct {
path *StringNode
start Pos
end Pos
}
func (n IncludeNode) Type() NodeType {
return IncludeNodeType
}
func (n IncludeNode) String() string {
return fmt.Sprintf("include \"%s\"", n.path)
}
func (n IncludeNode) Bounds() (Pos, Pos) {
return n.start, n.end
}
type IndexNode struct {
source Node
index Node