diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/texec/eval.go | 16 | ||||
-rw-r--r-- | src/tparse/tokenize.go | 2 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/texec/eval.go b/src/texec/eval.go index ead8f74..3eca821 100644 --- a/src/texec/eval.go +++ b/src/texec/eval.go @@ -448,14 +448,16 @@ func cata(str TType, skp int, dat []interface{}) { } func convertValPS(from, to TType, sk int, dat interface{}) interface{} { - if isStruct(to, sk) { - if equateTypePS(from, tStruct, sk) { - return cvsa(to, sk, ) + if equateTypePS(from, tStruct, sk) { + if isStruct(to, sk) { + return cvsa(to, sk) + } else if isArray(to, sk) { + } - } else if isArray(to, sk) { - if equateTypePS(from, tStruct, sk) || isArray(from, sk) { + } else if isArray(from, sk) { + if isArray(to, sk) { out := []interface{} - for i := 0; i < len(dat.([]interface{});i++ { + for i := 0; i < len(dat.([]interface{}));i++ { out = append(out, convertValPS(from, to, sk + 1, dat.([]interface{})[i])) } } @@ -463,7 +465,7 @@ func convertValPS(from, to TType, sk int, dat interface{}) interface{} { if equateTypePS(to, tInt, sk) { return dat.(int) } else if equateTypePS(to, tCharp, sk) { - return dat.() + return dat.(byte) } } diff --git a/src/tparse/tokenize.go b/src/tparse/tokenize.go index 7f57576..2d49376 100644 --- a/src/tparse/tokenize.go +++ b/src/tparse/tokenize.go @@ -235,6 +235,8 @@ func TokenizeFile(path string) []Token { if err != nil { if err != io.EOF { out = append(out, Token{Type: -1}) + } else { + out = append(out, Token{Type: checkToken(b.String(), pre), Data: b.String(), Line: ln, Char: last}) } break } |