Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Syntax.Parse.Expr

The Prism-owned expression parser.

The ordinary productions below are direct recursive descent. Only the prefix/infix tower is a Pratt loop, with binding powers selected directly from TokenKind; it does not allocate an operator table or pass parsing callbacks through the generic Syntax.Cursor.Pratt API.

Functions and Values

parse_expr

parse_expr : (Syntax.Cursor.Cursor, Int) -> Syntax.Parse.Support.Parsed(Syntax.Ast.Sp(Syntax.Ast.Expr))

Parse one expression from c, leaving the first following token unconsumed. The caller supplies the remaining structural depth budget.

parse_expr_or_block

parse_expr_or_block : (Syntax.Cursor.Cursor, Int) -> Syntax.Parse.Support.Parsed(Syntax.Ast.Sp(Syntax.Ast.Expr))

Parse an expression or a layout-delimited statement block. Declaration bodies use the same production as control-flow branches, so this seam is public to Syntax.Parse.Decl rather than duplicated there.