use brink_syntax::ast::{self, AstNode};
use crate::IncludeSite;
use crate::provenance::NodeClass;
use super::super::context::{LowerScope, LowerSink, Lowered};
#[expect(clippy::unnecessary_wraps)]
pub(super) fn lower_include(
scope: &LowerScope,
inc: &ast::IncludeStmt,
_sink: &mut impl LowerSink,
) -> Lowered<IncludeSite> {
let Some(file_path) = inc.file_path() else {
unreachable!("parser guarantees FILE_PATH node in INCLUDE_STMT")
};
let raw = file_path.text();
let cleaned = raw
.strip_prefix('"')
.and_then(|s| s.strip_suffix('"'))
.unwrap_or(&raw);
Ok(IncludeSite {
file_path: cleaned.to_owned(),
ptr: scope.prov(NodeClass::Include, inc.syntax()),
})
}