From 7590bd684f00ac8aad5e6f01728145f61ec1d0eb Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 7 Mar 2003 05:59:42 +0000 Subject: * 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: http://svn.ruby-lang.org/repos/ruby/trunk@3561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index c1e75b3fb..1ee563304 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($$)); -- cgit