compiler/stage2_l0/src/parser/stmt.l0

Module parser.stmt

Overview Symbols grouped by source file: compiler/stage2_l0/src/parser/stmt.l0

Module: parser.stmt

Source: compiler/stage2_l0/src/parser/stmt.l0 Language: Dea/L0

Imports / Includes

  • parser.shared
  • ast
  • parser.expr
  • tokens
  • std.vector
  • std.text
  • std.string

Symbols

Function ps_parse_pattern

func ps_parse_pattern(self: ParserState*) -> PatternId?

Parse a match pattern.

Parameters:

  • self: Parser state to advance.

Returns: Parsed pattern, or null on error.

Function ps_parse_block

func ps_parse_block(self: ParserState*) -> StmtId?

Parse a block statement.

Parameters:

  • self: Parser state to advance.

Returns: Parsed block statement id, or null on error.

Function ps_parse_break_stmt

func ps_parse_break_stmt(self: ParserState*) -> StmtId?

Parse a break statement.

Parameters:

  • self: Parser state to advance.

Returns: Parsed break statement id, or null on error.

Function ps_parse_continue_stmt

func ps_parse_continue_stmt(self: ParserState*) -> StmtId?

Parse a continue statement.

Parameters:

  • self: Parser state to advance.

Returns: Parsed continue statement id, or null on error.

Function ps_parse_return_stmt

func ps_parse_return_stmt(self: ParserState*) -> StmtId?

Parse a return statement.

Parameters:

  • self: Parser state to advance.

Returns: Parsed return statement id, or null on error.

Function ps_parse_drop_stmt

func ps_parse_drop_stmt(self: ParserState*) -> StmtId?

Parse a drop statement.

Parameters:

  • self: Parser state to advance.

Returns: Parsed drop statement id, or null on error.

Function ps_parse_let_stmt

func ps_parse_let_stmt(self: ParserState*) -> StmtId?

Parse a local let statement.

Parameters:

  • self: Parser state to advance.

Returns: Parsed let statement id, or null on error.

Function ps_parse_if_stmt

func ps_parse_if_stmt(self: ParserState*) -> StmtId?

Parse an if statement.

Parameters:

  • self: Parser state to advance.

Returns: Parsed if statement id, or null on error.

Function ps_parse_while_stmt

func ps_parse_while_stmt(self: ParserState*) -> StmtId?

Parse a while statement.

Parameters:

  • self: Parser state to advance.

Returns: Parsed while statement id, or null on error.

Function ps_parse_for_stmt

func ps_parse_for_stmt(self: ParserState*) -> StmtId?

Parse a for statement.

Parameters:

  • self: Parser state to advance.

Returns: Parsed for statement id, or null on error.

Function ps_parse_for_update_stmt

func ps_parse_for_update_stmt(self: ParserState*) -> StmtId?

Parse a statement permitted in a for update clause.

Parameters:

  • self: Parser state to advance.

Returns: Parsed update statement id, or null on error.

Function ps_parse_match_stmt

func ps_parse_match_stmt(self: ParserState*) -> StmtId?

Parse a match statement.

Parameters:

  • self: Parser state to advance.

Returns: Parsed match statement id, or null on error.

Function ps_parse_with_item

func ps_parse_with_item(self: ParserState*) -> WithItem*?

Parse one item inside a with header.

Parameters:

  • self: Parser state to advance.

Returns: Parsed with item, or null on error.

Function ps_parse_with_stmt

func ps_parse_with_stmt(self: ParserState*) -> StmtId?

Parse a with statement.

Parameters:

  • self: Parser state to advance.

Returns: Parsed with statement id, or null on error.

Function ps_parse_case_literal

func ps_parse_case_literal(self: ParserState*) -> ExprId?

Parse a literal allowed in a case arm.

Parameters:

  • self: Parser state to advance.

Returns: Parsed literal expression id, or null on error.

Function ps_at_case_arm_start

func ps_at_case_arm_start(self: ParserState*) -> bool

Report whether the current token can start a case arm.

Parameters:

  • self: Parser state to inspect.

Returns: True if the current token is a likely arm boundary.

Function ps_sync_case_invalid_arm

func ps_sync_case_invalid_arm(self: ParserState*)

Skip one malformed or forbidden case arm.

Starts at the offending arm token, consumes at least one token, and stops before the next likely arm or the enclosing case close.

Parameters:

  • self: Parser state to resynchronize.

Function ps_parse_case_stmt

func ps_parse_case_stmt(self: ParserState*) -> StmtId?

Parse a case statement.

Parameters:

  • self: Parser state to advance.

Returns: Parsed case statement id, or null on error.

Function ps_parse_simple_stmt

func ps_parse_simple_stmt(self: ParserState*) -> StmtId?

Parse a statement that does not consume its trailing semicolon.

Parameters:

  • self: Parser state to advance.

Returns: Parsed simple statement id, or null on error.

Function ps_parse_stmt

func ps_parse_stmt(self: ParserState*) -> StmtId?

Parse one statement.

Parameters:

  • self: Parser state to advance.

Returns: Parsed statement id, or null on error.