summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-24 16:08:16 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-24 16:08:16 +0000
commit8866dba90dc7e496afa04605d31685e5cd07ce65 (patch)
treee59492a2d11090df6dae0e5bf65662a4cba5e650
parent7920f46e61a341772187eed8b906a6bb94715c61 (diff)
downloadruby-8866dba90dc7e496afa04605d31685e5cd07ce65.tar.gz
ruby-8866dba90dc7e496afa04605d31685e5cd07ce65.tar.xz
ruby-8866dba90dc7e496afa04605d31685e5cd07ce65.zip
merges r23837 from trunk into ruby_1_9_1.
-- * parse.y (parser_set_encode): show the erred file name instead of the file that requires it. [ruby-core:24006] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@23845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--parse.y14
-rw-r--r--version.h2
3 files changed, 18 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 93e59bc63..06e9013d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Jun 24 15:02:29 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_set_encode): show the erred file name instead of
+ the file that requires it. [ruby-core:24006]
+
Mon Jun 22 16:14:30 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* compile.c (iseq_set_arguments, iseq_compile_each): internal
diff --git a/parse.y b/parse.y
index 6596bf8af..735f31c2c 100644
--- a/parse.y
+++ b/parse.y
@@ -6113,13 +6113,23 @@ parser_set_encode(struct parser_params *parser, const char *name)
{
int idx = rb_enc_find_index(name);
rb_encoding *enc;
+ VALUE excargs[3];
if (idx < 0) {
- rb_raise(rb_eArgError, "unknown encoding name: %s", name);
+ VALUE rb_make_backtrace(void);
+ VALUE rb_make_exception(int, VALUE*);
+
+ excargs[1] = rb_sprintf("unknown encoding name: %s", name);
+ error:
+ excargs[0] = rb_eArgError;
+ excargs[2] = rb_make_backtrace();
+ rb_ary_unshift(excargs[2], rb_sprintf("%s:%d", ruby_sourcefile, ruby_sourceline));
+ rb_exc_raise(rb_make_exception(3, excargs));
}
enc = rb_enc_from_index(idx);
if (!rb_enc_asciicompat(enc)) {
- rb_raise(rb_eArgError, "%s is not ASCII compatible", rb_enc_name(enc));
+ excargs[1] = rb_sprintf("%s is not ASCII compatible", rb_enc_name(enc));
+ goto error;
}
parser->enc = enc;
}
diff --git a/version.h b/version.h
index 7d6dd9a8a..86362a286 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "1.9.1"
#define RUBY_RELEASE_DATE "2009-06-25"
-#define RUBY_PATCHLEVEL 202
+#define RUBY_PATCHLEVEL 203
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1