mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
feat(semantic): impl GetSpan for AstNode (#4717)
This commit is contained in:
parent
7345bc944c
commit
33f1312a8c
1 changed files with 8 additions and 0 deletions
|
|
@ -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> {
|
||||
|
|
|
|||
Loading…
Reference in a new issue