From 70a8be8e4c50ca4ca15dfd1dc22c0e9414d1aec2 Mon Sep 17 00:00:00 2001 From: ValKmjolnir Date: Sat, 5 Aug 2023 00:08:28 +0800 Subject: [PATCH] :sparkles: symbol begins with '_' will not be exported --- src/nasal_import.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/nasal_import.cpp b/src/nasal_import.cpp index 945d30d..31b862b 100644 --- a/src/nasal_import.cpp +++ b/src/nasal_import.cpp @@ -279,6 +279,10 @@ return_expr* linker::generate_module_return(code_block* block) { res->set_value(value); for(const auto& i : sf->do_find(block)) { auto pair = new hash_pair(block->get_location()); + // do not export symbol begins with '_' + if (i.name.length() && i.name[0]=='_') { + continue; + } pair->set_name(i.name); pair->set_value(new identifier(block->get_location(), i.name)); value->add_member(pair);