diff options
| author | Elis Eriksson <spelis@spelis.li> | 2026-06-20 20:12:29 +0200 |
|---|---|---|
| committer | Elis Eriksson <spelis@spelis.li> | 2026-06-20 20:12:29 +0200 |
| commit | 38942c34a497a4c6edf080dc64440c1bc486fc46 (patch) | |
| tree | 8fd3c891dff03f649b21aeb02c594e3e50f3160c /src/all.h | |
| parent | de91ec0542aea5959376ee0d2c9d486268dd9392 (diff) | |
| download | bfc-38942c34a497a4c6edf080dc64440c1bc486fc46.tar bfc-38942c34a497a4c6edf080dc64440c1bc486fc46.tar.gz bfc-38942c34a497a4c6edf080dc64440c1bc486fc46.tar.bz2 bfc-38942c34a497a4c6edf080dc64440c1bc486fc46.tar.lz bfc-38942c34a497a4c6edf080dc64440c1bc486fc46.tar.xz bfc-38942c34a497a4c6edf080dc64440c1bc486fc46.tar.zst bfc-38942c34a497a4c6edf080dc64440c1bc486fc46.zip | |
Pattern matching optimizer and more
it's not the best optimizer but it works.
Also added a -ast_dump flag which dumps the AST to stderr.
Also input is now done in raw mode just because it can be.
Diffstat (limited to 'src/all.h')
| -rw-r--r-- | src/all.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -40,7 +40,8 @@ typedef enum { AST_PTR_DEC, AST_OUT, AST_IN, - AST_LOOP + AST_LOOP, + AST_CLEAR } ast_type_e; struct ast_node { @@ -58,7 +59,9 @@ typedef struct { parser_t parser_init(lexer_t *lx); ast_node_t *parse_program(parser_t *p); +ast_node_t *optimize_ast(ast_node_t *ast); void ast_free(ast_node_t *node); +void ast_dump(ast_node_t *node, int depth); // codegen |
