summaryrefslogtreecommitdiff
path: root/tests/suite/syntax/comment.typ
blob: 88802fe977ff171ebc39e3ac40a35d404a41ca58 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// 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

--- issue-4632-sth-followed-by-comment ---
// Test heading markers followed by comments.
#test([
  =// Comment
  =/* Comment */
], [
  =
  =
])

// Test list markers followed by comments.
#test([
  -// Comment
  -/* Comment */
], [
  -
  -
])

// Test enum markers followed by comments.
#test([
  +// Comment
  +/* Comment */

  1.// Comment
  2./* Comment */
], [
  +
  +

  1.
  2.
])


--- 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.
/*