Skip to documentation
SLOP

tiny.python.syntax

Reference tiny.python syntax

Defined in tiny.python.

The second stage of the package reads the token list and builds the program's syntax tree: a list of statements, whose expressions are trees of operators and operands.

API (6)

Actions

Public operations.

Types and contracts

Public types and contracts.

Namespaces

Public namespaces.

No direct callersNo direct callstiny.pythonsyntax
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/python/src/root.zig:89

zig
pub const syntax = @import("syntax/root.zig");

Source: lib/python/src/syntax/root.zig

zig
//! The second stage of the package reads the token list and builds the program's syntax tree: a//! list of statements, whose expressions are trees of operators and operands. The compiler needs//! the program's structure with precedence and block nesting already settled, so it can emit//! instructions in one walk over the tree.//!//! One file, `ast`, defines the tree's types. The other file, `parser`, builds the tree through one//! function, `parse`. The namespace re-exports `Program`, `Statement` and `Expression` from `ast`,//! and `parse` from `parser`. The package's `execute` calls `parse` right after `tokenize`. The//! compiler walks the `Program` that `parse` returns.pub const ast = @import("ast.zig");pub const parser = @import("parser.zig");pub const Program = ast.Program;pub const Statement = ast.Statement;pub const Expression = ast.Expression;pub const parse = parser.parse;

Audit

Definitions1
Public names1
Members0
Version26.7.0
Revisiondaab053ee433