summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-01 09:37:12 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-01 09:37:12 +0000
commit13a22e389490ef6c11afd7362ce346634a805358 (patch)
tree84d32724b424e1fdd25aec7132adae4b0de6c7f0 /parse.y
parent3202eea1a1f5acf939d79b382f118ecfddf2c393 (diff)
merges r30784 from trunk into ruby_1_9_2.
-- * parse.y (lex_getline, parser_set_encode): set encoding of lines in SCRIPT_LINES__ as source encoding. [ruby-dev:43168] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y10
1 files changed, 10 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 330213ca78..ff1747d4e7 100644
--- a/parse.y
+++ b/parse.y
@@ -5204,6 +5204,7 @@ lex_getline(struct parser_params *parser)
must_be_ascii_compatible(line);
#ifndef RIPPER
if (ruby_debug_lines) {
+ rb_enc_associate(line, parser->enc);
rb_ary_push(ruby_debug_lines, line);
}
if (ruby_coverage) {
@@ -6239,6 +6240,15 @@ parser_set_encode(struct parser_params *parser, const char *name)
goto error;
}
parser->enc = enc;
+#ifndef RIPPER
+ if (ruby_debug_lines) {
+ long i, n = RARRAY_LEN(ruby_debug_lines);
+ const VALUE *p = RARRAY_PTR(ruby_debug_lines);
+ for (i = 0; i < n; ++i) {
+ rb_enc_associate_index(*p, idx);
+ }
+ }
+#endif
}
static int