feat(semantic): impl GetSpan for AstNode (#4717)

This commit is contained in:
DonIsaac 2024-08-07 03:59:37 +00:00
parent 7345bc944c
commit 33f1312a8c

View file

@ -1,6 +1,7 @@
use oxc_ast::AstKind;
use oxc_cfg::BasicBlockId;
use oxc_index::IndexVec;
use oxc_span::GetSpan;
pub use oxc_syntax::node::{AstNodeId, NodeFlags};
use crate::scope::ScopeId;
@ -64,6 +65,13 @@ impl<'a> AstNode<'a> {
}
}
impl GetSpan for AstNode<'_> {
#[inline]
fn span(&self) -> oxc_span::Span {
self.kind.span()
}
}
/// Untyped AST nodes flattened into an vec
#[derive(Debug, Default)]
pub struct AstNodes<'a> {