Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions crates/oxc_ast/src/generated/ast_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,9 @@ impl AstKind<'_> {
}

impl GetSpan for AstKind<'_> {
/// Get [`Span`] of an [`AstKind`].
// `span` field is in consistent position in all AST structs, so this boils down to 1 instruction.
#[inline]
fn span(&self) -> Span {
match self {
Self::Program(it) => it.span(),
Expand Down
4 changes: 4 additions & 0 deletions tasks/ast_tools/src/generators/ast_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ impl Generator for AstKindGenerator {

///@@line_break
impl GetSpan for AstKind<'_> {
///@@line_break
/// Get [`Span`] of an [`AstKind`].
///@ `span` field is in consistent position in all AST structs, so this boils down to 1 instruction.
#[inline]
fn span(&self) -> Span {
match self {
#span_match_arms
Expand Down
Loading