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.DeclClass

Effects, classes, instances, canonical designations, and the shared alias declaration family for the Prism-owned parser.

These declarations share two pieces of grammar that do not belong in the top-level dispatcher: given constraints and member lists. Effect, class, and instance members are layout-delimited; a real brace is recognized as the retired form and receives the same directed rewrite as the bootstrap parser. Instance methods are parsed here as complete function declarations so this module does not depend on private helpers in Syntax.Parse.Decl.

Functions and Values

parse_given_clause

parse_given_clause : (Syntax.Cursor.Cursor, Int) -> Syntax.Parse.Support.Parsed(List(Syntax.Ast.Constraint))

Parse an optional given Class(Type), ... clause. This is public because ordinary function declarations and the other declaration-family modules use exactly the same qualifier.

parse_effect_item

parse_effect_item : (Syntax.Cursor.Cursor, Int, Option(String)) -> Syntax.Parse.Support.Parsed(Syntax.Ast.Item)

Parse an effect item. c points at the keyword, and vis is the already-decoded visibility prefix (None, Some("pub"), or Some("opaque")).

parse_alias_item

parse_alias_item : (Syntax.Cursor.Cursor, Int, Option(String)) -> Syntax.Parse.Support.Parsed(Syntax.Ast.Item)

Parse the shared alias family. A brace RHS constructs an effect alias; every other RHS is a type synonym. The optional parameter list is retained only for a synonym, matching the bootstrap AST.

parse_class_item

parse_class_item : (Syntax.Cursor.Cursor, Int, Option(String)) -> Syntax.Parse.Support.Parsed(Syntax.Ast.Item)

Parse a class declaration, including marker classes without a body and layout bodies containing method signatures.

parse_instance_item

parse_instance_item : (Syntax.Cursor.Cursor, Int, Option(String)) -> Syntax.Parse.Support.Parsed(Syntax.Ast.Item)

Parse an instance declaration, including marker instances and layout bodies of complete function declarations. Visibility is accepted for the uniform dispatcher API; the phase-independent instance AST has no visibility field, matching the bootstrap export.

parse_canonical_item

parse_canonical_item : (Syntax.Cursor.Cursor, Int, Option(String)) -> Syntax.Parse.Support.Parsed(Syntax.Ast.Item)

Parse canonical Class(Head) = instance_name.