fst.common
Low level common data and functions that are not part of or aware of the FST class.
class
NodeError(builtins.Exception):
General FST node error.
class
astfield(typing.NamedTuple):
Name and optional index indicating a field location in an AST (or FST) node.
def
get( self, parent: ast.AST) -> ast.AST | ellipsis | int | float | complex | str | bytes | bool | None:
Get child node at this field in the given parent.
def
get_default( self, parent: ast.AST, default: ast.AST | ellipsis | int | float | complex | str | bytes | bool | None = False) -> ast.AST | ellipsis | int | float | complex | str | bytes | bool | None:
Get child node at this field in the given parent. Return default if not found instead of raising
AttributError or IndexError, False works well because not normally found in locations where AST nodes
can reside in AST trees.
class
fstloc(typing.NamedTuple):
Full location span.
class
fstlocn(typing.NamedTuple):
Version of fstloc with a namespace, used for pars().n.