@@ -454,7 +454,7 @@ impl <'a> Compiler<'a> {
454
454
}
455
455
456
456
fn compile_binding ( & mut self , bind : & Binding < Id > ) -> SuperCombinator {
457
- debug ! ( "Compiling binding {} :: {}" , bind. name, bind. name. typ) ;
457
+ debug ! ( "Compiling binding {:? } :: {:? }" , bind. name, bind. name. typ) ;
458
458
let dict_arg = if bind. name . typ . constraints . len ( ) > 0 { 1 } else { 0 } ;
459
459
self . context = bind. name . typ . constraints . clone ( ) ;
460
460
let mut instructions = Vec :: new ( ) ;
@@ -463,15 +463,15 @@ impl <'a> Compiler<'a> {
463
463
if dict_arg == 1 {
464
464
this. new_stack_var ( Name { name : intern ( "$dict" ) , uid : 0 } ) ;
465
465
}
466
- debug ! ( "{} {}\n {}" , bind. name, dict_arg, bind. expression) ;
466
+ debug ! ( "{:? } {:? }\n {:? }" , bind. name, dict_arg, bind. expression) ;
467
467
arity = this. compile_lambda_binding ( & bind. expression , & mut instructions) + dict_arg;
468
468
instructions. push ( Update ( 0 ) ) ;
469
469
if arity != 0 {
470
470
instructions. push ( Pop ( arity) ) ;
471
471
}
472
472
instructions. push ( Unwind ) ;
473
473
} ) ;
474
- debug ! ( "{} :: {} compiled as:\n {}" , bind. name, bind. name. typ, instructions) ;
474
+ debug ! ( "{:? } :: {:? } compiled as:\n {:? }" , bind. name, bind. name. typ, instructions) ;
475
475
SuperCombinator {
476
476
assembly_id : self . assemblies . len ( ) ,
477
477
typ : bind. name . typ . clone ( ) ,
@@ -720,7 +720,7 @@ impl <'a> Compiler<'a> {
720
720
//might be created which is returned here and added to the assembly
721
721
let mut is_primitive = false ;
722
722
let var = self . find ( name. name )
723
- . unwrap_or_else ( || panic ! ( "Error: Undefined variable {}" , * name) ) ;
723
+ . unwrap_or_else ( || panic ! ( "Error: Undefined variable {:? }" , * name) ) ;
724
724
match var {
725
725
Var :: Primitive ( ..) => is_primitive = true ,
726
726
_ => ( )
@@ -735,11 +735,11 @@ impl <'a> Compiler<'a> {
735
735
}
736
736
Var :: Builtin ( index) => { instructions. push ( PushBuiltin ( index) ) ; }
737
737
Var :: Class ( typ, constraints, var) => {
738
- debug ! ( "Var::Class ({}, {}, {}) {}" , typ, constraints, var, expr. get_type( ) ) ;
738
+ debug ! ( "Var::Class ({:? }, {:? }, {:? }) {:? }" , typ, constraints, var, expr. get_type( ) ) ;
739
739
self . compile_instance_variable ( expr. get_type ( ) , instructions, name. name , typ, constraints, var) ;
740
740
}
741
741
Var :: Constraint ( index, bind_type, constraints) => {
742
- debug ! ( "Var::Constraint {} ({}, {}, {})" , name, index, bind_type, constraints) ;
742
+ debug ! ( "Var::Constraint {:? } ({:? }, {:? }, {:? })" , name, index, bind_type, constraints) ;
743
743
self . compile_with_constraints ( name. name , expr. get_type ( ) , bind_type, constraints, instructions) ;
744
744
instructions. push ( PushGlobal ( index) ) ;
745
745
instructions. push ( Mkap ) ;
@@ -749,7 +749,7 @@ impl <'a> Compiler<'a> {
749
749
instructions. push ( instruction) ;
750
750
}
751
751
else {
752
- panic ! ( "Expected {} arguments for {}, got {}" , num_args, name, arg_length)
752
+ panic ! ( "Expected {:? } arguments for {:? }, got {:? }" , num_args, name, arg_length)
753
753
}
754
754
is_function = false ;
755
755
}
@@ -821,7 +821,7 @@ impl <'a> Compiler<'a> {
821
821
instructions. push ( PushGlobal ( index) ) ;
822
822
instructions. push ( Mkap ) ;
823
823
}
824
- _ => panic ! ( "Unregistered instance function {}" , instance_fn_name)
824
+ _ => panic ! ( "Unregistered instance function {:? }" , instance_fn_name)
825
825
}
826
826
}
827
827
None => {
@@ -853,7 +853,7 @@ impl <'a> Compiler<'a> {
853
853
}
854
854
855
855
fn push_dictionary ( & mut self , context : & [ Constraint < Name > ] , constraints : & [ ( Name , Type ) ] , instructions : & mut Vec < Instruction > ) {
856
- debug ! ( "Push dictionary {} ==> {}" , context, constraints) ;
856
+ debug ! ( "Push dictionary {:? } ==> {:? }" , context, constraints) ;
857
857
for & ( ref class, ref typ) in constraints. iter ( ) {
858
858
self . fold_dictionary ( * class, typ, instructions) ;
859
859
instructions. push ( ConstructDictionary ( constraints. len ( ) ) ) ;
@@ -864,13 +864,13 @@ impl <'a> Compiler<'a> {
864
864
fn fold_dictionary ( & mut self , class : Name , typ : & Type , instructions : & mut Vec < Instruction > ) {
865
865
match * typ {
866
866
Type :: Constructor ( ref ctor) => { //Simple
867
- debug ! ( "Simple for {}" , ctor) ;
867
+ debug ! ( "Simple for {:? }" , ctor) ;
868
868
//Push static dictionary to the top of the stack
869
869
let index = self . find_dictionary_index ( & [ ( class. clone ( ) , typ. clone ( ) ) ] ) ;
870
870
instructions. push ( PushDictionary ( index) ) ;
871
871
}
872
872
Type :: Application ( ref lhs, ref rhs) => {
873
- debug ! ( "App for ({} {})" , lhs, rhs) ;
873
+ debug ! ( "App for ({:? } {:? })" , lhs, rhs) ;
874
874
//For function in functions
875
875
// Mkap function fold_dictionary(rhs)
876
876
self . fold_dictionary ( class, * lhs, instructions) ;
@@ -894,11 +894,11 @@ impl <'a> Compiler<'a> {
894
894
let num_class_functions = self . find_class ( class)
895
895
. map ( |( _, _, decls) | decls. len ( ) )
896
896
. unwrap ( ) ;
897
- debug ! ( "Use previous dict for {} at {}..{}" , var, index, num_class_functions) ;
897
+ debug ! ( "Use previous dict for {:? } at {:? }..{:? }" , var, index, num_class_functions) ;
898
898
instructions. push ( PushDictionaryRange ( index, num_class_functions) ) ;
899
899
}
900
900
else {
901
- debug ! ( "No dict for {}" , var) ;
901
+ debug ! ( "No dict for {:? }" , var) ;
902
902
}
903
903
}
904
904
_ => panic ! ( "Did not expect generic" )
@@ -908,7 +908,7 @@ impl <'a> Compiler<'a> {
908
908
///Lookup which index in the instance dictionary that holds the function called 'name'
909
909
fn push_dictionary_member ( & self , constraints : & [ Constraint < Name > ] , name : Name ) -> Option < uint > {
910
910
if constraints. len ( ) == 0 {
911
- panic ! ( "Attempted to push dictionary member '{}' with no constraints" , name)
911
+ panic ! ( "Attempted to push dictionary member '{:? }' with no constraints" , name)
912
912
}
913
913
let mut ii = 0 ;
914
914
for c in constraints. iter ( ) {
@@ -974,7 +974,7 @@ impl <'a> Compiler<'a> {
974
974
for decl in declarations. iter ( ) {
975
975
let x = match extract_applied_type ( typ) {
976
976
& Type :: Constructor ( ref x) => x,
977
- _ => panic ! ( "{}" , typ)
977
+ _ => panic ! ( "{:? }" , typ)
978
978
} ;
979
979
let mut b = "#" . to_string ( ) ;
980
980
b. push_str ( x. name . as_slice ( ) ) ;
@@ -988,7 +988,7 @@ impl <'a> Compiler<'a> {
988
988
Some ( Var :: Constraint ( index, _, _) ) => {
989
989
function_indexes. push ( index as uint ) ; //TODO this is not really correct since this function requires a dictionary
990
990
}
991
- var => panic ! ( "Did not find function {} {}" , name, var)
991
+ var => panic ! ( "Did not find function {:? } {:? }" , name, var)
992
992
}
993
993
}
994
994
None
@@ -1000,7 +1000,7 @@ impl <'a> Compiler<'a> {
1000
1000
///An index to the Jump instruction which is taken when the match fails is stored in the branches vector
1001
1001
///These instructions will need to be updated later with the correct jump location.
1002
1002
fn compile_pattern ( & mut self , pattern : & Pattern < Id > , branches : & mut Vec < uint > , instructions : & mut Vec < Instruction > , stack_size : uint ) -> uint {
1003
- debug ! ( "Pattern {} at {}" , pattern, stack_size) ;
1003
+ debug ! ( "Pattern {:? } at {:? }" , pattern, stack_size) ;
1004
1004
match pattern {
1005
1005
& Pattern :: Constructor ( ref name, ref patterns) => {
1006
1006
instructions. push ( Push ( stack_size) ) ;
@@ -1010,7 +1010,7 @@ impl <'a> Compiler<'a> {
1010
1010
branches. push ( instructions. len ( ) ) ;
1011
1011
instructions. push ( Jump ( 0 ) ) ;
1012
1012
}
1013
- _ => panic ! ( "Undefined constructor {}" , * name)
1013
+ _ => panic ! ( "Undefined constructor {:? }" , * name)
1014
1014
}
1015
1015
instructions. push ( Split ( patterns. len ( ) ) ) ;
1016
1016
self . stackSize += patterns. len ( ) ;
0 commit comments