summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-13 03:55:44 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-13 03:55:44 +0000
commitb3ecbfaa01e7c75bfea9c895bb7476c58e998131 (patch)
tree1b23f1e6c0b8291136e64917835310a6cbde1fbc /parse.y
parenta2020f907a942f09c651b1006151c932cdf7e77e (diff)
* eval.c (svalue_to_avalue): v may be Qundef. This fix was
suggested by Guy Decoux. * hash.c (rb_hash_s_create): use rb_hash_aset() instead of calling st_insert() directly, to dup&freeze string keys. * parse.y (yylex): proper error message for "@@0". * parse.y (yylex): paren to parse_string() must be zero for unparenthesized strings. * parse.y (str_extend): broken string when unterminated "#{". * enum.c (enum_sort_by): had a bug in 1 element enumeration. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y13
1 files changed, 9 insertions, 4 deletions
diff --git a/parse.y b/parse.y
index 72fc1183a0..a200f0b14e 100644
--- a/parse.y
+++ b/parse.y
@@ -3241,11 +3241,11 @@ yylex()
return '>';
case '"':
- return parse_string(c,c,c);
+ return parse_string(c,c,0);
case '`':
if (lex_state == EXPR_FNAME) return c;
if (lex_state == EXPR_DOT) return c;
- return parse_string(c,c,c);
+ return parse_string(c,c,0);
case '\'':
return parse_qstring(c,0);
@@ -3896,7 +3896,12 @@ yylex()
c = nextc();
}
if (ISDIGIT(c)) {
- rb_compile_error("`@%c' is not a valid instance variable name", c);
+ if (tokidx == 1) {
+ rb_compile_error("`@%c' is not a valid instance variable name", c);
+ }
+ else {
+ rb_compile_error("`@@%c' is not a valid class variable name", c);
+ }
}
if (!is_identchar(c)) {
pushback(c);
@@ -4196,7 +4201,7 @@ str_extend(list, term, paren)
if (c == paren) paren_nest++;
else if (c == term && (!paren || paren_nest-- == 0)) {
pushback(c);
- list_append(list, NEW_STR(rb_str_new2("#")));
+ list_append(list, NEW_STR(rb_str_new2("#{")));
rb_warn("bad substitution in string");
tokfix();
list_append(list, NEW_STR(rb_str_new(tok(), toklen())));