Whitespace and comment pretokens
Whitespace
Grammar
Whitespace = { PATTERN_WHITE_SPACE + }
Pretoken kind
Whitespace
Attributes
(none)
Line comment
Grammar
Line_comment = { "//" ~ LINE_COMMENT_CONTENT }
LINE_COMMENT_CONTENT = { ( !"\n" ~ ANY )* }
Pretoken kind
LineComment
Attributes
comment content | from LINE_COMMENT_CONTENT |
Block comment
Grammar
Block_comment = { "/*" ~ BLOCK_COMMENT_CONTENT ~ "*/" }
BLOCK_COMMENT_CONTENT = { ( Block_comment | !"*/" ~ !"/*" ~ ANY ) * }
Pretoken kind
BlockComment
Attributes
comment content | from BLOCK_COMMENT_CONTENT |
Note: See Nested block comments for discussion of the
!"/*"
subexpression.
Unterminated block comment
Grammar
Unterminated_block_comment = { "/*" }
Pretoken kind
Reserved
Attributes
(none)
Note: This definition makes sure that an unterminated block comment isn't accepted as punctuation (* followed by /).