Permalink
Browse files

fix analyze-vim-declarations

  • Loading branch information...
1 parent a950e37 commit 04111cb51b8050c1f36b8943c61154d1a9b5ada5 Christian Dickmann committed Dec 17, 2013
Showing with 16 additions and 4 deletions.
  1. +16 −4 devel/analyze-vim-declarations.rb
View
20 devel/analyze-vim-declarations.rb
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
require 'nokogiri'
-
+require 'pp'
# :usage => analyze-vim-declarations.rb vim-declarations.xml foo-declarations.xml vmodl.db
XML_FNS = ARGV[0...-1]
@@ -130,14 +130,18 @@ def handle_version x
XML_FNS.each do |fn|
puts "parsing #{fn} ..."
- xml = Nokogiri.parse(File.read(fn), nil, nil, Nokogiri::XML::ParseOptions::NOBLANKS)
+ xml_str = File.read(fn)
+ xml_str = xml_str.gsub(/\<description-html\>(.*?)\<\/description-html\>/m, "")
+ xml = Nokogiri.parse(xml_str, nil, nil, Nokogiri::XML::ParseOptions::NOBLANKS)
xml.root.at('enums').children.each { |x| handle_enum x }
xml.root.at('managed-objects').children.each { |x| handle_managed_object x }
xml.root.at('data-objects').children.each { |x| handle_data_object x }
xml.root.at('faults').children.each { |x| handle_fault x }
#xml.root.at('definitions').at('version-types').children.each { |x| handle_version x }
end
+#pp ID2NAME
+
munge_fault = lambda { |x| true }
TYPES.each do |k,t|
@@ -160,12 +164,20 @@ def handle_version x
end
t['methods'].each do |mName,x|
if y = x['result']
- y['wsdl_type'] = ID2NAME[y['type-id-ref']]
+ begin
+ y['wsdl_type'] = ID2NAME[y['type-id-ref']]
+ rescue Exception => ex
+ pp ex
+ end
y.delete 'type-id-ref'
munge_fault[y]
end
x['params'].each do |r|
- r['wsdl_type'] = ID2NAME[r['type-id-ref']]
+ begin
+ r['wsdl_type'] = ID2NAME[r['type-id-ref']]
+ rescue Exception => ex
+ pp ex
+ end
r.delete 'type-id-ref'
munge_fault[r]
end

0 comments on commit 04111cb

Please sign in to comment.