Python bindings for Tree-Sitter Talon

Tree-Sitter Instances

tree_sitter_talon.language = <tree_sitter_talon._internal.core.TalonLanguage object>
tree_sitter_talon.parser = <tree_sitter.Parser object>

A parser

Parsing and Converting to AST

tree_sitter_talon.parse(contents: str | bytes, *, encoding: str = 'utf-8', filename: str | None = None, raise_parse_error: bool = False) Node | Sequence[Node] | None
Parameters:
  • contents (str | bytes)

  • encoding (str)

  • filename (str | None)

  • raise_parse_error (bool)

Return type:

Node | Sequence[Node] | None

tree_sitter_talon.parse_file(path: str | Path, *, encoding: str = 'utf-8', raise_parse_error: bool = False) Node | Sequence[Node] | None
Parameters:
  • path (str | Path)

  • encoding (str)

  • raise_parse_error (bool)

Return type:

Node | Sequence[Node] | None

tree_sitter_talon.from_tree_sitter(tsvalue: Tree | Node | TreeCursor, *, encoding: str = 'utf-8', filename: str | None = None, raise_parse_error: bool = False) Node
Parameters:
  • tsvalue (Tree | Node | TreeCursor)

  • encoding (str)

  • filename (str | None)

  • raise_parse_error (bool)

Return type:

Node

Talon Abstract Syntax Tree Nodes

All AST nodes inherit from the Node class.

class tree_sitter_talon.Node(text: str, type_name: str, start_position: Point, end_position: Point)

Nodes store the following information the text and the start and end positions corresponding to this node in the source file, as well as the tree-sitter name for the node type:

Parameters:
  • text (str)

  • type_name (str)

  • start_position (Point)

  • end_position (Point)

text: str
start_position: Point
end_position: Point
type_name: str

Nodes can be converted to and from JSON.

to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: str | int | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str
Parameters:
  • skipkeys (bool)

  • ensure_ascii (bool)

  • check_circular (bool)

  • allow_nan (bool)

  • indent (str | int | None)

  • separators (Tuple[str, str] | None)

  • default (Callable | None)

  • sort_keys (bool)

Return type:

str

classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
Parameters:

s (str | bytes | bytearray)

Return type:

A

Nodes can be converted to and from a Python dictionary.

to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
Return type:

Dict[str, dict | list | str | int | float | bool | None]

classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
Parameters:

kvs (dict | list | str | int | float | bool | None)

Return type:

A

Nodes types are associated with a JSON schema, which can be used, amongst other things, to load multiple nodes from a file.

source_files: List[SourceFile] = (
   SourceFile.schema().loads(json, many=True)
)
classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
Parameters:
  • infer_missing (bool)

  • many (bool)

  • partial (bool)

Return type:

SchemaF[A]

There are two subclasses of Node:

class tree_sitter_talon.Leaf(text: str, type_name: str, start_position: Point, end_position: Point)

Leaf nodes have no fields other than those inherited from Node.

Parameters:
  • text (str)

  • type_name (str)

  • start_position (Point)

  • end_position (Point)

class tree_sitter_talon.Branch(text: str, type_name: str, start_position: Point, end_position: Point, children: NoneType | Node | Sequence[Node])

Branch nodes are guaranteed to have a field children, as well as other fields corresponding to the named fields in the tree-sitter grammar.

Each subclass provides a more specific typing for children, including None if the subclass only has named fields.

Parameters:
  • text (str)

  • type_name (str)

  • start_position (Point)

  • end_position (Point)

  • children (None | Node | Sequence[Node])

children: None | Node | Sequence[Node]

Each explicit node in the tree-sitter grammar corresponds to a dataclass.

class tree_sitter_talon.TalonSourceFile(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonDeclarations'), ForwardRef('TalonMatches'), ForwardRef('TalonComment'), ForwardRef('TalonError')]])
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonDeclarations | TalonMatches | TalonComment | TalonError]
find_command(text: Sequence[str], *, fullmatch: bool = False, get_capture: Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None = None, get_list: Callable[[str], List[str] | Dict[str, Any] | None] | None = None) TalonCommandDeclaration | None
Parameters:
Return type:

TalonCommandDeclaration | None

get_docstring() str | None
Parameters:

self (TalonSourceFile)

Return type:

str | None

class tree_sitter_talon.TalonComment(text: str, type_name: str, start_position: Point, end_position: Point)
Parameters:
  • text (str)

  • type_name (str)

  • start_position (Point)

  • end_position (Point)

assert_equivalent(other: Node) None
Parameters:
Return type:

None

get_docstring() str | None
Parameters:

self (TalonComment)

Return type:

str | None

tree_sitter_talon.TalonError

alias of ParseError

class tree_sitter_talon.TalonMatches(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonMatch'), ForwardRef('TalonComment'), ForwardRef('TalonError')]])
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonMatch | TalonComment | TalonError]
is_explicit() bool
Parameters:

self (TalonMatches)

Return type:

bool

class tree_sitter_talon.TalonMatch(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonComment'), ForwardRef('TalonError')]], left: 'TalonIdentifier', modifiers: List[ForwardRef('TalonMatchModifier')], right: 'TalonImplicitString')
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonComment | TalonError]
property key: TalonIdentifier
left: TalonIdentifier
property modifier: Sequence[TalonMatchModifier]
modifiers: List[TalonMatchModifier]
property pattern: TalonImplicitString
right: TalonImplicitString
class tree_sitter_talon.TalonMatchModifier(text: str, type_name: str, start_position: Point, end_position: Point)
Parameters:
  • text (str)

  • type_name (str)

  • start_position (Point)

  • end_position (Point)

assert_equivalent(other: Node) None
Parameters:
Return type:

None

class tree_sitter_talon.TalonDeclaration(text: str, type_name: str, start_position: Point, end_position: Point)
Parameters:
  • text (str)

  • type_name (str)

  • start_position (Point)

  • end_position (Point)

class tree_sitter_talon.TalonCommandDeclaration(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonComment'), ForwardRef('TalonError')]], left: 'TalonRule', right: 'TalonBlock')
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonComment | TalonError]
get_docstring() str | None
Parameters:

self (TalonCommandDeclaration)

Return type:

str | None

is_short() bool
Parameters:

self (TalonCommandDeclaration)

Return type:

bool

left: TalonRule
match(text: Sequence[str], *, fullmatch: bool = False, get_capture: Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None = None, get_list: Callable[[str], List[str] | Dict[str, Any] | None] | None = None) bool
Parameters:
Return type:

bool

right: TalonBlock
property rule: TalonRule
property script: TalonBlock
class tree_sitter_talon.TalonKeyBindingDeclaration(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonComment'), ForwardRef('TalonError')]], left: 'TalonKeyAction', right: 'TalonBlock')
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonComment | TalonError]
is_short() bool
Parameters:

self (TalonKeyBindingDeclaration)

Return type:

bool

property key: TalonKeyAction
left: TalonKeyAction
right: TalonBlock
property script: TalonBlock
class tree_sitter_talon.TalonSettingsDeclaration(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonComment'), ForwardRef('TalonError')]], right: 'TalonBlock')
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonComment | TalonError]
is_short() bool
Parameters:

self (TalonSettingsDeclaration)

Return type:

bool

right: TalonBlock
class tree_sitter_talon.TalonTagImportDeclaration(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonComment'), ForwardRef('TalonError')]], right: 'TalonIdentifier')
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonComment | TalonError]
right: TalonIdentifier
property tag: TalonIdentifier
class tree_sitter_talon.TalonCapture(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonComment'), ForwardRef('TalonError')]], capture_name: 'TalonIdentifier')
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

capture_name: TalonIdentifier
children: List[TalonComment | TalonError]
match(text: Sequence[str], *, fullmatch: bool = False, get_capture: Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None = None, get_list: Callable[[str], List[str] | Dict[str, Any] | None] | None = None) bool
Parameters:
Return type:

bool

class tree_sitter_talon.TalonChoice(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonCapture'), ForwardRef('TalonEndAnchor'), ForwardRef('TalonList'), ForwardRef('TalonOptional'), ForwardRef('TalonParenthesizedRule'), ForwardRef('TalonRepeat'), ForwardRef('TalonRepeat1'), ForwardRef('TalonSeq'), ForwardRef('TalonStartAnchor'), ForwardRef('TalonWord'), ForwardRef('TalonComment'), ForwardRef('TalonError')]])
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonCapture | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonSeq | TalonStartAnchor | TalonWord | TalonComment | TalonError]
match(text: Sequence[str], *, fullmatch: bool = False, get_capture: Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None = None, get_list: Callable[[str], List[str] | Dict[str, Any] | None] | None = None) bool
Parameters:
Return type:

bool

class tree_sitter_talon.TalonEndAnchor(text: str, type_name: str, start_position: Point, end_position: Point)
Parameters:
  • text (str)

  • type_name (str)

  • start_position (Point)

  • end_position (Point)

assert_equivalent(other: Node) None
Parameters:
Return type:

None

match(text: Sequence[str], *, fullmatch: bool = False, get_capture: Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None = None, get_list: Callable[[str], List[str] | Dict[str, Any] | None] | None = None) bool
Parameters:
Return type:

bool

class tree_sitter_talon.TalonList(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonComment'), ForwardRef('TalonError')]], list_name: 'TalonIdentifier')
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonComment | TalonError]
list_name: TalonIdentifier
match(text: Sequence[str], *, fullmatch: bool = False, get_capture: Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None = None, get_list: Callable[[str], List[str] | Dict[str, Any] | None] | None = None) bool
Parameters:
Return type:

bool

class tree_sitter_talon.TalonOptional(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonCapture'), ForwardRef('TalonChoice'), ForwardRef('TalonEndAnchor'), ForwardRef('TalonList'), ForwardRef('TalonOptional'), ForwardRef('TalonParenthesizedRule'), ForwardRef('TalonRepeat'), ForwardRef('TalonRepeat1'), ForwardRef('TalonSeq'), ForwardRef('TalonStartAnchor'), ForwardRef('TalonWord'), ForwardRef('TalonComment'), ForwardRef('TalonError')]])
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonSeq | TalonStartAnchor | TalonWord | TalonComment | TalonError]
get_child() Node

Get the only non-extra child of a branch node.

Parameters:

self (Node)

Return type:

Node

match(text: Sequence[str], *, fullmatch: bool = False, get_capture: Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None = None, get_list: Callable[[str], List[str] | Dict[str, Any] | None] | None = None) bool
Parameters:
Return type:

bool

class tree_sitter_talon.TalonParenthesizedRule(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonCapture'), ForwardRef('TalonChoice'), ForwardRef('TalonEndAnchor'), ForwardRef('TalonList'), ForwardRef('TalonOptional'), ForwardRef('TalonParenthesizedRule'), ForwardRef('TalonRepeat'), ForwardRef('TalonRepeat1'), ForwardRef('TalonSeq'), ForwardRef('TalonStartAnchor'), ForwardRef('TalonWord'), ForwardRef('TalonComment'), ForwardRef('TalonError')]])
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonSeq | TalonStartAnchor | TalonWord | TalonComment | TalonError]
get_child() Node

Get the only non-extra child of a branch node.

Parameters:

self (Node)

Return type:

Node

match(text: Sequence[str], *, fullmatch: bool = False, get_capture: Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None = None, get_list: Callable[[str], List[str] | Dict[str, Any] | None] | None = None) bool
Parameters:
Return type:

bool

class tree_sitter_talon.TalonRepeat(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonCapture'), ForwardRef('TalonList'), ForwardRef('TalonOptional'), ForwardRef('TalonParenthesizedRule'), ForwardRef('TalonRepeat'), ForwardRef('TalonRepeat1'), ForwardRef('TalonWord'), ForwardRef('TalonComment'), ForwardRef('TalonError')]])
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonCapture | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonWord | TalonComment | TalonError]
get_child() Node

Get the only non-extra child of a branch node.

Parameters:

self (Node)

Return type:

Node

match(text: Sequence[str], *, fullmatch: bool = False, get_capture: Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None = None, get_list: Callable[[str], List[str] | Dict[str, Any] | None] | None = None) bool
Parameters:
Return type:

bool

class tree_sitter_talon.TalonRepeat1(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonCapture'), ForwardRef('TalonList'), ForwardRef('TalonOptional'), ForwardRef('TalonParenthesizedRule'), ForwardRef('TalonRepeat'), ForwardRef('TalonRepeat1'), ForwardRef('TalonWord'), ForwardRef('TalonComment'), ForwardRef('TalonError')]])
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonCapture | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonWord | TalonComment | TalonError]
get_child() Node

Get the only non-extra child of a branch node.

Parameters:

self (Node)

Return type:

Node

match(text: Sequence[str], *, fullmatch: bool = False, get_capture: Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None = None, get_list: Callable[[str], List[str] | Dict[str, Any] | None] | None = None) bool
Parameters:
Return type:

bool

class tree_sitter_talon.TalonRule(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonCapture'), ForwardRef('TalonChoice'), ForwardRef('TalonEndAnchor'), ForwardRef('TalonList'), ForwardRef('TalonOptional'), ForwardRef('TalonParenthesizedRule'), ForwardRef('TalonRepeat'), ForwardRef('TalonRepeat1'), ForwardRef('TalonSeq'), ForwardRef('TalonStartAnchor'), ForwardRef('TalonWord'), ForwardRef('TalonComment'), ForwardRef('TalonError')]])
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonSeq | TalonStartAnchor | TalonWord | TalonComment | TalonError]
match(text: Sequence[str], *, fullmatch: bool = False, get_capture: Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None = None, get_list: Callable[[str], List[str] | Dict[str, Any] | None] | None = None) bool
Parameters:
Return type:

bool

class tree_sitter_talon.TalonSeq(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonCapture'), ForwardRef('TalonList'), ForwardRef('TalonOptional'), ForwardRef('TalonParenthesizedRule'), ForwardRef('TalonRepeat'), ForwardRef('TalonRepeat1'), ForwardRef('TalonWord'), ForwardRef('TalonComment'), ForwardRef('TalonError')]])
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonCapture | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonWord | TalonComment | TalonError]
match(text: Sequence[str], *, fullmatch: bool = False, get_capture: Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None = None, get_list: Callable[[str], List[str] | Dict[str, Any] | None] | None = None) bool
Parameters:
Return type:

bool

class tree_sitter_talon.TalonStartAnchor(text: str, type_name: str, start_position: Point, end_position: Point)
Parameters:
  • text (str)

  • type_name (str)

  • start_position (Point)

  • end_position (Point)

assert_equivalent(other: Node) None
Parameters:
Return type:

None

match(text: Sequence[str], *, fullmatch: bool = False, get_capture: Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None = None, get_list: Callable[[str], List[str] | Dict[str, Any] | None] | None = None) bool
Parameters:
Return type:

bool

class tree_sitter_talon.TalonWord(text: str, type_name: str, start_position: Point, end_position: Point)
Parameters:
  • text (str)

  • type_name (str)

  • start_position (Point)

  • end_position (Point)

assert_equivalent(other: Node) None
Parameters:
Return type:

None

match(text: Sequence[str], *, fullmatch: bool = False, get_capture: Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None = None, get_list: Callable[[str], List[str] | Dict[str, Any] | None] | None = None) bool
Parameters:
Return type:

bool

class tree_sitter_talon.TalonStatement(text: str, type_name: str, start_position: Point, end_position: Point)
Parameters:
  • text (str)

  • type_name (str)

  • start_position (Point)

  • end_position (Point)

class tree_sitter_talon.TalonAssignmentStatement(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonComment'), ForwardRef('TalonError')]], left: 'TalonIdentifier', right: 'TalonExpression')
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonComment | TalonError]
left: TalonIdentifier
right: TalonExpression
class tree_sitter_talon.TalonExpressionStatement(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonComment'), ForwardRef('TalonError')]], expression: 'TalonExpression')
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonComment | TalonError]
expression: TalonExpression
class tree_sitter_talon.TalonBlock(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonStatement'), ForwardRef('TalonComment'), ForwardRef('TalonError')]])
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonStatement | TalonComment | TalonError]
is_short() bool
Parameters:

self (TalonBlock)

Return type:

bool

class tree_sitter_talon.TalonExpression(text: str, type_name: str, start_position: Point, end_position: Point)
Parameters:
  • text (str)

  • type_name (str)

  • start_position (Point)

  • end_position (Point)

class tree_sitter_talon.TalonAction(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonComment'), ForwardRef('TalonError')]], action_name: 'TalonIdentifier', arguments: 'TalonArgumentList')
Parameters:
action_name: TalonIdentifier
arguments: TalonArgumentList
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonComment | TalonError]
class tree_sitter_talon.TalonArgumentList(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonExpression'), ForwardRef('TalonComment'), ForwardRef('TalonError')]])
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonExpression | TalonComment | TalonError]
class tree_sitter_talon.TalonBinaryOperator(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonComment'), ForwardRef('TalonError')]], left: 'TalonExpression', operator: 'TalonOperator', right: 'TalonExpression')
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonComment | TalonError]
left: TalonExpression
operator: TalonOperator
right: TalonExpression
class tree_sitter_talon.TalonUnaryOperator(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonComment'), ForwardRef('TalonError')]], operator: 'TalonOperator', right: 'TalonExpression')
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonComment | TalonError]
operator: TalonOperator
right: TalonExpression
class tree_sitter_talon.TalonKeyAction(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonComment'), ForwardRef('TalonError')]], arguments: 'TalonImplicitString')
Parameters:
arguments: TalonImplicitString
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonComment | TalonError]
class tree_sitter_talon.TalonParenthesizedExpression(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonExpression'), ForwardRef('TalonComment'), ForwardRef('TalonError')]])
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonExpression | TalonComment | TalonError]
get_child() Node

Get the only non-extra child of a branch node.

Parameters:

self (Node)

Return type:

Node

class tree_sitter_talon.TalonSleepAction(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonComment'), ForwardRef('TalonError')]], arguments: 'TalonImplicitString')
Parameters:
arguments: TalonImplicitString
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonComment | TalonError]
class tree_sitter_talon.TalonVariable(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonComment'), ForwardRef('TalonError')]], variable_name: 'TalonIdentifier')
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonComment | TalonError]
variable_name: TalonIdentifier
class tree_sitter_talon.TalonIdentifier(text: str, type_name: str, start_position: Point, end_position: Point)
Parameters:
  • text (str)

  • type_name (str)

  • start_position (Point)

  • end_position (Point)

assert_equivalent(other: Node) None
Parameters:
Return type:

None

class tree_sitter_talon.TalonOperator(text: str, type_name: str, start_position: Point, end_position: Point)
Parameters:
  • text (str)

  • type_name (str)

  • start_position (Point)

  • end_position (Point)

assert_equivalent(other: Node) None
Parameters:
Return type:

None

class tree_sitter_talon.TalonImplicitString(text: str, type_name: str, start_position: Point, end_position: Point)
Parameters:
  • text (str)

  • type_name (str)

  • start_position (Point)

  • end_position (Point)

assert_equivalent(other: Node) None
Parameters:
Return type:

None

class tree_sitter_talon.TalonInterpolation(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonExpression'), ForwardRef('TalonComment'), ForwardRef('TalonError')]])
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonExpression | TalonComment | TalonError]
get_child() Node

Get the only non-extra child of a branch node.

Parameters:

self (Node)

Return type:

Node

class tree_sitter_talon.TalonString(text: str, type_name: str, start_position: Point, end_position: Point, children: List[Union[ForwardRef('TalonInterpolation'), ForwardRef('TalonStringContent'), ForwardRef('TalonStringEscapeSequence'), ForwardRef('TalonComment'), ForwardRef('TalonError')]])
Parameters:
assert_equivalent(other: Node) None
Parameters:
Return type:

None

children: List[TalonInterpolation | TalonStringContent | TalonStringEscapeSequence | TalonComment | TalonError]
class tree_sitter_talon.TalonStringContent(text: str, type_name: str, start_position: Point, end_position: Point)
Parameters:
  • text (str)

  • type_name (str)

  • start_position (Point)

  • end_position (Point)

assert_equivalent(other: Node) None
Parameters:
Return type:

None

class tree_sitter_talon.TalonStringEscapeSequence(text: str, type_name: str, start_position: Point, end_position: Point)
Parameters:
  • text (str)

  • type_name (str)

  • start_position (Point)

  • end_position (Point)

assert_equivalent(other: Node) None
Parameters:
Return type:

None

class tree_sitter_talon.TalonFloat(text: str, type_name: str, start_position: Point, end_position: Point)
Parameters:
  • text (str)

  • type_name (str)

  • start_position (Point)

  • end_position (Point)

assert_equivalent(other: Node) None
Parameters:
Return type:

None

class tree_sitter_talon.TalonInteger(text: str, type_name: str, start_position: Point, end_position: Point)
Parameters:
  • text (str)

  • type_name (str)

  • start_position (Point)

  • end_position (Point)

assert_equivalent(other: Node) None
Parameters:
Return type:

None

class tree_sitter_talon.TalonNumber(text: str, type_name: str, start_position: Point, end_position: Point)
Parameters:
  • text (str)

  • type_name (str)

  • start_position (Point)

  • end_position (Point)

Helper Classes

class tree_sitter_talon.Point(line: int, column: int)
Parameters:
  • line (int)

  • column (int)