From 53d5c419bdfaa58c2cf7c30e51e4515f66fa85a1 Mon Sep 17 00:00:00 2001 From: c Date: Mon, 18 Mar 2024 21:27:42 -0400 Subject: Fixed bugs. Keywords with numbers in them were being read as lints, forgot to add numbers to allowed chars somehow. --- src/include/doer.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/include/doer.h') diff --git a/src/include/doer.h b/src/include/doer.h index 314edc3..641abed 100644 --- a/src/include/doer.h +++ b/src/include/doer.h @@ -56,13 +56,16 @@ char* doer_eval_str(doer_t* doer); // `die`: dies. Does not accept any arguments, returns int (if a tree falls in // the forest, but it burns down before anyone can hear it, did it ever make a // sound at all?) TODO: Make this actually clean up afterwards. -void blin_die(doer_t* tree); +void blin_die(doer_t* doer); // `print`: print a string. -void blin_print(doer_t* tree); +void blin_print(doer_t* doer); static tree_type_t blin_print_args[] = { TREE_TYPE_LSTR }; // `printl`: print a string, and add a newline. -void blin_printl(doer_t* tree); +void blin_printl(doer_t* doer); static tree_type_t blin_printl_args[] = { TREE_TYPE_LSTR }; +// `to_str`: convert any (primitive) type to a string. +void blin_to_str(doer_t* doer); +static tree_type_t blin_to_str_args[] = { TREE_TYPE_CALL }; void doer_do_block(doer_t* tree); void doer_do_expr(doer_t* tree); @@ -78,6 +81,7 @@ static blinf_t blinfs[] = { { blin_die, TREE_TYPE_LINT, NULL, "die" }, { blin_print, TREE_TYPE_LSTR, blin_print_args, "print" }, { blin_printl, TREE_TYPE_LSTR, blin_printl_args, "printl" }, + { blin_to_str, TREE_TYPE_LSTR, blin_to_str_args, "to_str" }, }; #endif -- cgit v1.2.3