OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Why is the "follows" rule not matched in ast-grep for two consecutive identifiers?

  • Thread starter Thread starter Johannes Schaub - litb
  • Start date Start date
J

Johannes Schaub - litb

Guest
Why is the follows: kind: identifier relation not matched for c which immediately follows b according to the Treesitter AST?

Code:
def f(a):
  b, c

Rule:

Code:
id: example
language: py
rule:
  kind: identifier
  follows:
    kind: identifier

Playground:

Playground link
<p>Why is the <code>follows: kind: identifier</code> relation not matched for <code>c</code> which immediately follows <code>b</code> according to the Treesitter AST?</p>
<pre><code>def f(a):
b, c
</code></pre>
<p>Rule:</p>
<pre><code>id: example
language: py
rule:
kind: identifier
follows:
kind: identifier
</code></pre>
<p>Playground:</p>
<p><a href="https://ast-grep.github.io/playgrou...ic291cmNlIjoiZGVmIGYoYSk6XG4gIGIsIGNcblxuIn0=" rel="nofollow noreferrer">Playground link</a></p>
 

Latest posts

Top