Commit 38481431 authored by Moses Nakamura's avatar Moses Nakamura

fixed whitespace error, tried to clean up names

parent 0411f046
...@@ -40,23 +40,22 @@ main = do ...@@ -40,23 +40,22 @@ main = do
let lang = head args let lang = head args
putStrLn lang putStrLn lang
let files = tail args let files = tail args
handleFiles (generateCode lang) files handleFiles (generatorFnFor lang) files
handleFiles codeGenerator files = case codeGenerator of handleFiles (Right fn) files = mapM_ (handleFile fn) files
Right fn -> mapM_ (handleFile fn) files handleFiles (Left str) _ = putStrLn str
Left str -> putStrLn str
handleFile codeGenerator filename = do handleFile generateCode filename = do
text <- readFile filename text <- readFile filename
case parseAndCompileFile filename text of case parseAndCompileFile filename text of
Active desc [] -> do Active desc [] -> do
print desc print desc
codeGenerator desc filename generateCode desc filename
Active _ e -> mapM_ printError (List.sortBy compareErrors e) Active _ e -> mapM_ printError (List.sortBy compareErrors e)
Failed e -> mapM_ printError (List.sortBy compareErrors e) Failed e -> mapM_ printError (List.sortBy compareErrors e)
generateCode lang = case lang of generatorFnFor lang = case lang of
"c++" -> Right (\desc filename -> do "c++" -> Right (\desc filename -> do
header <- generateCxxHeader desc header <- generateCxxHeader desc
LZ.writeFile (filename ++ ".h") header LZ.writeFile (filename ++ ".h") header
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment