Bruno BELANYI
50a0eaa071
Unfortunately, the 'extras' array expects single tokens only, so one can't really use a recursive parsing rule to express nesting comments...
81 lines
2.1 KiB
Plaintext
81 lines
2.1 KiB
Plaintext
================================================================================
|
|
Empty comment
|
|
================================================================================
|
|
|
|
/**/
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(comment))
|
|
|
|
================================================================================
|
|
Whitespace comment
|
|
================================================================================
|
|
|
|
/* */
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(comment))
|
|
|
|
================================================================================
|
|
Comment
|
|
================================================================================
|
|
|
|
/* This is a comment */
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(comment))
|
|
|
|
================================================================================
|
|
Comment with slashes
|
|
================================================================================
|
|
|
|
/* /// */
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(comment))
|
|
|
|
================================================================================
|
|
Nested comment
|
|
================================================================================
|
|
|
|
/* This is /* a /* nested */ comment */*/
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(comment))
|
|
|
|
================================================================================
|
|
Unterminated comment
|
|
================================================================================
|
|
|
|
/*
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(ERROR
|
|
(operator)
|
|
(operator)))
|
|
|
|
================================================================================
|
|
Comment end-delimiter only
|
|
================================================================================
|
|
|
|
*/
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(source_file
|
|
(ERROR
|
|
(operator)
|
|
(operator)))
|