From 6a3c97169c8a671f5feda7eba2b2a7529252daf3 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 23 Jun 1998 10:30:12 +0000 Subject: *** empty log message *** git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ parse.y | 11 ++++++++++- regex.c | 10 +++++----- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 747320febd..61cebdf250 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Jun 23 11:46:16 1998 Yukihiro Matsumoto + + * parse.y (yylex): `&&=' and `||=' added. + Sat Jun 20 02:53:50 1998 Yukihiro Matsumoto * parse.y (assignable): nesting local variables should have higher diff --git a/parse.y b/parse.y index 8b1376659e..de14f4f6ea 100644 --- a/parse.y +++ b/parse.y @@ -441,7 +441,6 @@ mlhs : mlhs_head { $$ = $2; } - | mlhs_head tSTAR lhs { $$ = NEW_MASGN(NEW_LIST($1), $3); @@ -2470,6 +2469,11 @@ retry: case '&': if ((c = nextc()) == '&') { lex_state = EXPR_BEG; + if ((c = nextc()) == '=') { + yylval.id = tANDOP; + return tOP_ASGN; + } + pushback(c); return tANDOP; } else if (c == '=') { @@ -2493,6 +2497,11 @@ retry: case '|': lex_state = EXPR_BEG; if ((c = nextc()) == '|') { + if ((c = nextc()) == '=') { + yylval.id = tOROP; + return tOP_ASGN; + } + pushback(c); return tOROP; } else if (c == '=') { diff --git a/regex.c b/regex.c index accfbdf457..fbe91ecdee 100644 --- a/regex.c +++ b/regex.c @@ -2824,7 +2824,7 @@ typedef union } while(0) #define AT_STRINGS_BEG(d) (d == string) -#define AT_STRINGS_END(d) (d == dend) +#define AT_STRINGS_END(d) (d == dend) #define AT_WORD_BOUNDARY(d) \ (AT_STRINGS_BEG(d) || AT_STRINGS_END(d) || IS_A_LETTER(d - 1) != IS_A_LETTER(d)) @@ -3300,14 +3300,14 @@ re_match(bufp, string_arg, size, pos, regs) case begline: if (size == 0 - || d == string + || AT_STRINGS_BEG(d) || (d && d[-1] == '\n')) break; else goto fail; case endline: - if (d == dend || *d == '\n') + if (AT_STRINGS_END(d) || *d == '\n') break; goto fail; @@ -3604,7 +3604,7 @@ re_match(bufp, string_arg, size, pos, regs) if (*p == 0xff) { p++; if (!--mcnt - || d == dend + || AT_STRINGS_END(d) || (unsigned char)*d++ != (unsigned char)*p++) goto fail; continue; @@ -3613,7 +3613,7 @@ re_match(bufp, string_arg, size, pos, regs) if (c != (unsigned char)*p++ || !--mcnt /* redundant check if pattern was compiled properly. */ - || d == dend + || AT_STRINGS_END(d) || (unsigned char)*d++ != (unsigned char)*p++) goto fail; continue; -- cgit v1.2.3