aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorc2024-03-02 11:00:37 -0500
committerc2024-03-02 11:00:37 -0500
commit96c63e2fc4d70f20c8e2bac79e3547dfd6a5fcb8 (patch)
tree4b00617617355193486ff506cb2c012e8b33cbfa /src/include
parente29c41a84b299c95a49dfa429f4161eb71cf6837 (diff)
Doer is.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/doer.h35
-rw-r--r--src/include/main.h1
2 files changed, 24 insertions, 12 deletions
diff --git a/src/include/doer.h b/src/include/doer.h
index a672f88..8f51266 100644
--- a/src/include/doer.h
+++ b/src/include/doer.h
@@ -4,7 +4,6 @@
#include "util.h"
#include "tree.h"
-/* Doer? I 'ardly know 'er! */
typedef struct DOER {
tree_t* tree;
} doer_t;
@@ -18,16 +17,28 @@ doer_t* doer_init(tree_t* tree);
*/
void doer_destroy(doer_t* doer);
-void doer_do_blin_print(char* s);
-
-void doer_do_block(tree_t* tree);
-void doer_do_expr(tree_t* tree);
-void doer_do_lint(tree_t* tree);
-void doer_do_lstr(tree_t* tree);
-void doer_do_tag(tree_t* tree);
-void doer_do_darg(tree_t* tree);
-void doer_do_carg(tree_t* tree);
-void doer_do_def(tree_t* tree);
-void doer_do_call(tree_t* tree);
+/* Built-in function. */
+typedef struct BLINF {
+ void (*fp)(doer_t*);
+ char name[24];
+} blinf_t;
+
+void doer_do_blin_print(doer_t* tree); // Built-in function `print`.
+void doer_do_blin_printl(doer_t* tree); // Built-in function `print`.
+
+void doer_do_block(doer_t* tree);
+void doer_do_expr(doer_t* tree);
+void doer_do_lint(doer_t* tree);
+void doer_do_lstr(doer_t* tree);
+void doer_do_tag(doer_t* tree);
+void doer_do_darg(doer_t* tree);
+void doer_do_carg(doer_t* tree);
+void doer_do_def(doer_t* tree);
+void doer_do_call(doer_t* tree);
+
+const static blinf_t blinfs[] = {
+ { doer_do_blin_print, "print" },
+ { doer_do_blin_printl, "printl" }
+};
#endif
diff --git a/src/include/main.h b/src/include/main.h
index 63dd15c..d4f98dd 100644
--- a/src/include/main.h
+++ b/src/include/main.h
@@ -10,5 +10,6 @@
#include "pp.h"
#include "lexer.h"
#include "parser.h"
+#include "doer.h"
#endif