Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/ast.rs')
-rw-r--r--crates/syntax/src/ast.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/syntax/src/ast.rs b/crates/syntax/src/ast.rs
index 1e691befff..cc90d2dd1d 100644
--- a/crates/syntax/src/ast.rs
+++ b/crates/syntax/src/ast.rs
@@ -136,6 +136,16 @@ where
{
}
+/// Trait to describe operations common to both `RangeExpr` and `RangePat`.
+pub trait RangeItem {
+ type Bound;
+
+ fn start(&self) -> Option<Self::Bound>;
+ fn end(&self) -> Option<Self::Bound>;
+ fn op_kind(&self) -> Option<RangeOp>;
+ fn op_token(&self) -> Option<SyntaxToken>;
+}
+
mod support {
use super::{AstChildren, AstNode, SyntaxKind, SyntaxNode, SyntaxToken};