private void _comment ( ) throws IOException , CssException { if ( debug ) { checkState ( reader . curChar == ' ' && reader . peek ( ) == ' ' ) ; } /* * badcomment1 \/\*[^*]*\*+([^/*][^*]*\*+)* badcomment2 * \/\*[^*]*(\*+[^/*][^*]*)* comment \/\*[^*]*\*+([^/*][^*]*\*+)*\/ * * * "comments can not nest" just close at first occurrence of comment * close and let the grammar level handle reporting */ builder . type = Type . COMMENT ; reader . next ( ) ; // '*' while ( true ) { Mark mark = reader . mark ( ) ; int ch = reader . next ( ) ; if ( ch == - 1 ) { builder . error ( SCANNER_PREMATURE_EOF , reader ) ; reader . unread ( ch , mark ) ; break ; } else if ( ch == ' ' && reader . peek ( ) == ' ' ) { reader . next ( ) ; break ; } else { builder . append ( ch ) ; } } if ( debug && builder . errors . size ( ) < 1 ) { checkState ( ' ' == reader . curChar && ' ' == reader . prevChar ) ; } }
Builds a comment token excluding the leading and trailing comment tokens .