{ } Raw JSON

bundles / papyri latest / papyri / ts / Node

class

papyri.ts:Node

source: /papyri/ts.py :54

Signature

class   Node ( node : Any * _with_whitespace : bool = True )  →  None

Members

Summary

A wrapper around tree sitter Nodes to slightly modify behavior.

Extended Summary

In particular we want to be able to extract whitespace information, which is made hard by tree sitter.

So we intercept iterating through children, and if the bytes start/stop don't match, we insert a fake Whitespace node that has similar api to tree sitter official nodes.

Aliases

  • papyri.ts.Node