Mercurial > lcfOS
comparison python/testir.py @ 174:3eb06f5fb987
Added memory alloc for locals
author | Windel Bouwman |
---|---|
date | Fri, 19 Apr 2013 19:22:52 +0200 |
parents | c1d2b6b9f9a7 |
children | a51b3c956386 |
comparison
equal
deleted
inserted
replaced
173:c1d2b6b9f9a7 | 174:3eb06f5fb987 |
---|---|
25 } | 25 } |
26 | 26 |
27 function int add2(int x, int y) | 27 function int add2(int x, int y) |
28 { | 28 { |
29 var int res; | 29 var int res; |
30 res = x + y; | 30 res = x + y + 2 - 7 + 2; |
31 if (x > 13) | |
32 { | |
33 res = res + 2; | |
34 } | |
31 return res; | 35 return res; |
32 } | 36 } |
33 | 37 |
34 """ | 38 """ |
35 | 39 |
58 # Dump a graphiz file: | 62 # Dump a graphiz file: |
59 with open('graaf.gv', 'w') as f: | 63 with open('graaf.gv', 'w') as f: |
60 ir.dumpgv(f) | 64 ir.dumpgv(f) |
61 os.system('dot -Tpdf -ograaf.pdf graaf.gv') | 65 os.system('dot -Tpdf -ograaf.pdf graaf.gv') |
62 | 66 |
63 |