Skip to main content

Module statements

Module statements 

Source
Expand description

Top-level statement dispatcher and block parser.

parse_statement_to_ast is the main entry point called by the top-level parse loop in Parser::parse. It peeks at the current token and routes to the appropriate sub-parser. Anything that does not start with a known keyword is parsed as a bare expression statement.

Modulesยง

const_declaration ๐Ÿ”’
Constant declaration parser (CONST).
for_statement ๐Ÿ”’
for loop parser - three distinct syntaxes.
function_declaration ๐Ÿ”’
Function declaration parser (fn).
if_statement ๐Ÿ”’
Conditional statement parser (if / else if / else).
import_statement ๐Ÿ”’
Import statement parser (get).
match_statement ๐Ÿ”’
match statement parser.
record_declaration ๐Ÿ”’
Record (struct) declaration parser (record).
tag_declaration ๐Ÿ”’
Tag (enum) declaration parser (tag).
variable_declaration ๐Ÿ”’
Variable declaration parser (dec).
while_statement ๐Ÿ”’
while loop parser.