on master help sign in
Merge pull request #344 from andy-morris/comment
e221d08Edwin Brady
src/Core/CoreParser.hs+10−7
@@ -57,13 +57,16 @@ lexWS = do i <- getInput
57 where
57 where
58
58
59 simpleSpace = skipMany1 (satisfy isSpace)
59 simpleSpace = skipMany1 (satisfy isSpace)
60− oneLineComment = do try (do string ("--")
60+ oneLineComment =
61+ try (void $ string "--\n") <|>
62+ do try (do string "--"
61− satisfy (\x -> x /= '|' && x /= '^'))
63+ satisfy (\x -> x /= '|' && x /= '^'))
62− skipMany (satisfy (/= '\n'))
64+ skipMany (satisfy (/= '\n'))
63− return ()
64− multiLineComment = do try (do string "{-"
65+ multiLineComment =
66+ try (void $ string "{--}") <|>
67+ do try (do string "{-"
65− satisfy (\x -> x /= '|' && x /= '^'))
68+ satisfy (\x -> x /= '|' && x /= '^'))
66− inCommentMulti
69+ inCommentMulti
67
70
68 inCommentMulti
71 inCommentMulti
69 = do{ try (string "-}") ; return () }
72 = do{ try (string "-}") ; return () }
test/test028/expectednew file+1
@@ -0,0 +1 @@
1+hello, world!
test/test028/runnew file+4
@@ -0,0 +1,4 @@
1+#!/bin/bash
2+idris $@ test028.idr -o test028
3+./test028
4+rm -f test028 test028.ibc
test/test028/test028.idrnew file+5
@@ -0,0 +1,5 @@
1+{--}
2+module Main
3+--
4+main : IO ()
5+main = print "hello, world!"