warp icon indicating copy to clipboard operation
warp copied to clipboard

getContaining methods refactoring

Open cicr99 opened this issue 3 years ago • 1 comments

There were many places in the code where the closest parent which was a FunctionDefinition was wanted and then there was an assertion checking this parent node was not undefined. Also there were two methods, which enclosed this behavior, so they were the same, in different parts of the code. This PR creates a method getContainingFunction for these cases, that is placed in the utils folder of the passes. A similar situation occurred with SourceUnit, so a getContainingSourceUnit method was created the same way.

cicr99 avatar Aug 09 '22 13:08 cicr99

This must have been super satisfying. I will kick off Sem Tests and then this can go in.

GuyMcComb avatar Aug 11 '22 09:08 GuyMcComb

Sem tests pass.

GuyMcComb avatar Aug 15 '22 13:08 GuyMcComb