Skip to content

Use child in fix? #480

Jun 28, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hi, thanks for using ast-grep. You can use relational rule to extract child.

rule:
  any:
    - pattern: '{FooBar: $CHILD}'
    - pattern: '{BarFoo: $CHILD}'
  has:
    pattern: '{ iri: $B, $$$ }'
    stopBy: end
fix: $B

link

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@hobofan
Comment options

@HerringtonDarkholme
Comment options

Answer selected by hobofan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants