Improve oxc_traverse
#3209
Labels
A-transformer
Area - Transformer / Transpiler
C-cleanup
Category - technical debt or refactoring. Solution not expected to change behavior
Various improvements to make to
oxc_traverse
:ScopeFlags
(ctx.scope()
).ancestor.rs
by using generics instead of repetition for*Without*
types.TraverseCtx::has_ancestor
method where closure returnstrue
orfalse
(or maybe
Some(true)
,Some(false)
orNone
)TraverseCtx::find_ancestor
can return an ancestor node that it found.Ancestor
so thatis_*
can use bitwise ops +retag_stack
can write 1 byte only.matches!()
inis_*
functions. Need to do it manually.ancestor_type2
branch (on my local machine).Debug
forAncestor
and*Without*
typesas_ref
method which creates a struct of references, whichDebug
can use.Ancestor::is_via_*
&mut TraverseCtx
toenter_*
andexit_*
parent_mut
,ancestor_mut
methods toTraverseCtx
span_mut
,directives_mut
etc to all*Without*
typesTraverseCtx
andAncestor
prevents creating more than 1 mut ref at a timeTraverseCtx
unfortunately also blocks callingctx.alloc()
.ctx.ancestry.parent_mut()
+ctx.ast.alloc()
- separate propertiescan be mut borrowed at same time.
Span
to constant position in all structs, for fast lookup?The text was updated successfully, but these errors were encountered: