glimr/loom/gleam_parser
Gleam Source Parser
Parses Gleam source files to extract type definitions and imports. Used by the template compiler to understand view data structures for code generation.
Types
Represents the parsed contents of a view file. Contains the extracted field definitions from the Data type and all import statements found in the file.
pub type ParsedViewFile {
ParsedViewFile(
fields: List(#(String, String)),
imports: List(String),
)
}
Constructors
-
ParsedViewFile( fields: List(#(String, String)), imports: List(String), )
Values
pub fn parse_view_file(
path: String,
) -> Result(ParsedViewFile, Nil)
Parses a view file to extract its Data type fields and imports. Returns the parsed structure or Error if the file cannot be read.