From b1e2e72242fee4a2858825e773b1eb620faf0373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abigail=20Magalh=C3=A3es?= 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