Whitespace cleanup

This commit is contained in:
Jonas Claeson 2018-08-07 17:25:59 +02:00
parent 8478f7346c
commit 9c1bfc77c4
19 changed files with 78 additions and 80 deletions

View File

@ -74,7 +74,6 @@ defaultFunctionsSpecial =
("map", toOObj $ flip
(map :: (OVal -> OVal) -> [OVal] -> [OVal] )
)
]
defaultModules :: [(String, OVal)]

View File

@ -24,7 +24,6 @@ import Graphics.Implicit.ExtOpenScad.Eval.Expr (evalExpr, matchPat)
import Graphics.Implicit.ExtOpenScad.Parser.Statement (parseProgram)
import Data.Maybe(fromMaybe)
import qualified Data.Map as Map
import Control.Monad (forM_, forM, mapM_)
import Control.Monad.State (get, liftIO, mapM, runStateT, (>>))

View File

@ -17,34 +17,34 @@ isArgument (ArgumentDoc _ _ _) = True
isArgument _ = False
main = do
let names = map fst primitives
docs <- sequence $ map (getArgParserDocs.($ []).snd) primitives
let names = map fst primitives
docs <- sequence $ map (getArgParserDocs.($ []).snd) primitives
forM_ (zip names docs) $ \(moduleName, moduleDocList) -> do
let
examples = filter isExample moduleDocList
arguments = filter isArgument moduleDocList
putStrLn moduleName
putStrLn (map (const '-') moduleName)
putStrLn ""
if not $ null examples then putStrLn "**Examples:**\n" else return ()
forM_ examples $ \(ExampleDoc example) -> do
putStrLn $ " * `" ++ example ++ "`"
putStrLn ""
putStrLn "**Arguments:**\n"
forM_ arguments $ \(ArgumentDoc name posfallback description) ->
case (posfallback, description) of
(Nothing, "") -> do
putStrLn $ " * `" ++ name ++ "`"
(Just fallback, "") -> do
putStrLn $ " * `" ++ name ++ " = " ++ fallback ++ "`"
(Nothing, _) -> do
putStrLn $ " * `" ++ name ++ "`"
putStrLn $ " " ++ description
(Just fallback, _) -> do
putStrLn $ " * `" ++ name ++ " = " ++ fallback ++ "`"
putStrLn $ " " ++ description
putStrLn ""
forM_ (zip names docs) $ \(moduleName, moduleDocList) -> do
let
examples = filter isExample moduleDocList
arguments = filter isArgument moduleDocList
putStrLn moduleName
putStrLn (map (const '-') moduleName)
putStrLn ""
if not $ null examples then putStrLn "**Examples:**\n" else return ()
forM_ examples $ \(ExampleDoc example) -> do
putStrLn $ " * `" ++ example ++ "`"
putStrLn ""
putStrLn "**Arguments:**\n"
forM_ arguments $ \(ArgumentDoc name posfallback description) ->
case (posfallback, description) of
(Nothing, "") -> do
putStrLn $ " * `" ++ name ++ "`"
(Just fallback, "") -> do
putStrLn $ " * `" ++ name ++ " = " ++ fallback ++ "`"
(Nothing, _) -> do
putStrLn $ " * `" ++ name ++ "`"
putStrLn $ " " ++ description
(Just fallback, _) -> do
putStrLn $ " * `" ++ name ++ " = " ++ fallback ++ "`"
putStrLn $ " " ++ description
putStrLn ""
-- | We need a format to extract documentation into
data Doc = Doc String [DocPart]