why did i do this to myself
This commit is contained in:
@@ -146,48 +146,46 @@ Params : {- epsilon -} { [] }
|
|||||||
| Params Pat1 { $1 `snoc` $2 }
|
| Params Pat1 { $1 `snoc` $2 }
|
||||||
|
|
||||||
Pat :: { Pat RlpcPs }
|
Pat :: { Pat RlpcPs }
|
||||||
: Con Pat1s { $1 }
|
: Con Pat1s { ConP $1 $2 }
|
||||||
| Pat1 { undefined }
|
| Pat1 { $1 }
|
||||||
|
|
||||||
Pat1s :: { [Pat RlpcPs] }
|
Pat1s :: { [Pat RlpcPs] }
|
||||||
: Pat1s Pat1 { undefined }
|
: Pat1s Pat1 { $1 `snoc` $2 }
|
||||||
| Pat1 { undefined }
|
| Pat1 { [$1] }
|
||||||
|
|
||||||
Pat1 :: { Pat RlpcPs }
|
Pat1 :: { Pat RlpcPs }
|
||||||
: Con { undefined }
|
: Con { ConP $1 [] }
|
||||||
| Var { undefined }
|
| Var { VarP $1 }
|
||||||
| Lit { undefined }
|
| Lit { LitP $1 }
|
||||||
| '(' Pat ')' { undefined }
|
| '(' Pat ')' { $2 }
|
||||||
|
|
||||||
Expr :: { Expr' RlpcPs SrcSpan }
|
Expr :: { Expr' RlpcPs SrcSpan }
|
||||||
-- infixities delayed till next release :(
|
-- infixities delayed till next release :(
|
||||||
-- : Expr1 InfixOp Expr { undefined }
|
-- : Expr1 InfixOp Expr { undefined }
|
||||||
: AppExpr { $1 }
|
: AppExpr { $1 }
|
||||||
-- | TempInfixExpr { undefined }
|
| TempInfixExpr { $1 }
|
||||||
-- | LetExpr { undefined }
|
| LetExpr { $1 }
|
||||||
-- | CaseExpr { undefined }
|
| CaseExpr { $1 }
|
||||||
|
|
||||||
TempInfixExpr :: { Expr' RlpcPs SrcSpan }
|
TempInfixExpr :: { Expr' RlpcPs SrcSpan }
|
||||||
TempInfixExpr : Expr1 InfixOp TempInfixExpr { undefined }
|
TempInfixExpr : Expr1 InfixOp TempInfixExpr {% tempInfixExprErr }
|
||||||
| Expr1 InfixOp Expr1 { undefined }
|
| Expr1 InfixOp Expr1 { nolo' $ InfixEF $2 $1 $3 }
|
||||||
|
|
||||||
AppExpr :: { Expr' RlpcPs SrcSpan }
|
AppExpr :: { Expr' RlpcPs SrcSpan }
|
||||||
: Expr1 { $1 }
|
: Expr1 { $1 }
|
||||||
| AppExpr Expr1 { comb2 AppEF $1 $2 }
|
| AppExpr Expr1 { comb2 AppEF $1 $2 }
|
||||||
|
|
||||||
LetExpr :: { Expr RlpcPs }
|
LetExpr :: { Expr' RlpcPs SrcSpan }
|
||||||
: let layout1(Binding) in Expr { undefined }
|
: let layout1(Binding) in Expr { nolo' $ LetEF NonRec $2 $4 }
|
||||||
| letrec layout1(Binding) in Expr { undefined }
|
| letrec layout1(Binding) in Expr { nolo' $ LetEF Rec $2 $4 }
|
||||||
|
|
||||||
CaseExpr :: { Expr RlpcPs }
|
CaseExpr :: { Expr' RlpcPs SrcSpan }
|
||||||
: case Expr of layout0(CaseAlt) { undefined }
|
: case Expr of layout0(Alt) { nolo' $ CaseEF $2 $4 }
|
||||||
|
|
||||||
-- TODO: where-binds
|
-- TODO: where-binds
|
||||||
CaseAlt :: { (Alt RlpcPs, Where RlpcPs) }
|
|
||||||
: Alt { undefined }
|
|
||||||
|
|
||||||
Alt :: { Alt RlpcPs }
|
Alt :: { Alt RlpcPs }
|
||||||
: Pat '->' Expr { undefined }
|
: Pat '->' Expr { AltA $1 (collapse . strip $ $3)
|
||||||
|
Nothing }
|
||||||
|
|
||||||
-- layout0(p : β) :: [β]
|
-- layout0(p : β) :: [β]
|
||||||
layout0(p) : '{' layout_list0(';',p) '}' { $2 }
|
layout0(p) : '{' layout_list0(';',p) '}' { $2 }
|
||||||
@@ -234,7 +232,7 @@ Con :: { PsName }
|
|||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
parseRlpProgR = undefined
|
parseRlpProgR :: Text -> RLPCT m (Program )
|
||||||
parseRlpExprR = undefined
|
parseRlpExprR = undefined
|
||||||
|
|
||||||
mkInfixD :: Assoc -> Int -> PsName -> P (Decl RlpcPs SrcSpan)
|
mkInfixD :: Assoc -> Int -> PsName -> P (Decl RlpcPs SrcSpan)
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ module Rlp.Syntax.Types
|
|||||||
, Ty(..)
|
, Ty(..)
|
||||||
, Binding(..)
|
, Binding(..)
|
||||||
, Expr(..), Expr', ExprF(..)
|
, Expr(..), Expr', ExprF(..)
|
||||||
|
, Rec(..)
|
||||||
, Lit(..)
|
, Lit(..)
|
||||||
, Pat(..)
|
, Pat(..)
|
||||||
, Decl(..)
|
, Decl(..)
|
||||||
|
|||||||
Reference in New Issue
Block a user