summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-18 22:07:09 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-18 22:07:09 +0000
commitb205e559537f5a3cbd8cdb133378134e8c983615 (patch)
tree3f34c971e0b69e1395d37149add63f8927e180f0 /lib
parentf535b33f8d7b1b46e6f94b836adca0bb89059cba (diff)
* lib/benchmark.rb: Fix indentation.
* lib/net/imap.rb: Fix indentation of regular expressions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/benchmark.rb6
-rw-r--r--lib/net/imap.rb88
2 files changed, 47 insertions, 47 deletions
diff --git a/lib/benchmark.rb b/lib/benchmark.rb
index 0c786a4862..f3d1cca8f1 100644
--- a/lib/benchmark.rb
+++ b/lib/benchmark.rb
@@ -254,9 +254,9 @@ module Benchmark
puts 'Rehearsal '.ljust(width+CAPTION.length,'-')
ets = job.list.inject(Tms.new) { |sum,(label,item)|
print label.ljust(width)
- res = Benchmark.measure(&item)
- print res.format
- sum + res
+ res = Benchmark.measure(&item)
+ print res.format
+ sum + res
}.format("total: %tsec")
print " #{ets}\n\n".rjust(width+CAPTION.length+2,'-')
diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index 1f32f1b97d..cf4754cb71 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -2032,43 +2032,43 @@ module Net
T_TEXT = :TEXT
BEG_REGEXP = /\G(?:\
- (?# 1: SPACE )( +)|\
- (?# 2: NIL )(NIL)(?=[\x80-\xff(){ \x00-\x1f\x7f%*#{'"'}\\\[\]+])|\
- (?# 3: NUMBER )(\d+)(?=[\x80-\xff(){ \x00-\x1f\x7f%*#{'"'}\\\[\]+])|\
- (?# 4: ATOM )([^\x80-\xff(){ \x00-\x1f\x7f%*#{'"'}\\\[\]+]+)|\
- (?# 5: QUOTED )"((?:[^\x00\r\n"\\]|\\["\\])*)"|\
- (?# 6: LPAR )(\()|\
- (?# 7: RPAR )(\))|\
- (?# 8: BSLASH )(\\)|\
- (?# 9: STAR )(\*)|\
- (?# 10: LBRA )(\[)|\
- (?# 11: RBRA )(\])|\
- (?# 12: LITERAL )\{(\d+)\}\r\n|\
- (?# 13: PLUS )(\+)|\
- (?# 14: PERCENT )(%)|\
- (?# 15: CRLF )(\r\n)|\
- (?# 16: EOF )(\z))/ni
-
- DATA_REGEXP = /\G(?:\
- (?# 1: SPACE )( )|\
- (?# 2: NIL )(NIL)|\
- (?# 3: NUMBER )(\d+)|\
- (?# 4: QUOTED )"((?:[^\x00\r\n"\\]|\\["\\])*)"|\
- (?# 5: LITERAL )\{(\d+)\}\r\n|\
- (?# 6: LPAR )(\()|\
- (?# 7: RPAR )(\)))/ni
-
- TEXT_REGEXP = /\G(?:\
- (?# 1: TEXT )([^\x00\r\n]*))/ni
-
- RTEXT_REGEXP = /\G(?:\
- (?# 1: LBRA )(\[)|\
- (?# 2: TEXT )([^\x00\r\n]*))/ni
-
- CTEXT_REGEXP = /\G(?:\
- (?# 1: TEXT )([^\x00\r\n\]]*))/ni
-
- Token = Struct.new(:symbol, :value)
+(?# 1: SPACE )( +)|\
+(?# 2: NIL )(NIL)(?=[\x80-\xff(){ \x00-\x1f\x7f%*#{'"'}\\\[\]+])|\
+(?# 3: NUMBER )(\d+)(?=[\x80-\xff(){ \x00-\x1f\x7f%*#{'"'}\\\[\]+])|\
+(?# 4: ATOM )([^\x80-\xff(){ \x00-\x1f\x7f%*#{'"'}\\\[\]+]+)|\
+(?# 5: QUOTED )"((?:[^\x00\r\n"\\]|\\["\\])*)"|\
+(?# 6: LPAR )(\()|\
+(?# 7: RPAR )(\))|\
+(?# 8: BSLASH )(\\)|\
+(?# 9: STAR )(\*)|\
+(?# 10: LBRA )(\[)|\
+(?# 11: RBRA )(\])|\
+(?# 12: LITERAL )\{(\d+)\}\r\n|\
+(?# 13: PLUS )(\+)|\
+(?# 14: PERCENT )(%)|\
+(?# 15: CRLF )(\r\n)|\
+(?# 16: EOF )(\z))/ni
+
+ DATA_REGEXP = /\G(?:\
+(?# 1: SPACE )( )|\
+(?# 2: NIL )(NIL)|\
+(?# 3: NUMBER )(\d+)|\
+(?# 4: QUOTED )"((?:[^\x00\r\n"\\]|\\["\\])*)"|\
+(?# 5: LITERAL )\{(\d+)\}\r\n|\
+(?# 6: LPAR )(\()|\
+(?# 7: RPAR )(\)))/ni
+
+ TEXT_REGEXP = /\G(?:\
+(?# 1: TEXT )([^\x00\r\n]*))/ni
+
+ RTEXT_REGEXP = /\G(?:\
+(?# 1: LBRA )(\[)|\
+(?# 2: TEXT )([^\x00\r\n]*))/ni
+
+ CTEXT_REGEXP = /\G(?:\
+(?# 1: TEXT )([^\x00\r\n\]]*))/ni
+
+ Token = Struct.new(:symbol, :value)
def response
token = lookahead
@@ -2932,11 +2932,11 @@ module Net
end
ADDRESS_REGEXP = /\G\
- (?# 1: NAME )(?:NIL|"((?:[^\x80-\xff\x00\r\n"\\]|\\["\\])*)") \
- (?# 2: ROUTE )(?:NIL|"((?:[^\x80-\xff\x00\r\n"\\]|\\["\\])*)") \
- (?# 3: MAILBOX )(?:NIL|"((?:[^\x80-\xff\x00\r\n"\\]|\\["\\])*)") \
- (?# 4: HOST )(?:NIL|"((?:[^\x80-\xff\x00\r\n"\\]|\\["\\])*)")\
- \)/ni
+(?# 1: NAME )(?:NIL|"((?:[^\x80-\xff\x00\r\n"\\]|\\["\\])*)") \
+(?# 2: ROUTE )(?:NIL|"((?:[^\x80-\xff\x00\r\n"\\]|\\["\\])*)") \
+(?# 3: MAILBOX )(?:NIL|"((?:[^\x80-\xff\x00\r\n"\\]|\\["\\])*)") \
+(?# 4: HOST )(?:NIL|"((?:[^\x80-\xff\x00\r\n"\\]|\\["\\])*)")\
+\)/ni
def address
match(T_LPAR)
@@ -2999,8 +2999,8 @@ module Net
# end
FLAG_REGEXP = /\
- (?# FLAG )\\([^\x80-\xff(){ \x00-\x1f\x7f%"\\]+)|\
- (?# ATOM )([^\x80-\xff(){ \x00-\x1f\x7f%*"\\]+)/n
+(?# FLAG )\\([^\x80-\xff(){ \x00-\x1f\x7f%"\\]+)|\
+(?# ATOM )([^\x80-\xff(){ \x00-\x1f\x7f%*"\\]+)/n
def flag_list
if @str.index(/\(([^)]*)\)/ni, @pos)