Add more range API's.

This commit is contained in:
Stephen Chung
2021-12-15 22:12:51 +08:00
parent 59a9ff0b0f
commit abbfa3777d
5 changed files with 42 additions and 28 deletions

View File

@@ -1057,6 +1057,12 @@ impl StmtBlock {
pub fn len(&self) -> usize {
self.0.len()
}
/// Get the statements of this statements block.
#[inline(always)]
#[must_use]
pub fn statements(&self) -> &[Stmt] {
&self.0
}
/// Get the position (location of the beginning `{`) of this statements block.
#[inline(always)]
#[must_use]