@@ -463,74 +463,6 @@ impl Evaluator {
463 .unwrap_or(rest);
463 .unwrap_or(rest);
464 let filename = substitute_vars(filename, &ctx.variables);
464 let filename = substitute_vars(filename, &ctx.variables);
466− // Glob support: if filename contains *, expand to multiple imports
467− if filename.contains('*') {
468− let base_dir = match &ctx.base_path {
469− Some(base) => base.clone(),
470− None => PathBuf::from("."),
472− let pattern_path = Path::new(&filename);
473− let (glob_dir, glob_pattern) = match pattern_path.parent() {
474− Some(dir) if !dir.as_os_str().is_empty() => (
478− .unwrap_or_default()
482− _ => (base_dir.clone(), filename.clone()),
484− let matched_files = match std::fs::read_dir(&glob_dir) {
486− let mut files: Vec<PathBuf> = entries
489− let name = e.file_name().to_string_lossy().to_string();
490− glob_match(&glob_pattern, &name)
498− ctx.diagnostics.push(Diagnostic {
502− "cannot read directory for glob '{}': {}",
505− severity: Severity::Error,
506− source_line: Some(content.clone()),
511− if matched_files.is_empty() {
512− ctx.diagnostics.push(Diagnostic {
515− message: format!("no files matched glob pattern '{}'", filename),
516− severity: Severity::Warning,
517− source_line: Some(content.clone()),
521− let mut matched_nodes = Vec::new();
522− for file_path in matched_files {
523− let rel_name = file_path
524− .strip_prefix(&base_dir)
525− .unwrap_or(&file_path)
528− let import_line = format!("@include \"{}\"", rel_name);
529− matched_nodes.extend(self.eval_block(&syntax::parse(&import_line), ctx));
531− return Ok(Some(matched_nodes));
534 let resolved = match &ctx.base_path {
466 let resolved = match &ctx.base_path {
535 Some(base) => base.join(&filename),
467 Some(base) => base.join(&filename),
536 None => PathBuf::from(&filename),
468 None => PathBuf::from(&filename),