1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-26 00:10:27 +00:00

Fix formating on master.

This commit is contained in:
Calvin Rose 2022-01-21 16:44:11 -06:00
parent 56357699cb
commit 46738825c0
2 changed files with 6 additions and 8 deletions

View File

@ -163,7 +163,7 @@ static int destructure(JanetCompiler *c,
if (i + 2 < len) { if (i + 2 < len) {
int32_t num_extra = len - i - 1; int32_t num_extra = len - i - 1;
Janet* extra = janet_tuple_begin(num_extra); Janet *extra = janet_tuple_begin(num_extra);
janet_tuple_flag(extra) |= JANET_TUPLE_FLAG_BRACKETCTOR; janet_tuple_flag(extra) |= JANET_TUPLE_FLAG_BRACKETCTOR;
for (int32_t j = 0; j < num_extra; ++j) { for (int32_t j = 0; j < num_extra; ++j) {
@ -187,18 +187,16 @@ static int destructure(JanetCompiler *c,
janetc_emit_si(c, JOP_LOAD_INTEGER, argi, i, 0); janetc_emit_si(c, JOP_LOAD_INTEGER, argi, i, 0);
janetc_emit_ss(c, JOP_LENGTH, len, right, 0); janetc_emit_ss(c, JOP_LENGTH, len, right, 0);
// loop condition /* loop condition - reuse arg slot for the condition result */
// reuse arg slot for the condition result
int32_t label_loop_start = janetc_emit_sss(c, JOP_EQUALS, arg, argi, len, 0); int32_t label_loop_start = janetc_emit_sss(c, JOP_EQUALS, arg, argi, len, 0);
int32_t label_loop_cond_jump = janetc_emit_si(c, JOP_JUMP_IF, arg, 0, 0); int32_t label_loop_cond_jump = janetc_emit_si(c, JOP_JUMP_IF, arg, 0, 0);
// loop body /* loop body */
janetc_emit_sss(c, JOP_GET, arg, right, argi, 0); janetc_emit_sss(c, JOP_GET, arg, right, argi, 0);
janetc_emit_s(c, JOP_PUSH, arg, 0); janetc_emit_s(c, JOP_PUSH, arg, 0);
janetc_emit_ssi(c, JOP_ADD_IMMEDIATE, argi, argi, 1, 0); janetc_emit_ssi(c, JOP_ADD_IMMEDIATE, argi, argi, 1, 0);
// loop /* loop - jump back to the start of the loop */
// jump back to the start of the loop
int32_t label_loop_loop = janet_v_count(c->buffer); int32_t label_loop_loop = janet_v_count(c->buffer);
janetc_emit(c, JOP_JUMP); janetc_emit(c, JOP_JUMP);
int32_t label_loop_exit = janet_v_count(c->buffer); int32_t label_loop_exit = janet_v_count(c->buffer);

View File

@ -411,7 +411,7 @@
compare-poly-tests compare-poly-tests
[[(int/s64 3) (int/u64 3) 0] [[(int/s64 3) (int/u64 3) 0]
[(int/s64 -3) (int/u64 3) -1] [(int/s64 -3) (int/u64 3) -1]
[(int/s64 3) (int/u64 2) 1] [(int/s64 3) (int/u64 2) 1]
[(int/s64 3) 3 0] [(int/s64 3) 4 -1] [(int/s64 3) -9 1] [(int/s64 3) 3 0] [(int/s64 3) 4 -1] [(int/s64 3) -9 1]
[(int/u64 3) 3 0] [(int/u64 3) 4 -1] [(int/u64 3) -9 1] [(int/u64 3) 3 0] [(int/u64 3) 4 -1] [(int/u64 3) -9 1]
[3 (int/s64 3) 0] [3 (int/s64 4) -1] [3 (int/s64 -5) 1] [3 (int/s64 3) 0] [3 (int/s64 4) -1] [3 (int/s64 -5) 1]
@ -421,7 +421,7 @@
[(int/u64 MAX_INT_IN_DBL_STRING) (scan-number MAX_INT_IN_DBL_STRING) 0] [(int/u64 MAX_INT_IN_DBL_STRING) (scan-number MAX_INT_IN_DBL_STRING) 0]
[(+ 1 (int/u64 MAX_INT_IN_DBL_STRING)) (scan-number MAX_INT_IN_DBL_STRING) 1] [(+ 1 (int/u64 MAX_INT_IN_DBL_STRING)) (scan-number MAX_INT_IN_DBL_STRING) 1]
[(int/s64 0) INF -1] [(int/u64 0) INF -1] [(int/s64 0) INF -1] [(int/u64 0) INF -1]
[MINUS_INF (int/u64 0) -1] [MINUS_INF (int/s64 0) -1] [MINUS_INF (int/u64 0) -1] [MINUS_INF (int/s64 0) -1]
[(int/s64 1) NAN 0] [NAN (int/u64 1) 0]]] [(int/s64 1) NAN 0] [NAN (int/u64 1) 0]]]
(each [x y c] compare-poly-tests (each [x y c] compare-poly-tests
(assert (= c (compare x y)) (string/format "compare polymorphic %q %q %d" x y c)))) (assert (= c (compare x y)) (string/format "compare polymorphic %q %q %d" x y c))))