diff options
author | c | 2024-04-16 15:11:11 -0400 |
---|---|---|
committer | c | 2024-04-16 15:11:11 -0400 |
commit | 2e6d3b3343f8e51bc2f3749017ee8a22d7e8b2f6 (patch) | |
tree | 1934dbff693f0d89e1e9dcce0be0bbde2d7bc176 /src/include | |
parent | 2a80ebb87b3d2b84fb2afe66e8a91f19414d24da (diff) |
Something happened.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/doer.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/include/doer.h b/src/include/doer.h index 4292ff7..30b514e 100644 --- a/src/include/doer.h +++ b/src/include/doer.h @@ -53,11 +53,11 @@ tree_t* doer_find_target_from_call(doer_t* doer); tree_t* doer_eval_prim(doer_t* doer); // Given a tree, evaluate it to a string (or type error). char* doer_eval_str(doer_t* doer); +int doer_eval_lint(doer_t* doer); // Built-in functions. // `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. +// the forest, &c &c.) TODO: Make this actually clean up afterwards. tree_t* blin_die(doer_t* doer); // `print`: print a string. tree_t* blin_print(doer_t* doer); @@ -69,6 +69,9 @@ static tree_type_t blin_printl_args[] = { TREE_TYPE_LSTR }; // Returns a tree pointer to a lstr. tree_t* blin_str_cat(doer_t* doer); static tree_type_t blin_str_cat_args[] = { TREE_TYPE_LSTR, TREE_TYPE_LSTR }; +// `+`: Add two integers. +tree_t* blin_add(doer_t* doer); +static tree_type_t blin_add_args[] = { TREE_TYPE_LINT, TREE_TYPE_LINT }; void doer_do_call(doer_t* doer); tree_t* doer_do_call_blin(doer_t* doer); @@ -87,6 +90,7 @@ static blinf_t blinfs[] = { { blin_print, TREE_TYPE_LSTR, blin_print_args, "print" }, { blin_printl, TREE_TYPE_LSTR, blin_printl_args, "printl" }, { blin_str_cat, TREE_TYPE_LSTR, blin_str_cat_args, "str_cat" }, + { blin_add, TREE_TYPE_LINT, blin_add_args, "+" }, }; #endif |