|
| | UseDecl (Loc loc, Mods mods, Ptr< Path > path, Dbg alias) |
| | use path [as alias|*];; no alias means as *.
|
| | UseDecl (Loc loc, Mods mods, Tok::Tag tag, Ptr< Path > path, Sym file_path, Dbg alias, bool splice, const File *file) |
| | import/plugin; name is the module name, derived from file_path if there is one.
|
| Tok::Tag | tag () const |
| | import, plugin, or use.
|
| bool | is_import () const |
| const Path * | path () const |
| | Module path of a use; module name of an import/plugin.
|
| Dbg | alias () const |
| | Empty, unless the source spelled as I.
|
| Sym | file_path () const |
| | Spelling of an import "..."; empty otherwise.
|
| bool | is_file_path () const |
| const File * | file () const |
| bool | is_splice () const |
| | as *: splice the module's public members, bind no name.
|
| Dbg | dbg () const override |
| | The name this decl introduces; anonymous if it splices instead.
|
| const Scope * | scope () const override |
| | Non-nullptr if this Decl is a module whose members a Path may walk into.
|
| void | bind (Scopes &) const override |
| void | emit (Emitter &) const override |
| void | stream (fe::Tab &, std::ostream &) const override |
| Vis | vis () const override |
| | A ValDecl's own Vis; Pub for anything else (Ptrn, Import, ...), which the priv/pub system ignores.
|
| bool | is_extern () const override |
| | Whether this decl crosses the Mim/native boundary (extern); body presence picks which side supplies it.
|
| bool | is_anx () const override |
| | Whether this decl is registered as a compiler-exposed annex (anx).
|
| const Mods & | mods () const |
| const Def * | def () const |
| virtual std::pair< AnnexInfo *, sub_t > | annex_sub () const |
| | The (AnnexInfo, sub) slot this decl registered itself under as an annex; {nullptr, 0} if it isn't one.
|
| Loc | loc () const |
| void | dump () const |
import "file"|name [as alias|*];, plugin name [as alias|*];, or use path [as alias|*]; as * splices instead of naming; a use without an as is sugar for as *.
Makes another module available here: import/plugin pull in a File, use walks a Path. Either that module is bound under UseDecl::dbg, or its public members are spliced into the current scope. Defaults to priv; whatever it binds or splices carries this decl's own Vis, so only pub re-exports.
Definition at line 893 of file ast.h.
| mim::ast::UseDecl::UseDecl |
( |
Loc | loc, |
|
|
Mods | mods, |
|
|
Tok::Tag | tag, |
|
|
Ptr< Path > | path, |
|
|
Sym | file_path, |
|
|
Dbg | alias, |
|
|
bool | splice, |
|
|
const File * | file ) |
|
inline |