fix type-to-string conv. + fix binary type check + add modulo + rework import (now include)
Some checks failed
/ test (push) Failing after 41s
Some checks failed
/ test (push) Failing after 41s
This commit is contained in:
parent
91baf28fdf
commit
575fd8e37a
7 changed files with 131 additions and 91 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue