module Language.SimpleShell.AST.Expr ( Expr(..) , TypedExpr , VarName , FunName ) where import Language.SimpleShell.AST.SimpleType (SimpleType) import Data.Text (Text) type VarName = Text type FunName = Text -- | Pure expression (no side effects). data Expr = IntLiteral Integer | StrLiteral String | BoolLiteral Bool | Var VarName | FunCall FunName [Expr] | And Expr Expr | Or Expr Expr | Not Expr | Eq Expr Expr | Neq Expr Expr | Gt Expr Expr | Ge Expr Expr | Lt Expr Expr | Le Expr Expr | Add Expr Expr | Sub Expr Expr | Mul Expr Expr | Div Expr Expr | UMinus Expr | Concat Expr Expr | Ternary Expr Expr Expr | Length Expr | IntCast Expr | StrCast Expr deriving (Show) type TypedExpr = (SimpleType, Expr)