Literal -> Lit, LitE -> Lit
This commit is contained in:
@@ -123,7 +123,7 @@ Alter :: { Alter Name }
|
||||
Alter : litint ParList '->' Expr { Alter (AltData $1) $2 $4 }
|
||||
|
||||
Expr1 :: { Expr Name }
|
||||
Expr1 : litint { LitE $ IntL $1 }
|
||||
Expr1 : litint { Lit $ IntL $1 }
|
||||
| Id { Var $1 }
|
||||
| PackCon { $1 }
|
||||
| ExprPragma { $1 }
|
||||
|
||||
@@ -7,7 +7,7 @@ Description : Core ASTs and the like
|
||||
module Core.Syntax
|
||||
( Expr(..)
|
||||
, Type(..)
|
||||
, Literal(..)
|
||||
, Lit(..)
|
||||
, pattern (:$)
|
||||
, Binding(..)
|
||||
, AltCon(..)
|
||||
@@ -47,7 +47,7 @@ data Expr b = Var Name
|
||||
| Lam [b] (Expr b)
|
||||
| Let Rec [Binding b] (Expr b)
|
||||
| App (Expr b) (Expr b)
|
||||
| LitE Literal
|
||||
| Lit Lit
|
||||
| Type Type
|
||||
deriving (Show, Read, Lift)
|
||||
|
||||
@@ -87,11 +87,11 @@ data Rec = Rec
|
||||
deriving (Show, Read, Eq, Lift)
|
||||
|
||||
data AltCon = AltData Tag
|
||||
| AltLiteral Literal
|
||||
| AltLit Lit
|
||||
| Default
|
||||
deriving (Show, Read, Eq, Lift)
|
||||
|
||||
data Literal = IntL Int
|
||||
data Lit = IntL Int
|
||||
deriving (Show, Read, Eq, Lift)
|
||||
|
||||
type Name = String
|
||||
|
||||
@@ -32,7 +32,7 @@ rhssOf = fromList . fmap f
|
||||
|
||||
isAtomic :: Expr b -> Bool
|
||||
isAtomic (Var _) = True
|
||||
isAtomic (LitE _) = True
|
||||
isAtomic (Lit _) = True
|
||||
isAtomic _ = False
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user