module Jikka.RestrictedPython.Language.WithoutLoc where

import Jikka.Common.Location
import Jikka.RestrictedPython.Language.Expr

constIntExp :: Integer -> Expr'
constIntExp :: Integer -> Expr'
constIntExp = Expr -> Expr'
forall a. a -> WithLoc' a
withoutLoc (Expr -> Expr') -> (Integer -> Expr) -> Integer -> Expr'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Constant -> Expr
Constant (Constant -> Expr) -> (Integer -> Constant) -> Integer -> Expr
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Constant
ConstInt

constBoolExp :: Bool -> Expr'
constBoolExp :: Bool -> Expr'
constBoolExp = Expr -> Expr'
forall a. a -> WithLoc' a
withoutLoc (Expr -> Expr') -> (Bool -> Expr) -> Bool -> Expr'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Constant -> Expr
Constant (Constant -> Expr) -> (Bool -> Constant) -> Bool -> Expr
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Constant
ConstBool

constBuiltinExp :: Builtin -> Expr'
constBuiltinExp :: Builtin -> Expr'
constBuiltinExp = Expr -> Expr'
forall a. a -> WithLoc' a
withoutLoc (Expr -> Expr') -> (Builtin -> Expr) -> Builtin -> Expr'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Constant -> Expr
Constant (Constant -> Expr) -> (Builtin -> Constant) -> Builtin -> Expr
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Builtin -> Constant
ConstBuiltin

binOp :: Expr' -> Operator -> Expr' -> Expr'
binOp :: Expr' -> Operator -> Expr' -> Expr'
binOp Expr'
e1 Operator
op Expr'
e2 = Expr -> Expr'
forall a. a -> WithLoc' a
withoutLoc (Expr' -> Operator -> Expr' -> Expr
BinOp Expr'
e1 Operator
op Expr'
e2)

addExp :: Expr' -> Expr' -> Expr'
addExp :: Expr' -> Expr' -> Expr'
addExp Expr'
e1 Expr'
e2 = Expr' -> Operator -> Expr' -> Expr'
binOp Expr'
e1 Operator
Add Expr'
e2

subExp :: Expr' -> Expr' -> Expr'
subExp :: Expr' -> Expr' -> Expr'
subExp Expr'
e1 Expr'
e2 = Expr' -> Operator -> Expr' -> Expr'
binOp Expr'
e1 Operator
Sub Expr'
e2

multExp :: Expr' -> Expr' -> Expr'
multExp :: Expr' -> Expr' -> Expr'
multExp Expr'
e1 Expr'
e2 = Expr' -> Operator -> Expr' -> Expr'
binOp Expr'
e1 Operator
Mult Expr'
e2

unaryOp :: UnaryOp -> Expr' -> Expr'
unaryOp :: UnaryOp -> Expr' -> Expr'
unaryOp UnaryOp
op Expr'
e = Expr -> Expr'
forall a. a -> WithLoc' a
withoutLoc (UnaryOp -> Expr' -> Expr
UnaryOp UnaryOp
op Expr'
e)

eqExp :: Type -> Expr' -> Expr' -> Expr'
eqExp :: Type -> Expr' -> Expr' -> Expr'
eqExp Type
t Expr'
e1 Expr'
e2 = Expr -> Expr'
forall a. a -> WithLoc' a
withoutLoc (Expr' -> CmpOp' -> Expr' -> Expr
Compare Expr'
e1 (CmpOp -> Type -> CmpOp'
CmpOp' CmpOp
Eq' Type
t) Expr'
e2)

name :: VarName' -> Expr'
name :: VarName' -> Expr'
name = Expr -> Expr'
forall a. a -> WithLoc' a
withoutLoc (Expr -> Expr') -> (VarName' -> Expr) -> VarName' -> Expr'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VarName' -> Expr
Name

call :: Expr' -> [Expr'] -> Expr'
call :: Expr' -> [Expr'] -> Expr'
call Expr'
f [Expr']
args = Expr -> Expr'
forall a. a -> WithLoc' a
withoutLoc (Expr' -> [Expr'] -> Expr
Call Expr'
f [Expr']
args)

list :: Type -> [Expr'] -> Expr'
list :: Type -> [Expr'] -> Expr'
list = (Expr -> Expr'
forall a. a -> WithLoc' a
withoutLoc (Expr -> Expr') -> ([Expr'] -> Expr) -> [Expr'] -> Expr'
forall b c a. (b -> c) -> (a -> b) -> a -> c
.) (([Expr'] -> Expr) -> [Expr'] -> Expr')
-> (Type -> [Expr'] -> Expr) -> Type -> [Expr'] -> Expr'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Type -> [Expr'] -> Expr
List

listComp :: Expr' -> Comprehension -> Expr'
listComp :: Expr' -> Comprehension -> Expr'
listComp = (Expr -> Expr'
forall a. a -> WithLoc' a
withoutLoc (Expr -> Expr')
-> (Comprehension -> Expr) -> Comprehension -> Expr'
forall b c a. (b -> c) -> (a -> b) -> a -> c
.) ((Comprehension -> Expr) -> Comprehension -> Expr')
-> (Expr' -> Comprehension -> Expr)
-> Expr'
-> Comprehension
-> Expr'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Expr' -> Comprehension -> Expr
ListComp

subscript :: Expr' -> Expr' -> Expr'
subscript :: Expr' -> Expr' -> Expr'
subscript = (Expr -> Expr'
forall a. a -> WithLoc' a
withoutLoc (Expr -> Expr') -> (Expr' -> Expr) -> Expr' -> Expr'
forall b c a. (b -> c) -> (a -> b) -> a -> c
.) ((Expr' -> Expr) -> Expr' -> Expr')
-> (Expr' -> Expr' -> Expr) -> Expr' -> Expr' -> Expr'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Expr' -> Expr' -> Expr
Subscript

nameTrg :: VarName' -> Target'
nameTrg :: VarName' -> Target'
nameTrg = Target -> Target'
forall a. a -> WithLoc' a
withoutLoc (Target -> Target') -> (VarName' -> Target) -> VarName' -> Target'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VarName' -> Target
NameTrg

subscriptTrg :: Target' -> Expr' -> Target'
subscriptTrg :: Target' -> Expr' -> Target'
subscriptTrg = (Target -> Target'
forall a. a -> WithLoc' a
withoutLoc (Target -> Target') -> (Expr' -> Target) -> Expr' -> Target'
forall b c a. (b -> c) -> (a -> b) -> a -> c
.) ((Expr' -> Target) -> Expr' -> Target')
-> (Target' -> Expr' -> Target) -> Target' -> Expr' -> Target'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Target' -> Expr' -> Target
SubscriptTrg

tupleTrg :: [Target'] -> Target'
tupleTrg :: [Target'] -> Target'
tupleTrg = Target -> Target'
forall a. a -> WithLoc' a
withoutLoc (Target -> Target')
-> ([Target'] -> Target) -> [Target'] -> Target'
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Target'] -> Target
TupleTrg