summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-11-09 09:11:52 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-11-09 09:11:52 +0000
commitee5ab9cc136baf18756abc6bd5d136a0231f973e (patch)
treeabdc351cbffd7b67f63f41ea08f544819af0a28b /parse.y
parentdc8da69e7cbc54f020ef1182fd28e57bbaa40fc3 (diff)
1.1c7
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y20
1 files changed, 14 insertions, 6 deletions
diff --git a/parse.y b/parse.y
index eac498a08c..3bf2bee981 100644
--- a/parse.y
+++ b/parse.y
@@ -569,10 +569,11 @@ reswords : k__LINE__ | k__FILE__ | klBEGIN | klEND
| kTHEN | kTRUE | kUNDEF | kUNLESS_MOD | kUNTIL_MOD | kWHEN
| kWHILE_MOD | kYIELD
-arg : variable '=' arg
+arg : variable '=' {$$ = assignable($1, 0);} arg
{
- $$ = assignable($1, $3);
- fixpos($$, $3);
+ $$ = $<node>3;
+ $$->nd_value = $4;
+ fixpos($$, $4);
}
| primary '[' aref_args ']' '=' arg
{
@@ -2384,6 +2385,9 @@ retry:
case '=':
if (lex_p == lex_pbeg + 1) {
+ if (!lex_input) {
+ Error("embedded document not available in eval");
+ }
/* skip embedded rd document */
if (strncmp(lex_p, "begin", 5) == 0 && ISSPACE(lex_p[5])) {
for (;;) {
@@ -2430,7 +2434,7 @@ retry:
int c2 = nextc();
if (!ISSPACE(c2) && (strchr("\"'`", c2) || is_identchar(c2))) {
if (!lex_input) {
- ArgError("here document not available");
+ ArgError("here document not available in eval");
}
return here_document(c2);
}
@@ -4065,8 +4069,12 @@ rb_intern(name)
strncpy(buf, name, last);
buf[last] = '\0';
- id = id_attrset(rb_intern(buf));
- goto id_regist;
+ id = rb_intern(buf);
+ if (id > LAST_TOKEN) {
+ id = id_attrset(id);
+ goto id_regist;
+ }
+ id |= ID_ATTRSET;
}
else if (ISUPPER(name[0])) {
id = ID_CONST;