aboutsummaryrefslogtreecommitdiff
path: root/unit-tests/lexer/comment.test
blob: 65e768cb47d93283b3034a691015745a89ab463b (plain)
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# file      : unit-tests/lexer/comment.test
# copyright : Copyright (c) 2014-2016 Code Synthesis Ltd
# license   : MIT; see accompanying LICENSE file

# Single-line comments.

$* <<EOI >>:EOO # single-only
# comment
EOI
EOO

$* <<EOI >>EOO # single-first
# comment
foo
EOI
'foo'
<newline>
EOO

$* <<EOI >>EOO # single-last
foo
# comment
EOI
'foo'
<newline>
EOO

$* <<EOI >>EOO # single-few
foo
# comment
# comment
EOI
'foo'
<newline>
EOO

$* <<EOI >>EOO # single-cont
foo
# comment\\
bar
EOI
'foo'
<newline>
'bar'
<newline>
EOO

$* <<EOI >>EOO # single-same
foo # comment
bar # comment
EOI
'foo'
<newline>
'bar'
<newline>
EOO

# Multi-line comments.
#

$* <<EOI >>:EOO # multi-only
#\
comment
comment
#\
EOI
EOO

$* <<EOI >>:EOO # multi-empty
#\
#\
EOI
EOO

$* <<EOI >>EOO # multi-start-same
foo #\
comment
comment
#\
EOI
'foo'
<newline>
EOO

$* <<EOI >>EOO # multi-end-same
#\
comment
comment
foo #\
bar
EOI
'bar'
<newline>
EOO

$* <<EOI >>EOO # multi-end-not
#\
comment
#\ not an end
foo #\
bar
EOI
'bar'
<newline>
EOO

$* <<EOI 2>>EOE != 0 # multi-unterm
#\
comment
EOI
stdin:3:1: error: unterminated multi-line comment
EOE