mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-10-27 00:53:17 -06:00
a draft for the generalized control operators
This commit is contained in:
1 parent
544bbd9049
commit
3d7c8ade17
11 files changed
+105
-103
No files matched your search
@@ -256,8 +256,11 @@ ppTerm q d (Markup tag attrs children)
|
||||
| otherwise = pp "<" <> pp tag <+> hsep (map (ppMarkupAttr q) attrs) <> pp ">" $$
|
||||
nest 3 (ppMarkupChildren q children) $$
|
||||
pp "</" <> pp tag <> pp ">"
|
||||
ppTerm q d (Reset ctl t)
|
||||
= pp "[:" <> ppControl q ctl <+> pp "|" <> ppTerm q 0 t <> pp "]"
|
||||
ppTerm q d (Reset ctl ct t _)
|
||||
= pp "[" <> pp ctl <>
|
||||
maybe empty (\t -> ':' <+> ppTerm q 6 t) ct <>
|
||||
pp "|" <> ppTerm q 0 t <>
|
||||
pp "]"
|
||||
ppTerm q d (TSymCat i r rs) = pp '<' <> pp i <> pp ',' <> ppLinFun (pp.fst) r rs <> pp '>'
|
||||
ppTerm q d (TSymVar i r) = pp '<' <> pp i <> pp ',' <> pp '$' <> pp r <> pp '>'
|
||||
|
||||
@@ -265,12 +268,8 @@ ppEquation q (ps,e) = hcat (map (ppPatt q 2) ps) <+> "->" <+> ppTerm q 0 e
|
||||
|
||||
ppCase q (p,e) = ppPatt q 0 p <+> "=>" <+> ppTerm q 0 e
|
||||
|
||||
ppControl q All = empty
|
||||
ppControl q One = pp "one"
|
||||
ppControl q (Limit n) = pp n
|
||||
ppControl q (Coordination mb_mn n _) = ppTerm q 0 (case mb_mn of
|
||||
Just mn -> QC (mn,n)
|
||||
Nothing -> Cn n)
|
||||
ppControl q (id,Nothing) = pp id
|
||||
ppControl q (id,Just t ) = pp id <> ':' <+> ppTerm q 6 t
|
||||
|
||||
instance Pretty Patt where pp = ppPatt Unqualified 0
|
||||
|
||||
|
||||
Reference in new issue
Block a user