summaryrefslogtreecommitdiff
path: root/test/prism/fixtures/spanning_heredoc.txt
blob: d09cb11b1f7de1d9be1c5b376125ba7a1de3f373 (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
# test regex, string, and lists that span a heredoc thanks to an escaped newline

# ripper incorrectly creates a "b\nb" token instead of two separate string tokens
pp <<-A.gsub(/b\
a
A
b/, "")

# ripper incorrectly creates a "d\nd" token instead of two separate string tokens
pp <<-A, "d\
c
A
d"

# ripper gets this right
pp <<-A, %q[f\
e
A
f]

# ripper incorrectly creates a "h\nh" token instead of two separate string tokens
pp <<-A, %Q[h\
g
A
h]

# ripper can't parse this successfully, though ruby runs it correctly
pp <<-A, %w[j\
i
A
j]

# ripper can't parse this successfully, though ruby runs it correctly
# TODO: prism does not include the "\n" in "l\nl" in the AST like ruby does
pp <<-A, %W[l\
k
A
l]

# ripper can't parse this successfully, though ruby runs it correctly
pp <<-A, %i[n\
m
A
n]

# ripper gets this one wrong in the same way that prism does ...
# TODO: prism does not include the "\n" in "p\np" in the AST like ruby does
pp <<-A, %I[p\
o
A
p]

<<A; /\
A
(?<a>)/ =~ ''

<<A; :'a
A
b'

<<A; :"a
A
b"