spudplate
Template scaffolding compiler for spudlang .spud files
Loading...
Searching...
No Matches
spudplate::IncludeStmt Struct Reference

An include statement - runs another bundled template inline. More...

#include <ast.h>

Public Attributes

std::string name
 Name of the installed template to run.
 
std::optional< std::uint32_t > version_pin
 Optional @N pin from source. Bundler resolves to that exact installed/archived version.
 
std::optional< ExprPtr > when_clause
 Optional condition guarding the include.
 
int line
 1-based source line where this node begins.
 
int column
 1-based source column where this node begins.
 

Detailed Description

An include statement - runs another bundled template inline.

Example: include claude_setup when use_claude

At install time the bundler reads the bytes of the named installed template and embeds them as a dep inside the parent spudpack. At run time the include site decodes the dep, deserialises and validates the dep program, and runs it inline at the include point with isolated variable scope. Prompts interleave with the parent's in source order; filesystem operations join the parent's deferred queue. The optional when clause skips the include entirely if false.