Compare commits
10 Commits
fixingInco
...
master
Author | SHA1 | Date |
---|---|---|
|
1d9ac86a2a | 1 week ago |
|
0320402957 | 1 week ago |
|
8696a185a7 | 1 week ago |
|
da38ac226f | 1 week ago |
|
1fcce32ef6 | 2 weeks ago |
|
e50081614a | 2 weeks ago |
|
b98a8cc44f | 2 weeks ago |
|
90c7a585d2 | 2 weeks ago |
|
4a15330874 | 2 weeks ago |
|
c14112d3e4 | 2 weeks ago |
@ -1,8 +1,27 @@
|
||||
module Main where
|
||||
|
||||
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 = reverse <$> readLinesHelper []
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
let res = fst $ leftmostLongestParse parseDocument "# _Hello_\n"
|
||||
putStrLn (show res)
|
||||
args <- getArgs
|
||||
fileContents <- case args of
|
||||
[] -> getContents
|
||||
x : _ -> readFile x
|
||||
let res = fst $ leftmostLongestParse parseDocument fileContents
|
||||
print res
|
||||
|
Loading…
Reference in New Issue