Mercurial > repos > tabletprog
diff modules/il.tp @ 356:3b023e5a0b42
llcompile almost working well enough for fib sample
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 15 Apr 2015 23:03:24 -0700 |
parents | a6cdcc1b1c02 |
children | 06dceff348ea |
line wrap: on
line diff
--- a/modules/il.tp Wed Apr 15 21:14:44 2015 -0700 +++ b/modules/il.tp Wed Apr 15 23:03:24 2015 -0700 @@ -452,7 +452,7 @@ } skipIf:else <- :_cond _toskip :_else { #{ - opcode <- { _skipif } + opcode <- { _skipifelse } toskip <- { _toskip } else <- { _else } cond <- { _cond } @@ -743,6 +743,15 @@ backend label } outprog <- #[] + //translate main first so it's at the start of the output + prepped ifget: "main" :instarr { + outprog append: (labels get: "main" else: { false }) + foreach: instarr :_ inst { + print: "Translating: " . inst . "\n" + backend convertIL: inst to: outprog withLabels: labels + } + } else: {} + foreach: prepped :name instarr { outprog append: (labels get: name else: { false }) foreach: instarr :_ inst {