File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
grin/src/Grin/ExtendedSyntax Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ instance FoldNames Val where
2626instance FoldNames BPat where
2727 foldNames f = \ case
2828 VarPat v -> f v
29- AsPat t vs v -> f v <> foldNames (ConstTagNode t vs)
29+ AsPat t vs v -> f v <> foldNames f (ConstTagNode t vs)
3030
3131
3232instance FoldNames CPat where
Original file line number Diff line number Diff line change @@ -54,8 +54,9 @@ alternative i = Alt <$> try (L.indentGuard sc EQ i *> altPat) <*> (op "@" *> var
5454-- and we don't want to parenthesize variables, literals and units.
5555bindingPat :: Parser BPat
5656bindingPat =
57- try (flip AsPat <$> value <*> (op " @" *> var)) <|>
58- VarPat <$> var
57+ VarPat <$> var <|>
58+ mkAsPat <$> parens ((,) <$> tag <*> many var) <*> (op " @" *> var)
59+ where mkAsPat (tag, fields) var = AsPat tag fields var
5960
6061
6162altPat :: Parser CPat
You can’t perform that action at this time.
0 commit comments