Removed monadic and dyadic operators from the AST
This is the first part of a change, suggested in #64, to remove operators in favour of functions (which will also allow user-defined operators). The ticket suggested removed operators after the parser, but the way it's working out, it is fine to just never represent as anything other than function calls. All the knock-on changes will be recorded in later patches.
This commit is contained in:
parent
364bc6f31e
commit
7b4a6c812c
27
data/AST.hs
27
data/AST.hs
|
@ -257,12 +257,8 @@ data Variable =
|
|||
|
||||
-- | An expression.
|
||||
data Expression =
|
||||
-- | A monadic (unary) operator.
|
||||
Monadic Meta MonadicOp Expression
|
||||
-- | A dyadic (binary) operator.
|
||||
| Dyadic Meta DyadicOp Expression Expression
|
||||
-- | The most positive value of a given type.
|
||||
| MostPos Meta Type
|
||||
MostPos Meta Type
|
||||
-- | The most negative value of a given type.
|
||||
| MostNeg Meta Type
|
||||
-- | The size of the outermost dimension of an array type (see 'SizeExpr').
|
||||
|
@ -304,27 +300,6 @@ data ExpressionList =
|
|||
| AllocChannelBundle Meta Name
|
||||
deriving (Show, Eq, Typeable, Data)
|
||||
|
||||
-- | A monadic (unary) operator.
|
||||
-- Nothing to do with Haskell monads.
|
||||
data MonadicOp =
|
||||
MonadicSubtr
|
||||
| MonadicMinus
|
||||
| MonadicBitNot
|
||||
| MonadicNot
|
||||
deriving (Show, Eq, Typeable, Data)
|
||||
|
||||
-- | A dyadic (binary) operator.
|
||||
data DyadicOp =
|
||||
Add | Subtr | Mul | Div | Rem
|
||||
| Plus | Minus | Times
|
||||
| BitAnd | BitOr | BitXor
|
||||
| LeftShift | RightShift
|
||||
| And | Or
|
||||
| Eq | NotEq | Less | More | LessEq | MoreEq
|
||||
| After
|
||||
| Concat
|
||||
deriving (Show, Eq, Typeable, Data)
|
||||
|
||||
-- | An item in an input.
|
||||
data InputItem =
|
||||
-- | A counted input.
|
||||
|
|
Loading…
Reference in New Issue
Block a user