Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tidying up the lsp documentation loading code #631

Merged
merged 7 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading