tree-sitter-bp/test/corpus/comments.txt
Bruno BELANYI b62fc19da9 Make comments a single node in the grammar
This looks to be a *strong* idiom in tree-sitter parsers.
2024-04-11 18:36:20 +01:00

141 lines
3.7 KiB
Plaintext

================================================================================
Empty comment
================================================================================
//
--------------------------------------------------------------------------------
(source_file
(comment))
================================================================================
Single comment
================================================================================
// This is a comment
--------------------------------------------------------------------------------
(source_file
(comment))
================================================================================
Multiple comments
================================================================================
// This is a comment
// This is a second comment
--------------------------------------------------------------------------------
(source_file
(comment)
(comment))
================================================================================
Empty block comment
================================================================================
/**/
--------------------------------------------------------------------------------
(source_file
(comment))
================================================================================
Whitespace block comment
================================================================================
/* */
--------------------------------------------------------------------------------
(source_file
(comment))
================================================================================
Block comment
================================================================================
/* This is a comment */
--------------------------------------------------------------------------------
(source_file
(comment))
================================================================================
Block comment with slashes
================================================================================
/* /// */
--------------------------------------------------------------------------------
(source_file
(comment))
================================================================================
Block comment with asterisks
================================================================================
/* *** */
--------------------------------------------------------------------------------
(source_file
(comment))
================================================================================
Block comment (multiline)
================================================================================
/*
This
is
a
long
comment
*/
--------------------------------------------------------------------------------
(source_file
(comment))
================================================================================
Block comment is not recursive
================================================================================
/* /* */
--------------------------------------------------------------------------------
(source_file
(comment))
================================================================================
Unterminated comment
================================================================================
/*
--------------------------------------------------------------------------------
(source_file
(ERROR))
================================================================================
Comment end-delimiter only
================================================================================
*/
--------------------------------------------------------------------------------
(source_file
(ERROR
(UNEXPECTED '*')))