estools/esquery

Add support for AST token matching

jrfeenst opened this issue · 0 comments

Adding token matching is useful for a few cases where things like whitespace are important but not represented in the AST.

Possible pseudo selectors:

  • :token(type, value) - token inside the node
  • :nth-token(n, type, value) - token inside or around the associated node (n tokens)
  • :nth-token-before(n, type, value) - token before the associated node (n tokens)
  • :nth-token-after(n, type, value) - token after the associated node (n tokens)