Skip to main content

Module statements

Module statements 

Source
Expand description

Splitting a block into statements: the line rules of SST.

A statement ends at the end of its line. It continues onto the next line only while a (, [, or { is open, like implicit line joining in Python; there is no \ continuation and no statement terminator. A comment runs from ; to the end of the line, except inside a "…" string literal. Indentation and spacing carry no meaning, and \r\n is a newline.

statements is a pre-pass: it finds each statement’s span in the block and leaves the statement text untouched, so the derived parsers run over a slice of the original text and every span they report is a block offset. A comment inside a bracket-continued statement stays in its slice, where the trivia of collections and records skips it.

Structs§

Statement
One statement of a block.
Statements
The statements of a block and its bracket errors.

Functions§

statements
Split text into statements. first_line is the file line of the start of text, used in error messages.