Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Orgdex - an indexer for org-mode files
- module Orgdex where
- import Text.ParserCombinators.Parsec
- myTest = parse node "org-mode" "** TODO Foo :tags:here:"
- node :: Parser (Int, Maybe String, String, [String])
- node = do
- level <- many1 (char '*')
- many1 space
- keyword <- optionMaybe keyword
- node <- many1 (noneOf ":")
- tags <- ((many1 space) >> tags) <|> return []
- return ((length level), keyword, node, tags)
- keyword :: Parser String
- keyword = do
- keyword <- many1 upper
- many1 space
- return keyword
- tags :: Parser [String]
- tags = (char ':') >>
- (sepEndBy1 (many1 alphaNum) (char ':'))
- <?> "Tag list"
Add Comment
Please, Sign In to add comment