Ignore useless separators preceding a file encoding comment
This commit is contained in:
parent
a58f9aa350
commit
607aa11711
1
parse.y
1
parse.y
@ -8274,6 +8274,7 @@ set_file_encoding(struct parser_params *p, const char *str, const char *send)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (STRNCASECMP(str-6, "coding", 6) == 0) break;
|
if (STRNCASECMP(str-6, "coding", 6) == 0) break;
|
||||||
|
sep = 0;
|
||||||
}
|
}
|
||||||
for (;;) {
|
for (;;) {
|
||||||
do {
|
do {
|
||||||
|
@ -692,6 +692,14 @@ x = __ENCODING__
|
|||||||
x = __ENCODING__
|
x = __ENCODING__
|
||||||
END
|
END
|
||||||
end
|
end
|
||||||
|
|
||||||
|
assert_nothing_raised do
|
||||||
|
eval <<-END, nil, __FILE__, __LINE__+1
|
||||||
|
# xxxx : coding sjis
|
||||||
|
x = __ENCODING__
|
||||||
|
END
|
||||||
|
end
|
||||||
|
assert_equal(__ENCODING__, x)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_utf8_bom
|
def test_utf8_bom
|
||||||
|
Loading…
x
Reference in New Issue
Block a user