aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-08-21 13:44:16 +0100
committergingerBill <bill@gingerbill.org>2021-08-21 13:44:16 +0100
commitf0437a42422ee84d20c06b5731f963923acb858c (patch)
tree6eeb222e78682ecc36834b3e05569b76e61774f8 /src/parser.cpp
parent32bdad322aaf9012adef09c7ce57284dd217c161 (diff)
Enforce `core:builtin` and `core:intrinsics` for imports
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 3b5c30207..6184a62ab 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -5184,7 +5184,12 @@ bool determine_path_from_string(BlockingMutex *file_mutex, Ast *node, String bas
if (is_package_name_reserved(file_str)) {
*path = file_str;
- return true;
+ if (collection_name == "core") {
+ return true;
+ } else {
+ syntax_error(node, "The package '%.*s' must be imported with the core library collection: 'core:%.*s'", LIT(file_str), LIT(file_str));
+ return false;
+ }
}
if (file_mutex) mutex_lock(file_mutex);