Question: Is it possible to make the findWrapping method support the specification of the attributes of the inner node?Is there anything else I need to pay attention to?
Looking forward to hearing different opinions from everyone, thank you~
Question: Is it possible to make the findWrapping method support the specification of the attributes of the inner node?Is there anything else I need to pay attention to?
Looking forward to hearing different opinions from everyone, thank you~
You could take the array returned by findWrapping
and build a new one with the same type
fields but different attrs
, and then pass that to wrap
.
Thanks for the reply! This works, but it means I need to write separate if else checks, which makes some methods less general. So I’m thinking that if the findWrapping method can support types like Map<type, Attrs>, it might be more general.