summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Hallgren <th-github@altocumulus.org>2019-03-12 22:32:54 +0100
committerThomas Hallgren <th-github@altocumulus.org>2019-03-12 22:32:54 +0100
commit8e2424af49dfc8289fe938a36c5cdab96386c074 (patch)
tree3d9135891b8e96e4028e2e078337635017c71738 /src
parent5b401f3880f68828272dccfb3787cc3b3abd4cc3 (diff)
GF.Grammar.Canonical: add TuplePattern and CommentedValue
Diffstat (limited to 'src')
-rw-r--r--src/compiler/GF/Grammar/Canonical.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/GF/Grammar/Canonical.hs b/src/compiler/GF/Grammar/Canonical.hs
index ab9bf280c..8be659e1b 100644
--- a/src/compiler/GF/Grammar/Canonical.hs
+++ b/src/compiler/GF/Grammar/Canonical.hs
@@ -69,6 +69,7 @@ data LinValue = ConcatValue LinValue LinValue
| PreValue [([String], LinValue)] LinValue
| Projection LinValue LabelId
| Selection LinValue LinValue
+ | CommentedValue String LinValue
deriving (Eq,Ord,Show)
data LinLiteral = FloatConstant Float
@@ -78,6 +79,7 @@ data LinLiteral = FloatConstant Float
data LinPattern = ParamPattern ParamPattern
| RecordPattern [RecordRow LinPattern]
+ | TuplePattern [LinPattern]
| WildPattern
deriving (Eq,Ord,Show)
@@ -213,6 +215,7 @@ instance Pretty LinValue where
Projection lv l -> ppA lv<>"."<>l
Selection tv pv -> ppA tv<>"!"<>ppA pv
VariantValue vs -> "variants"<+>block vs
+ CommentedValue s v -> "{-" <+> s <+> "-}" $$ v
_ -> ppA lv
instance PPA LinValue where
@@ -253,6 +256,7 @@ instance PPA LinPattern where
ppA p =
case p of
RecordPattern r -> block r
+ TuplePattern ps -> "<"<>punctuate "," ps<>">"
WildPattern -> pp "_"
_ -> parens p