mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-19 10:17:35 +03:00
journal, csv: comment lines can also start with *
As in Ledger. This means you can embed emacs org/outline-mode nodes in your journal file and manipulate it like an outline.
This commit is contained in:
parent
a719cb8f6e
commit
9c68944c79
@ -383,7 +383,9 @@ P 2010/1/1 € $1.40
|
|||||||
|
|
||||||
#### Comments
|
#### Comments
|
||||||
|
|
||||||
- A semicolon (`;`) or hash (`#`) in column 0 starts a journal comment line, which hledger will ignore.
|
- A semicolon (`;`) or hash (`#`) or asterisk (`*`) in column 0 starts
|
||||||
|
a journal comment line, which hledger will ignore. (Asterisk allows you
|
||||||
|
to embed emacs org/outline-mode nodes and treat your journal like an outline.)
|
||||||
|
|
||||||
- A semicolon after a transaction's description and/or indented on the following lines
|
- A semicolon after a transaction's description and/or indented on the following lines
|
||||||
starts a transaction comment.
|
starts a transaction comment.
|
||||||
|
@ -410,7 +410,7 @@ commentline :: Stream [Char] m t => ParsecT [Char] CsvRules m ()
|
|||||||
commentline = many spacenonewline >> commentchar >> restofline >> return () <?> "comment line"
|
commentline = many spacenonewline >> commentchar >> restofline >> return () <?> "comment line"
|
||||||
|
|
||||||
commentchar :: Stream [Char] m t => ParsecT [Char] CsvRules m Char
|
commentchar :: Stream [Char] m t => ParsecT [Char] CsvRules m Char
|
||||||
commentchar = oneOf ";#"
|
commentchar = oneOf ";#*"
|
||||||
|
|
||||||
directive :: Stream [Char] m t => ParsecT [Char] CsvRules m (DirectiveName, String)
|
directive :: Stream [Char] m t => ParsecT [Char] CsvRules m (DirectiveName, String)
|
||||||
directive = do
|
directive = do
|
||||||
|
@ -905,7 +905,10 @@ followingcommentp =
|
|||||||
return $ unlines $ samelinecomment:newlinecomments
|
return $ unlines $ samelinecomment:newlinecomments
|
||||||
|
|
||||||
comment :: Stream [Char] m Char => ParsecT [Char] JournalContext m String
|
comment :: Stream [Char] m Char => ParsecT [Char] JournalContext m String
|
||||||
comment = commentStartingWith "#;"
|
comment = commentStartingWith commentchars
|
||||||
|
|
||||||
|
commentchars :: [Char]
|
||||||
|
commentchars = "#;*"
|
||||||
|
|
||||||
semicoloncomment :: Stream [Char] m Char => ParsecT [Char] JournalContext m String
|
semicoloncomment :: Stream [Char] m Char => ParsecT [Char] JournalContext m String
|
||||||
semicoloncomment = commentStartingWith ";"
|
semicoloncomment = commentStartingWith ";"
|
||||||
|
Loading…
Reference in New Issue
Block a user