summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-07 05:59:42 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-07 05:59:42 +0000
commit9d77639f30172b0e3b88ea22df0724df61240161 (patch)
tree842fe16738ccff2dee8b962b1ed71ddc0eda62c5 /parse.y
parent5208fec1cfd93841e0b1a89c42cc2e8692e1aa9c (diff)
* parse.y (dsym): :"symbol string" style should not contain `\0'.
* process.c (proc_detach): new method Proc#detach(pid) which create background watcher thread to issue waitpid. [new] * process.c (rb_detach_process): utility function to detach process from C code. * ext/pty/pty.c (pty_finalize_syswait): terminate watcher thread, and detach child process (by creating new idle waitpid watcher thread). * ext/pty/pty.c (pty_syswait): may lost signal stopped child. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y14
1 files changed, 9 insertions, 5 deletions
diff --git a/parse.y b/parse.y
index c1e75b3..1ee5633 100644
--- a/parse.y
+++ b/parse.y
@@ -924,9 +924,10 @@ op : '|' { $$ = '|'; }
reswords : k__LINE__ | k__FILE__ | klBEGIN | klEND
| kALIAS | kAND | kBEGIN | kBREAK | kCASE | kCLASS | kDEF
| kDEFINED | kDO | kELSE | kELSIF | kEND | kENSURE | kFALSE
- | kFOR | kIF_MOD | kIN | kMODULE | kNEXT | kNIL | kNOT
+ | kFOR | kIN | kMODULE | kNEXT | kNIL | kNOT
| kOR | kREDO | kRESCUE | kRETRY | kRETURN | kSELF | kSUPER
| kTHEN | kTRUE | kUNDEF | kWHEN | kYIELD
+ | kIF_MOD | kUNLESS_MOD | kWHILE_MOD | kUNTIL_MOD | kRESCUE_MOD
;
arg : lhs '=' arg
@@ -2095,13 +2096,16 @@ dsym : tSYMBEG xstring_contents tSTRING_END
}
else {
switch (nd_type($$)) {
- case NODE_STR:
- $$->nd_lit = ID2SYM(rb_intern(RSTRING($$->nd_lit)->ptr));
- nd_set_type($$, NODE_LIT);
- break;
case NODE_DSTR:
nd_set_type($$, NODE_DSYM);
break;
+ case NODE_STR:
+ if (strlen(RSTRING($$->nd_lit)->ptr) == RSTRING($$->nd_lit)->len) {
+ $$->nd_lit = ID2SYM(rb_intern(RSTRING($$->nd_lit)->ptr));
+ nd_set_type($$, NODE_LIT);
+ break;
+ }
+ /* fall through */
default:
$$ = rb_node_newnode(NODE_DSYM, rb_str_new(0, 0),
1, NEW_LIST($$));