Author: raja
Date: 2005-04-22 02:31:29 -0400 (Fri, 22 Apr 2005)
New Revision: 43430

Modified:
   trunk/mcs/class/Microsoft.VisualBasic/Assembly/
   trunk/mcs/class/Microsoft.VisualBasic/ChangeLog
   trunk/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/
   trunk/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/
   trunk/mcs/class/Microsoft.VisualBasic/fixup/
   trunk/mcs/class/Microsoft.VisualBasic/fixup/Makefile
   trunk/mcs/class/Microsoft.VisualBasic/fixup/default/
   trunk/mcs/class/Microsoft.VisualBasic/fixup/fixup.pl
   trunk/mcs/class/Microsoft.VisualBasic/fixup/net_2_0/
Log:
* fixup/Makefile (install-local): Depend on $(the_lib).
* fixup/fixup.pl: Be more resilient to varying order of .param
custom attributes.



Property changes on: trunk/mcs/class/Microsoft.VisualBasic/Assembly
___________________________________________________________________
Name: svn:ignore
   + semantic.cache


Modified: trunk/mcs/class/Microsoft.VisualBasic/ChangeLog
===================================================================
--- trunk/mcs/class/Microsoft.VisualBasic/ChangeLog     2005-04-22 04:37:32 UTC 
(rev 43429)
+++ trunk/mcs/class/Microsoft.VisualBasic/ChangeLog     2005-04-22 06:31:29 UTC 
(rev 43430)
@@ -1,3 +1,9 @@
+2005-04-22  Raja R Harinath  <[EMAIL PROTECTED]>
+
+       * fixup/Makefile (install-local): Depend on $(the_lib).
+       * fixup/fixup.pl: Be more resilient to varying order of .param
+       custom attributes.
+
 2005-04-21  Raja R Harinath  <[EMAIL PROTECTED]>
 
        * Makefile (NO_SIGN_ASSEMBLY, NO_INSTALL): Set.  The actual signing


Property changes on: trunk/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic
___________________________________________________________________
Name: svn:ignore
   - pending
*.diff
*~
VBUtils.resources
   + pending
*.diff
*~
VBUtils.resources
semantic.cache



Property changes on: 
trunk/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices
___________________________________________________________________
Name: svn:ignore
   + semantic.cache



Property changes on: trunk/mcs/class/Microsoft.VisualBasic/fixup
___________________________________________________________________
Name: svn:ignore
   + semantic.cache
t1
t2
*.resources


Modified: trunk/mcs/class/Microsoft.VisualBasic/fixup/Makefile
===================================================================
--- trunk/mcs/class/Microsoft.VisualBasic/fixup/Makefile        2005-04-22 
04:37:32 UTC (rev 43429)
+++ trunk/mcs/class/Microsoft.VisualBasic/fixup/Makefile        2005-04-22 
06:31:29 UTC (rev 43430)
@@ -49,11 +49,10 @@
        $(ILASM) /out:$@ $<
        $(SN) $(SNFLAGS) $@ $(topdir)/class/mono.snk
 
-$(the_il): $(topdir)/class/lib/$(PROFILE)/Microsoft.VisualBasic.dll
-#      disabled until this works on the mac
-#      $(with_mono_path) $(ILDISASM) $< | $(PERL) ./fixup.pl > [EMAIL 
PROTECTED]
-       $(with_mono_path) $(ILDISASM) $< > [EMAIL PROTECTED]
-       mv [EMAIL PROTECTED] $@
+$(the_il): $(topdir)/class/lib/$(PROFILE)/Microsoft.VisualBasic.dll fixup.pl
+       $(with_mono_path) $(ILDISASM) $< > t1 || { rm -f t1; exit 1; }
+       $(PERL) ./fixup.pl t1 > t2 && rm -f t1
+       mv t2 $@
 
 Microsoft.VisualBasic.VBUtils.resources: 
../Microsoft.VisualBasic/VBUtils.resources
        cp $< $@
@@ -64,12 +63,12 @@
 # ----------------------------------------------
 # Minor hack.  Copied from build/library.make
 
-ifdef NO_INSTALL
-install-local uninstall-local:
-       @:
+install-local: $(the_lib)
 
-else
+uninstall-local:
 
+ifndef NO_INSTALL
+
 ifdef LIBRARY_INSTALL_DIR
 install-local:
        $(MKINSTALLDIRS) $(DESTDIR)$(LIBRARY_INSTALL_DIR)


Property changes on: trunk/mcs/class/Microsoft.VisualBasic/fixup/default
___________________________________________________________________
Name: svn:ignore
   + *.il
*.dll
semantic.cache


Modified: trunk/mcs/class/Microsoft.VisualBasic/fixup/fixup.pl
===================================================================
--- trunk/mcs/class/Microsoft.VisualBasic/fixup/fixup.pl        2005-04-22 
04:37:32 UTC (rev 43429)
+++ trunk/mcs/class/Microsoft.VisualBasic/fixup/fixup.pl        2005-04-22 
06:31:29 UTC (rev 43430)
@@ -27,38 +27,54 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
+my $param = "";
+my $output = "";
+my $rest = "";
+
 while (<>) {
-       if (/\.custom instance 
void\s+(?:class\s+)?Microsoft\.VisualBasic\.CompilerServices\.__DefaultArgumentValueAttribute::\.ctor\s*\(([^)]*)\)\s*=\s*\(([^)]*)\)/)
 { 
+    if (!/^\s*\.param\s*\[/) {
+       print;
+       next;
+    }
 
-               my @str = split (/ /, $2);
-               if ($1 =~ /string/) {
-                       # FIXME: Assumes length < 0x80.
-                       $size = hex $str [2];
-                       
-                       if ($size == 0) {
-                               print ("= \"\"\n");
-                       }elsif ($size == 255) {
-                               print ("= nullref\n");
-                       }else{  
-                               # FIXME: Should be a UTF-8 to UCS-2 translator. 
 However, we only use ASCII.
-                               print "= bytearray ( ";
-                               for ($i = 3; $i < @str - 2; $i ++) {
-                                       print $str [$i] . " 00 ";
-                               }
-                               print " )\n";
-                       }
-               }elsif ($1 =~ /bool/) {
-                       print "= bool (" . ($str [2] == '00' ? "false" : 
"true") . ")\n";
-               }else {
-                       print "= $1 (0x";
-                       
-                       for ($i = @str - 2 - 1; $i >= 2;$i --) {
-                               print $str [$i] ;
-                       }
+    chomp;
+    $param = $_;
+    while (<>) {
+       chomp;
+       next if /^\s*$/;
 
-                       print ")\n";
-               }
-       }else{
-               print;
+       if (/^\s*\.param\s*\[/) {
+           print $param;
+            print " = $output" if $output;
+           print "\n";
+           print "$rest\n" if $rest;
+           $output = ""; $rest = "";
+
+           $param = $_;
+           next;
        }
+       last if !/.custom/;
+       
+       if (/\.custom instance 
void\s+(?:class\s+)?Microsoft\.VisualBasic\.CompilerServices\.__DefaultArgumentValueAttribute.*\.ctor\s*\(([^)]*)\)\s*=\s*\(\s*01\s+00\s+([^)]*)\s+00\s+00\s*\)/)
 {
+           my @str = split (/ /, $2);
+           if ($1 =~ /string/) {
+               # FIXME: Assumes length < 0x80.
+               $size = hex (shift @str);
+               $output = $size == 0 ? '""' : $size == 255 ? 'nullref' : 
"bytearray ( " . join (" 00 ", @str) . ' 00)';
+           } elsif ($1 =~ /bool/) {
+               $output = "bool (" . ($str [0] == '00' ? "false" : "true") . 
")";
+           } else {
+               @str = reverse @str;
+               $output = "$1 (0x" . join ("", @str) . ')';
+           }
+       } else {
+           $rest .= "$_\n";
+       }
+    }
+
+    print $param;
+    print " = $output" if $output;
+    print "\n";
+    print "$rest\n" if $rest;
+    $output = ""; $rest = "";
 }


Property changes on: trunk/mcs/class/Microsoft.VisualBasic/fixup/net_2_0
___________________________________________________________________
Name: svn:ignore
   + *.il
*.dll
semantic.cache


_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to