(#21373) Fix future parser transformation of node inheritence.

This fixes the broken transformation of node inheritence. The cause
was that Resource::Type only handles an AST::Regexp as a special
case and expects the :parent option to be a String otherwise.

The transformer passed an ASTString (or other AST objects) which
caused the reported problem.

This fix also includes validation of the node parent (it was missing
in the 3x checker).