- Parent the addr eand assignment `Expression`s of a `PointerDereferenceAssignment`
This commit is contained in:
Tristan B. Velloza Kildaire 2024-04-24 14:28:45 +02:00
parent 7e958c5658
commit ed346116a8
1 changed files with 15 additions and 0 deletions

View File

@ -2029,6 +2029,21 @@ public final class Parser
parentToContainer(container, [varAssExp]);
}
/**
* If we have a `PointerDereferenceAssignment`
* then we must parent its left-hand and right-hand
* side expressions (the expression the address
* is derived from) and (the expression being
* assigned)
*/
else if(cast(PointerDereferenceAssignment)statement)
{
PointerDereferenceAssignment ptrDerefAss = cast(PointerDereferenceAssignment)statement;
Expression addrExp = ptrDerefAss.getPointerExpression();
Expression assExp = ptrDerefAss.getExpression();
parentToContainer(container, [addrExp, assExp]);
}
/**
* If we have a `FunctionCall`
* expression