rewrote a few methods to use if/while instead of ifTrue:/whileTrue: in Collect.moo

This commit is contained in:
hyunghwan.chung
2017-02-07 18:09:07 +00:00
parent 5c07a48c5a
commit a05793a66d
3 changed files with 75 additions and 64 deletions

View File

@ -4141,7 +4141,10 @@ static int compile_dictionary_expression (moo_t* moo)
x.ptr = msg;
x.len = 11;
/* if the method returns self, i don't need DUP_STACKTOP and POP_STACKTOP
/* [ATTENTION]
* if the method returns self, i don't need DUP_STACKTOP and POP_STACKTOP.
* if the method retruns something else, DUP_STACKTOP and POP_STACKTOP is needed
* to emulate message cascading.
if (emit_byte_instruction (moo, BCODE_DUP_STACKTOP) <= -1 ||
compile_association_expression(moo) <= -1 ||
add_symbol_literal(moo, &x, 0, &si) <= -1 ||