Browse Source

Fix formatting

master
cancel 6 years ago
parent
commit
86dd6be4f4
  1. 19
      sim.c

19
sim.c

@ -535,20 +535,23 @@ BEGIN_OPERATOR(jump)
POKE(1, 0, PEEK(-1, 0)); POKE(1, 0, PEEK(-1, 0));
END_OPERATOR END_OPERATOR
// Note: this is merged from a pull request without being fully tested or
// optimized
BEGIN_OPERATOR(konkat) BEGIN_OPERATOR(konkat)
LOWERCASE_REQUIRES_BANG; LOWERCASE_REQUIRES_BANG;
Isz len = (Isz)index_of(PEEK(0, -1)); Isz len = (Isz)index_of(PEEK(0, -1));
if (len == 0) len = 1; if (len == 0)
len = 1;
PORT(0, -1, IN | PARAM); PORT(0, -1, IN | PARAM);
for ( Isz i = 0; i < len; ++i) { for (Isz i = 0; i < len; ++i) {
PORT(0, i+1, IN); PORT(0, i + 1, IN);
Glyph var = PEEK(0, i+1); Glyph var = PEEK(0, i + 1);
Usz var_idx = safe_index_of(var); Usz var_idx = safe_index_of(var);
if( var_idx != 0 ){ if (var_idx != 0) {
Glyph result = extra_params->vars_slots[var_idx]; Glyph result = extra_params->vars_slots[var_idx];
if (result != '.'){ if (result != '.') {
PORT(1, i+1, OUT); PORT(1, i + 1, OUT);
POKE(1, i+1, result); POKE(1, i + 1, result);
} }
} }
} }

Loading…
Cancel
Save