Compare commits
2 Commits
b98a8cc44f
...
1fcce32ef6
Author | SHA1 | Date | |
---|---|---|---|
1fcce32ef6 | |||
e50081614a |
23
app/Main.hs
23
app/Main.hs
@@ -1,8 +1,27 @@
|
|||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import MdToHTML
|
import MdToHTML
|
||||||
|
import System.Environment
|
||||||
|
import System.IO
|
||||||
|
|
||||||
|
readLinesHelper :: [String] -> IO [String]
|
||||||
|
readLinesHelper xs = do
|
||||||
|
done <- isEOF
|
||||||
|
if done
|
||||||
|
then return xs
|
||||||
|
else do
|
||||||
|
line <- getLine
|
||||||
|
let xs' = line : xs
|
||||||
|
readLinesHelper xs'
|
||||||
|
|
||||||
|
readLines :: IO [String]
|
||||||
|
readLines = fmap reverse $ readLinesHelper []
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = do
|
main = do
|
||||||
let res = fst $ leftmostLongestParse parseDocument "# _Hello_\n"
|
args <- getArgs
|
||||||
putStrLn (show res)
|
fileContents <- case args of
|
||||||
|
[] -> getContents
|
||||||
|
x : _ -> readFile x
|
||||||
|
let res = fst $ leftmostLongestParse parseDocument fileContents
|
||||||
|
print res
|
||||||
|
@@ -67,10 +67,6 @@ executable md-to-html-runner
|
|||||||
-- .hs or .lhs file containing the Main module.
|
-- .hs or .lhs file containing the Main module.
|
||||||
main-is: Main.hs
|
main-is: Main.hs
|
||||||
|
|
||||||
-- Modules included in this executable, other than Main.
|
|
||||||
other-modules:
|
|
||||||
MdToHTML
|
|
||||||
MdToHtmlTest
|
|
||||||
|
|
||||||
-- LANGUAGE extensions used by modules in this package.
|
-- LANGUAGE extensions used by modules in this package.
|
||||||
-- other-extensions:
|
-- other-extensions:
|
||||||
|
Reference in New Issue
Block a user