diff options
| -rw-r--r-- | tnslc/compile/function.tnsl | 12 | ||||
| -rw-r--r-- | tnslc/compile/struct.tnsl | 10 | ||||
| -rw-r--r-- | tnslc/compile/var.tnsl | 29 |
3 files changed, 16 insertions, 35 deletions
diff --git a/tnslc/compile/function.tnsl b/tnslc/compile/function.tnsl index eec65ed..0ad8e6f 100644 --- a/tnslc/compile/function.tnsl +++ b/tnslc/compile/function.tnsl @@ -198,19 +198,19 @@ struct Function { _printf(self.name) _printf("\n\0") - _indent(idt) - _printf(" inputs:\n\0") + _indent(idt + 1) + _printf("inputs:\n\0") ~Var prtv /; loop (int i = 0; i < self.inputs.count) [i++] prtv = self.inputs.get(i) - prtv`._print(idt + 1) + prtv`._print(idt + 2) ;/ - _indent(idt) - _printf(" outputs:\n\0") + _indent(idt + 1) + _printf("outputs:\n\0") /; loop (int i = 0; i < self.outputs.count) [i++] prtv = self.outputs.get(i) - prtv`._print(idt + 1) + prtv`._print(idt + 2) ;/ _indent(idt) diff --git a/tnslc/compile/struct.tnsl b/tnslc/compile/struct.tnsl index 715d576..5eded31 100644 --- a/tnslc/compile/struct.tnsl +++ b/tnslc/compile/struct.tnsl @@ -120,16 +120,16 @@ struct Struct { _printf(self.name) _printf("\n\0") - _indent(idt) - _print_num(" size: %d\n\0", self.size) + _indent(idt + 1) + _print_num("size: %d\n\0", self.size) - _indent(idt) - _printf(" members:\n\0") + _indent(idt + 1) + _printf("members:\n\0") ~Var v /; loop (int i = 0; i < self.members.count) [i++] v = self.members.get(i) - v`._print(idt + 1) + v`._print(idt + 2) ;/ _indent(idt) diff --git a/tnslc/compile/var.tnsl b/tnslc/compile/var.tnsl index 9748ed4..5d86406 100644 --- a/tnslc/compile/var.tnsl +++ b/tnslc/compile/var.tnsl @@ -12,11 +12,6 @@ int32 PTYPE_REF = 0 # 1 Arr is ptr to arr, larger #s are static size arrs int32 PTYPE_ARR = 1 -int PRIM_NON = 0 -int PRIM_BOO = 1 -int PRIM_INT = 2 -int PRIM_FLT = 3 - ~uint8 PRIM_CSV_BOO = "bool\0" ~uint8 PRIM_CSV_INT = "int,int8,int16,int32,int64,uint,uint8,uint16,uint32,uint64\0" ~uint8 PRIM_CSV_FLT = "float,float32,float64\0" @@ -97,7 +92,7 @@ struct Var { ~uint8 name, ~Struct _type, utils.Vector ptrc, - int loc, + int loc, offset, ~parse.Node _tn, _id } @@ -143,8 +138,8 @@ struct Var { _printf(self.name) _printf("\n\0") - _indent(idt) - _printf(" type: \0") + _indent(idt + 1) + _printf("type: \0") /; if (self._type !== NULL) _printf(self._type`.name) ;; else @@ -152,8 +147,8 @@ struct Var { ;/ _printf("\n\0") - _indent(idt) - _printf(" ptrc: \0") + _indent(idt + 1) + _printf("ptrc: \0") ~int32 istr /; loop (int i = 0; i < self.ptrc.count) [i++] istr = self.ptrc.get(i) @@ -304,20 +299,6 @@ struct Var { self.ptrc.pop() ;/ - /; is_primitive [int] - ~uint8 tn = self`._type`.name - - /; if (parse._in_csv(PRIM_CSV_BOO, tn) == true) - return PRIM_BOO - ;; else if (parse._in_csv(PRIM_CSV_INT, tn) == true) - return PRIM_INT - ;; else if (parse._in_csv(PRIM_CSV_FLT, tn) == true) - return PRIM_FLT - ;/ - - return PRIM_NON - ;/ - /; end _delete(self.name) self.ptrc.end() |