github.com/aretext/aretext@v1.3.0/syntax/languages/gitcommit.go (about) 1 package languages 2 3 import ( 4 "github.com/aretext/aretext/syntax/parser" 5 ) 6 7 // GitCommitParseFunc parses a git commit. 8 func GitCommitParseFunc() parser.Func { 9 parseCommentLine := consumeString("#"). 10 ThenMaybe(consumeToNextLineFeed). 11 Map(recognizeToken(parser.TokenRoleComment)) 12 return parseCommentLine.Or(consumeToNextLineFeed) 13 }