From e5eab73374880077971f3f22acbdd3d302877128 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 8 Mar 2023 10:54:04 +0100 Subject: Streamline field names --- src/model/content.rs | 8 ++++---- src/syntax/ast.rs | 4 ++-- src/syntax/kind.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/model/content.rs b/src/model/content.rs index 189ee23a..1b87aaea 100644 --- a/src/model/content.rs +++ b/src/model/content.rs @@ -55,7 +55,7 @@ impl Content { /// Attach a span to the content. pub fn spanned(mut self, span: Span) -> Self { if let Some(styled) = self.to::() { - self = StyledNode::new(styled.sub().spanned(span), styled.map()).pack(); + self = StyledNode::new(styled.body().spanned(span), styled.map()).pack(); } self.span = Some(span); self @@ -83,7 +83,7 @@ impl Content { } else if let Some(styled) = self.to::() { let mut map = styled.map(); map.apply(styles); - StyledNode::new(styled.sub(), map).pack() + StyledNode::new(styled.body(), map).pack() } else { StyledNode::new(self, styles).pack() } @@ -268,7 +268,7 @@ impl Debug for Content { if let Some(styled) = self.to::() { styled.map().fmt(f)?; - styled.sub().fmt(f) + styled.body().fmt(f) } else if let Some(seq) = self.to::() { f.debug_list().entries(&seq.children()).finish() } else if self.id.name() == "space" { @@ -334,7 +334,7 @@ pub struct StyledNode { /// The styled content. #[positional] #[required] - pub sub: Content, + pub body: Content, /// The styles. #[positional] diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs index 75931a8c..2fdedbcf 100644 --- a/src/syntax/ast.rs +++ b/src/syntax/ast.rs @@ -165,7 +165,7 @@ pub enum Expr { Let(LetBinding), /// A set rule: `set text(...)`. Set(SetRule), - /// A show rule: `show heading: it => [*{it.body}*]`. + /// A show rule: `show heading: it => emph(it.body)`. Show(ShowRule), /// An if-else conditional: `if x { y } else { z }`. Conditional(Conditional), @@ -1591,7 +1591,7 @@ impl SetRule { } node! { - /// A show rule: `show heading: it => [*{it.body}*]`. + /// A show rule: `show heading: it => emph(it.body)`. ShowRule } diff --git a/src/syntax/kind.rs b/src/syntax/kind.rs index cf973e6a..47b5da31 100644 --- a/src/syntax/kind.rs +++ b/src/syntax/kind.rs @@ -224,7 +224,7 @@ pub enum SyntaxKind { LetBinding, /// A set rule: `set text(...)`. SetRule, - /// A show rule: `show heading: it => [*{it.body}*]`. + /// A show rule: `show heading: it => emph(it.body)`. ShowRule, /// An if-else conditional: `if x { y } else { z }`. Conditional, -- cgit v1.2.3