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 ¶
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:
- text: str¶
- 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.
- 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:
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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonDeclarations | TalonMatches | TalonComment | TalonError])
- 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:
self (TalonSourceFile)
text (Sequence[str])
fullmatch (bool)
get_capture (Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None)
get_list (Callable[[str], List[str] | Dict[str, Any] | None] | None)
- 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)¶
-
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonMatch | TalonComment | TalonError])
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonComment | TalonError])
left (TalonIdentifier)
modifiers (List[TalonMatchModifier])
right (TalonImplicitString)
- 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)¶
- class tree_sitter_talon.TalonDeclaration(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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (Sequence[TalonComment] | None)
left (TalonRule)
right (TalonBlock)
- children: List[TalonComment | TalonError]¶
- get_docstring() str | None ¶
- Parameters:
self (TalonCommandDeclaration)
- Return type:
str | None
- is_short() bool ¶
- Parameters:
self (TalonCommandDeclaration)
- Return type:
bool
- 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:
self (TalonCommandDeclaration | TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord)
text (Sequence[str])
fullmatch (bool)
get_capture (Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None)
get_list (Callable[[str], List[str] | Dict[str, Any] | None] | None)
- Return type:
bool
- right: TalonBlock¶
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (Sequence[TalonComment] | None)
left (TalonKeyAction)
right (TalonBlock)
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (Sequence[TalonComment] | None)
right (TalonBlock)
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonComment | TalonError])
right (TalonIdentifier)
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonComment | TalonError])
capture_name (TalonIdentifier)
- 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:
self (TalonCommandDeclaration | TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord)
text (Sequence[str])
fullmatch (bool)
get_capture (Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None)
get_list (Callable[[str], List[str] | Dict[str, Any] | None] | None)
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonCapture | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonSeq | TalonStartAnchor | TalonWord | TalonComment | TalonError])
- 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:
self (TalonCommandDeclaration | TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord)
text (Sequence[str])
fullmatch (bool)
get_capture (Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None)
get_list (Callable[[str], List[str] | Dict[str, Any] | None] | None)
- Return type:
bool
- class tree_sitter_talon.TalonEndAnchor(text: str, type_name: str, start_position: Point, end_position: Point)¶
-
- 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:
self (TalonCommandDeclaration | TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord)
text (Sequence[str])
fullmatch (bool)
get_capture (Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None)
get_list (Callable[[str], List[str] | Dict[str, Any] | None] | None)
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonComment | TalonError])
list_name (TalonIdentifier)
- 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:
self (TalonCommandDeclaration | TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord)
text (Sequence[str])
fullmatch (bool)
get_capture (Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None)
get_list (Callable[[str], List[str] | Dict[str, Any] | None] | None)
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonSeq | TalonStartAnchor | TalonWord | TalonComment | TalonError])
- 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:
self (TalonCommandDeclaration | TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord)
text (Sequence[str])
fullmatch (bool)
get_capture (Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None)
get_list (Callable[[str], List[str] | Dict[str, Any] | None] | None)
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonSeq | TalonStartAnchor | TalonWord | TalonComment | TalonError])
- 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:
self (TalonCommandDeclaration | TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord)
text (Sequence[str])
fullmatch (bool)
get_capture (Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None)
get_list (Callable[[str], List[str] | Dict[str, Any] | None] | None)
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonCapture | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonWord | TalonComment | TalonError])
- 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:
self (TalonCommandDeclaration | TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord)
text (Sequence[str])
fullmatch (bool)
get_capture (Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None)
get_list (Callable[[str], List[str] | Dict[str, Any] | None] | None)
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonCapture | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonWord | TalonComment | TalonError])
- 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:
self (TalonCommandDeclaration | TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord)
text (Sequence[str])
fullmatch (bool)
get_capture (Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None)
get_list (Callable[[str], List[str] | Dict[str, Any] | None] | None)
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonSeq | TalonStartAnchor | TalonWord | TalonComment | TalonError])
- 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:
self (TalonCommandDeclaration | TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord)
text (Sequence[str])
fullmatch (bool)
get_capture (Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None)
get_list (Callable[[str], List[str] | Dict[str, Any] | None] | None)
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonCapture | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonWord | TalonComment | TalonError])
- 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:
self (TalonCommandDeclaration | TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord)
text (Sequence[str])
fullmatch (bool)
get_capture (Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None)
get_list (Callable[[str], List[str] | Dict[str, Any] | None] | None)
- Return type:
bool
- class tree_sitter_talon.TalonStartAnchor(text: str, type_name: str, start_position: Point, end_position: Point)¶
-
- 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:
self (TalonCommandDeclaration | TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord)
text (Sequence[str])
fullmatch (bool)
get_capture (Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None)
get_list (Callable[[str], List[str] | Dict[str, Any] | None] | None)
- Return type:
bool
- class tree_sitter_talon.TalonWord(text: str, type_name: str, start_position: Point, end_position: Point)¶
-
- 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:
self (TalonCommandDeclaration | TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord)
text (Sequence[str])
fullmatch (bool)
get_capture (Callable[[str], TalonCapture | TalonChoice | TalonEndAnchor | TalonList | TalonOptional | TalonParenthesizedRule | TalonRepeat | TalonRepeat1 | TalonRule | TalonSeq | TalonStartAnchor | TalonWord | None] | None)
get_list (Callable[[str], List[str] | Dict[str, Any] | None] | None)
- Return type:
bool
- class tree_sitter_talon.TalonStatement(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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonComment | TalonError])
left (TalonIdentifier)
right (TalonExpression)
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonComment | TalonError])
expression (TalonExpression)
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonStatement | TalonComment | TalonError])
- 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)¶
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonComment | TalonError])
action_name (TalonIdentifier)
arguments (TalonArgumentList)
- action_name: TalonIdentifier¶
- arguments: TalonArgumentList¶
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonExpression | TalonComment | TalonError])
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonComment | TalonError])
left (TalonExpression)
operator (TalonOperator)
right (TalonExpression)
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonComment | TalonError])
operator (TalonOperator)
right (TalonExpression)
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonComment | TalonError])
arguments (TalonImplicitString)
- arguments: TalonImplicitString¶
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonExpression | TalonComment | TalonError])
- children: List[TalonExpression | TalonComment | TalonError]¶
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonComment | TalonError])
arguments (TalonImplicitString)
- arguments: TalonImplicitString¶
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonComment | TalonError])
variable_name (TalonIdentifier)
- children: List[TalonComment | TalonError]¶
- variable_name: TalonIdentifier¶
- class tree_sitter_talon.TalonIdentifier(text: str, type_name: str, start_position: Point, end_position: Point)¶
- class tree_sitter_talon.TalonOperator(text: str, type_name: str, start_position: Point, end_position: Point)¶
- class tree_sitter_talon.TalonImplicitString(text: str, type_name: str, start_position: Point, end_position: Point)¶
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonExpression | TalonComment | TalonError])
- children: List[TalonExpression | TalonComment | TalonError]¶
- 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:
text (str)
type_name (str)
start_position (Point)
end_position (Point)
children (List[TalonInterpolation | TalonStringContent | TalonStringEscapeSequence | TalonComment | TalonError])
- children: List[TalonInterpolation | TalonStringContent | TalonStringEscapeSequence | TalonComment | TalonError]¶
- class tree_sitter_talon.TalonStringContent(text: str, type_name: str, start_position: Point, end_position: Point)¶
- class tree_sitter_talon.TalonStringEscapeSequence(text: str, type_name: str, start_position: Point, end_position: Point)¶
- class tree_sitter_talon.TalonFloat(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)