mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
feat(allocator): implement IntoIterator for &mut Vec (#8389)
Implement `IntoIterator` for `&mut Vec` like `std::vec::Vec` does. This allows shorter and more idiomatic syntax.
Before:
```rs
for item in object.collection.iter_mut() {
// ...
}
```
After:
```rs
for item in &mut object.collection {
// ...
}
```
This commit is contained in:
parent
eb25bc0ec6
commit
6c7acac72e
9 changed files with 106 additions and 132 deletions
|
|
@ -254,6 +254,15 @@ impl<'i, T> IntoIterator for &'i Vec<'_, T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'i, T> IntoIterator for &'i mut Vec<'_, T> {
|
||||||
|
type IntoIter = std::slice::IterMut<'i, T>;
|
||||||
|
type Item = &'i mut T;
|
||||||
|
|
||||||
|
fn into_iter(self) -> Self::IntoIter {
|
||||||
|
self.0.iter_mut()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<T, I> ops::Index<I> for Vec<'_, T>
|
impl<T, I> ops::Index<I> for Vec<'_, T>
|
||||||
where
|
where
|
||||||
I: SliceIndex<[T]>,
|
I: SliceIndex<[T]>,
|
||||||
|
|
|
||||||
|
|
@ -395,7 +395,7 @@ impl<'a, 'b> PeepholeRemoveDeadCode {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
for el in array_expr.elements.iter_mut() {
|
for el in &mut array_expr.elements {
|
||||||
match el {
|
match el {
|
||||||
ArrayExpressionElement::SpreadElement(_) => {
|
ArrayExpressionElement::SpreadElement(_) => {
|
||||||
let spread_element = ctx.ast.move_array_expression_element(el);
|
let spread_element = ctx.ast.move_array_expression_element(el);
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ impl<'a> Traverse<'a> for PeepholeSubstituteAlternateSyntax {
|
||||||
decl: &mut VariableDeclaration<'a>,
|
decl: &mut VariableDeclaration<'a>,
|
||||||
ctx: &mut TraverseCtx<'a>,
|
ctx: &mut TraverseCtx<'a>,
|
||||||
) {
|
) {
|
||||||
for declarator in decl.declarations.iter_mut() {
|
for declarator in &mut decl.declarations {
|
||||||
self.compress_variable_declarator(declarator, Ctx(ctx));
|
self.compress_variable_declarator(declarator, Ctx(ctx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1084,7 +1084,7 @@ impl<'a, 'b> PeepholeSubstituteAlternateSyntax {
|
||||||
for arg in old_args {
|
for arg in old_args {
|
||||||
if let Argument::SpreadElement(mut spread_el) = arg {
|
if let Argument::SpreadElement(mut spread_el) = arg {
|
||||||
if let Expression::ArrayExpression(array_expr) = &mut spread_el.argument {
|
if let Expression::ArrayExpression(array_expr) = &mut spread_el.argument {
|
||||||
for el in array_expr.elements.iter_mut() {
|
for el in &mut array_expr.elements {
|
||||||
match el {
|
match el {
|
||||||
ArrayExpressionElement::SpreadElement(spread_el) => {
|
ArrayExpressionElement::SpreadElement(spread_el) => {
|
||||||
new_args.push(ctx.ast.argument_spread_element(
|
new_args.push(ctx.ast.argument_spread_element(
|
||||||
|
|
|
||||||
|
|
@ -297,7 +297,7 @@ impl<'a> ParserImpl<'a> {
|
||||||
|
|
||||||
// ExportDeclaration : export NamedExports ;
|
// ExportDeclaration : export NamedExports ;
|
||||||
if source.is_none() {
|
if source.is_none() {
|
||||||
for specifier in specifiers.iter_mut() {
|
for specifier in &mut specifiers {
|
||||||
match &specifier.local {
|
match &specifier.local {
|
||||||
// It is a Syntax Error if ReferencedBindings of NamedExports contains any StringLiterals.
|
// It is a Syntax Error if ReferencedBindings of NamedExports contains any StringLiterals.
|
||||||
ModuleExportName::StringLiteral(literal) => {
|
ModuleExportName::StringLiteral(literal) => {
|
||||||
|
|
|
||||||
|
|
@ -287,7 +287,7 @@ impl<'a> ObjectRestSpread<'a, '_> {
|
||||||
match target {
|
match target {
|
||||||
AssignmentTarget::ObjectAssignmentTarget(t) => {
|
AssignmentTarget::ObjectAssignmentTarget(t) => {
|
||||||
let mut data = vec![];
|
let mut data = vec![];
|
||||||
for prop in t.properties.iter_mut() {
|
for prop in &mut t.properties {
|
||||||
if let AssignmentTargetProperty::AssignmentTargetPropertyProperty(p) = prop {
|
if let AssignmentTargetProperty::AssignmentTargetPropertyProperty(p) = prop {
|
||||||
data.extend(match &mut p.binding {
|
data.extend(match &mut p.binding {
|
||||||
AssignmentTargetMaybeDefault::AssignmentTargetWithDefault(t) => {
|
AssignmentTargetMaybeDefault::AssignmentTargetWithDefault(t) => {
|
||||||
|
|
@ -419,7 +419,7 @@ impl<'a> ObjectRestSpread<'a, '_> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AssignmentTarget::ObjectAssignmentTarget(t) => {
|
AssignmentTarget::ObjectAssignmentTarget(t) => {
|
||||||
for p in t.properties.iter_mut() {
|
for p in &mut t.properties {
|
||||||
if let AssignmentTargetProperty::AssignmentTargetPropertyProperty(e) = p {
|
if let AssignmentTargetProperty::AssignmentTargetPropertyProperty(e) = p {
|
||||||
Self::recursive_walk_assignment_target_maybe_default(
|
Self::recursive_walk_assignment_target_maybe_default(
|
||||||
&mut e.binding,
|
&mut e.binding,
|
||||||
|
|
@ -537,7 +537,7 @@ impl<'a> ObjectRestSpread<'a, '_> {
|
||||||
fn transform_function(func: &mut Function<'a>, ctx: &mut TraverseCtx<'a>) {
|
fn transform_function(func: &mut Function<'a>, ctx: &mut TraverseCtx<'a>) {
|
||||||
let scope_id = func.scope_id();
|
let scope_id = func.scope_id();
|
||||||
let Some(body) = func.body.as_mut() else { return };
|
let Some(body) = func.body.as_mut() else { return };
|
||||||
for param in func.params.items.iter_mut() {
|
for param in &mut func.params.items {
|
||||||
if Self::has_nested_object_rest(¶m.pattern) {
|
if Self::has_nested_object_rest(¶m.pattern) {
|
||||||
Self::replace_rest_element(
|
Self::replace_rest_element(
|
||||||
VariableDeclarationKind::Var,
|
VariableDeclarationKind::Var,
|
||||||
|
|
@ -554,7 +554,7 @@ impl<'a> ObjectRestSpread<'a, '_> {
|
||||||
fn transform_arrow(arrow: &mut ArrowFunctionExpression<'a>, ctx: &mut TraverseCtx<'a>) {
|
fn transform_arrow(arrow: &mut ArrowFunctionExpression<'a>, ctx: &mut TraverseCtx<'a>) {
|
||||||
let scope_id = arrow.scope_id();
|
let scope_id = arrow.scope_id();
|
||||||
let mut replaced = false;
|
let mut replaced = false;
|
||||||
for param in arrow.params.items.iter_mut() {
|
for param in &mut arrow.params.items {
|
||||||
if Self::has_nested_object_rest(¶m.pattern) {
|
if Self::has_nested_object_rest(¶m.pattern) {
|
||||||
Self::replace_rest_element(
|
Self::replace_rest_element(
|
||||||
VariableDeclarationKind::Var,
|
VariableDeclarationKind::Var,
|
||||||
|
|
@ -599,7 +599,7 @@ impl<'a> ObjectRestSpread<'a, '_> {
|
||||||
scope_id: ScopeId,
|
scope_id: ScopeId,
|
||||||
ctx: &mut TraverseCtx<'a>,
|
ctx: &mut TraverseCtx<'a>,
|
||||||
) {
|
) {
|
||||||
for declarator in decl.declarations.iter_mut() {
|
for declarator in &mut decl.declarations {
|
||||||
if Self::has_nested_object_rest(&declarator.id) {
|
if Self::has_nested_object_rest(&declarator.id) {
|
||||||
let new_scope_id = Self::try_replace_statement_with_block(body, scope_id, ctx);
|
let new_scope_id = Self::try_replace_statement_with_block(body, scope_id, ctx);
|
||||||
let Statement::BlockStatement(block) = body else {
|
let Statement::BlockStatement(block) = body else {
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ impl<'a> ClassProperties<'a, '_> {
|
||||||
// TODO: Store `FxIndexMap`s in a pool and re-use them
|
// TODO: Store `FxIndexMap`s in a pool and re-use them
|
||||||
let mut private_props = FxIndexMap::default();
|
let mut private_props = FxIndexMap::default();
|
||||||
let mut constructor = None;
|
let mut constructor = None;
|
||||||
for element in body.body.iter_mut() {
|
for element in &mut body.body {
|
||||||
match element {
|
match element {
|
||||||
ClassElement::PropertyDefinition(prop) => {
|
ClassElement::PropertyDefinition(prop) => {
|
||||||
// TODO: Throw error if property has decorators
|
// TODO: Throw error if property has decorators
|
||||||
|
|
@ -296,7 +296,7 @@ impl<'a> ClassProperties<'a, '_> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut constructor = None;
|
let mut constructor = None;
|
||||||
for element in body.body.iter_mut() {
|
for element in &mut body.body {
|
||||||
#[expect(clippy::match_same_arms)]
|
#[expect(clippy::match_same_arms)]
|
||||||
match element {
|
match element {
|
||||||
ClassElement::PropertyDefinition(prop) => {
|
ClassElement::PropertyDefinition(prop) => {
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ impl<'a> Traverse<'a> for ClassStaticBlock {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for element in body.body.iter_mut() {
|
for element in &mut body.body {
|
||||||
if let ClassElement::StaticBlock(block) = element {
|
if let ClassElement::StaticBlock(block) = element {
|
||||||
*element = Self::convert_block_to_private_field(block, &mut keys, ctx);
|
*element = Self::convert_block_to_private_field(block, &mut keys, ctx);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ export default function generateWalkFunctionsCode(types) {
|
||||||
ctx: &mut TraverseCtx<'a>
|
ctx: &mut TraverseCtx<'a>
|
||||||
) {
|
) {
|
||||||
traverser.enter_statements(&mut *stmts, ctx);
|
traverser.enter_statements(&mut *stmts, ctx);
|
||||||
for stmt in (*stmts).iter_mut() {
|
for stmt in &mut *stmts {
|
||||||
walk_statement(traverser, stmt, ctx);
|
walk_statement(traverser, stmt, ctx);
|
||||||
}
|
}
|
||||||
traverser.exit_statements(&mut *stmts, ctx);
|
traverser.exit_statements(&mut *stmts, ctx);
|
||||||
|
|
@ -209,17 +209,18 @@ function generateWalkForStruct(type, types) {
|
||||||
walkVecCode = `walk_statements(traverser, ${fieldCode}, ctx);`;
|
walkVecCode = `walk_statements(traverser, ${fieldCode}, ctx);`;
|
||||||
} else {
|
} else {
|
||||||
let walkCode = `${fieldWalkName}(traverser, item as *mut _, ctx);`,
|
let walkCode = `${fieldWalkName}(traverser, item as *mut _, ctx);`,
|
||||||
iterModifier = '';
|
iteratorCode = '';
|
||||||
if (field.wrappers.length === 2 && field.wrappers[1] === 'Option') {
|
if (field.wrappers.length === 2 && field.wrappers[1] === 'Option') {
|
||||||
iterModifier = '.flatten()';
|
iteratorCode = `(*(${fieldCode})).iter_mut().flatten()`;
|
||||||
} else {
|
} else {
|
||||||
assert(
|
assert(
|
||||||
field.wrappers.length === 1,
|
field.wrappers.length === 1,
|
||||||
`Cannot handle struct field with type ${field.type}`,
|
`Cannot handle struct field with type ${field.type}`,
|
||||||
);
|
);
|
||||||
|
iteratorCode = `&mut *(${fieldCode})`;
|
||||||
}
|
}
|
||||||
walkVecCode = `
|
walkVecCode = `
|
||||||
for item in (*(${fieldCode})).iter_mut()${iterModifier} {
|
for item in ${iteratorCode} {
|
||||||
${walkCode}
|
${walkCode}
|
||||||
}
|
}
|
||||||
`.trim();
|
`.trim();
|
||||||
|
|
|
||||||
|
|
@ -49,9 +49,8 @@ pub(crate) unsafe fn walk_program<'a, Tr: Traverse<'a>>(
|
||||||
walk_hashbang(traverser, field as *mut _, ctx);
|
walk_hashbang(traverser, field as *mut _, ctx);
|
||||||
}
|
}
|
||||||
ctx.retag_stack(AncestorType::ProgramDirectives);
|
ctx.retag_stack(AncestorType::ProgramDirectives);
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_PROGRAM_DIRECTIVES)
|
for item in
|
||||||
as *mut Vec<Directive>))
|
&mut *((node as *mut u8).add(ancestor::OFFSET_PROGRAM_DIRECTIVES) as *mut Vec<Directive>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_directive(traverser, item as *mut _, ctx);
|
walk_directive(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -245,9 +244,8 @@ pub(crate) unsafe fn walk_array_expression<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::ArrayExpressionElements(
|
let pop_token = ctx.push_stack(Ancestor::ArrayExpressionElements(
|
||||||
ancestor::ArrayExpressionWithoutElements(node, PhantomData),
|
ancestor::ArrayExpressionWithoutElements(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_ARRAY_EXPRESSION_ELEMENTS)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_ARRAY_EXPRESSION_ELEMENTS)
|
||||||
as *mut Vec<ArrayExpressionElement>))
|
as *mut Vec<ArrayExpressionElement>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_array_expression_element(traverser, item as *mut _, ctx);
|
walk_array_expression_element(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -332,9 +330,8 @@ pub(crate) unsafe fn walk_object_expression<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::ObjectExpressionProperties(
|
let pop_token = ctx.push_stack(Ancestor::ObjectExpressionProperties(
|
||||||
ancestor::ObjectExpressionWithoutProperties(node, PhantomData),
|
ancestor::ObjectExpressionWithoutProperties(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_OBJECT_EXPRESSION_PROPERTIES)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_OBJECT_EXPRESSION_PROPERTIES)
|
||||||
as *mut Vec<ObjectPropertyKind>))
|
as *mut Vec<ObjectPropertyKind>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_object_property_kind(traverser, item as *mut _, ctx);
|
walk_object_property_kind(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -451,16 +448,14 @@ pub(crate) unsafe fn walk_template_literal<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::TemplateLiteralQuasis(
|
let pop_token = ctx.push_stack(Ancestor::TemplateLiteralQuasis(
|
||||||
ancestor::TemplateLiteralWithoutQuasis(node, PhantomData),
|
ancestor::TemplateLiteralWithoutQuasis(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_TEMPLATE_LITERAL_QUASIS)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_TEMPLATE_LITERAL_QUASIS)
|
||||||
as *mut Vec<TemplateElement>))
|
as *mut Vec<TemplateElement>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_template_element(traverser, item as *mut _, ctx);
|
walk_template_element(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
ctx.retag_stack(AncestorType::TemplateLiteralExpressions);
|
ctx.retag_stack(AncestorType::TemplateLiteralExpressions);
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_TEMPLATE_LITERAL_EXPRESSIONS)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_TEMPLATE_LITERAL_EXPRESSIONS)
|
||||||
as *mut Vec<Expression>))
|
as *mut Vec<Expression>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_expression(traverser, item as *mut _, ctx);
|
walk_expression(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -627,9 +622,8 @@ pub(crate) unsafe fn walk_call_expression<'a, Tr: Traverse<'a>>(
|
||||||
walk_ts_type_parameter_instantiation(traverser, (&mut **field) as *mut _, ctx);
|
walk_ts_type_parameter_instantiation(traverser, (&mut **field) as *mut _, ctx);
|
||||||
}
|
}
|
||||||
ctx.retag_stack(AncestorType::CallExpressionArguments);
|
ctx.retag_stack(AncestorType::CallExpressionArguments);
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_CALL_EXPRESSION_ARGUMENTS)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_CALL_EXPRESSION_ARGUMENTS)
|
||||||
as *mut Vec<Argument>))
|
as *mut Vec<Argument>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_argument(traverser, item as *mut _, ctx);
|
walk_argument(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -652,9 +646,8 @@ pub(crate) unsafe fn walk_new_expression<'a, Tr: Traverse<'a>>(
|
||||||
ctx,
|
ctx,
|
||||||
);
|
);
|
||||||
ctx.retag_stack(AncestorType::NewExpressionArguments);
|
ctx.retag_stack(AncestorType::NewExpressionArguments);
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_NEW_EXPRESSION_ARGUMENTS)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_NEW_EXPRESSION_ARGUMENTS)
|
||||||
as *mut Vec<Argument>))
|
as *mut Vec<Argument>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_argument(traverser, item as *mut _, ctx);
|
walk_argument(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -1045,9 +1038,8 @@ pub(crate) unsafe fn walk_object_assignment_target<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::ObjectAssignmentTargetProperties(
|
let pop_token = ctx.push_stack(Ancestor::ObjectAssignmentTargetProperties(
|
||||||
ancestor::ObjectAssignmentTargetWithoutProperties(node, PhantomData),
|
ancestor::ObjectAssignmentTargetWithoutProperties(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_OBJECT_ASSIGNMENT_TARGET_PROPERTIES)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_OBJECT_ASSIGNMENT_TARGET_PROPERTIES)
|
||||||
as *mut Vec<AssignmentTargetProperty>))
|
as *mut Vec<AssignmentTargetProperty>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_assignment_target_property(traverser, item as *mut _, ctx);
|
walk_assignment_target_property(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -1212,9 +1204,8 @@ pub(crate) unsafe fn walk_sequence_expression<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::SequenceExpressionExpressions(
|
let pop_token = ctx.push_stack(Ancestor::SequenceExpressionExpressions(
|
||||||
ancestor::SequenceExpressionWithoutExpressions(node, PhantomData),
|
ancestor::SequenceExpressionWithoutExpressions(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_SEQUENCE_EXPRESSION_EXPRESSIONS)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_SEQUENCE_EXPRESSION_EXPRESSIONS)
|
||||||
as *mut Vec<Expression>))
|
as *mut Vec<Expression>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_expression(traverser, item as *mut _, ctx);
|
walk_expression(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -1486,9 +1477,8 @@ pub(crate) unsafe fn walk_variable_declaration<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::VariableDeclarationDeclarations(
|
let pop_token = ctx.push_stack(Ancestor::VariableDeclarationDeclarations(
|
||||||
ancestor::VariableDeclarationWithoutDeclarations(node, PhantomData),
|
ancestor::VariableDeclarationWithoutDeclarations(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_VARIABLE_DECLARATION_DECLARATIONS)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_VARIABLE_DECLARATION_DECLARATIONS)
|
||||||
as *mut Vec<VariableDeclarator>))
|
as *mut Vec<VariableDeclarator>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_variable_declarator(traverser, item as *mut _, ctx);
|
walk_variable_declarator(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -1926,9 +1916,8 @@ pub(crate) unsafe fn walk_switch_statement<'a, Tr: Traverse<'a>>(
|
||||||
.unwrap();
|
.unwrap();
|
||||||
ctx.set_current_scope_id(current_scope_id);
|
ctx.set_current_scope_id(current_scope_id);
|
||||||
ctx.retag_stack(AncestorType::SwitchStatementCases);
|
ctx.retag_stack(AncestorType::SwitchStatementCases);
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_SWITCH_STATEMENT_CASES)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_SWITCH_STATEMENT_CASES)
|
||||||
as *mut Vec<SwitchCase>))
|
as *mut Vec<SwitchCase>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_switch_case(traverser, item as *mut _, ctx);
|
walk_switch_case(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -2174,9 +2163,8 @@ pub(crate) unsafe fn walk_object_pattern<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::ObjectPatternProperties(
|
let pop_token = ctx.push_stack(Ancestor::ObjectPatternProperties(
|
||||||
ancestor::ObjectPatternWithoutProperties(node, PhantomData),
|
ancestor::ObjectPatternWithoutProperties(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_OBJECT_PATTERN_PROPERTIES)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_OBJECT_PATTERN_PROPERTIES)
|
||||||
as *mut Vec<BindingProperty>))
|
as *mut Vec<BindingProperty>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_binding_property(traverser, item as *mut _, ctx);
|
walk_binding_property(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -2329,9 +2317,8 @@ pub(crate) unsafe fn walk_formal_parameters<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::FormalParametersItems(
|
let pop_token = ctx.push_stack(Ancestor::FormalParametersItems(
|
||||||
ancestor::FormalParametersWithoutItems(node, PhantomData),
|
ancestor::FormalParametersWithoutItems(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_FORMAL_PARAMETERS_ITEMS)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_FORMAL_PARAMETERS_ITEMS)
|
||||||
as *mut Vec<FormalParameter>))
|
as *mut Vec<FormalParameter>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_formal_parameter(traverser, item as *mut _, ctx);
|
walk_formal_parameter(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -2354,9 +2341,8 @@ pub(crate) unsafe fn walk_formal_parameter<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::FormalParameterDecorators(
|
let pop_token = ctx.push_stack(Ancestor::FormalParameterDecorators(
|
||||||
ancestor::FormalParameterWithoutDecorators(node, PhantomData),
|
ancestor::FormalParameterWithoutDecorators(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_FORMAL_PARAMETER_DECORATORS)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_FORMAL_PARAMETER_DECORATORS)
|
||||||
as *mut Vec<Decorator>))
|
as *mut Vec<Decorator>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_decorator(traverser, item as *mut _, ctx);
|
walk_decorator(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -2379,9 +2365,8 @@ pub(crate) unsafe fn walk_function_body<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::FunctionBodyDirectives(
|
let pop_token = ctx.push_stack(Ancestor::FunctionBodyDirectives(
|
||||||
ancestor::FunctionBodyWithoutDirectives(node, PhantomData),
|
ancestor::FunctionBodyWithoutDirectives(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_FUNCTION_BODY_DIRECTIVES)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_FUNCTION_BODY_DIRECTIVES)
|
||||||
as *mut Vec<Directive>))
|
as *mut Vec<Directive>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_directive(traverser, item as *mut _, ctx);
|
walk_directive(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -2475,8 +2460,8 @@ pub(crate) unsafe fn walk_class<'a, Tr: Traverse<'a>>(
|
||||||
traverser.enter_class(&mut *node, ctx);
|
traverser.enter_class(&mut *node, ctx);
|
||||||
let pop_token = ctx
|
let pop_token = ctx
|
||||||
.push_stack(Ancestor::ClassDecorators(ancestor::ClassWithoutDecorators(node, PhantomData)));
|
.push_stack(Ancestor::ClassDecorators(ancestor::ClassWithoutDecorators(node, PhantomData)));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_CLASS_DECORATORS) as *mut Vec<Decorator>))
|
for item in
|
||||||
.iter_mut()
|
&mut *((node as *mut u8).add(ancestor::OFFSET_CLASS_DECORATORS) as *mut Vec<Decorator>)
|
||||||
{
|
{
|
||||||
walk_decorator(traverser, item as *mut _, ctx);
|
walk_decorator(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -2538,9 +2523,8 @@ pub(crate) unsafe fn walk_class_body<'a, Tr: Traverse<'a>>(
|
||||||
traverser.enter_class_body(&mut *node, ctx);
|
traverser.enter_class_body(&mut *node, ctx);
|
||||||
let pop_token =
|
let pop_token =
|
||||||
ctx.push_stack(Ancestor::ClassBodyBody(ancestor::ClassBodyWithoutBody(node, PhantomData)));
|
ctx.push_stack(Ancestor::ClassBodyBody(ancestor::ClassBodyWithoutBody(node, PhantomData)));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_CLASS_BODY_BODY)
|
for item in
|
||||||
as *mut Vec<ClassElement>))
|
&mut *((node as *mut u8).add(ancestor::OFFSET_CLASS_BODY_BODY) as *mut Vec<ClassElement>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_class_element(traverser, item as *mut _, ctx);
|
walk_class_element(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -2583,9 +2567,8 @@ pub(crate) unsafe fn walk_method_definition<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::MethodDefinitionDecorators(
|
let pop_token = ctx.push_stack(Ancestor::MethodDefinitionDecorators(
|
||||||
ancestor::MethodDefinitionWithoutDecorators(node, PhantomData),
|
ancestor::MethodDefinitionWithoutDecorators(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_METHOD_DEFINITION_DECORATORS)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_METHOD_DEFINITION_DECORATORS)
|
||||||
as *mut Vec<Decorator>))
|
as *mut Vec<Decorator>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_decorator(traverser, item as *mut _, ctx);
|
walk_decorator(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -2615,9 +2598,8 @@ pub(crate) unsafe fn walk_property_definition<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::PropertyDefinitionDecorators(
|
let pop_token = ctx.push_stack(Ancestor::PropertyDefinitionDecorators(
|
||||||
ancestor::PropertyDefinitionWithoutDecorators(node, PhantomData),
|
ancestor::PropertyDefinitionWithoutDecorators(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_PROPERTY_DEFINITION_DECORATORS)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_PROPERTY_DEFINITION_DECORATORS)
|
||||||
as *mut Vec<Decorator>))
|
as *mut Vec<Decorator>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_decorator(traverser, item as *mut _, ctx);
|
walk_decorator(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -2721,9 +2703,8 @@ pub(crate) unsafe fn walk_accessor_property<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::AccessorPropertyDecorators(
|
let pop_token = ctx.push_stack(Ancestor::AccessorPropertyDecorators(
|
||||||
ancestor::AccessorPropertyWithoutDecorators(node, PhantomData),
|
ancestor::AccessorPropertyWithoutDecorators(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_ACCESSOR_PROPERTY_DECORATORS)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_ACCESSOR_PROPERTY_DECORATORS)
|
||||||
as *mut Vec<Decorator>))
|
as *mut Vec<Decorator>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_decorator(traverser, item as *mut _, ctx);
|
walk_decorator(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -2765,9 +2746,8 @@ pub(crate) unsafe fn walk_import_expression<'a, Tr: Traverse<'a>>(
|
||||||
ctx,
|
ctx,
|
||||||
);
|
);
|
||||||
ctx.retag_stack(AncestorType::ImportExpressionArguments);
|
ctx.retag_stack(AncestorType::ImportExpressionArguments);
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_IMPORT_EXPRESSION_ARGUMENTS)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_IMPORT_EXPRESSION_ARGUMENTS)
|
||||||
as *mut Vec<Expression>))
|
as *mut Vec<Expression>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_expression(traverser, item as *mut _, ctx);
|
walk_expression(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -2907,9 +2887,8 @@ pub(crate) unsafe fn walk_with_clause<'a, Tr: Traverse<'a>>(
|
||||||
ctx,
|
ctx,
|
||||||
);
|
);
|
||||||
ctx.retag_stack(AncestorType::WithClauseWithEntries);
|
ctx.retag_stack(AncestorType::WithClauseWithEntries);
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_WITH_CLAUSE_WITH_ENTRIES)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_WITH_CLAUSE_WITH_ENTRIES)
|
||||||
as *mut Vec<ImportAttribute>))
|
as *mut Vec<ImportAttribute>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_import_attribute(traverser, item as *mut _, ctx);
|
walk_import_attribute(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -2974,9 +2953,8 @@ pub(crate) unsafe fn walk_export_named_declaration<'a, Tr: Traverse<'a>>(
|
||||||
walk_declaration(traverser, field as *mut _, ctx);
|
walk_declaration(traverser, field as *mut _, ctx);
|
||||||
}
|
}
|
||||||
ctx.retag_stack(AncestorType::ExportNamedDeclarationSpecifiers);
|
ctx.retag_stack(AncestorType::ExportNamedDeclarationSpecifiers);
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_EXPORT_NAMED_DECLARATION_SPECIFIERS)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_EXPORT_NAMED_DECLARATION_SPECIFIERS)
|
||||||
as *mut Vec<ExportSpecifier>))
|
as *mut Vec<ExportSpecifier>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_export_specifier(traverser, item as *mut _, ctx);
|
walk_export_specifier(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -3186,9 +3164,8 @@ pub(crate) unsafe fn walk_jsx_element<'a, Tr: Traverse<'a>>(
|
||||||
walk_jsx_closing_element(traverser, (&mut **field) as *mut _, ctx);
|
walk_jsx_closing_element(traverser, (&mut **field) as *mut _, ctx);
|
||||||
}
|
}
|
||||||
ctx.retag_stack(AncestorType::JSXElementChildren);
|
ctx.retag_stack(AncestorType::JSXElementChildren);
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_JSX_ELEMENT_CHILDREN)
|
for item in
|
||||||
as *mut Vec<JSXChild>))
|
&mut *((node as *mut u8).add(ancestor::OFFSET_JSX_ELEMENT_CHILDREN) as *mut Vec<JSXChild>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_jsx_child(traverser, item as *mut _, ctx);
|
walk_jsx_child(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -3211,9 +3188,8 @@ pub(crate) unsafe fn walk_jsx_opening_element<'a, Tr: Traverse<'a>>(
|
||||||
ctx,
|
ctx,
|
||||||
);
|
);
|
||||||
ctx.retag_stack(AncestorType::JSXOpeningElementAttributes);
|
ctx.retag_stack(AncestorType::JSXOpeningElementAttributes);
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_JSX_OPENING_ELEMENT_ATTRIBUTES)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_JSX_OPENING_ELEMENT_ATTRIBUTES)
|
||||||
as *mut Vec<JSXAttributeItem>))
|
as *mut Vec<JSXAttributeItem>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_jsx_attribute_item(traverser, item as *mut _, ctx);
|
walk_jsx_attribute_item(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -3255,9 +3231,8 @@ pub(crate) unsafe fn walk_jsx_fragment<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::JSXFragmentChildren(
|
let pop_token = ctx.push_stack(Ancestor::JSXFragmentChildren(
|
||||||
ancestor::JSXFragmentWithoutChildren(node, PhantomData),
|
ancestor::JSXFragmentWithoutChildren(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_JSX_FRAGMENT_CHILDREN)
|
for item in
|
||||||
as *mut Vec<JSXChild>))
|
&mut *((node as *mut u8).add(ancestor::OFFSET_JSX_FRAGMENT_CHILDREN) as *mut Vec<JSXChild>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_jsx_child(traverser, item as *mut _, ctx);
|
walk_jsx_child(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -3695,9 +3670,8 @@ pub(crate) unsafe fn walk_ts_enum_declaration<'a, Tr: Traverse<'a>>(
|
||||||
.unwrap();
|
.unwrap();
|
||||||
ctx.set_current_scope_id(current_scope_id);
|
ctx.set_current_scope_id(current_scope_id);
|
||||||
ctx.retag_stack(AncestorType::TSEnumDeclarationMembers);
|
ctx.retag_stack(AncestorType::TSEnumDeclarationMembers);
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_ENUM_DECLARATION_MEMBERS)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_TS_ENUM_DECLARATION_MEMBERS)
|
||||||
as *mut Vec<TSEnumMember>))
|
as *mut Vec<TSEnumMember>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_ts_enum_member(traverser, item as *mut _, ctx);
|
walk_ts_enum_member(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -3975,8 +3949,8 @@ pub(crate) unsafe fn walk_ts_union_type<'a, Tr: Traverse<'a>>(
|
||||||
node,
|
node,
|
||||||
PhantomData,
|
PhantomData,
|
||||||
)));
|
)));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_UNION_TYPE_TYPES) as *mut Vec<TSType>))
|
for item in
|
||||||
.iter_mut()
|
&mut *((node as *mut u8).add(ancestor::OFFSET_TS_UNION_TYPE_TYPES) as *mut Vec<TSType>)
|
||||||
{
|
{
|
||||||
walk_ts_type(traverser, item as *mut _, ctx);
|
walk_ts_type(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -3993,9 +3967,8 @@ pub(crate) unsafe fn walk_ts_intersection_type<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::TSIntersectionTypeTypes(
|
let pop_token = ctx.push_stack(Ancestor::TSIntersectionTypeTypes(
|
||||||
ancestor::TSIntersectionTypeWithoutTypes(node, PhantomData),
|
ancestor::TSIntersectionTypeWithoutTypes(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_INTERSECTION_TYPE_TYPES)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_TS_INTERSECTION_TYPE_TYPES)
|
||||||
as *mut Vec<TSType>))
|
as *mut Vec<TSType>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_ts_type(traverser, item as *mut _, ctx);
|
walk_ts_type(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -4091,9 +4064,8 @@ pub(crate) unsafe fn walk_ts_tuple_type<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::TSTupleTypeElementTypes(
|
let pop_token = ctx.push_stack(Ancestor::TSTupleTypeElementTypes(
|
||||||
ancestor::TSTupleTypeWithoutElementTypes(node, PhantomData),
|
ancestor::TSTupleTypeWithoutElementTypes(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_TUPLE_TYPE_ELEMENT_TYPES)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_TS_TUPLE_TYPE_ELEMENT_TYPES)
|
||||||
as *mut Vec<TSTupleElement>))
|
as *mut Vec<TSTupleElement>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_ts_tuple_element(traverser, item as *mut _, ctx);
|
walk_ts_tuple_element(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -4418,9 +4390,9 @@ pub(crate) unsafe fn walk_ts_type_parameter_instantiation<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::TSTypeParameterInstantiationParams(
|
let pop_token = ctx.push_stack(Ancestor::TSTypeParameterInstantiationParams(
|
||||||
ancestor::TSTypeParameterInstantiationWithoutParams(node, PhantomData),
|
ancestor::TSTypeParameterInstantiationWithoutParams(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_TYPE_PARAMETER_INSTANTIATION_PARAMS)
|
for item in &mut *((node as *mut u8)
|
||||||
as *mut Vec<TSType>))
|
.add(ancestor::OFFSET_TS_TYPE_PARAMETER_INSTANTIATION_PARAMS)
|
||||||
.iter_mut()
|
as *mut Vec<TSType>)
|
||||||
{
|
{
|
||||||
walk_ts_type(traverser, item as *mut _, ctx);
|
walk_ts_type(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -4467,9 +4439,8 @@ pub(crate) unsafe fn walk_ts_type_parameter_declaration<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::TSTypeParameterDeclarationParams(
|
let pop_token = ctx.push_stack(Ancestor::TSTypeParameterDeclarationParams(
|
||||||
ancestor::TSTypeParameterDeclarationWithoutParams(node, PhantomData),
|
ancestor::TSTypeParameterDeclarationWithoutParams(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_TYPE_PARAMETER_DECLARATION_PARAMS)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_TS_TYPE_PARAMETER_DECLARATION_PARAMS)
|
||||||
as *mut Vec<TSTypeParameter>))
|
as *mut Vec<TSTypeParameter>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_ts_type_parameter(traverser, item as *mut _, ctx);
|
walk_ts_type_parameter(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -4602,9 +4573,8 @@ pub(crate) unsafe fn walk_ts_interface_body<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::TSInterfaceBodyBody(
|
let pop_token = ctx.push_stack(Ancestor::TSInterfaceBodyBody(
|
||||||
ancestor::TSInterfaceBodyWithoutBody(node, PhantomData),
|
ancestor::TSInterfaceBodyWithoutBody(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_INTERFACE_BODY_BODY)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_TS_INTERFACE_BODY_BODY)
|
||||||
as *mut Vec<TSSignature>))
|
as *mut Vec<TSSignature>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_ts_signature(traverser, item as *mut _, ctx);
|
walk_ts_signature(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -4672,9 +4642,8 @@ pub(crate) unsafe fn walk_ts_index_signature<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::TSIndexSignatureParameters(
|
let pop_token = ctx.push_stack(Ancestor::TSIndexSignatureParameters(
|
||||||
ancestor::TSIndexSignatureWithoutParameters(node, PhantomData),
|
ancestor::TSIndexSignatureWithoutParameters(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_INDEX_SIGNATURE_PARAMETERS)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_TS_INDEX_SIGNATURE_PARAMETERS)
|
||||||
as *mut Vec<TSIndexSignatureName>))
|
as *mut Vec<TSIndexSignatureName>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_ts_index_signature_name(traverser, item as *mut _, ctx);
|
walk_ts_index_signature_name(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -4990,9 +4959,8 @@ pub(crate) unsafe fn walk_ts_module_block<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::TSModuleBlockDirectives(
|
let pop_token = ctx.push_stack(Ancestor::TSModuleBlockDirectives(
|
||||||
ancestor::TSModuleBlockWithoutDirectives(node, PhantomData),
|
ancestor::TSModuleBlockWithoutDirectives(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_MODULE_BLOCK_DIRECTIVES)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_TS_MODULE_BLOCK_DIRECTIVES)
|
||||||
as *mut Vec<Directive>))
|
as *mut Vec<Directive>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_directive(traverser, item as *mut _, ctx);
|
walk_directive(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -5015,9 +4983,8 @@ pub(crate) unsafe fn walk_ts_type_literal<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::TSTypeLiteralMembers(
|
let pop_token = ctx.push_stack(Ancestor::TSTypeLiteralMembers(
|
||||||
ancestor::TSTypeLiteralWithoutMembers(node, PhantomData),
|
ancestor::TSTypeLiteralWithoutMembers(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_TYPE_LITERAL_MEMBERS)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_TS_TYPE_LITERAL_MEMBERS)
|
||||||
as *mut Vec<TSSignature>))
|
as *mut Vec<TSSignature>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_ts_signature(traverser, item as *mut _, ctx);
|
walk_ts_signature(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -5139,9 +5106,8 @@ pub(crate) unsafe fn walk_ts_import_attributes<'a, Tr: Traverse<'a>>(
|
||||||
ctx,
|
ctx,
|
||||||
);
|
);
|
||||||
ctx.retag_stack(AncestorType::TSImportAttributesElements);
|
ctx.retag_stack(AncestorType::TSImportAttributesElements);
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_IMPORT_ATTRIBUTES_ELEMENTS)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_TS_IMPORT_ATTRIBUTES_ELEMENTS)
|
||||||
as *mut Vec<TSImportAttribute>))
|
as *mut Vec<TSImportAttribute>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_ts_import_attribute(traverser, item as *mut _, ctx);
|
walk_ts_import_attribute(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -5311,16 +5277,14 @@ pub(crate) unsafe fn walk_ts_template_literal_type<'a, Tr: Traverse<'a>>(
|
||||||
let pop_token = ctx.push_stack(Ancestor::TSTemplateLiteralTypeQuasis(
|
let pop_token = ctx.push_stack(Ancestor::TSTemplateLiteralTypeQuasis(
|
||||||
ancestor::TSTemplateLiteralTypeWithoutQuasis(node, PhantomData),
|
ancestor::TSTemplateLiteralTypeWithoutQuasis(node, PhantomData),
|
||||||
));
|
));
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_TEMPLATE_LITERAL_TYPE_QUASIS)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_TS_TEMPLATE_LITERAL_TYPE_QUASIS)
|
||||||
as *mut Vec<TemplateElement>))
|
as *mut Vec<TemplateElement>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_template_element(traverser, item as *mut _, ctx);
|
walk_template_element(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
ctx.retag_stack(AncestorType::TSTemplateLiteralTypeTypes);
|
ctx.retag_stack(AncestorType::TSTemplateLiteralTypeTypes);
|
||||||
for item in (*((node as *mut u8).add(ancestor::OFFSET_TS_TEMPLATE_LITERAL_TYPE_TYPES)
|
for item in &mut *((node as *mut u8).add(ancestor::OFFSET_TS_TEMPLATE_LITERAL_TYPE_TYPES)
|
||||||
as *mut Vec<TSType>))
|
as *mut Vec<TSType>)
|
||||||
.iter_mut()
|
|
||||||
{
|
{
|
||||||
walk_ts_type(traverser, item as *mut _, ctx);
|
walk_ts_type(traverser, item as *mut _, ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -5616,7 +5580,7 @@ pub(crate) unsafe fn walk_statements<'a, Tr: Traverse<'a>>(
|
||||||
ctx: &mut TraverseCtx<'a>,
|
ctx: &mut TraverseCtx<'a>,
|
||||||
) {
|
) {
|
||||||
traverser.enter_statements(&mut *stmts, ctx);
|
traverser.enter_statements(&mut *stmts, ctx);
|
||||||
for stmt in (*stmts).iter_mut() {
|
for stmt in &mut *stmts {
|
||||||
walk_statement(traverser, stmt, ctx);
|
walk_statement(traverser, stmt, ctx);
|
||||||
}
|
}
|
||||||
traverser.exit_statements(&mut *stmts, ctx);
|
traverser.exit_statements(&mut *stmts, ctx);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue