Browse Source

Tweak the parser a bit

feature/hits
Amélia Liao 3 years ago
parent
commit
b1e2e72242
1 changed files with 5 additions and 8 deletions
  1. +5
    -8
      src/Presyntax/Parser.y

+ 5
- 8
src/Presyntax/Parser.y View File

@ -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


Loading…
Cancel
Save