aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-05-13 17:38:35 +0100
committergingerBill <bill@gingerbill.org>2018-05-13 17:38:35 +0100
commite597a8d72eba1241b944fee48c0be4d6203acc4c (patch)
tree0e473696a04bed8cb7cde5a184016d13afbcae65 /src/parser.cpp
parentde9a4b516465201c8803ae2a2181c9532be65339 (diff)
Fix issues with exact integer bounds and remove dead code
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index f5df64902..289a30864 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -2959,6 +2959,11 @@ AstNode *parse_field_list(AstFile *f, isize *name_count_, u32 allowed_flags, Tok
syntax_error(f->curr_token, "Default parameters can only be applied to single values");
}
+ if (allowed_flags == FieldFlag_Struct && default_value != nullptr) {
+ syntax_error(default_value, "Default parameters are not allowed for structs");
+ default_value = nullptr;
+ }
+
if (type != nullptr && type->kind == AstNode_Ellipsis) {
if (seen_ellipsis) syntax_error(type, "Extra variadic parameter after ellipsis");
seen_ellipsis = true;
@@ -4275,7 +4280,7 @@ ParseFileError parse_files(Parser *p, String init_filename) {
p->init_fullpath = init_fullpath;
// IMPORTANT TODO(bill): Figure out why this doesn't work on *nix sometimes
-#if USE_THREADED_PARSER && defined(GB_SYSTEM_WINDOWS)
+#if defined(GB_SYSTEM_WINDOWS)
isize thread_count = gb_max(build_context.thread_count, 1);
if (thread_count > 1) {
isize volatile curr_import_index = 0;