* lib/date/format.rb: suppressed a warning.

* lib/irb/ruby-lex.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2009-08-16 12:32:35 +00:00
Родитель 066b30245b
Коммит 5e4f23d600
3 изменённых файлов: 15 добавлений и 9 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Sun Aug 16 21:31:21 2009 NARUSE, Yui <naruse@ruby-lang.org>
* lib/date/format.rb: suppressed a warning.
* lib/irb/ruby-lex.rb: ditto.
Sun Aug 16 15:25:26 2009 NARUSE, Yui <naruse@ruby-lang.org> Sun Aug 16 15:25:26 2009 NARUSE, Yui <naruse@ruby-lang.org>
* lib/csv.rb: Change magic comment to US-ASCII in order to * lib/csv.rb: Change magic comment to US-ASCII in order to

Просмотреть файл

@ -544,8 +544,8 @@ class Date
e._cent ||= if val >= 69 then 19 else 20 end e._cent ||= if val >= 69 then 19 else 20 end
when 'Z', /\A:{0,3}z/ when 'Z', /\A:{0,3}z/
return unless str.sub!(/\A((?:gmt|utc?)?[-+]\d+(?:[,.:]\d+(?::\d+)?)? return unless str.sub!(/\A((?:gmt|utc?)?[-+]\d+(?:[,.:]\d+(?::\d+)?)?
|[[:alpha:].\s]+(?:standard|daylight)\s+time\b |[a-z.\s]+(?:standard|daylight)\s+time\b
|[[:alpha:]]+(?:\s+dst)?\b |[a-z]+(?:\s+dst)?\b
)/ix, '') )/ix, '')
val = $1 val = $1
e.zone = val e.zone = val
@ -560,8 +560,8 @@ class Date
end end
else else
case c case c
when /\A[\s\v]/ when /\A\s/
str.sub!(/\A[\s\v]+/, '') str.sub!(/\A\s+/, '')
else else
return unless str.sub!(Regexp.new('\\A' + Regexp.quote(a)), '') return unless str.sub!(Regexp.new('\\A' + Regexp.quote(a)), '')
end end
@ -703,9 +703,9 @@ class Date
( (
(?:gmt|utc?)?[-+]\d+(?:[,.:]\d+(?::\d+)?)? (?:gmt|utc?)?[-+]\d+(?:[,.:]\d+(?::\d+)?)?
| |
[[:alpha:].\s]+(?:standard|daylight)\stime\b [a-z.\s]+(?:standard|daylight)\stime\b
| |
[[:alpha:]]+(?:\sdst)?\b [a-z]+(?:\sdst)?\b
) )
)? )?
/ix, /ix,
@ -1034,7 +1034,7 @@ class Date
e._comp = comp e._comp = comp
str.gsub!(/[^-+',.\/:@[:alnum:]\[\]]+/, ' ') str.gsub!(/[^-+',.\/:@0-9a-zA-Z\[\]]+/, ' ')
_parse_time(str, e) # || _parse_beat(str, e) _parse_time(str, e) # || _parse_beat(str, e)
_parse_day(str, e) _parse_day(str, e)

Просмотреть файл

@ -407,7 +407,7 @@ class RubyLex
if @lex_state != EXPR_END && @lex_state != EXPR_CLASS && if @lex_state != EXPR_END && @lex_state != EXPR_CLASS &&
(@lex_state != EXPR_ARG || @space_seen) (@lex_state != EXPR_ARG || @space_seen)
c = peek(0) c = peek(0)
if /\S/ =~ c && (/["'`]/ =~ c || /[\w_]/ =~ c || c == "-") if /\S/ =~ c && (/["'`]/ =~ c || /\w/ =~ c || c == "-")
tk = identify_here_document tk = identify_here_document
end end
end end
@ -728,7 +728,7 @@ class RubyLex
printf "MATCH: start %s: %s\n", op, io.inspect if RubyLex.debug? printf "MATCH: start %s: %s\n", op, io.inspect if RubyLex.debug?
if peek(0) =~ /[0-9]/ if peek(0) =~ /[0-9]/
t = identify_number t = identify_number
elsif peek(0) =~ /[\w_]/ elsif peek(0) =~ /\w/
t = identify_identifier t = identify_identifier
end end
printf "MATCH: end %s: %s\n", op, io.inspect if RubyLex.debug? printf "MATCH: end %s: %s\n", op, io.inspect if RubyLex.debug?