mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Ignore useless separators preceding a file encoding comment
This commit is contained in:
parent
a58f9aa350
commit
607aa11711
2 changed files with 9 additions and 0 deletions
1
parse.y
1
parse.y
|
@ -8274,6 +8274,7 @@ set_file_encoding(struct parser_params *p, const char *str, const char *send)
|
|||
continue;
|
||||
}
|
||||
if (STRNCASECMP(str-6, "coding", 6) == 0) break;
|
||||
sep = 0;
|
||||
}
|
||||
for (;;) {
|
||||
do {
|
||||
|
|
|
@ -692,6 +692,14 @@ x = __ENCODING__
|
|||
x = __ENCODING__
|
||||
END
|
||||
end
|
||||
|
||||
assert_nothing_raised do
|
||||
eval <<-END, nil, __FILE__, __LINE__+1
|
||||
# xxxx : coding sjis
|
||||
x = __ENCODING__
|
||||
END
|
||||
end
|
||||
assert_equal(__ENCODING__, x)
|
||||
end
|
||||
|
||||
def test_utf8_bom
|
||||
|
|
Loading…
Reference in a new issue