pub mod changelog;
pub mod cond;
pub mod deps;
pub mod expr;
pub mod files;
pub mod macros;
pub mod preamble;
pub mod scriptlet;
pub mod section;
pub mod span;
pub mod text;
pub use changelog::{ChangelogDate, ChangelogEntry, Month, Weekday};
pub use cond::{CondBranch, CondExpr, CondKind, Conditional};
pub use deps::{BoolDep, DepAtom, DepConstraint, DepExpr, EVR, VerOp};
pub use expr::{BinOp, ExprAst};
pub use files::{
AttrField, AttrFields, ConfigFlag, DefattrFields, FileDirective, FileEntry, FilePath,
FilesContent, VerifyCheck,
};
pub use macros::{
BuildCondStyle, BuildCondition, Comment, CommentStyle, IncludeDirective, MacroDef, MacroDefKind,
};
pub use preamble::{PreambleContent, PreambleItem, Tag, TagQualifier, TagValue};
pub use scriptlet::{
DEFAULT_FILE_TRIGGER_PRIORITY, FileTrigger, FileTriggerKind, Interpreter, Scriptlet,
ScriptletKind, Trigger, TriggerKind,
};
pub use section::{BuildScriptKind, PackageName, Section, ShellBody, SubpkgRef, TextBody};
pub use span::Span;
pub use text::{
BuiltinMacro, ConditionalMacro, MacroKind, MacroRef, SIGIL_ALL_ARGS, SIGIL_ALL_POSITIONAL,
SIGIL_ARG_COUNT, Text, TextSegment,
};
#[derive(Debug, Clone, PartialEq, Eq, Default)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(deny_unknown_fields))]
pub struct SpecFile<T = ()> {
pub items: Vec<SpecItem<T>>,
pub data: T,
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[non_exhaustive]
pub enum SpecItem<T = ()> {
Preamble(PreambleItem<T>),
Section(Box<Section<T>>),
Conditional(Conditional<T, SpecItem<T>>),
MacroDef(MacroDef<T>),
BuildCondition(BuildCondition<T>),
Include(IncludeDirective<T>),
Statement(Box<MacroRef>),
Comment(Comment<T>),
Blank,
}
impl<T> SpecItem<T> {
pub fn section(section: Section<T>) -> Self {
Self::Section(Box::new(section))
}
}