aboutsummaryrefslogtreecommitdiff
path: root/src/compiler/code_generator
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/code_generator')
-rw-r--r--src/compiler/code_generator/code_generator.c6
-rw-r--r--src/compiler/code_generator/code_generator.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/compiler/code_generator/code_generator.c b/src/compiler/code_generator/code_generator.c
index 2b575d8..03901cd 100644
--- a/src/compiler/code_generator/code_generator.c
+++ b/src/compiler/code_generator/code_generator.c
@@ -61,7 +61,7 @@ void deleteInstructions(Instructions instructions) {
free(instructions.instructions);
}
-Instructions codeGenerator(SourceCode code) {
+Instructions codeGenerator(SourceCode *code) {
ParsedTree *root = treeParser(code);
if (root != NULL) {
Instructions instructions = _codeGenerator(root, code);
@@ -76,7 +76,7 @@ Instructions codeGenerator(SourceCode code) {
return error;
}
-Instructions _codeGenerator(ParsedTree *root, SourceCode code) {
+Instructions _codeGenerator(ParsedTree *root, SourceCode *code) {
const TreeScopeMetadata *metadata = root->metadata;
size_t instructions_size = 10;
@@ -111,7 +111,7 @@ RETURN_ERROR:
bool nodeToInstruction(ParsedTree *tree, Instruction **instructions,
size_t *instructions_size, size_t *instructions_inserted,
- SourceCode code) {
+ SourceCode *code) {
switch (tree->token) {
case TREE_TOKEN_FUNCTION_CALL: {
const TreeFunctionCallMetadata *tree_metadata = tree->metadata;
diff --git a/src/compiler/code_generator/code_generator.h b/src/compiler/code_generator/code_generator.h
index 0f8b69d..0ae3219 100644
--- a/src/compiler/code_generator/code_generator.h
+++ b/src/compiler/code_generator/code_generator.h
@@ -36,12 +36,12 @@ extern void printInstructions(Instructions instructions);
extern void deleteInstruction(Instruction instruction);
extern void deleteInstructions(Instructions instructions);
-extern Instructions codeGenerator(SourceCode code);
-extern Instructions _codeGenerator(ParsedTree *root, SourceCode code);
+extern Instructions codeGenerator(SourceCode *code);
+extern Instructions _codeGenerator(ParsedTree *root, SourceCode *code);
extern bool nodeToInstruction(ParsedTree *tree, Instruction **instructions,
size_t *instructions_size,
- size_t *instructions_inserted, SourceCode code);
+ size_t *instructions_inserted, SourceCode *code);
extern void insertInstruction(const Instruction instruction,
Instruction **restrict instructions,