Skip to content

Commit

Permalink
changing syntax of beta and phi
Browse files Browse the repository at this point in the history
The erased portions now require {| |} instead of just { }
  • Loading branch information
astump committed Jan 13, 2020
1 parent 144e703 commit 3e9579f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions parser/src/CedilleLexer.x
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ token :-
<0> \| { mkTokenEmpty TPipe }
<0> \{\^ { mkTokenEmpty TLSpan }
<0> \^\} { mkTokenEmpty TRSpan }
<0> \{\| { mkTokenEmpty TLErased }
<0> \|\} { mkTokenEmpty TRErased }
<0> module { mkTokenEmpty TModule }
<0> import { mkTokenEmpty TImport }
<0> as { mkTokenEmpty TAs }
Expand Down Expand Up @@ -170,6 +172,8 @@ data TokenClass =
| TEpsRM
| TLSpan
| TRSpan
| TLErased
| TRErased
| TImport
| TAs
| TData
Expand Down Expand Up @@ -207,6 +211,8 @@ instance Show TokenClass where
show (TEpsRM) = "TEpsRM"
show (TLSpan) = "TLSpan"
show (TRSpan) = "TRSpan"
show (TLErased) = "TLErased"
show (TRErased) = "TRErased"
show (TImport) = "TImport"
show (TAs) = "TAs"
show (TData) = "TData"
Expand Down
6 changes: 4 additions & 2 deletions parser/src/CedilleParser.y
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ import System.Environment
'close' { Token $$ TClose }
'{^' { Token $$ TLSpan }
'^}' { Token $$ TRSpan }
'{|' { Token $$ TLErased }
'|}' { Token $$ TRErased }
'θ' { Token $$ TTheta }
'θ+' { Token $$ TThetaEq }
'θ<' { Token $$ TThetaVars }
Expand Down Expand Up @@ -203,7 +205,7 @@ Nums :: { [CedilleTypes.Num] }

OptTerm :: { Maybe PosTerm }
: { Nothing }
| '{' Term '}' { Just (PosTerm $2 (pos2Txt1 $3)) }
| '{|' Term '|}' { Just (PosTerm $2 (pos2Txt1 $3)) }

OptTermAngle :: { Maybe PosTerm }
: { Nothing }
Expand Down Expand Up @@ -262,7 +264,7 @@ Term :: { Term }
| 'open' Qvar '-' Term { Open (pos2Txt $1) True (tPosTxt $2) (tTxt $2) $4 }
| 'close' Qvar '-' Term { Open (pos2Txt $1) False (tPosTxt $2) (tTxt $2) $4 }
| 'ρ' OptPlus OptNums Lterm OptGuide '-' Term { Rho (pos2Txt $1) $2 $3 $4 $5 $7 }
| 'φ' Lterm '-' Term '{' Term '}' { Phi (pos2Txt $1) $2 $4 $6 (pos2Txt1 $7) }
| 'φ' Lterm '-' Pterm '{|' Term '|}' { Phi (pos2Txt $1) $2 $4 $6 (pos2Txt1 $7) }
| 'χ' OptType '-' Term { Chi (pos2Txt $1) $2 $4 }
| 'δ' OptType '-' Term { Delta (pos2Txt $1) $2 $4 }
| Theta Lterm Lterms { Theta (snd $1) (fst $1) $2 $3 }
Expand Down

0 comments on commit 3e9579f

Please sign in to comment.