diff options
author | Jakub Hampl <kopomir@gmail.com> | 2019-02-14 15:23:49 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-14 15:23:49 +0000 |
commit | 6bd5f8ccbd8c44c3311ef36b0e2de9ede4fa71ed (patch) | |
tree | de40a36d34cb734c2765a705506436f8b38e28a9 /style-generator/src/MyElm/Types.elm | |
parent | f0c36a3d49fad46e0fb6cafeb7a021dd5d775993 (diff) |
New Style Generator (#8)
Diffstat (limited to 'style-generator/src/MyElm/Types.elm')
-rw-r--r-- | style-generator/src/MyElm/Types.elm | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/style-generator/src/MyElm/Types.elm b/style-generator/src/MyElm/Types.elm new file mode 100644 index 0000000..ef473e4 --- /dev/null +++ b/style-generator/src/MyElm/Types.elm @@ -0,0 +1,56 @@ +module MyElm.Types exposing (Argument(..), Declaration(..), Exposing(..), Expression(..), Ident(..), Module(..), QualifiedName(..), Type(..)) + + +type Module + = Module + { name : String + , exposes : List Exposing + , doc : Maybe String + , imports : List String + , declarations : List Declaration + } + + +type QualifiedName + = Local Ident + | FullyQualified (List String) Ident + | Aliased (List String) String Ident + | Bare (List String) Ident + + +type Ident + = Constructor String String + | ValueOrType String + + +type Exposing + = ValueExposed String + | TypeExposed String + | TypeAndConstructors String + + +type Type + = NamedType QualifiedName (List Type) + | RecordType (List ( String, Type )) + | FunctionType (List Type) + | TupleType (List Type) + | TypeVariable String + + +type Declaration + = CustomType String (List String) (List ( String, List Type )) + | TypeAlias String (List String) Type + | ValueDeclaration String (List Type) (List Argument) Expression + | Comment String + + +type Expression + = Call QualifiedName (List Expression) + | Literal String + | ListExpr (List Expression) + | Tuple (List Expression) + | Record (List ( String, Expression )) + + +type Argument + = Argument String |