Skip to main content

Module parser

Module parser 

Source
Expand description

The .seam front end.

file        := declaration*
declaration := object | union
object      := "schema" ident "{" field* "}"
union       := "union" ident "@tag" "(" string ")" "{" variant* "}"
variant     := value ":" ident
field       := ident ":" "optional"? type rule*
type        := base "?"?
base        := ident | "[" type "]" | enum
enum        := "enum" "{" value ("," value)* ","? "}"
value       := ident | string
rule        := "@" ident "(" args ")"
format      := "@format" "(" name ")"      // a closed set, never a regex

Structs§

ParseError

Functions§

parse