tree-sitter-tiger/test/corpus/comments.txt
Bruno BELANYI 751929a058 Fix whitespace skipping in scanner
Once again, implicit fall-through is the devil.
2022-06-02 22:27:13 +02:00

131 lines
3.3 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))
================================================================================
Comment with asterisks
================================================================================
/*****/
--------------------------------------------------------------------------------
(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)))
================================================================================
Comment in real code
================================================================================
let
/* This is a comment */
var a := 12
/* This is an other comment */
var b := 27
/* Yet another comment */
in
/* This is the final comment */
(a + b) <> 42
/* Sike! This is the *actual* final comment */
end
--------------------------------------------------------------------------------
(source_file
(let_expression
(comment)
(variable_declaration
(identifier)
(integer_literal))
(comment)
(variable_declaration
(identifier)
(integer_literal))
(comment)
(comment)
(binary_expression
(sequence_expression
(binary_expression
(identifier)
(operator)
(identifier)))
(operator)
(integer_literal))
(comment)))