runner: centralize resolve env flags

This commit is contained in:
2025-12-28 14:01:10 +09:00
parent 2ee8718476
commit 8904135380
6 changed files with 47 additions and 36 deletions

View File

@ -3,6 +3,7 @@
//! This module groups all `using` system and namespace flags.
//! Use this for IDE autocomplete to discover using/namespace flags easily.
use super::env_bool;
use super::warn_alias_once;
pub fn enable_using() -> bool {
@ -68,3 +69,18 @@ pub fn using_ast_enabled() -> bool {
_ => !using_is_prod(), // dev/ci → true, prod → false
}
}
// ---- Using/resolve diagnostics ----
pub fn resolve_trace() -> bool {
env_bool("NYASH_RESOLVE_TRACE")
}
pub fn resolve_seam_debug() -> bool {
env_bool("NYASH_RESOLVE_SEAM_DEBUG")
}
pub fn resolve_dump_merged_path() -> Option<String> {
std::env::var("NYASH_RESOLVE_DUMP_MERGED")
.ok()
.filter(|s| !s.is_empty())
}