Author: pmichaud
Date: Sat Jan  3 08:56:20 2009
New Revision: 34891

Modified:
   branches/rvar/compilers/pct/src/PAST/Compiler.pir

Log:
[pct]:  Make the "Scope not found" error a bit more informative.


Modified: branches/rvar/compilers/pct/src/PAST/Compiler.pir
==============================================================================
--- branches/rvar/compilers/pct/src/PAST/Compiler.pir   (original)
+++ branches/rvar/compilers/pct/src/PAST/Compiler.pir   Sat Jan  3 08:56:20 2009
@@ -1938,7 +1938,17 @@
     scope = concat " '", scope
     scope = concat scope, "'"
   scope_error_1:
-    .tailcall self.'panic'("Scope", scope, " not found for PAST::Var '", name, 
"'")
+    # Find the nearest named block
+    .local pmc it
+    $P0 = get_global '@?BLOCK'
+    it = iter $P0
+  scope_error_block_loop:
+    unless it goto scope_error_2
+    $P0 = shift it
+    $S0 = $P0.'name'()
+    unless $S0 goto scope_error_block_loop
+  scope_error_2:
+    .tailcall self.'panic'("Scope", scope, " not found for PAST::Var '", name, 
"' in ", $S0)
 .end
 
 

Reply via email to