Skip to main content

Module parser

Module parser 

Source
Expand description

Recursive-descent parser with Pratt expressions.

Layout: the token stream contains Newline tokens. Inside (, [ and dimension-argument {…} the parser is in free mode and newlines are skipped; in function bodies, module bodies and configuration blocks it is in lines mode, where an expression ends at a newline unless the next token is a binary operator that cannot begin an expression (see expr.rs). Declarations recover at the next declaration keyword at column 0.

Functions§

parse_file
Parse one file. Lexer and parser diagnostics are returned together; the program is returned even when there are errors (with the failing declarations dropped) so that later phases can still report on the rest.
parse_type
Parse a file holding exactly one type ((idx[64][seq: 8], idx[64][seq: 8])), as written in the header of a .psk.d data file.