diff options
author | Michael Pavone <pavone@retrodev.com> | 2018-09-25 09:33:46 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2018-09-25 09:33:46 -0700 |
commit | 2a3088ca16babe0ce74d6e7205f4c0301c1eb56d (patch) | |
tree | ddda42b6876de5773f292f942688a7bcd1b6f127 | |
parent | 4283aeaeab7dac5e73d4efcd11fbe6115a1687d5 (diff) |
Fix implementation cmp+condition version of if in CPU DSL
-rwxr-xr-x | cpu_dsl.py | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -566,10 +566,8 @@ class Switch(ChildBlock): def _geuCImpl(prog, parent, fieldVals, output): if prog.lastOp.op == 'cmp': output.pop() - params = prog.lastOp.params - for i in range(0, len(params)): - params[i] = prog.resolveParam(params[i], parent, fieldVals) - return '\n\tif ({a} >= {b}) '.format(a=params[0], b = params[1]) + '{' + params = [prog.resolveParam(p, parent, fieldVals) for p in prog.lastOp.params] + return '\n\tif ({a} >= {b}) '.format(a=params[1], b = params[0]) + '{' else: raise ion(">=U not implemented in the general case yet") |