Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- parse :: ByteString -> Either String [TopLevel]
- newtype Ident = Ident String
- ident :: Parser Ident
- data TopLevel
- topLevel :: Parser TopLevel
- data Object
- = Module Ident [Argument Expr] (Maybe Object)
- | ForLoop Ident Expr Object
- | Objects [Object]
- | If Expr Object (Maybe Object)
- | BackgroundMod Object
- | DebugMod Object
- | RootMod Object
- | DisableMod Object
- | ModuleDef {
- moduleName :: Ident
- moduleArgs :: [(Ident, Maybe Expr)]
- moduleBody :: [Object]
- | VarDef { }
- | FuncDef { }
- object :: Parser Object
- data Expr
- = EVar Ident
- | EIndex Expr Expr
- | ENum Double
- | EVec [Expr]
- | ERange (Range Expr)
- | EString String
- | EBool Bool
- | EFunc Ident [Argument Expr]
- | ENegate Expr
- | EPlus Expr Expr
- | EMinus Expr Expr
- | EMult Expr Expr
- | EDiv Expr Expr
- | EMod Expr Expr
- | EEquals Expr Expr
- | ENotEquals Expr Expr
- | EGT Expr Expr
- | EGE Expr Expr
- | ELT Expr Expr
- | ELE Expr Expr
- | ENot Expr
- | EOr Expr Expr
- | EAnd Expr Expr
- | ETernary Expr Expr Expr
- | EParen Expr
- expression :: Parser Expr
- data Argument a
- = Argument a
- | NamedArgument Ident a
- data Range a = Range {
- rangeStart :: a
- rangeEnd :: a
- rangeStep :: Maybe a
Basic parsing
Primitives
An identifier
Things which can appear at the top level of an OpenSCAD source file
Instances
Eq TopLevel Source # | |
Show TopLevel Source # | |
Generic TopLevel Source # | |
Arbitrary TopLevel Source # | |
Pretty TopLevel Source # | |
Defined in Language.OpenSCAD | |
type Rep TopLevel Source # | |
Defined in Language.OpenSCAD type Rep TopLevel = D1 (MetaData "TopLevel" "Language.OpenSCAD" "language-openscad-0.1.8-inplace" False) (C1 (MetaCons "TopLevelScope" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Object)) :+: (C1 (MetaCons "UseDirective" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)) :+: C1 (MetaCons "IncludeDirective" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)))) |
An OpenSCAD geometry object
Module Ident [Argument Expr] (Maybe Object) | |
ForLoop Ident Expr Object | |
Objects [Object] | Implicit union |
If Expr Object (Maybe Object) | |
BackgroundMod Object | |
DebugMod Object | |
RootMod Object | |
DisableMod Object | |
ModuleDef | |
| |
VarDef | |
FuncDef | |
Instances
Expressions
An OpenSCAD expression
Instances
expression :: Parser Expr Source #
Parse an expression
An item in an argument list
Argument a | Just a plain value |
NamedArgument Ident a | A named argument |
Instances
Eq a => Eq (Argument a) Source # | |
Show a => Show (Argument a) Source # | |
Generic (Argument a) Source # | |
Arbitrary a => Arbitrary (Argument a) Source # | |
Pretty a => Pretty (Argument a) Source # | |
Defined in Language.OpenSCAD | |
type Rep (Argument a) Source # | |
Defined in Language.OpenSCAD type Rep (Argument a) = D1 (MetaData "Argument" "Language.OpenSCAD" "language-openscad-0.1.8-inplace" False) (C1 (MetaCons "Argument" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)) :+: C1 (MetaCons "NamedArgument" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Ident) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a))) |
Range start end step
denotes a list starting at start
and
stopping at end
with increments of step
.
Range | |
|
Instances
Eq a => Eq (Range a) Source # | |
Show a => Show (Range a) Source # | |
Arbitrary a => Arbitrary (Range a) Source # | |
Pretty a => Pretty (Range a) Source # | |
Defined in Language.OpenSCAD | |
Generic1 Range Source # | |
type Rep1 Range Source # | |
Defined in Language.OpenSCAD type Rep1 Range = D1 (MetaData "Range" "Language.OpenSCAD" "language-openscad-0.1.8-inplace" False) (C1 (MetaCons "Range" PrefixI True) (S1 (MetaSel (Just "rangeStart") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1 :*: (S1 (MetaSel (Just "rangeEnd") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1 :*: S1 (MetaSel (Just "rangeStep") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec1 Maybe)))) |