Skip to content

Commit

Permalink
0.3V BETA Barn release
Browse files Browse the repository at this point in the history
  • Loading branch information
SolindekDev committed Dec 2, 2023
1 parent 3b7fc53 commit 46d654a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ BUGS:
- [ ] Conditions with string
- [ ] \\\" bug
- [X] constant variables and enums can't use runtime values like functions
- [X] implement --no-main and --no-stdlib
- [X] implement --no-main
- [X] implement --no-stdlib
- [ ] add some more info to unused variable warning
- [X] format arguments are not required
- [X] add || and &&
Expand Down
7 changes: 5 additions & 2 deletions src/barn_codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,11 @@ barn_codegen_start(barn_parser_t* parser)
barn_codegen_t* codegen = barn_codegen_create(parser);

// TODO: if flag --no-stdlib is on don't add barn_header.h
barn_codegen_add_header(codegen, "std-c/barn_format.h");
barn_codegen_add_header(codegen, "std-c/barn_header.h");
if (!barn_is_flag(parser->lexer->args_parser, "--no-stdlib", "-n-stdlib"))
{
barn_codegen_add_header(codegen, "std-c/barn_format.h");
barn_codegen_add_header(codegen, "std-c/barn_header.h");
}

for (codegen->index = 0; codegen->index < parser->nodes->length; codegen->index++)
{
Expand Down
1 change: 1 addition & 0 deletions src/barn_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,4 +506,5 @@ barn_parser_extern_function_declaration(barn_parser_t* parser)
barn_node_t* node = barn_function_declaration_create_node(function_name, function_args,
function_return_type, true);
barn_parser_append_node(parser, node);
barn_append_element_to_array(parser->function_nodes, node);
}
4 changes: 2 additions & 2 deletions tests/test-12-extern-functions.ba
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file is compiling with flag "--no-stdlib"

// extern fun puts(string msg)
extern fun puts(string msg)

fun main() {
// puts("Hello")
puts("Hello")
}

0 comments on commit 46d654a

Please sign in to comment.