| 264 | } |
| 265 | |
| 266 | fn comment<'a>() -> impl Parser<'a, ParserInput<'a>, TokenKind, ParserError<'a>> { |
| 267 | // Extract the common comment text parser |
| 268 | let comment_text = none_of("\n\r").repeated().collect::<String>(); |
| 269 | |
| 270 | just('#').ignore_then( |
| 271 | // One option would be to check that doc comments have new lines in the |
| 272 | // lexer (we currently do in the parser); which would give better error |
| 273 | // messages? |
| 274 | just('!') |
| 275 | .ignore_then(comment_text.map(TokenKind::DocComment)) |
| 276 | .or(comment_text.map(TokenKind::Comment)), |
| 277 | ) |
| 278 | } |
| 279 | |
| 280 | pub fn ident_part<'a>() -> impl Parser<'a, ParserInput<'a>, String, ParserError<'a>> { |
| 281 | let plain = any() |