mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Wrote the docs for toy_literal.h
This commit is contained in:
@@ -48,8 +48,6 @@ const unsigned char* Toy_compileString(const char* source, size_t* size) {
|
||||
}
|
||||
```
|
||||
|
||||
This header also includes [toy_ast_node.h](toy_ast_node_h.md), so the `Toy_freeASTNode` function can also be used.
|
||||
|
||||
## Defined Functions
|
||||
|
||||
### void Toy_initParser(Toy_Parser* parser, Toy_Lexer* lexer)
|
||||
@@ -66,3 +64,9 @@ This function returns an abstract syntax tree representing part of the program,
|
||||
|
||||
This function should be called repeatedly until it returns `NULL`, indicating the end of the program.
|
||||
|
||||
### void Toy_freeASTNode(Toy_ASTNode* node)
|
||||
|
||||
This function cleans up any valid instance of `Toy_ASTNode` pointer passed to it. It is most commonly used to clean up the values returned by `Toy_scanParser`, after they have been passsed to `Toy_writeCompiler`, or when the node is an error node.
|
||||
|
||||
Note: this function is *actually* defined in toy_ast_node.h, but documented here, because this is where it matters most.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user