Skip to content

Commit

Permalink
* parse.y (yylex): __END__ should not be effective within
Browse files Browse the repository at this point in the history
  string literals.

* parse.y (here_document): should be aware of __END__ within here
  documents.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed Jun 24, 2002
1 parent 9020b60 commit 05b4ec8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
14 changes: 14 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ Sun Jun 23 00:19:10 2002 Tadayoshi Funaba <[email protected]>
* lib/date.rb, lib/date/format.rb, sample/cal.rb, sample/goodfriday.rb:
updated to the new version (based on date2 3.3).

Fri Jun 21 18:49:58 2002 Yukihiro Matsumoto <[email protected]>

* parse.y (yylex): __END__ should not be effective within
string literals.

Thu Jun 20 21:09:37 2002 Nobuyoshi Nakada <[email protected]>

* ext/readline/readline.c (readline_readline): get rid of
Expand All @@ -42,6 +47,11 @@ Wed Jun 19 14:46:18 2002 WATANABE Hirofumi <[email protected]>
* ext/extmk.rb, lib/mkmf.rb (xsystem): open the log file if xsystem
is called.

Wed Jun 19 01:01:13 2002 Yukihiro Matsumoto <[email protected]>

* parse.y (here_document): should be aware of __END__ within here
documents.

Wed Jun 19 00:50:50 2002 Nobuyoshi Nakada <[email protected]>

* parse.y (yylex): ? followed by successive word charaters is
Expand All @@ -64,6 +74,10 @@ Tue Jun 18 12:50:17 2002 Nobuyoshi Nakada <[email protected]>

* parse.y (logop): ditto.

Mon Jun 17 11:11:34 2002 Kazuhiro NISHIYAMA <[email protected]>

* string.c (rb_str_crypt): result need not be tainted always.

Mon Jun 17 10:51:37 2002 Nobuyoshi Nakada <[email protected]>

* dln.c (dln_load): need to preserve dln_strerror() result,
Expand Down
1 change: 0 additions & 1 deletion lex.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ hash (str, len)
return hval + asso_values[(unsigned char)str[len - 1]];
}

static
#ifdef __GNUC__
__inline
#endif
Expand Down
3 changes: 1 addition & 2 deletions lib/pstore.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ def transaction(read_only=false)
file.flock(read_only ? File::LOCK_SH : File::LOCK_EX)
if read_only
@table = Marshal::load(file)
elsif orig
content = file.read
elsif orig and (content = file.read) != nil
@table = Marshal::load(content)
size = content.size
md5 = Digest::MD5.digest(content)
Expand Down
14 changes: 8 additions & 6 deletions parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -1778,6 +1778,7 @@ strings : string
}
$$ = node;
}
;

string : string1
| string string1
Expand Down Expand Up @@ -2445,12 +2446,6 @@ nextc()
ruby_sourceline++;
lex_pbeg = lex_p = RSTRING(v)->ptr;
lex_pend = lex_p + RSTRING(v)->len;
if (!lex_strterm && strncmp(lex_pbeg, "__END__", 7) == 0 &&
(RSTRING(v)->len == 7 || lex_pbeg[7] == '\n' || lex_pbeg[7] == '\r')) {
ruby__end__seen = 1;
lex_lastline = 0;
return -1;
}
lex_lastline = v;
}
else {
Expand Down Expand Up @@ -4182,6 +4177,13 @@ yylex()
}
}
tokfix();
if (strcmp(tok(), "__END__") == 0 &&
lex_p - lex_pbeg == 7 &&
(lex_pend == lex_p || *lex_p == '\n' || *lex_p == '\r')) {
ruby__end__seen = 1;
lex_lastline = 0;
return -1;
}
last_id = yylval.id = rb_intern(tok());
return result;
}
Expand Down

0 comments on commit 05b4ec8

Please sign in to comment.