@@ -450,3 +450,43 @@ impl StgIntrinsic for Dq {
450
450
}
451
451
452
452
impl CallGlobal0 for Dq { }
453
+
454
+ /// __UPPER(s) - convert to upper case
455
+ pub struct Upper ;
456
+
457
+ impl StgIntrinsic for Upper {
458
+ fn name ( & self ) -> & str {
459
+ "UPPER"
460
+ }
461
+
462
+ fn execute < ' guard > (
463
+ & self ,
464
+ machine : & mut dyn IntrinsicMachine ,
465
+ view : MutatorHeapView < ' guard > ,
466
+ _emitter : & mut dyn Emitter ,
467
+ args : & [ Ref ] ,
468
+ ) -> Result < ( ) , ExecutionError > {
469
+ let string = str_arg ( machine, view, & args[ 0 ] ) ?;
470
+ machine_return_str ( machine, view, string. to_uppercase ( ) )
471
+ }
472
+ }
473
+
474
+ /// __LOWER(s) - convert to lower case
475
+ pub struct Lower ;
476
+
477
+ impl StgIntrinsic for Lower {
478
+ fn name ( & self ) -> & str {
479
+ "LOWER"
480
+ }
481
+
482
+ fn execute < ' guard > (
483
+ & self ,
484
+ machine : & mut dyn IntrinsicMachine ,
485
+ view : MutatorHeapView < ' guard > ,
486
+ _emitter : & mut dyn Emitter ,
487
+ args : & [ Ref ] ,
488
+ ) -> Result < ( ) , ExecutionError > {
489
+ let string = str_arg ( machine, view, & args[ 0 ] ) ?;
490
+ machine_return_str ( machine, view, string. to_lowercase ( ) )
491
+ }
492
+ }
0 commit comments