scikit_build_core.ast package

Submodules

scikit_build_core.ast.ast module

class scikit_build_core.ast.ast.Block(name, value, start, stop, contents)[source]

Bases: Node

contents: list[Node]
class scikit_build_core.ast.ast.Node(name, value, start, stop)[source]

Bases: object

name: str
start: int
stop: int
value: str
scikit_build_core.ast.ast.parse(tokens, stop='')[source]

Generate a stream of nodes from a stream of tokens. This currently bundles all block-like functions into a single Block node, but this could be changed to be more specific eventually if needed.

Return type:

Generator[Node, None, None]

scikit_build_core.ast.tokenizer module

class scikit_build_core.ast.tokenizer.Token(type, start, stop, value)[source]

Bases: object

start: int
stop: int
type: TokenType
value: str
class scikit_build_core.ast.tokenizer.TokenType(value)[source]

Bases: Enum

BRACKET_COMMENT = 1
BRACKET_QUOTE = 5
CLOSE_PAREN = 8
COMMENT = 2
LEGACY = 6
OPEN_PAREN = 7
QUOTED = 4
UNQUOTED = 3
WHITESPACE = 9
scikit_build_core.ast.tokenizer.tokenize(contents)[source]
Return type:

Generator[Token, None, None]