@@ -9,7 +9,7 @@ module Swarm.DocGen (
9
9
keywordsCommands ,
10
10
keywordsDirections ,
11
11
operatorNames ,
12
- builtinCommandsListEMacs ,
12
+ builtinCommandsListEmacs ,
13
13
editorList ,
14
14
) where
15
15
@@ -55,7 +55,7 @@ data GenerateDocs where
55
55
EditorKeywords :: Maybe EditorType -> GenerateDocs
56
56
deriving (Eq , Show )
57
57
58
- data EditorType = EMacs | VSCode
58
+ data EditorType = Emacs | VSCode
59
59
deriving (Eq , Show , Enum , Bounded )
60
60
61
61
generateDocs :: GenerateDocs -> IO ()
@@ -79,12 +79,12 @@ generateDocs = \case
79
79
80
80
generateEditorKeywords :: EditorType -> IO ()
81
81
generateEditorKeywords = \ case
82
- EMacs -> do
82
+ Emacs -> do
83
83
putStrLn " (x-builtins '("
84
- T. putStr . editorList EMacs $ map constSyntax builtinCommandsEMacs
84
+ T. putStr . editorList Emacs $ map constSyntax builtinCommandsEmacs
85
85
putStrLn " ))\n (x-commands '("
86
- T. putStr $ keywordsCommands EMacs
87
- T. putStr $ keywordsDirections EMacs
86
+ T. putStr $ keywordsCommands Emacs
87
+ T. putStr $ keywordsDirections Emacs
88
88
putStrLn " ))"
89
89
VSCode -> do
90
90
putStrLn " Functions and commands:"
@@ -94,15 +94,15 @@ generateEditorKeywords = \case
94
94
putStrLn " \n Operators:"
95
95
T. putStrLn operatorNames
96
96
97
- builtinCommandsEMacs :: [Const ]
98
- builtinCommandsEMacs = [If , Run , Return , Try , Fail , Force , Fst , Snd ]
97
+ builtinCommandsEmacs :: [Const ]
98
+ builtinCommandsEmacs = [If , Run , Return , Try , Fail , Force , Fst , Snd ]
99
99
100
- builtinCommandsListEMacs :: Text
101
- builtinCommandsListEMacs = editorList EMacs $ map constSyntax builtinCommandsEMacs
100
+ builtinCommandsListEmacs :: Text
101
+ builtinCommandsListEmacs = editorList Emacs $ map constSyntax builtinCommandsEmacs
102
102
103
103
editorList :: EditorType -> [Text ] -> Text
104
104
editorList = \ case
105
- EMacs -> T. unlines . map ((" " <> ) . quote)
105
+ Emacs -> T. unlines . map ((" " <> ) . quote)
106
106
VSCode -> T. intercalate " |"
107
107
where
108
108
quote = T. cons ' "' . flip T. snoc ' "'
@@ -114,7 +114,7 @@ constSyntax = Syntax.syntax . Syntax.constInfo
114
114
keywordsCommands :: EditorType -> Text
115
115
keywordsCommands e = editorList e $ map constSyntax (filter isFunc Syntax. allConst)
116
116
where
117
- isFunc c = Syntax. isUserFunc c && (e /= EMacs || c `notElem` builtinCommandsEMacs )
117
+ isFunc c = Syntax. isUserFunc c && (e /= Emacs || c `notElem` builtinCommandsEmacs )
118
118
119
119
-- | Get formatted list of directions.
120
120
keywordsDirections :: EditorType -> Text
0 commit comments