Extract parent/child path repair logic into a helper function.
Extract parent/child path repair logic into a helper function.

cpojer/ast-types,benjamn/ast-types,jamestalmage/ast-types,benjamn/ast-types,benjamn/ast-types,marcioj/ast-types,gabelevi/ast-types