mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
add -T option to disable TCO
This commit is contained in:
parent
2f1b730f65
commit
0fa1179c2f
4 changed files with 7 additions and 1 deletions
|
@ -1346,6 +1346,7 @@ enum sexp_context_globals {
|
|||
SEXP_G_RESUMECC_BYTECODE,
|
||||
SEXP_G_FINAL_RESUMER,
|
||||
SEXP_G_STRICT_P,
|
||||
SEXP_G_NO_TAIL_CALLS_P,
|
||||
#if SEXP_USE_FOLD_CASE_SYMS
|
||||
SEXP_G_FOLD_CASE_P,
|
||||
#endif
|
||||
|
|
4
main.c
4
main.c
|
@ -473,6 +473,10 @@ sexp run_main (int argc, char **argv) {
|
|||
init_context(); sexp_global(ctx, SEXP_G_STRICT_P) = SEXP_TRUE;
|
||||
handle_noarg();
|
||||
break;
|
||||
case 'T':
|
||||
init_context(); sexp_global(ctx, SEXP_G_NO_TAIL_CALLS_P) = SEXP_TRUE;
|
||||
handle_noarg();
|
||||
break;
|
||||
case 't':
|
||||
mods_loaded = 1;
|
||||
load_init(1);
|
||||
|
|
1
sexp.c
1
sexp.c
|
@ -434,6 +434,7 @@ void sexp_init_context_globals (sexp ctx) {
|
|||
sexp_global(ctx, SEXP_G_SYMBOLS) = sexp_make_vector(ctx, sexp_make_fixnum(SEXP_SYMBOL_TABLE_SIZE), SEXP_NULL);
|
||||
#endif
|
||||
sexp_global(ctx, SEXP_G_STRICT_P) = SEXP_FALSE;
|
||||
sexp_global(ctx, SEXP_G_NO_TAIL_CALLS_P) = SEXP_FALSE;
|
||||
#if SEXP_USE_FOLD_CASE_SYMS
|
||||
sexp_global(ctx, SEXP_G_FOLD_CASE_P) = sexp_make_boolean(SEXP_DEFAULT_FOLD_CASE_SYMS);
|
||||
#endif
|
||||
|
|
2
vm.c
2
vm.c
|
@ -475,7 +475,7 @@ static void generate_general_app (sexp ctx, sexp app) {
|
|||
sexp_generate(ctx, 0, 0, 0, sexp_car(app));
|
||||
|
||||
/* maybe overwrite the current frame */
|
||||
sexp_emit(ctx, (tailp ? SEXP_OP_TAIL_CALL : SEXP_OP_CALL));
|
||||
sexp_emit(ctx, ((tailp && sexp_not(sexp_global(ctx, SEXP_G_NO_TAIL_CALLS_P))) ? SEXP_OP_TAIL_CALL : SEXP_OP_CALL));
|
||||
sexp_emit_word(ctx, (sexp_uint_t)sexp_make_fixnum(len));
|
||||
|
||||
sexp_context_tailp(ctx) = (char)tailp;
|
||||
|
|
Loading…
Add table
Reference in a new issue