aboutsummaryrefslogtreecommitdiffstats
path: root/liblll
diff options
context:
space:
mode:
authorDaniel Ellison <daniel@syrinx.net>2016-10-26 21:24:01 +0800
committerDaniel Ellison <daniel@syrinx.net>2016-10-26 21:24:01 +0800
commit7ac53f5305d83d3f2a220d30753f82341311392c (patch)
tree4fb88fd2b4ef9742af9e65000b49a56ca9f45d33 /liblll
parentf9946ec029cf14d973d78b31c265c8735ab9eb05 (diff)
downloaddexon-solidity-7ac53f5305d83d3f2a220d30753f82341311392c.tar
dexon-solidity-7ac53f5305d83d3f2a220d30753f82341311392c.tar.gz
dexon-solidity-7ac53f5305d83d3f2a220d30753f82341311392c.tar.bz2
dexon-solidity-7ac53f5305d83d3f2a220d30753f82341311392c.tar.lz
dexon-solidity-7ac53f5305d83d3f2a220d30753f82341311392c.tar.xz
dexon-solidity-7ac53f5305d83d3f2a220d30753f82341311392c.tar.zst
dexon-solidity-7ac53f5305d83d3f2a220d30753f82341311392c.zip
Added support for `until`, the inverse of `while`.
Diffstat (limited to 'liblll')
-rw-r--r--liblll/CodeFragment.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/liblll/CodeFragment.cpp b/liblll/CodeFragment.cpp
index eadb0140..e76f4974 100644
--- a/liblll/CodeFragment.cpp
+++ b/liblll/CodeFragment.cpp
@@ -472,14 +472,15 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
m_asm << end.tag();
m_asm.donePaths();
}
- else if (us == "WHILE")
+ else if (us == "WHILE" || us == "UNTIL")
{
requireSize(2);
requireDeposit(0, 1);
auto begin = m_asm.append();
m_asm.append(code[0].m_asm);
- m_asm.append(Instruction::ISZERO);
+ if (us == "WHILE")
+ m_asm.append(Instruction::ISZERO);
auto end = m_asm.appendJumpI();
m_asm.append(code[1].m_asm, 0);
m_asm.appendJump(begin);