1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00
new database
fift/func bugfixes
This commit is contained in:
ton 2019-11-15 18:02:37 +04:00
parent 950e292264
commit e30d98eb30
110 changed files with 6102 additions and 2075 deletions

21
crypto/fift/lib/Color.fif Normal file
View file

@ -0,0 +1,21 @@
library Color
{ 27 emit } : esc
{ char " word 27 chr swap $+ 1 ' type does create } :_ make-esc"
make-esc"[0m" ^reset
make-esc"[30m" ^black
make-esc"[31m" ^red
make-esc"[32m" ^green
make-esc"[33m" ^yellow
make-esc"[34m" ^blue
make-esc"[35m" ^magenta
make-esc"[36m" ^cyan
make-esc"[37m" ^white
// bold
make-esc"[30;1m" ^Black
make-esc"[31;1m" ^Red
make-esc"[32;1m" ^Green
make-esc"[33;1m" ^Yellow
make-esc"[34;1m" ^Blue
make-esc"[35;1m" ^Magenta
make-esc"[36;1m" ^Cyan
make-esc"[37;1m" ^White

View file

@ -96,6 +96,10 @@ void interpret_dotstack_list(IntCtx& ctx) {
*ctx.output_stream << std::endl;
}
void interpret_dotstack_list_dump(IntCtx& ctx) {
ctx.stack.dump(*ctx.output_stream, 3);
}
void interpret_dump(IntCtx& ctx) {
ctx.stack.pop_chk().dump(*ctx.output_stream);
*ctx.output_stream << ' ';
@ -105,6 +109,10 @@ void interpret_dump_internal(vm::Stack& stack) {
stack.push_string(stack.pop_chk().to_string());
}
void interpret_list_dump_internal(vm::Stack& stack) {
stack.push_string(stack.pop_chk().to_lisp_string());
}
void interpret_print_list(IntCtx& ctx) {
ctx.stack.pop_chk().print_list(*ctx.output_stream);
*ctx.output_stream << ' ';
@ -2434,10 +2442,12 @@ void init_words_common(Dictionary& d) {
d.def_ctx_word("csr. ", interpret_dot_cellslice_rec);
d.def_ctx_word(".s ", interpret_dotstack);
d.def_ctx_word(".sl ", interpret_dotstack_list);
d.def_ctx_word(".sL ", interpret_dotstack_list_dump); // TMP
d.def_ctx_word(".dump ", interpret_dump);
d.def_ctx_word(".l ", interpret_print_list);
d.def_ctx_word(".tc ", interpret_dottc);
d.def_stack_word("(dump) ", interpret_dump_internal);
d.def_stack_word("(ldump) ", interpret_list_dump_internal);
d.def_stack_word("(.) ", interpret_dot_internal);
d.def_stack_word("(x.) ", std::bind(interpret_dothex_internal, _1, false));
d.def_stack_word("(X.) ", std::bind(interpret_dothex_internal, _1, true));