Pop-Up Thingie
Sidebar
>>> Magnum BBS <<<
Home
Forum
Files
Dark
Log in
Username
Password
Sidebar
Forum
Usenet
COMP.LANG.C++
#include
From
Mr Flibble
@21:1/5 to
All
on Sat Mar 22 18:04:18 2025
Hi!
Support for the equivalent of #include has been added to "neos" the
universal compiler that can compile any programming language:
class source_package_import : public
semantic_concept<source_package_import>
{
// types
public:
using data_type = neolib::string;
// construction
public:
source_package_import() :
semantic_concept{ "source.package.import", neos::language::emit_type::Infix }
{
}
// emit
public:
bool can_fold() const override
{
return holds_data();
}
bool can_fold(const i_semantic_concept& aRhs) const override
{
return aRhs.name() == "source.package.name";
}
// emit
protected:
void do_fold(i_context& aContext,
neolib::i_ref_ptr<i_semantic_concept>& aResult) override
{
language::source_fragment file{ data<neolib::string>() };
file.set_imported();
aContext.load_fragment(file);
aContext.compiler().compile(std::move(file));
}
void do_fold(i_context& aContext, const i_semantic_concept& aRhs, neolib::i_ref_ptr<i_semantic_concept>& aResult) override
{
data<neolib::string>() = aRhs.data<neolib::i_string>();
aResult.reset(this);
}
};
/Flibble
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)
Who's Online
System Info
Sysop:
Keyop
Location:
Huddersfield, West Yorkshire, UK
Users:
715
Nodes:
16 (
2
/
14
)
Uptime:
156:09:09
Calls:
12,092
Files:
15,000
Messages:
6,517,729