@@ -436,21 +436,21 @@ def __repr__(self):
436
436
437
437
#####################################
438
438
439
- def execute_print (self , exec_ctx ):
439
+ def execute_Cuchame (self , exec_ctx ):
440
440
print (str (exec_ctx .symbol_table .get ('value' )))
441
441
return RTResult ().success (Empty ())
442
- execute_print .arg_names = ['value' ]
442
+ execute_Cuchame .arg_names = ['value' ]
443
443
444
- def execute_print_ret (self , exec_ctx ):
444
+ def execute_CuchameRet (self , exec_ctx ):
445
445
return RTResult ().success (String (str (exec_ctx .symbol_table .get ('value' ))))
446
- execute_print_ret .arg_names = ['value' ]
446
+ execute_CuchameRet .arg_names = ['value' ]
447
447
448
- def execute_input (self , exec_ctx ):
448
+ def execute_Traeme (self , exec_ctx ):
449
449
text = input (exec_ctx .symbol_table .get ('inputValue?' ) or "Que me queré decir bro? >" )
450
450
return RTResult ().success (String (text ))
451
- execute_input .arg_names = ["inputValue?" ]
451
+ execute_Traeme .arg_names = ["inputValue?" ]
452
452
453
- def execute_input_int (self , exec_ctx ):
453
+ def execute_TraemeNumerito (self , exec_ctx ):
454
454
while True :
455
455
text = input (exec_ctx .symbol_table .get ('inputValue?' ) or "Tirame un numero: " )
456
456
try :
@@ -459,34 +459,34 @@ def execute_input_int(self, exec_ctx):
459
459
except ValueError :
460
460
print (f"'{ text } ' tiene que ser un numero tarao, mandale denuevo" )
461
461
return RTResult ().success (Number (number ))
462
- execute_input_int .arg_names = ["inputValue?" ]
462
+ execute_TraemeNumerito .arg_names = ["inputValue?" ]
463
463
464
- def execute_clear (self , exec_ctx ):
464
+ def execute_Limpiame (self , exec_ctx ):
465
465
os .system ('cls' if os .name == 'nt' else 'cls' )
466
466
return RTResult ().success (Empty ())
467
- execute_clear .arg_names = []
467
+ execute_Limpiame .arg_names = []
468
468
469
- def execute_is_number (self , exec_ctx ):
469
+ def execute_EsNumerito (self , exec_ctx ):
470
470
is_number = isinstance (exec_ctx .symbol_table .get ("value" ), Number )
471
471
return RTResult ().success (Number .true if is_number else Number .false )
472
- execute_is_number .arg_names = ["value" ]
472
+ execute_EsNumerito .arg_names = ["value" ]
473
473
474
- def execute_is_string (self , exec_ctx ):
474
+ def execute_EsTexto (self , exec_ctx ):
475
475
is_number = isinstance (exec_ctx .symbol_table .get ("value" ), String )
476
476
return RTResult ().success (Number .true if is_number else Number .false )
477
- execute_is_string .arg_names = ["value" ]
477
+ execute_EsTexto .arg_names = ["value" ]
478
478
479
- def execute_is_list (self , exec_ctx ):
479
+ def execute_EsLista (self , exec_ctx ):
480
480
is_number = isinstance (exec_ctx .symbol_table .get ("value" ), List )
481
481
return RTResult ().success (Number .true if is_number else Number .false )
482
- execute_is_list .arg_names = ["value" ]
482
+ execute_EsLista .arg_names = ["value" ]
483
483
484
- def execute_is_function (self , exec_ctx ):
484
+ def execute_EsFuncion (self , exec_ctx ):
485
485
is_number = isinstance (exec_ctx .symbol_table .get ("value" ), BaseFunction )
486
486
return RTResult ().success (Number .true if is_number else Number .false )
487
- execute_is_function .arg_names = ["value" ]
487
+ execute_EsFuncion .arg_names = ["value" ]
488
488
489
- def execute_append (self , exec_ctx ):
489
+ def execute_Agregale (self , exec_ctx ):
490
490
list_ = exec_ctx .symbol_table .get ("list" )
491
491
value = exec_ctx .symbol_table .get ("value" )
492
492
@@ -499,9 +499,9 @@ def execute_append(self, exec_ctx):
499
499
500
500
list_ .elements .append (value )
501
501
return RTResult ().success (list_ )
502
- execute_append .arg_names = ["list" , "value" ]
502
+ execute_Agregale .arg_names = ["list" , "value" ]
503
503
504
- def execute_pop (self , exec_ctx ):
504
+ def execute_Rajale (self , exec_ctx ):
505
505
list_ = exec_ctx .symbol_table .get ("list" )
506
506
index = exec_ctx .symbol_table .get ("index" )
507
507
@@ -528,9 +528,9 @@ def execute_pop(self, exec_ctx):
528
528
exec_ctx
529
529
))
530
530
return RTResult ().success (element )
531
- execute_pop .arg_names = ["list" , "index" ]
531
+ execute_Rajale .arg_names = ["list" , "index" ]
532
532
533
- def execute_extend (self , exec_ctx ):
533
+ def execute_Metele (self , exec_ctx ):
534
534
listA = exec_ctx .symbol_table .get ("listA" )
535
535
listB = exec_ctx .symbol_table .get ("listB" )
536
536
@@ -550,9 +550,9 @@ def execute_extend(self, exec_ctx):
550
550
551
551
listA .elements .extend (listB .elements )
552
552
return RTResult ().success (listA )
553
- execute_extend .arg_names = ["listA" , "listB" ]
553
+ execute_Metele .arg_names = ["listA" , "listB" ]
554
554
555
- def execute_len (self , exec_ctx ):
555
+ def execute_TaLargo (self , exec_ctx ):
556
556
value = exec_ctx .symbol_table .get ("value" )
557
557
558
558
if isinstance (value , List ):
@@ -562,13 +562,13 @@ def execute_len(self, exec_ctx):
562
562
563
563
return RTResult ().failure (RTError (
564
564
self .pos_start , self .pos_end ,
565
- "Che el len tiene que tener una lista o un string" ,
565
+ "Che el TaLargo tiene que tener una lista o un string" ,
566
566
exec_ctx
567
567
))
568
568
569
- execute_len .arg_names = ["value" ]
569
+ execute_TaLargo .arg_names = ["value" ]
570
570
571
- def execute_run (self , exec_ctx ):
571
+ def execute_Correme (self , exec_ctx ):
572
572
fn = exec_ctx .symbol_table .get ("fn" )
573
573
574
574
if not isinstance (fn , String ):
@@ -608,14 +608,14 @@ def execute_run(self, exec_ctx):
608
608
))
609
609
610
610
return RTResult ().success (Empty ())
611
- execute_run .arg_names = ["fn" ]
611
+ execute_Correme .arg_names = ["fn" ]
612
612
613
- def execute_hola (self , exec_ctx ):
613
+ def execute_Hola (self , exec_ctx ):
614
614
print ("Que onda perro? Todo piola?" )
615
615
return RTResult ().success (Empty ())
616
- execute_hola .arg_names = []
616
+ execute_Hola .arg_names = []
617
617
618
- def execute_argentina (self , exec_ctx ):
618
+ def execute_Argentina (self , exec_ctx ):
619
619
import ctypes
620
620
import os
621
621
from playsound import playsound
@@ -640,9 +640,9 @@ def execute_argentina(self, exec_ctx):
640
640
print ("Pasó algo, no pude cargar las cosas... Para mi es culpa del kernel imperialista..." )
641
641
finally :
642
642
return RTResult ().success (Empty ())
643
- execute_argentina .arg_names = []
643
+ execute_Argentina .arg_names = []
644
644
645
- def execute_thief (self , exec_ctx ):
645
+ def execute_Chorro (self , exec_ctx ):
646
646
from time import sleep
647
647
print ("\n Si entra el chorro no lo podes amasijar en el patio porque despues dicen que se cayo de la medianera." , end = "\n \n " )
648
648
sleep (4 )
@@ -675,17 +675,16 @@ def execute_thief(self, exec_ctx):
675
675
print ("En diez dias salis." , end = "\n \n " )
676
676
sleep (1 )
677
677
return RTResult ().success (Empty ())
678
- execute_thief .arg_names = []
678
+ execute_Chorro .arg_names = []
679
679
680
- def execute_exit (self , exec_ctx ):
680
+ def execute_Ninos (self , exec_ctx ):
681
681
import sys
682
682
print ('Nos vemos wachin! Aguante Argentina!' )
683
683
sys .exit (0 )
684
684
return RTResult ().success (Empty ())
685
- execute_exit .arg_names = []
685
+ execute_Ninos .arg_names = []
686
686
687
-
688
- def execute_sleep (self , exec_ctx ):
687
+ def execute_Boludear (self , exec_ctx ):
689
688
from time import sleep
690
689
n = exec_ctx .symbol_table .get ("value" )
691
690
if isinstance (n , Number ):
@@ -697,24 +696,113 @@ def execute_sleep(self, exec_ctx):
697
696
exec_ctx
698
697
))
699
698
return RTResult ().success (Empty ())
700
- execute_sleep .arg_names = ["value" ]
701
-
702
- BuiltInFunction .print = BuiltInFunction ("print" )
703
- BuiltInFunction .print_ret = BuiltInFunction ("print_ret" )
704
- BuiltInFunction .input = BuiltInFunction ("input" )
705
- BuiltInFunction .input_int = BuiltInFunction ("input_int" )
706
- BuiltInFunction .clear = BuiltInFunction ("clear" )
707
- BuiltInFunction .is_number = BuiltInFunction ("is_number" )
708
- BuiltInFunction .is_string = BuiltInFunction ("is_string" )
709
- BuiltInFunction .is_list = BuiltInFunction ("is_list" )
710
- BuiltInFunction .is_function = BuiltInFunction ("is_function" )
711
- BuiltInFunction .append = BuiltInFunction ("append" )
712
- BuiltInFunction .pop = BuiltInFunction ("pop" )
713
- BuiltInFunction .extend = BuiltInFunction ("extend" )
714
- BuiltInFunction .len = BuiltInFunction ("len" )
715
- BuiltInFunction .run = BuiltInFunction ("run" )
716
- BuiltInFunction .hola = BuiltInFunction ("hola" )
717
- BuiltInFunction .argentina = BuiltInFunction ("argentina" )
718
- BuiltInFunction .thief = BuiltInFunction ("thief" )
719
- BuiltInFunction .exit = BuiltInFunction ("exit" )
720
- BuiltInFunction .sleep = BuiltInFunction ("sleep" )
699
+ execute_Boludear .arg_names = ["value" ]
700
+
701
+ def execute_Viborita (self , exec_ctx ):
702
+ ev = exec_ctx .symbol_table .get ("value" )
703
+ if isinstance (ev , String ):
704
+ return RTResult ().success (String (str (eval (ev .value ))))
705
+ else :
706
+ return RTResult ().failure (RTError (
707
+ self .pos_start , self .pos_end ,
708
+ "Capo dame un string pa evaluar, dale?" ,
709
+ exec_ctx
710
+ ))
711
+ execute_Viborita .arg_names = ["value" ]
712
+
713
+ def execute_ANumerito (self , exec_ctx ):
714
+ n = exec_ctx .symbol_table .get ("value" )
715
+ if isinstance (n , String ):
716
+ try :
717
+ tmp = float (n .value )
718
+ ret = int (tmp )
719
+ return RTResult ().success (Number (ret ))
720
+ except :
721
+ return RTResult ().failure (RTError (
722
+ self .pos_start , self .pos_end ,
723
+ "Flaco no se que me pasaste pero no se puede hacer numerito" ,
724
+ exec_ctx
725
+ ))
726
+ elif isinstance (n , Number ):
727
+ return RTResult ().success (Number (int (n .value )))
728
+ else :
729
+ return RTResult ().failure (RTError (
730
+ self .pos_start , self .pos_end ,
731
+ "Capo pasame un numerito o un string, dale?" ,
732
+ exec_ctx
733
+ ))
734
+ execute_ANumerito .arg_names = ["value" ]
735
+
736
+ def execute_AFlotantito (self , exec_ctx ):
737
+ n = exec_ctx .symbol_table .get ("value" )
738
+ if isinstance (n , String ):
739
+ try :
740
+ ret = float (n .value )
741
+ return RTResult ().success (Number (ret ))
742
+ except :
743
+ return RTResult ().failure (RTError (
744
+ self .pos_start , self .pos_end ,
745
+ "Flaco no se que me pasaste pero no se puede hacer numerito" ,
746
+ exec_ctx
747
+ ))
748
+ elif isinstance (n , Number ):
749
+ return RTResult ().success (Number (float (n .value )))
750
+ else :
751
+ return RTResult ().failure (RTError (
752
+ self .pos_start , self .pos_end ,
753
+ "Capo pasame un numerito o un string, dale?" ,
754
+ exec_ctx
755
+ ))
756
+ execute_AFlotantito .arg_names = ["value" ]
757
+
758
+ def execute_ATextito (self , exec_ctx ):
759
+ return RTResult ().success (String (exec_ctx .symbol_table .get ("value" )))
760
+ execute_ATextito .arg_names = ["value" ]
761
+
762
+ def execute_FloatYPico (self , exec_ctx ):
763
+ import random
764
+ n = exec_ctx .symbol_table .get ("value" )
765
+ if isinstance (n , String ):
766
+ try :
767
+ ret = float (n .value ) + random .random () - .5
768
+ return RTResult ().success (Number (ret ))
769
+ except :
770
+ return RTResult ().failure (RTError (
771
+ self .pos_start , self .pos_end ,
772
+ "Flaco no se que me pasaste pero no se puede hacer numerito" ,
773
+ exec_ctx
774
+ ))
775
+ elif isinstance (n , Number ):
776
+ return RTResult ().success (Number (float (n .value ) + random .random () - .5 ))
777
+ else :
778
+ return RTResult ().failure (RTError (
779
+ self .pos_start , self .pos_end ,
780
+ "Capo pasame un numerito o un string, dale?" ,
781
+ exec_ctx
782
+ ))
783
+ execute_FloatYPico .arg_names = ["value" ]
784
+
785
+ BuiltInFunction .print = BuiltInFunction ("Cuchame" )
786
+ BuiltInFunction .print_ret = BuiltInFunction ("CuchameRet" )
787
+ BuiltInFunction .input = BuiltInFunction ("Traeme" )
788
+ BuiltInFunction .input_int = BuiltInFunction ("TraemeNumerito" )
789
+ BuiltInFunction .clear = BuiltInFunction ("Limpiame" )
790
+ BuiltInFunction .is_number = BuiltInFunction ("EsNumerito" )
791
+ BuiltInFunction .is_string = BuiltInFunction ("EsTexto" )
792
+ BuiltInFunction .is_list = BuiltInFunction ("EsLista" )
793
+ BuiltInFunction .is_function = BuiltInFunction ("EsFuncion" )
794
+ BuiltInFunction .append = BuiltInFunction ("Agregale" )
795
+ BuiltInFunction .pop = BuiltInFunction ("Rajale" )
796
+ BuiltInFunction .extend = BuiltInFunction ("Metele" )
797
+ BuiltInFunction .len = BuiltInFunction ("TaLargo" )
798
+ BuiltInFunction .run = BuiltInFunction ("Correme" )
799
+ BuiltInFunction .hola = BuiltInFunction ("Hola" )
800
+ BuiltInFunction .argentina = BuiltInFunction ("Argentina" )
801
+ BuiltInFunction .thief = BuiltInFunction ("Chorro" )
802
+ BuiltInFunction .exit = BuiltInFunction ("Ninos" )
803
+ BuiltInFunction .sleep = BuiltInFunction ("Boludear" )
804
+ BuiltInFunction .python = BuiltInFunction ("Viborita" )
805
+ BuiltInFunction .toInt = BuiltInFunction ("ANumerito" )
806
+ BuiltInFunction .toFloat = BuiltInFunction ("AFlotantito" )
807
+ BuiltInFunction .toStr = BuiltInFunction ("ATextito" )
808
+ BuiltInFunction .FloatYPico = BuiltInFunction ("FloatYPico" )
0 commit comments