<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>trunk/as2api</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt><a href="#file1">api_loader.rb</a></tt></td><td align="right" id="added">+18</td><td align="right" id="removed">-9</td><td nowrap="nowrap" align="center">290 -> 291</td></tr>
<tr class="alt"><td><tt>ui/<a href="#file2">cli.rb</a></tt></td><td align="right" id="added">+5</td><td align="right" id="removed">-4</td><td nowrap="nowrap" align="center">290 -> 291</td></tr>
<tr><td></td><td align="right" id="added">+23</td><td align="right" id="removed">-13</td><td></td></tr>
</table>
<small id="info">2 modified files</small><br />
<pre class="comment">
Factor type-resolution code out of GlobalTypeAggregator
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname">trunk/as2api</span><br />
<div class="fileheader"><big><b>api_loader.rb</b></big> <small id="info">290 -> 291</small></div>
<pre class="diff"><small id="info">--- trunk/as2api/api_loader.rb        2006-03-07 23:16:51 UTC (rev 290)
+++ trunk/as2api/api_loader.rb        2006-03-07 23:36:22 UTC (rev 291)
@@ -395,11 +395,9 @@
</small></pre><pre class="diff" id="context"> # TODO: this structure sucks; responsibility for type resolution should be
# entirely seperate from aggregation, not shoe-horned into this class
</pre><pre class="diff" id="removed">- def initialize(classpath)
- @classpath = classpath
</pre><pre class="diff" id="added">+ def initialize()
</pre><pre class="diff" id="context"> @types = []
@packages = {}
</pre><pre class="diff" id="removed">- @parsed_external_types = {}
</pre><pre class="diff" id="context"> end
def add_type(type)
</pre><pre class="diff"><small id="info">@@ -434,18 +432,29 @@
</small></pre><pre class="diff" id="context"> @packages.values
end
</pre><pre class="diff" id="removed">- def resolve_types
</pre><pre class="diff" id="added">+ def package(name)
+ @packages[name]
+ end
+end
+
+class TypeResolver
+ def initialize(classpath)
+ @classpath = classpath
+ @parsed_external_types = {}
+ end
+
+ def resolve_types(type_aggregator)
</pre><pre class="diff" id="context"> # Eeek!...
qname_map = {}
qname_map[AS_VOID.qualified_name] = AS_VOID
</pre><pre class="diff" id="removed">- @types.each do |type|
</pre><pre class="diff" id="added">+ type_aggregator.each_type do |type|
</pre><pre class="diff" id="context"> qname_map[type.qualified_name] = type
end
</pre><pre class="diff" id="removed">- @types.each do |type|
</pre><pre class="diff" id="added">+ type_aggregator.each_type do |type|
</pre><pre class="diff" id="context"> local_namespace = qname_map.dup
local_namespace[type.unqualified_name] = type
import_types_into_namespace(type, local_namespace)
</pre><pre class="diff" id="removed">- import_packages_into_namespace(type, local_namespace)
</pre><pre class="diff" id="added">+ import_packages_into_namespace(type<span id="addedchars">_aggregator, type</span>, local_namespace)
</pre><pre class="diff" id="context"> type.type_namespace.each do |type_proxy|
        real_type = local_namespace[type_proxy.local_name]
        unless real_type
</pre><pre class="diff"><small id="info">@@ -474,9 +483,9 @@
</small></pre><pre class="diff" id="context"> end
end
</pre><pre class="diff" id="removed">- def import_packages_into_namespace(type, local_namespace)
</pre><pre class="diff" id="added">+ def import_packages_into_namespace(type<span id="addedchars">_aggregator, type</span>, local_namespace)
</pre><pre class="diff" id="context"> type.import_list.each_package do |package_name|
</pre><pre class="diff" id="removed">- @packages[package_name.join(".")].each_type do |package_type|
</pre><pre class="diff" id="added">+ type_aggregator.package(package_name.join(".")).each_type do|package_type|
</pre><pre class="diff" id="context">         if local_namespace.has_key?(package_type.unqualified_name)
         $stderr.puts "#{type.input_filename}: #{package_type.unqualified_name} already refers to #{local_namespace[package_type.unqualified_name].qualified_name}"
        end
</pre></div>
<hr /><a name="file2" /><div class="file">
<span class="pathname">trunk/as2api/ui</span><br />
<div class="fileheader"><big><b>cli.rb</b></big> <small id="info">290 -> 291</small></div>
<pre class="diff"><small id="info">--- trunk/as2api/ui/cli.rb        2006-03-07 23:16:51 UTC (rev 290)
+++ trunk/as2api/ui/cli.rb        2006-03-07 23:36:22 UTC (rev 291)
@@ -242,8 +242,8 @@
</small></pre><pre class="diff" id="context"> end
end
</pre><pre class="diff" id="removed">- def parse_all(files, classpath)
- type_agregator = GlobalTypeAggregator.new(classpath)
</pre><pre class="diff" id="added">+ def parse_all(files)
+ type_agregator = GlobalTypeAggregator.new
</pre><pre class="diff" id="context"> @conf.progress_listener.parsing_sources(files.length) do
files.each_with_index do |file, index|
        @conf.progress_listener.parse_source(index, file)
</pre><pre class="diff"><small id="info">@@ -265,11 +265,12 @@
</small></pre><pre class="diff" id="context"> @conf = parse_opts
files = find_sources(@conf.classpath)
error(_("No source files matching specified packages")) if files.empty?
</pre><pre class="diff" id="removed">- type_agregator = parse_all(files<span id="removedchars">, @conf.classpath</span>)
</pre><pre class="diff" id="added">+ type_agregator = parse_all(files)
</pre><pre class="diff" id="context"> if @conf.xliff_import
xliff_import(type_agregator)
end
</pre><pre class="diff" id="removed">- type_agregator.resolve_types
</pre><pre class="diff" id="added">+ type_resolver = TypeResolver.new(@conf.classpath)
+ type_resolver.resolve_types(type_agregator)
</pre><pre class="diff" id="context"> if @conf.xliff_export
xliff_export(type_agregator)
else
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -> email">CVSspam</a> 0.2.11</small></center>
</body></html>