* parse.y: encoding specifier should work if the line matches
/coding[:=] ?/, a la Python PEP-263, so that VIM comments like "# vim: set fileencoding=<encoding name>" should be recognized. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ba9eb2c929
commit
d962ef7454
@ -1,3 +1,9 @@
|
|||||||
|
Sat Oct 13 00:00:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* parse.y: encoding specifier should work if the line matches
|
||||||
|
/coding[:=] ?/, a la Python PEP-263, so that VIM comments like
|
||||||
|
"# vim: set fileencoding=<encoding name>" should be recognized.
|
||||||
|
|
||||||
Fri Oct 12 15:04:54 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Oct 12 15:04:54 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* trunk/parse.y (magic_comments): add "encoding" as same as "coding".
|
* trunk/parse.y (magic_comments): add "encoding" as same as "coding".
|
||||||
|
8
parse.y
8
parse.y
@ -5708,13 +5708,7 @@ set_file_encoding(struct parser_params *parser, const char *str, const char *sen
|
|||||||
if (ISSPACE(*str)) break;
|
if (ISSPACE(*str)) break;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#define BOW_P(p) ((p) == beg || !(ISALNUM((p)[-1]) || (p)[-1] == '_'))
|
if (strncasecmp(str-6, "coding", 6) == 0) break;
|
||||||
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
|
|
||||||
}
|
}
|
||||||
for (;;) {
|
for (;;) {
|
||||||
do {
|
do {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#define RUBY_VERSION "1.9.0"
|
#define RUBY_VERSION "1.9.0"
|
||||||
#define RUBY_RELEASE_DATE "2007-10-12"
|
#define RUBY_RELEASE_DATE "2007-10-13"
|
||||||
#define RUBY_VERSION_CODE 190
|
#define RUBY_VERSION_CODE 190
|
||||||
#define RUBY_RELEASE_CODE 20071012
|
#define RUBY_RELEASE_CODE 20071013
|
||||||
#define RUBY_PATCHLEVEL 0
|
#define RUBY_PATCHLEVEL 0
|
||||||
|
|
||||||
#define RUBY_VERSION_MAJOR 1
|
#define RUBY_VERSION_MAJOR 1
|
||||||
@ -9,7 +9,7 @@
|
|||||||
#define RUBY_VERSION_TEENY 0
|
#define RUBY_VERSION_TEENY 0
|
||||||
#define RUBY_RELEASE_YEAR 2007
|
#define RUBY_RELEASE_YEAR 2007
|
||||||
#define RUBY_RELEASE_MONTH 10
|
#define RUBY_RELEASE_MONTH 10
|
||||||
#define RUBY_RELEASE_DAY 12
|
#define RUBY_RELEASE_DAY 13
|
||||||
|
|
||||||
#ifdef RUBY_EXTERN
|
#ifdef RUBY_EXTERN
|
||||||
RUBY_EXTERN const char ruby_version[];
|
RUBY_EXTERN const char ruby_version[];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user