diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-03-11 12:59:55 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-03-11 23:36:06 +0100 |
| commit | 5ac7eb3860ebd3247f6486c227e816894cb8fd91 (patch) | |
| tree | a29a868c681c7de39f15f2d9d3f031db1861b90a /src/syntax/ast.rs | |
| parent | 5ce2a006b6d45d29be15e4562ae3ab4fc1b8e97c (diff) | |
Rename template to content
Diffstat (limited to 'src/syntax/ast.rs')
| -rw-r--r-- | src/syntax/ast.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs index 425af0c1..f48b445c 100644 --- a/src/syntax/ast.rs +++ b/src/syntax/ast.rs @@ -221,8 +221,8 @@ pub enum Expr { Ident(Ident), /// A code block: `{ let x = 1; x + 2 }`. Code(CodeBlock), - /// A template block: `[*Hi* there!]`. - Template(TemplateBlock), + /// A content block: `[*Hi* there!]`. + Content(ContentBlock), /// A grouped expression: `(1 + 2)`. Group(GroupExpr), /// An array expression: `(1, "hi", 12cm)`. @@ -270,7 +270,7 @@ impl TypedNode for Expr { match node.kind() { NodeKind::Ident(_) => node.cast().map(Self::Ident), NodeKind::CodeBlock => node.cast().map(Self::Code), - NodeKind::TemplateBlock => node.cast().map(Self::Template), + NodeKind::ContentBlock => node.cast().map(Self::Content), NodeKind::GroupExpr => node.cast().map(Self::Group), NodeKind::ArrayExpr => node.cast().map(Self::Array), NodeKind::DictExpr => node.cast().map(Self::Dict), @@ -299,7 +299,7 @@ impl TypedNode for Expr { match self { Self::Lit(v) => v.as_red(), Self::Code(v) => v.as_red(), - Self::Template(v) => v.as_red(), + Self::Content(v) => v.as_red(), Self::Ident(v) => v.as_red(), Self::Array(v) => v.as_red(), Self::Dict(v) => v.as_red(), @@ -419,14 +419,14 @@ impl CodeBlock { } node! { - /// A template block: `[*Hi* there!]`. - TemplateBlock: TemplateBlock + /// A content block: `[*Hi* there!]`. + ContentBlock: ContentBlock } -impl TemplateBlock { - /// The contents of the template. +impl ContentBlock { + /// The contained markup. pub fn body(&self) -> Markup { - self.0.cast_first_child().expect("template is missing body") + self.0.cast_first_child().expect("content is missing body") } } |
