@@ -93,7 +93,7 @@ impl<'a> Interpreter<'a> {
93
93
// @Task verify
94
94
( Projection ( _) , _) => expression,
95
95
// @Temporary
96
- ( IO ( _) , _) => expression,
96
+ ( IO ( _) , _) | ( Panic ( _ ) , _ ) => expression,
97
97
( Application ( application) , substitution) => Expression :: new (
98
98
expression. attributes ,
99
99
expression. span ,
@@ -415,6 +415,9 @@ impl<'a> Interpreter<'a> {
415
415
}
416
416
}
417
417
Type | Number ( _) | Text ( _) | IO ( _) => expression,
418
+ // @Task smh add a backtrace here!
419
+ // @Task make sure that ?(panic _) is evaluated *eagerly* not lazily!
420
+ Panic ( _) => expression,
418
421
Projection ( _) => todo ! ( ) ,
419
422
PiType ( pi) => match context. form {
420
423
Form :: Normal => {
@@ -616,34 +619,25 @@ impl<'a> Interpreter<'a> {
616
619
binder : Identifier ,
617
620
arguments : Vec < Expression > ,
618
621
) -> Result < Option < Expression > > {
619
- eprintln ! ( "apply_intrinsic_function binder={binder} args=[{arguments:?}]" ) ;
620
-
621
622
match self . look_up ( binder. declaration_index ( ) . unwrap ( ) ) . kind {
622
623
hir:: EntityKind :: IntrinsicFunction {
623
624
arity, function, ..
624
625
} => Ok ( if arguments. len ( ) == arity {
625
- eprintln ! ( " look_up -> [entity] intrinsic function" ) ;
626
-
627
626
let mut value_arguments = Vec :: new ( ) ;
628
627
629
628
// @Task tidy up with iterator combinators
630
629
for argument in arguments {
631
- dbg ! ( & argument) ;
632
-
633
630
if let Some ( argument) =
634
631
interfaceable:: Value :: from_expression ( & argument, self . session )
635
632
{
636
- eprintln ! ( "interfaceable argument found, pushing ..." ) ;
637
633
value_arguments. push ( argument) ;
638
634
} else {
639
- eprintln ! ( "non-interfaceable argument found, aborting ..." ) ;
640
635
return Ok ( None ) ;
641
636
}
642
637
}
643
638
644
639
Some ( function ( value_arguments) . into_expression ( self . session ) ?)
645
640
} else {
646
- eprintln ! ( " look_up -> None" ) ;
647
641
None
648
642
} ) ,
649
643
_ => unreachable ! ( ) ,
0 commit comments