Skip to content

Commit 586e630

Browse files
committed
Added grammar of comments
1 parent 2c29398 commit 586e630

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/comments.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Comments
22

3+
> **<sup>Lexer</sup>**
4+
> LINE_COMMENT :
5+
> &nbsp;&nbsp; `//` ~[\n\r]*
6+
>
7+
> BLOCK_COMMENT :
8+
> &nbsp;&nbsp; `/*` (BLOCK_COMMENT | .)* `*/`
9+
>
10+
> OUTER_DOC_LINE_COMMENT :
11+
> &nbsp;&nbsp; `//!` ~[\n\r]*
12+
>
13+
> OUTER_DOC_BLOCK_COMMENT :
14+
> &nbsp;&nbsp; `/*!` (OUTER_DOC_BLOCK_COMMENT | .)* `*/`
15+
>
16+
> INNER_DOC_LINE_COMMENT :
17+
> &nbsp;&nbsp; `///` ~[\n\r]*
18+
>
19+
> INNER_DOC_BLOCK_COMMENT :
20+
> &nbsp;&nbsp; `/**` (INNER_DOC_BLOCK_COMMENT | .)* `*/`
21+
322
Comments in Rust code follow the general C++ style of line (`//`) and
423
block (`/* ... */`) comment forms. Nested block comments are supported.
524

0 commit comments

Comments
 (0)