Skip to main content

Module parser

Module parser 

Source
Expand description

Tokenizer, recursive-descent parser, and Stmt AST.

Enums§

Stmt
Top-level statement returned by parse and parse_stmts.

Functions§

block_depth_delta
Returns the net block-depth change for a single (comment-stripped, trimmed) line.
is_partial
Returns true if the input looks like a partial expression (i.e. starts with an operator that needs a left-hand operand).
is_single_line_block
Returns true when line is a self-contained single-line block, e.g. if cond; body; end. These lines start with a block-opening keyword but also close themselves with end / until in the same line, so they do not need multi-line buffering.
parse
Parses a full input string into a Stmt.
parse_stmts
Parses a multi-line block string into a sequence of (Stmt, silent) pairs.
split_stmts
Splits a raw input line into (statement_str, silent) pairs.