@@ -2508,7 +2508,17 @@ data RuntimeError:
2508
2508
ED . text( " had the unit: " ) ] ,
2509
2509
ED . code( ED . text( self. r)) ,
2510
2510
[ ED . para: ED . text( "These units are not compatible" ) ]]
2511
- | none => ED . text( "TODO" )
2511
+ | none =>
2512
+ [ ED . sequence:
2513
+ ed-intro( self. op-name + " operation" , loc, -1 , true ) ,
2514
+ ED . cmcode( loc) ,
2515
+ [ ED . para:
2516
+ ED . text( "The left side had the unit: " ) ,
2517
+ ED . code( ED . text( self. l)) ] ,
2518
+ [ ED . para:
2519
+ ED . text( "The right side had the unit: " ) ,
2520
+ ED . code( ED . text( self. r)) ] ,
2521
+ [ ED . para: ED . text( "These units are not compatible" ) ]]
2512
2522
end
2513
2523
else :
2514
2524
[ ED . sequence:
@@ -2542,7 +2552,6 @@ data RuntimeError:
2542
2552
lam ( loc) :
2543
2553
[ ED . sequence:
2544
2554
ed-simple-intro( self. op-name + " operation" , loc) ,
2545
- ED . cmcode( loc) ,
2546
2555
[ ED . para:
2547
2556
ED . text( "The left side had the unit: " ) ,
2548
2557
ED . code( ED . text( self. l)) ] ,
@@ -2566,15 +2575,52 @@ data RuntimeError:
2566
2575
end
2567
2576
| invalid-unit-state( op-name, n, desc) with:
2568
2577
method render-fancy-reason( self, maybe-stack-loc, src-available, maybe-ast) :
2569
- self. render-reason()
2578
+ [ ED . error:
2579
+ cases ( O . Option ) maybe-stack-loc( 0 , false ) :
2580
+ | some( loc) =>
2581
+ if loc. is-builtin() :
2582
+ [ ED . sequence:
2583
+ ed-intro( self. op-name + " function" , loc, -1 , true ) ,
2584
+ [ ED . para:
2585
+ ED . code( ED . text( tostring( self. n))) ,
2586
+ ED . text( " is an invalid argument because: " ) ,
2587
+ ED . text( self. desc) ] ,
2588
+ please-report-bug() ]
2589
+ else if src-available( loc) :
2590
+ [ ED . sequence:
2591
+ ed-intro( self. op-name + " function" , loc, -1 , true ) ,
2592
+ ED . cmcode( loc) ,
2593
+ [ ED . para:
2594
+ ED . code( ED . text( tostring( self. n))) ,
2595
+ ED . text( " is an invalid argument because: " ) ,
2596
+ ED . text( self. desc) ]]
2597
+ end
2598
+ | none =>
2599
+ [ ED . sequence:
2600
+ [ ED . para:
2601
+ ED . text( "The " + self. op-name + " function failed." ) ] ,
2602
+ [ ED . para:
2603
+ ED . code( ED . text( tostring( self. n))) ,
2604
+ ED . text( " is an invalid argument because: " ) ,
2605
+ ED . text( self. desc) ]]
2606
+ end ]
2570
2607
end ,
2571
2608
method render-reason( self) :
2572
- [ ED . error:
2573
- [ ED . para:
2574
- ED . text( "The " + self. op-name + " operation failed. " ) ,
2575
- ED . text( tostring( self. n)) ,
2576
- ED . text( " is an invalid argument because: " ) ,
2577
- ED . text( self. desc) ]]
2609
+ [ ED . error: ED . maybe-stack-loc( 0 , false ,
2610
+ lam ( loc) :
2611
+ [ ED . sequence:
2612
+ ed-simple-intro( self. op-name + " function" , loc) ,
2613
+ [ ED . para:
2614
+ ED . code( ED . text( tostring( self. n))) ,
2615
+ ED . text( " is an invalid argument because: " ) ,
2616
+ ED . text( self. desc) ]]
2617
+ end ,
2618
+ [ ED . sequence:
2619
+ [ ED . para: ED . text( "The " + self. op-name + " function failed." ) ] ,
2620
+ [ ED . para:
2621
+ ED . code( ED . text( tostring( self. n))) ,
2622
+ ED . text( " is an invalid argument because: " ) ,
2623
+ ED . text( self. desc) ]] ) ]
2578
2624
end
2579
2625
end
2580
2626
0 commit comments