Added grammar of comments#85
Conversation
dfb4236 to
586e630
Compare
src/comments.md
Outdated
|
|
||
| > **<sup>Lexer</sup>** | ||
| > LINE_COMMENT : | ||
| > `//` ~[\n\r]* |
There was a problem hiding this comment.
A line comment can include bare CRs unless it isn't a doc-comment.
src/comments.md
Outdated
| > `/*` (BLOCK_COMMENT | .)* `*/` | ||
| > | ||
| > OUTER_DOC_LINE_COMMENT : | ||
| > `//!` ~[\n\r]* |
There was a problem hiding this comment.
Only one of LF/CRLF/EOF can end outer/inner doc line comments and bare CR isn't allowed here. For example, "//! foo \r//! bar\n" will lead to a syntax error. The difficulty here would be to express the fact that //! foo \r//! bar\n isn't a non-doc comment neither.
src/comments.md
Outdated
| > `/*!` (OUTER_DOC_BLOCK_COMMENT | .)* `*/` | ||
| > | ||
| > INNER_DOC_LINE_COMMENT : | ||
| > `///` ~[\n\r]* |
There was a problem hiding this comment.
There is an exception: comments starting with //// is a non-doc line comment.
src/comments.md
Outdated
| > `//!` ~[\n\r]* | ||
| > | ||
| > OUTER_DOC_BLOCK_COMMENT : | ||
| > `/*!` (OUTER_DOC_BLOCK_COMMENT | .)* `*/` |
There was a problem hiding this comment.
In outer/inner doc block comments, any kinds of block comments /* */ /** */ /*! */ can be nested.
There was a problem hiding this comment.
In outer/inner doc comments, bare CR isn't allowed. CRLF is allowed instead.
|
@qnighy Thank you for your comments 👍 I changed the comments' grammar to account for the special cases (and put a lot of examples to make these clear). I'll try to tackle the CR / CRLF problem tomorrow. |
9f094be to
c623f98
Compare
|
@brauliobz What's the status here? |
|
@Havvy I got involved with other parts of the grammar and forgot about this one :/ . The remaining problem here is the CR/LF details. I'm doing it now. |
|
LGTM, thanks! |
Issue #84