sun::driver::ManifestProcessor
class · Source (opens in a new tab)
class sun::driver::ManifestProcessorResolves manifest dependencies and prepares their compiler inputs.
Public Functions
- clearPathVariables
- exchangeDependencyPathVariables
- exchangeSourceConfig
- expandPathVariables
- findManifest
- fromEntrypointFile
- process
- resolvePath
- setDefaultPathVariable
- setPathVariable
clearPathVariables
public · function · static · Source (opens in a new tab)
void sun::driver::ManifestProcessor::clearPathVariables()Drop all defined path variables (used by tests).
exchangeDependencyPathVariables
public · function · static · Source (opens in a new tab)
std::map< std::string, std::string > sun::driver::ManifestProcessor::exchangeDependencyPathVariables(std::map< std::string, std::string > values)Replaces the consuming project's overrides for the current Git build and returns the previous values so a caller can restore them.
exchangeSourceConfig
public · function · static · Source (opens in a new tab)
const SunConfig * sun::driver::ManifestProcessor::exchangeSourceConfig(const SunConfig *config)Selects an explicit dependency config during its build, returning the previous config for restoration.
The caller owns both config lifetimes.
Related: SunConfig
expandPathVariables
public · function · static · Source (opens in a new tab)
std::string sun::driver::ManifestProcessor::expandPathVariables(const std::string &input, const SunConfig *config=nullptr)Replace every $NAME in a manifest entry with the variable's value — explicit path-var definitions first, then the consuming project's Git overrides, then the source config's pathVariables, project / language-server defaults, then the environment.
Throws SunError for a variable defined nowhere.
findManifest
public · function · static · Source (opens in a new tab)
const ManifestAST * sun::driver::ManifestProcessor::findManifest(const sun::ast::BlockExprAST &program)The manifest block among a program's top-level statements, or nullptr.
Related: sun::ast::ManifestAST, sun::ast::BlockExprAST
fromEntrypointFile
public · function · static · Source (opens in a new tab)
std::optional< ResolvedManifest > sun::driver::ManifestProcessor::fromEntrypointFile(const std::string &entrypointPath, const std::string &targetTriple="")Parse the entrypoint file and resolve its manifest (paths relative to the file's directory).
nullopt if the file cannot be read, does not parse, or has no manifest block.
Related: ResolvedManifest
process
public · function · static · Source (opens in a new tab)
ResolvedManifest sun::driver::ManifestProcessor::process(const sun::ast::ManifestAST &manifest, const std::string &baseDir, const std::string &targetTriple="")Resolve every entry of a manifest against baseDir.
targetTriple (the target value, host when empty) selects which of the manifest's target: { <os>: ... } blocks contribute their entries — the manifest itself never decides the target, the compilation does.
Related: ResolvedManifest, sun::ast::ManifestAST
resolvePath
public · function · static · Source (opens in a new tab)
std::string sun::driver::ManifestProcessor::resolvePath(const std::string &path, const std::string &baseDir, const SunConfig *config=nullptr, const std::string &targetTriple="")Resolve a manifest path: absolute as-is, else relative to baseDir, else through the config's sunPath dirs, lib-path, SUN_PATH and installation directories, else returned unchanged (errors surface later).
Related: SunConfig
setDefaultPathVariable
public · function · static · Source (opens in a new tab)
void sun::driver::ManifestProcessor::setDefaultPathVariable(const std::string &name, const std::string &value)Defines a project or editor fallback, used only when neither an explicit override nor the source's config defines the variable.
setPathVariable
public · function · static · Source (opens in a new tab)
void sun::driver::ManifestProcessor::setPathVariable(const std::string &name, const std::string &value)Define an explicit override for manifest entries (path-var NAME=DIR).
Explicit values take precedence over source configuration files.