This commit is contained in:
parent
42fa039daf
commit
8d12c0bdf8
4 changed files with 17 additions and 3 deletions
|
|
@ -185,6 +185,8 @@ func (t TokenKind) String() string {
|
||||||
return "for"
|
return "for"
|
||||||
case TokenIn:
|
case TokenIn:
|
||||||
return "in"
|
return "in"
|
||||||
|
case TokenPercent:
|
||||||
|
return "percent"
|
||||||
}
|
}
|
||||||
|
|
||||||
panic("UNDEFINED TOKENTYPE STRING CONVERSION")
|
panic("UNDEFINED TOKENTYPE STRING CONVERSION")
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,10 @@ func (n NodeType) String() string {
|
||||||
return "Index"
|
return "Index"
|
||||||
case RecordNodeType:
|
case RecordNodeType:
|
||||||
return "Record"
|
return "Record"
|
||||||
|
case ForNodeType:
|
||||||
|
return "For"
|
||||||
|
case IncludeNodeType:
|
||||||
|
return "Include"
|
||||||
}
|
}
|
||||||
return "Invalid Node Type"
|
return "Invalid Node Type"
|
||||||
}
|
}
|
||||||
|
|
@ -534,7 +538,7 @@ func (n ConditionalNode) String() string {
|
||||||
return fmt.Sprintf("if %s then %s", n.condition.String(), n.do.String())
|
return fmt.Sprintf("if %s then %s", n.condition.String(), n.do.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt.Sprintf("if %s then %s otheriwise %s", n.condition.String(), n.do.String(), n.otherwise.String())
|
return fmt.Sprintf("if %s then %s otherwise %s", n.condition.String(), n.do.String(), n.otherwise.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n ConditionalNode) Bounds() (Pos, Pos) {
|
func (n ConditionalNode) Bounds() (Pos, Pos) {
|
||||||
|
|
|
||||||
|
|
@ -383,7 +383,7 @@ var StringPrototype = map[string]*BuiltinFunctionValue{
|
||||||
}
|
}
|
||||||
|
|
||||||
if prev != len(str) {
|
if prev != len(str) {
|
||||||
out = append(out, &StringValue{str[prev:len(str)]})
|
out = append(out, &StringValue{str[prev:]})
|
||||||
}
|
}
|
||||||
|
|
||||||
return &ListValue{out}, nil
|
return &ListValue{out}, nil
|
||||||
|
|
@ -661,7 +661,7 @@ func (v *TupleValue) Equals(other Value) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
var TuplePrototype = map[string]*BuiltinFunctionValue{
|
var TuplePrototype = map[string]*BuiltinFunctionValue{
|
||||||
"at": &BuiltinFunctionValue{
|
"at": {
|
||||||
"at",
|
"at",
|
||||||
&FunctionSignature{
|
&FunctionSignature{
|
||||||
[]TypeSignature{&IntegerSignature{}},
|
[]TypeSignature{&IntegerSignature{}},
|
||||||
|
|
|
||||||
|
|
@ -268,6 +268,14 @@ func (b Bytecode) String() string {
|
||||||
return "INDEX_TUPLE"
|
return "INDEX_TUPLE"
|
||||||
case InstructionDestructureTuple:
|
case InstructionDestructureTuple:
|
||||||
return "DESTRUCTURE_TUPLE"
|
return "DESTRUCTURE_TUPLE"
|
||||||
|
case InstructionModInt:
|
||||||
|
return "MOD_INT"
|
||||||
|
case InstructionNewRecord:
|
||||||
|
return "NEW_RECORD"
|
||||||
|
case InstructionSetRecordItem:
|
||||||
|
return "SET_PROPERTY"
|
||||||
|
case InstructionIndexString:
|
||||||
|
return "INDEX_STRING"
|
||||||
}
|
}
|
||||||
return "UNDEFINED"
|
return "UNDEFINED"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue