Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.brim-lang.com/llms.txt

Use this file to discover all available pages before exploring further.

The full grammar source is maintained in:

Practical parser notes from the grammar

The grammar includes explicit ambiguity guidance for parser implementation:
  • record declarations vs record expressions
  • generic arguments vs comparison operators
  • newline-sensitive list separators
  • is pattern checks at comparison precedence
  • fallible binding (pattern <- expression) as statement-level syntax
  • pipeline lowering behavior (|>)

Snapshot excerpt

file = whitespace
 module_decl?
 file_imports?
 item_list?
 EOF ;

item = function_decl
 | type_decl
 | data_decl
 | trait_decl
 | impl_decl
 | const_decl
 | extern_block
 | test_block ;

expression = return_expr
 | break_expr
 | continue_expr
 | if_expr
 | match_expr
 | loop_expr
 | while_expr
 | for_expr
 | when_expr
 | unless_expr
 | guard_expr
 | ensure_expr
 | using_expr
 | do_expr
 | try_expr
 | pipeline_expr ;
Use this page as an entry point, and the source file as the canonical reference.