ast.rs: add Leaf::has_source() convenience function for now

This is exposed by our FFI bridge for convenience, so this makes porting
easier.
This commit is contained in:
Johannes Altmanninger 2023-04-18 18:58:19 +02:00
parent 966dc0d997
commit dc6aead17b

View File

@ -401,6 +401,9 @@ pub trait Leaf: Node {
/// we accepted incomplete and the token stream was exhausted.
fn range(&self) -> Option<SourceRange>;
fn range_mut(&mut self) -> &mut Option<SourceRange>;
fn has_source(&self) -> bool {
self.range().is_some()
}
fn leaf_as_node_ffi(&self) -> &dyn Node;
}