Bogdanp/elm-ast/2.0.0

NOTE: this package is not compatible with Elm 0.19.1

Ast.Statement

This module exposes parsers for Elm statements.

Types

= AllExport
| SubsetExport (List ExportSet)
| FunctionExport Name
| TypeExport Name (Maybe ExportSet)

Representations for modules' exports.

type Type
= TypeConstructor QualifiedType (List Type)
| TypeVariable Name
| TypeRecordConstructor Type (List ( Name, Type ))
| TypeRecord (List ( Name, Type ))
| TypeTuple (List Type)
| TypeApplication Type Type

Representations for Elm's type syntax.

= ModuleDeclaration ModuleName ExportSet
| PortModuleDeclaration ModuleName ExportSet
| ImportStatement ModuleName (Maybe Alias) (Maybe ExportSet)
| TypeAliasDeclaration Type Type
| TypeDeclaration Type (List Type)
| PortTypeDeclaration Name Type
| PortDeclaration Name (List Name) Expression
| FunctionTypeDeclaration Name Type
| FunctionDeclaration Name (List Name) Expression
| InfixDeclaration Assoc Int Name
| Comment String

Representations for Elm's statements.

Parsers

statement : OpTable -> Parser s Statement

A parser for stand-alone Elm statements.

statements : OpTable -> Parser s (List Statement)

A parser for a series of Elm statements.

infixStatements : Parser s (List Statement)

A scanner for infix statements. This is useful for performing a first pass over a module to find all of the infix declarations in it.

opTable : OpTable -> Parser s OpTable

A scanner that returns an updated OpTable based on the infix declarations in the input.