From 1de859f56825b39de59b1da4fa1be3290ca5eefa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Am=C3=A9lia=20Liao?= Date: Thu, 25 Feb 2021 04:32:01 -0300 Subject: [PATCH] Tweak the parser a bit --- src/Presyntax/Parser.y | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Presyntax/Parser.y b/src/Presyntax/Parser.y index 8e31834..ab90586 100644 --- a/src/Presyntax/Parser.y +++ b/src/Presyntax/Parser.y @@ -68,21 +68,18 @@ VarList :: { [Text] } | var VarList { $1:$2 } ExpProj :: { Expr } - : ExpFun '.1' { Proj1 $1 } - | ExpFun '.2' { Proj2 $1 } - | ExpFun { $1 } + : ExpProj '.1' { Proj1 $1 } + | ExpProj '.2' { Proj2 $1 } + | Atom { $1 } -ExpFun :: { Expr } - : Atom { $1 } +Atom :: { Expr } + : var { Var $1 } | '(' Tuple ')' { $2 } Tuple :: { Expr } : Exp { $1 } | Exp ',' Tuple { Pair $1 $3 } -Atom :: { Expr } - : var { Var $1 } - { lexer cont = alexMonadScan >>= cont