aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorAndreas T Jonsson <mail@andreasjonsson.se>2024-05-10 09:04:52 +0200
committerAndreas T Jonsson <mail@andreasjonsson.se>2024-05-10 09:04:52 +0200
commitb72c2edabbc9087b07a30b781de1925d6570dd62 (patch)
tree0e96f43038901ec8c6f6b015071c1803a2166d41 /src/parser.cpp
parent273e4c6b4ce6f1060870782c8e780fe2b371ede4 (diff)
parent41bd8cf7143902db59c02c56fc5318a7e749d7a5 (diff)
Merge branch 'master' into netbsd
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index f4d3dc48d..6e859fe32 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -1,7 +1,7 @@
#include "parser_pos.cpp"
gb_internal u64 ast_file_vet_flags(AstFile *f) {
- if (f->vet_flags_set) {
+ if (f != nullptr && f->vet_flags_set) {
return f->vet_flags;
}
return build_context.vet_flags;
@@ -3499,6 +3499,10 @@ gb_internal Ast *parse_type(AstFile *f) {
Token token = advance_token(f);
syntax_error(token, "Expected a type");
return ast_bad_expr(f, token, f->curr_token);
+ } else if (type->kind == Ast_ParenExpr &&
+ unparen_expr(type) == nullptr) {
+ syntax_error(type, "Expected a type within the parentheses");
+ return ast_bad_expr(f, type->ParenExpr.open, type->ParenExpr.close);
}
return type;
}
@@ -5710,7 +5714,7 @@ gb_internal bool determine_path_from_string(BlockingMutex *file_mutex, Ast *node
// working directory of the exe to the library search paths.
// Static libraries can be linked directly with the full pathname
//
- if (node->kind == Ast_ForeignImportDecl && string_ends_with(file_str, str_lit(".so"))) {
+ if (node->kind == Ast_ForeignImportDecl && (string_ends_with(file_str, str_lit(".so")) || string_contains_string(file_str, str_lit(".so.")))) {
*path = file_str;
return true;
}