Browse Source

prepare for 0.1.0

master
CismonX 1 year ago
parent
commit
af1366f3c6
No known key found for this signature in database GPG Key ID: 315D6652268C5007
  1. 2
      man/u6a.1
  2. 2
      man/u6ac.1
  3. 2
      src/common.h
  4. 6
      src/dump.c
  5. 24
      src/runtime.c

2
man/u6a.1

@ -1,4 +1,4 @@
.TH "U6A" "1" "Jan 30, 2020" "0.0.1" "U6A User Manual"
.TH "U6A" "1" "Jan 30, 2020" "0.1.0" "U6A User Manual"
.
.SH NAME
u6a \- Runtime for the Unlambda programming language

2
man/u6ac.1

@ -1,4 +1,4 @@
.TH "U6A" "1" "Jan 30, 2020" "0.0.1" "U6A User Manual"
.TH "U6A" "1" "Jan 30, 2020" "0.1.0" "U6A User Manual"
.
.SH NAME
u6ac \- Bytecode compiler for the Unlambda programming language

2
src/common.h

@ -46,7 +46,7 @@
#define U6A_MAGIC 0xDC /* Latin 'U' with diaeresis */
#define U6A_VER_MAJOR 0x00
#define U6A_VER_MINOR 0x00
#define U6A_VER_MINOR 0x01
#define U6A_VER_PATCH 0x00
#endif

6
src/dump.c

@ -32,9 +32,9 @@
#define F_2B_DUP_2 "%02x%02x %02x%02x "
#define F_2B_DUP_8 F_2B_DUP_2 F_2B_DUP_2 F_2B_DUP_2 F_2B_DUP_2
#define fprintf_check(os, format, ...) \
if (fprintf(os, format, __VA_ARGS__) < 0) { \
return false; \
#define fprintf_check(os, format, ...) \
if (UNLIKELY(fprintf(os, format, __VA_ARGS__) < 0)) { \
return false; \
}
static inline bool

24
src/runtime.c

@ -50,18 +50,18 @@ static const uint32_t text_subst_len = sizeof(text_subst) / sizeof(struct u6a_vm
static const char* err_runtime = "runtime error";
static const char* info_runtime = "runtime";
#define CHECK_BC_HEADER_VER(file_header) \
#define CHECK_BC_HEADER_VER(file_header) \
( (file_header).ver_major == U6A_VER_MAJOR && (file_header).ver_minor == U6A_VER_MINOR )
#define ACC_FN_REF(fn_, ref_) \
#define ACC_FN_REF(fn_, ref_) \
acc = U6A_VM_VAR_FN_REF(fn_, ref_)
#define VM_JMP(dest) \
ins = text + (dest); \
#define VM_JMP(dest) \
ins = text + (dest); \
continue
#define CHECK_FORCE(log_func, err_val) \
if (!force_exec) { \
log_func(err_runtime, err_val); \
goto runtime_error; \
#define CHECK_FORCE(log_func, err_val) \
if (!force_exec) { \
log_func(err_runtime, err_val); \
goto runtime_error; \
}
#define VM_VAR_JMP U6A_VM_VAR_FN_REF(u6a_vf_j, ins - text)
@ -71,11 +71,11 @@ static const char* info_runtime = "runtime";
#define STACK_PUSH2(fn_0, fn_1) u6a_vm_stack_push2(&stack_ctx, fn_0, fn_1)
#define STACK_PUSH3(fn_0, fn_1, fn_2) u6a_vm_stack_push3(&stack_ctx, fn_0, fn_1, fn_2)
#define STACK_PUSH4(fn_0, fn_1, fn_2, fn_3) u6a_vm_stack_push4(&stack_ctx, fn_0, fn_1, fn_2, fn_3)
#define STACK_POP(var) \
vm_var_fn_free(top); \
var = top = u6a_vm_stack_top(&stack_ctx); \
u6a_vm_stack_pop(&stack_ctx)
#define STACK_XCH(fn_0) u6a_vm_stack_xch(&stack_ctx, fn_0)
#define STACK_POP(var) \
vm_var_fn_free(top); \
var = top = u6a_vm_stack_top(&stack_ctx); \
u6a_vm_stack_pop(&stack_ctx)
#define POOL_ALLOC1(v1) u6a_vm_pool_alloc1(&pool_ctx, v1)
#define POOL_ALLOC2(v1, v2) u6a_vm_pool_alloc2(&pool_ctx, v1, v2)

Loading…
Cancel
Save