[前][次][番号順一覧][スレッド一覧]

ruby-changes:22371

From: kou <ko1@a...>
Date: Thu, 2 Feb 2012 21:48:57 +0900 (JST)
Subject: [ruby-changes:22371] kou:r34420 (trunk): * lib/rexml/parsers/baseparser.rb: use meaningful name.

kou	2012-02-02 21:48:45 +0900 (Thu, 02 Feb 2012)

  New Revision: 34420

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34420

  Log:
    * lib/rexml/parsers/baseparser.rb: use meaningful name.

  Modified files:
    trunk/ChangeLog
    trunk/lib/rexml/parsers/baseparser.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 34419)
+++ ChangeLog	(revision 34420)
@@ -1,3 +1,7 @@
+Thu Feb  2 21:48:18 2012  Kouhei Sutou  <kou@c...>
+
+	* lib/rexml/parsers/baseparser.rb: use meaningful names.
+
 Thu Feb  2 21:38:52 2012  Kouhei Sutou  <kou@c...>
 
 	* lib/rexml/parsers/baseparser.rb, test/rexml/test_namespace.rb:
Index: lib/rexml/parsers/baseparser.rb
===================================================================
--- lib/rexml/parsers/baseparser.rb	(revision 34419)
+++ lib/rexml/parsers/baseparser.rb	(revision 34420)
@@ -373,31 +373,31 @@
               if md[4].size > 0
                 attrs = md[4].scan( ATTRIBUTE_PATTERN )
                 raise REXML::ParseException.new( "error parsing attributes: [#{attrs.join ', '}], excess = \"#$'\"", @source) if $' and $'.strip.size > 0
-                attrs.each { |a,b,c,d,e|
-                  if b == "xmlns"
-                    if c == "xml"
-                      if e != "http://www.w3.org/XML/1998/namespace"
+                attrs.each do |name, prefix, local_part, quote, value|
+                  if prefix == "xmlns"
+                    if local_part == "xml"
+                      if value != "http://www.w3.org/XML/1998/namespace"
                         msg = "The 'xml' prefix must not be bound to any other namespace "+
                         "(http://www.w3.org/TR/REC-xml-names/#ns-decl)"
                         raise REXML::ParseException.new( msg, @source, self )
                       end
-                    elsif c == "xmlns"
+                    elsif local_part == "xmlns"
                       msg = "The 'xmlns' prefix must not be declared "+
                       "(http://www.w3.org/TR/REC-xml-names/#ns-decl)"
                       raise REXML::ParseException.new( msg, @source, self)
                     end
-                    curr_ns << c
-                  elsif b
-                    prefixes << b unless b == "xml"
+                    curr_ns << local_part
+                  elsif prefix
+                    prefixes << prefix unless prefix == "xml"
                   end
 
-                  if attributes.has_key? a
-                    msg = "Duplicate attribute #{a.inspect}"
-                    raise REXML::ParseException.new( msg, @source, self)
+                  if attributes.has_key?(name)
+                    msg = "Duplicate attribute #{name.inspect}"
+                    raise REXML::ParseException.new(msg, @source, self)
                   end
 
-                  attributes[a] = e
-                }
+                  attributes[name] = value
+                end
               end
 
               # Verify that all of the prefixes have been defined

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]