wrote dsl for ast boiler plate generation
This commit is contained in:
parent
b244f7e3b2
commit
e0dd8ff9d5
16 changed files with 915 additions and 60 deletions
27
runtime/loxtype_string.go
Normal file
27
runtime/loxtype_string.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
// Code generated by "stringer -type LoxType -trimprefix LoxType"; DO NOT EDIT.
|
||||
|
||||
package runtime
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[LoxTypeString-0]
|
||||
_ = x[LoxTypeNumber-1]
|
||||
_ = x[LoxTypeBoolean-2]
|
||||
_ = x[LoxTypeNil-3]
|
||||
_ = x[LoxTypeUndefined-4]
|
||||
}
|
||||
|
||||
const _LoxType_name = "StringNumberBooleanNilUndefined"
|
||||
|
||||
var _LoxType_index = [...]uint8{0, 6, 12, 19, 22, 31}
|
||||
|
||||
func (i LoxType) String() string {
|
||||
if i < 0 || i >= LoxType(len(_LoxType_index)-1) {
|
||||
return "LoxType(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _LoxType_name[_LoxType_index[i]:_LoxType_index[i+1]]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue