Skip to content

Commit 8065819

Browse files
committed
add Range::is_adjacent
1 parent 02d4abb commit 8065819

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/postgresql-cst-parser/src/tree_sitter.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ impl Range {
114114
},
115115
}
116116
}
117+
118+
pub fn is_adjacent(&self, other: &Self) -> bool {
119+
self.end_byte == other.start_byte || self.start_byte == other.end_byte
120+
}
117121
}
118122

119123
impl<'a> Node<'a> {

0 commit comments

Comments
 (0)