From 6d2d8dda73a537dbe724d2c9ccfb51c34ce77023 Mon Sep 17 00:00:00 2001 From: q66 Date: Sat, 10 Sep 2016 20:09:59 +0200 Subject: [PATCH] remove nodebug (useless/incompatible with pcall) --- include/cubescript/cubescript.hh | 1 - src/cs_vm.hh | 3 --- src/cubescript.cc | 9 --------- 3 files changed, 13 deletions(-) diff --git a/include/cubescript/cubescript.hh b/include/cubescript/cubescript.hh index ce076c3d..4ccce190 100644 --- a/include/cubescript/cubescript.hh +++ b/include/cubescript/cubescript.hh @@ -343,7 +343,6 @@ struct OSTD_EXPORT CsState { CsIdentLink *p_callstack = nullptr; int identflags = 0; - int nodebug = 0; int protect = 0; CsState(); diff --git a/src/cs_vm.hh b/src/cs_vm.hh index 50e9750d..5d008f88 100644 --- a/src/cs_vm.hh +++ b/src/cs_vm.hh @@ -110,9 +110,6 @@ CsStackState cs_save_stack(CsState &cs); template void cs_debug_code(CsState &cs, ostd::ConstCharRange fmt, A &&...args) { - if (cs.nodebug) { - return; - } cs.get_err().writefln(fmt, ostd::forward(args)...); auto st = cs_save_stack(cs); cscript::util::print_stack(cs.get_err().iter(), st); diff --git a/src/cubescript.cc b/src/cubescript.cc index 0e83b751..41db5188 100644 --- a/src/cubescript.cc +++ b/src/cubescript.cc @@ -1298,15 +1298,6 @@ void cs_init_lib_base(CsState &cs) { ); }); - cs.new_command("nodebug", "e", [&cs](CsValueRange args, CsValue &res) { - ++cs.nodebug; - cs_do_and_cleanup([&]() { - cs.run(args[0].get_code(), res); - }, [&cs]() { - --cs.nodebug; - }); - }); - cs.new_command("push", "rTe", [&cs](CsValueRange args, CsValue &res) { CsStackedValue idv{args[0].get_ident()}; if (!idv.has_alias() || (idv.get_alias()->get_index() < MaxArguments)) {