2022-06-02 11:03:55 +02:00
|
|
|
================================================================================
|
|
|
|
Empty comment
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
/**/
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
(comment))
|
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Whitespace comment
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
/* */
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
(comment))
|
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Comment
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
/* This is a comment */
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
(comment))
|
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Comment with slashes
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
/* /// */
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
2022-06-02 22:14:03 +02:00
|
|
|
|
|
|
|
(source_file
|
|
|
|
(comment))
|
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Comment with asterisks
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
/*****/
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
2022-06-02 11:03:55 +02:00
|
|
|
|
|
|
|
(source_file
|
|
|
|
(comment))
|
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Nested comment
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
/* This is /* a /* nested */ comment */*/
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
2022-06-02 16:13:55 +02:00
|
|
|
(comment))
|
2022-06-02 11:03:55 +02:00
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Unterminated comment
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
(ERROR
|
|
|
|
(operator)
|
|
|
|
(operator)))
|
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Comment end-delimiter only
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
(ERROR
|
|
|
|
(operator)
|
|
|
|
(operator)))
|
2022-06-02 22:27:00 +02:00
|
|
|
|
|
|
|
================================================================================
|
|
|
|
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)
|
2022-06-03 11:42:57 +02:00
|
|
|
(operator)
|
2022-06-02 22:27:00 +02:00
|
|
|
(integer_literal))
|
|
|
|
(comment)
|
|
|
|
(variable_declaration
|
|
|
|
(identifier)
|
2022-06-03 11:42:57 +02:00
|
|
|
(operator)
|
2022-06-02 22:27:00 +02:00
|
|
|
(integer_literal))
|
|
|
|
(comment)
|
|
|
|
(comment)
|
|
|
|
(binary_expression
|
|
|
|
(sequence_expression
|
|
|
|
(binary_expression
|
|
|
|
(identifier)
|
|
|
|
(operator)
|
|
|
|
(identifier)))
|
|
|
|
(operator)
|
|
|
|
(integer_literal))
|
|
|
|
(comment)))
|