From 46738825c07a064af9534aa21bf3dd46e3868a34 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Fri, 21 Jan 2022 16:44:11 -0600 Subject: [PATCH] Fix formating on master. --- src/core/specials.c | 10 ++++------ test/suite0000.janet | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/core/specials.c b/src/core/specials.c index 19e41179..7ebdeae9 100644 --- a/src/core/specials.c +++ b/src/core/specials.c @@ -163,7 +163,7 @@ static int destructure(JanetCompiler *c, if (i + 2 < len) { 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; 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_ss(c, JOP_LENGTH, len, right, 0); - // loop condition - // reuse arg slot for the condition result + /* loop condition - 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_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_s(c, JOP_PUSH, arg, 0); janetc_emit_ssi(c, JOP_ADD_IMMEDIATE, argi, argi, 1, 0); - // loop - // jump back to the start of the loop + /* loop - jump back to the start of the loop */ int32_t label_loop_loop = janet_v_count(c->buffer); janetc_emit(c, JOP_JUMP); int32_t label_loop_exit = janet_v_count(c->buffer); diff --git a/test/suite0000.janet b/test/suite0000.janet index 08a5371c..1846a042 100644 --- a/test/suite0000.janet +++ b/test/suite0000.janet @@ -411,7 +411,7 @@ compare-poly-tests [[(int/s64 3) (int/u64 3) 0] [(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/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] @@ -421,7 +421,7 @@ [(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] [(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]]] (each [x y c] compare-poly-tests (assert (= c (compare x y)) (string/format "compare polymorphic %q %q %d" x y c))))