Permalink
Browse files

also treat lines beginning with * as comments, allowing org mode

  • Loading branch information...
simonmichael committed Sep 22, 2018
1 parent cec717f commit 41bdadeb5f1a3c27db752b0cfdb929aa587e1646
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/Parse.hs
@@ -390,7 +390,8 @@ line = (anyChar `manyTill` newline) <?> "rest of line"
whitespacechar = oneOf " \t"
whitespace = many whitespacechar
whitespaceline = try (newline >> return "") <|> try (whitespacechar >> whitespacechar `manyTill` newlineoreof)
commentline = try (whitespace >> char '#' >> lineoreof) <?> "comments"
-- a line beginning with optional whitespace and #, or beginning with one or more * (an org node)
commentline = try ((many1 (char '*') <|> (whitespace >> many1 (char '#'))) >> lineoreof) <?> "comments"
whitespaceorcommentline = commentline <|> whitespaceline
whitespaceorcommentlineoreof = choice [eofasstr, commentline, whitespaceline]
eofasstr = eof >> return ""

0 comments on commit 41bdade

Please sign in to comment.