summaryrefslogtreecommitdiff
path: root/src/syntax/ast.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-12-09 10:21:11 +0100
committerLaurenz <laurmaedje@gmail.com>2022-12-09 10:21:11 +0100
commitcd089b6194c57b2e8dff70efaa7cbd53035f7327 (patch)
treef5466a0e2f8633aa609276c0c2794911c7e9252a /src/syntax/ast.rs
parent495b525694aa5901385f3acad043b4a9f3ebb911 (diff)
Align set rule
Diffstat (limited to 'src/syntax/ast.rs')
-rw-r--r--src/syntax/ast.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs
index 3661c156..4db00593 100644
--- a/src/syntax/ast.rs
+++ b/src/syntax/ast.rs
@@ -453,8 +453,8 @@ pub enum MathNode {
Script(Script),
/// A fraction: `x/2`.
Frac(Frac),
- /// An alignment indicator: `&`, `&&`.
- Align(Align),
+ /// An alignment point: `&`, `&&`.
+ AlignPoint(AlignPoint),
/// Grouped mathematical material.
Group(Math),
/// An expression.
@@ -472,7 +472,7 @@ impl AstNode for MathNode {
SyntaxKind::Symbol(_) => node.cast().map(Self::Symbol),
SyntaxKind::Script => node.cast().map(Self::Script),
SyntaxKind::Frac => node.cast().map(Self::Frac),
- SyntaxKind::Align => node.cast().map(Self::Align),
+ SyntaxKind::AlignPoint => node.cast().map(Self::AlignPoint),
SyntaxKind::Math => node.cast().map(Self::Group),
_ => node.cast().map(Self::Expr),
}
@@ -488,7 +488,7 @@ impl AstNode for MathNode {
Self::Symbol(v) => v.as_untyped(),
Self::Script(v) => v.as_untyped(),
Self::Frac(v) => v.as_untyped(),
- Self::Align(v) => v.as_untyped(),
+ Self::AlignPoint(v) => v.as_untyped(),
Self::Group(v) => v.as_untyped(),
Self::Expr(v) => v.as_untyped(),
}
@@ -558,11 +558,11 @@ impl Frac {
}
node! {
- /// An alignment indicator in a formula: `&`, `&&`.
- Align
+ /// An alignment point in a formula: `&`, `&&`.
+ AlignPoint
}
-impl Align {
+impl AlignPoint {
/// The number of ampersands.
pub fn count(&self) -> usize {
self.0.children().filter(|n| n.kind() == &SyntaxKind::Amp).count()