Commit 4683a196 authored by Seeker's avatar Seeker

Fix regression for squiggly heredocs

parent 1fbabe20
......@@ -4700,12 +4700,12 @@ parse_string(parser_state *p)
pylval.nd = nd;
if (head) {
hinf->indented = push(hinf->indented, cons((node*)spaces, nd->cdr));
if ((hinf->indent == -1 || spaces < hinf->indent) && (!empty || !hinf->line_head))
if ((hinf->indent == -1 || spaces < hinf->indent) && (!empty || !line_head))
hinf->indent = spaces;
}
return tHD_STRING_MID;
}
if (hinf && hinf->line_head) {
if (hinf && hinf->line_head && empty) {
if (ISSPACE(c)) {
if (hinf->indent_char == -1)
hinf->indent_char = c;
......
......@@ -11085,12 +11085,12 @@ parse_string(parser_state *p)
pylval.nd = nd;
if (head) {
hinf->indented = push(hinf->indented, cons((node*)spaces, nd->cdr));
if ((hinf->indent == -1 || spaces < hinf->indent) && (!empty || !hinf->line_head))
if ((hinf->indent == -1 || spaces < hinf->indent) && (!empty || !line_head))
hinf->indent = spaces;
}
return tHD_STRING_MID;
}
if (hinf && hinf->line_head) {
if (hinf && hinf->line_head && empty) {
if (ISSPACE(c)) {
if (hinf->indent_char == -1)
hinf->indent_char = c;
......
......@@ -190,6 +190,10 @@ QQ2
\tvvv
vvv
VVV
v3 = <<~VVV
v v v
vvv
VVV
w = %W( 1 #{<<WWW} 3
www
......@@ -232,6 +236,7 @@ ZZZ
assert_equal ["u1u\n", "u2u\n", "u\#{3}u\n"], u
assert_equal "\nvvv\nvvv\n", v1
assert_equal "\tvvv\n vvv\n", v2
assert_equal "v v v\n vvv\n", v3
assert_equal ["1", "www\n", "3", "4", "5"], w
assert_equal [1, "foo 222 333\n 444\n5\n bar\n6\n", 9], x
assert_equal "", z
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment