Skip to content

Commit

Permalink
Added ASCII and Unicode rules
Browse files Browse the repository at this point in the history
  • Loading branch information
geffk2 committed Apr 19, 2024
1 parent 1fe743d commit fbaf19c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rzk/grammar/Syntax.cf
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ ASCII_TopeOr. Term2 ::= Term3 "\\/" Term2 ;
ASCII_TypeFun. Term1 ::= ParamDecl "->" Term1 ;
ASCII_TypeSigma. Term1 ::= "Sigma" "(" Pattern ":" Term ")" "," Term1 ;
ASCII_TypeSigmaNested. Term1 ::= "Sigma" "(" SigmaParam "," [SigmaParam] ")" "," Term1 ;
ASCII_Lambda. Term1 ::= "\\" [Param] "->" Term1 ;
ASCII_Restriction. Restriction ::= Term "|->" Term ;
Expand All @@ -166,4 +167,6 @@ ASCII_Second. Term6 ::= "second" Term7 ;
-- Alternative Unicode syntax rules
unicode_TypeSigmaAlt. Term1 ::= "" "(" Pattern ":" Term ")" "," Term1 ; -- \sum
unicode_TypeSigmaNestedAlt. Term1 ::= "" "(" SigmaParam "," [SigmaParam] ")" "," Term1 ;
define unicode_TypeSigmaAlt pat fst snd = TypeSigma pat fst snd ;
define unicode_TypeSigmaNestedAlt par pars t = TypeSigmaNested par pars t ;
1 change: 1 addition & 0 deletions rzk/src/Language/Rzk/Free/Syntax.hs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ toTerm bvars = go

Rzk.ASCII_TypeFun loc param ret -> go (Rzk.TypeFun loc param ret)
Rzk.ASCII_TypeSigma loc pat ty ret -> go (Rzk.TypeSigma loc pat ty ret)
Rzk.ASCII_TypeSigmaNested loc p ps tN -> go (Rzk.TypeSigmaNested loc p ps tN)
Rzk.ASCII_Lambda loc pat ret -> go (Rzk.Lambda loc pat ret)
Rzk.ASCII_TypeExtensionDeprecated loc shape type_ -> go (Rzk.TypeExtensionDeprecated loc shape type_)
Rzk.ASCII_First loc term -> go (Rzk.First loc term)
Expand Down
5 changes: 5 additions & 0 deletions rzk/src/Language/Rzk/Syntax/Abs.hs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions rzk/src/Language/Rzk/Syntax/Doc.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions rzk/src/Language/Rzk/Syntax/Par.y

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rzk/src/Language/Rzk/Syntax/Print.hs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rzk/src/Language/Rzk/Syntax/Skel.hs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fbaf19c

Please sign in to comment.