Initial parser implementation that runs a simple hello_world.fun script.
This commit is contained in:
parent
284b4d3fa9
commit
7d587fe11b
5 changed files with 237 additions and 45 deletions
19
src/parser.h
19
src/parser.h
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* Parse a .fun source file and compile it into entry bytecode.
|
||||
* Minimal support:
|
||||
* - Optional shebang on the first line.
|
||||
* - Optional single function wrapper: fun <ident>() { ... }
|
||||
* - print("...") statements inside function or at top-level.
|
||||
* Produces bytecode that executes all discovered print statements and halts.
|
||||
*
|
||||
* Returns: newly allocated Bytecode*, or NULL on error.
|
||||
*/
|
||||
|
||||
#ifndef FUN_PARSER_H
|
||||
#define FUN_PARSER_H
|
||||
|
||||
#include "bytecode.h"
|
||||
|
||||
Bytecode *parse_file_to_bytecode(const char *path);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue