diff options
-rw-r--r-- | prism/prism.c | 5 | ||||
-rw-r--r-- | spec/prism.mspec | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/prism/prism.c b/prism/prism.c index 929255ef44..9d9aec00d5 100644 --- a/prism/prism.c +++ b/prism/prism.c @@ -19359,6 +19359,11 @@ pm_parser_init(pm_parser_t *parser, const uint8_t *source, size_t size, const pm pm_newline_list_clear(&parser->newline_list); } } + + // The encoding comment can start after any amount of inline whitespace, so + // here we'll advance it to the first non-inline-whitespace character so + // that it is ready for future comparisons. + parser->encoding_comment_start += pm_strspn_inline_whitespace(parser->encoding_comment_start, parser->end - parser->encoding_comment_start); } /** diff --git a/spec/prism.mspec b/spec/prism.mspec index dd499dbc29..9f20beff0a 100644 --- a/spec/prism.mspec +++ b/spec/prism.mspec @@ -29,8 +29,6 @@ MSpec.register(:exclude, "A Symbol literal raises an SyntaxError at parse time w ## Core MSpec.register(:exclude, "IO.popen with a leading Array argument accepts a trailing Hash of Process.exec options") MSpec.register(:exclude, "IO.popen with a leading Array argument accepts an IO mode argument following the Array") -MSpec.register(:exclude, "Kernel#eval with a magic encoding comment allows spaces before the magic encoding comment") -MSpec.register(:exclude, "Kernel#eval with a magic encoding comment allows a shebang line and some spaces before the magic encoding comment") MSpec.register(:exclude, "TracePoint#eval_script is the evald source code") MSpec.register(:exclude, "TracePoint#event returns the type of event") MSpec.register(:exclude, "TracePoint#inspect returns a String showing the event, method, path and line for a :return event") |