mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
45 lines
802 B
XML
45 lines
802 B
XML
// Test line and block comments.
|
|
|
|
--- comments ---
|
|
// Line comment acts as spacing.
|
|
A// you
|
|
B
|
|
|
|
// Block comment does not act as spacing, nested block comments.
|
|
C/*
|
|
/* */
|
|
*/D
|
|
|
|
// Works in code.
|
|
#test(type(/*1*/ 1) //
|
|
, int)
|
|
|
|
// End of block comment in line comment.
|
|
// Hello */
|
|
|
|
// Nested "//" doesn't count as line comment.
|
|
/* // */
|
|
E
|
|
|
|
/*//*/
|
|
This is a comment.
|
|
*/*/
|
|
|
|
--- comment-end-of-line ---
|
|
// Test comments at the end of a line
|
|
First part//
|
|
Second part
|
|
|
|
// Test comments at the end of a line with pre-spacing
|
|
First part //
|
|
Second part
|
|
|
|
--- comment-block-unclosed ---
|
|
// End should not appear without start.
|
|
// Error: 7-9 unexpected end of block comment
|
|
// Hint: 7-9 consider escaping the `*` with a backslash or opening the block comment with `/*`
|
|
/* */ */
|
|
|
|
// Unterminated is okay.
|
|
/*
|