Skip to content

Commit

Permalink
rename letting_anon to letting_unnamed
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgurakgun committed Nov 23, 2023
1 parent db5e25f commit f0692e5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Conjure/Language/AST/ASTParser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ parseLetting = try $ do
lSize <- want L_size
guard (not $ all isMissing [lOf,lSize])
expr <- parseExpression
return $ LettingAnon lNew lType lOf lSize expr
return $ LettingUnnamed lNew lType lOf lSize expr
finishEnum = do
lNew <- want L_new
lType <- want L_type
Expand Down
2 changes: 1 addition & 1 deletion src/Conjure/Language/AST/Reformer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ instance HighLevelTree LettingAssignmentNode where
LettingExpr d -> makeTree d
LettingDomain d e -> makeTree d <> makeTree e
LettingEnum d e f g -> mconcat [makeTree d, makeTree e, makeTree f, makeTree g]
LettingAnon d e f g h -> mconcat [makeTree d, makeTree e, makeTree f, makeTree g, makeTree h]
LettingUnnamed d e f g h -> mconcat [makeTree d, makeTree e, makeTree f, makeTree g, makeTree h]

instance HighLevelTree FindStatementNode where
makeTree (FindStatementNode a b c) = mconcat [makeTree a, makeTree b, makeTree c]
Expand Down
6 changes: 3 additions & 3 deletions src/Conjure/Language/AST/Syntax.hs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ data LettingAssignmentNode
LToken -- lType
LToken -- lEnum
(ListNode NameNode) -- nameList
| LettingAnon
| LettingUnnamed
LToken -- lNew
LToken -- lType
LToken -- lOf
Expand All @@ -178,13 +178,13 @@ instance Pretty LettingAssignmentNode where
LettingExpr en -> pretty en
LettingDomain lt dn -> pretty lt <+> pretty dn
LettingEnum lt lt' lt2 ln -> pretty lt <+> pretty lt' <+> pretty lt2 <+> pretty ln
LettingAnon lt lt' lt2 lt3 en -> pretty lt <+> pretty lt' <+> pretty lt2 <+> pretty lt3 <+> pretty en
LettingUnnamed lt lt' lt2 lt3 en -> pretty lt <+> pretty lt' <+> pretty lt2 <+> pretty lt3 <+> pretty en
instance Null LettingAssignmentNode where
isMissing x = case x of
LettingExpr en -> isMissing en
LettingDomain lt dn -> isMissing lt && isMissing dn
LettingEnum l1 l2 l3 ln -> all isMissing [l1, l2, l3] && isMissing ln
LettingAnon l1 l2 l3 l4 en -> all isMissing [l1, l2, l3, l4] && isMissing en
LettingUnnamed l1 l2 l3 l4 en -> all isMissing [l1, l2, l3, l4] && isMissing en

-- Branching on

Expand Down
4 changes: 2 additions & 2 deletions src/Conjure/Language/Validator.hs
Original file line number Diff line number Diff line change
Expand Up @@ -628,9 +628,9 @@ validateLettingAssignment names (LettingEnum l1 l2 l3 enames) = do
| (r, name@(Name n)) <- names'
]
return $ [LettingDomainDefnEnum n members | (_, n) <- names']
validateLettingAssignment names (LettingAnon l1 l2 l3 l4 szExp) = do
validateLettingAssignment names (LettingUnnamed l1 l2 l3 l4 szExp) = do
[l1, l2, l3, l4] `are` TtKeyword -- TODO keywords
putDocs KeywordD "letting_anon" [l1, l2, l3, l4]
putDocs KeywordD "letting_unnamed" [l1, l2, l3, l4]
names' <- validateSequence (validateNameAs TtEnum) names
size <- do
setContextFrom szExp
Expand Down

0 comments on commit f0692e5

Please sign in to comment.