r5984 - trunk/eda/boom

werner at docs.openmoko.org werner at docs.openmoko.org
Sat Oct 16 03:03:57 CEST 2010


Author: werner
Date: 2010-10-16 03:03:56 +0200 (Sat, 16 Oct 2010)
New Revision: 5984

Modified:
   trunk/eda/boom/gen2chr
   trunk/eda/boom/match.pl
Log:
Improve the diagnostics of gen2chr.

- boom/match.pl (sub_expand): print an explanation if available
- boom/match.pl (match_set_error): set the error explanation text
- boom/gen2chr: set the error explanation to the part number



Modified: trunk/eda/boom/gen2chr
===================================================================
--- trunk/eda/boom/gen2chr	2010-10-13 16:15:40 UTC (rev 5983)
+++ trunk/eda/boom/gen2chr	2010-10-16 01:03:56 UTC (rev 5984)
@@ -20,6 +20,7 @@
     next unless $id{$_} eq "$key $_";
     undef %field;
     $field{"REF"} = $_;
+    &match_set_error("$_");
     if (!&apply_rules()) {
 	print "$id{$_}\n" if $negate;
 	next;

Modified: trunk/eda/boom/match.pl
===================================================================
--- trunk/eda/boom/match.pl	2010-10-13 16:15:40 UTC (rev 5983)
+++ trunk/eda/boom/match.pl	2010-10-16 01:03:56 UTC (rev 5984)
@@ -147,7 +147,11 @@
     while ($s =~ /^([^\$]*)\$([A-Za-z_]\w*)(:(\d+))?|^([^\$]*)\${([A-Za-z_]\w*)(:(\d+))?}/) {
 	my $name = "$2$6";
 	$name .= "__$4$8" if defined($4) || defined($8);
-	die "don't know \"$name\"" unless defined $found{$name};
+	if (!defined $found{$name}) {
+		die "don't know \"$name\"".
+		  (defined $__match_error ?
+		  " (processing \"$__match_error\")" : "");
+	}
 	$s = $1.$5.$found{$name}.$';
     }
     return $s;
@@ -197,4 +201,10 @@
 }
 
 
+sub match_set_error
+{
+    $__match_error = $_[0];
+}
+
+
 return 1;




More information about the commitlog mailing list