From 12c84beae4698278ea664dcaffa944d369a401c3 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 12 Oct 2007 15:04:46 +0000 Subject: * parse.y: encoding specifier should work if the line matches /coding[:=] ?/, a la Python PEP-263, so that VIM comments like "# vim: set fileencoding=" should be recognized. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index fe90b3c6e..0431622e3 100644 --- a/parse.y +++ b/parse.y @@ -5708,13 +5708,7 @@ set_file_encoding(struct parser_params *parser, const char *str, const char *sen if (ISSPACE(*str)) break; continue; } -#define BOW_P(p) ((p) == beg || !(ISALNUM((p)[-1]) || (p)[-1] == '_')) - if (strncasecmp(str-6, "coding", 6)) continue; - if (BOW_P(str-6)) break; - if (str - beg < 8) continue; - if (strncasecmp(str-8, "en", 2)) continue; - if (BOW_P(str-8)) break; -#undef BOW_P + if (strncasecmp(str-6, "coding", 6) == 0) break; } for (;;) { do { -- cgit