Skip to content
This repository
Browse code

Prefixed all generated code names with Gambit_ .

  • Loading branch information...
commit 25c602b0fd8d8311e938c76213c1a0a302ba0390 1 parent 8074bd0
Gabriano authored June 11, 2012
320  gsc/_t-univ.scm
@@ -15,6 +15,8 @@
15 15
 (define univ-enable-jump-destination-inlining? #f)
16 16
 (set! univ-enable-jump-destination-inlining? #t)
17 17
 
  18
+(define (univ-prefix ctx name) (string-append "Gambit_" name))
  19
+
18 20
 ;;;----------------------------------------------------------------------------
19 21
 ;;
20 22
 ;; "Universal" back-end.
@@ -360,7 +362,7 @@
360 362
                       (univ-if-then
361 363
                        ctx
362 364
                        (univ-not= ctx
363  
-                                  (univ-global ctx "nargs")
  365
+                                  (univ-global ctx "Gambit_nargs")
364 366
                                   (label-entry-nb-parms gvm-instr))
365 367
                        (univ-throw ctx "\"wrong number of arguments\""))))
366 368
 
@@ -489,7 +491,7 @@
489 491
                ;; test: (jump-poll? gvm-instr)
490 492
                (gen (let ((nb-args (jump-nb-args gvm-instr)))
491 493
                       (if nb-args
492  
-                          (univ-assign ctx (univ-global ctx "nargs") nb-args)
  494
+                          (univ-assign ctx (univ-global ctx "Gambit_nargs") nb-args)
493 495
                           ""))
494 496
                     (with-stack-pointer-adjust
495 497
                      ctx
@@ -500,7 +502,7 @@
500 502
                          (univ-return
501 503
                           ctx
502 504
                           (if (jump-poll? gvm-instr)
503  
-                              (gen "poll(" (scan-gvm-opnd ctx opnd) ")")
  505
+                              (gen (univ-prefix ctx "poll(") (scan-gvm-opnd ctx opnd) ")")
504 506
                               (scan-gvm-opnd ctx opnd))))))))
505 507
 
506 508
               (else
@@ -605,7 +607,7 @@
605 607
 (define (with-stack-pointer-adjust ctx n proc)
606 608
   (gen (if (= n 0)
607 609
            (gen "")
608  
-           (univ-increment ctx (univ-global ctx "sp") n))
  610
+           (univ-increment ctx (univ-global ctx (univ-prefix ctx "sp")) n))
609 611
        (with-stack-base-offset
610 612
         ctx
611 613
         (- (ctx-stack-base-offset ctx) n)
@@ -617,16 +619,16 @@
617 619
          (gen "NO_OPERAND"))
618 620
 
619 621
         ((reg? gvm-opnd)
620  
-         (gen (univ-global ctx "reg")
  622
+         (gen (univ-global ctx (univ-prefix ctx "reg"))
621 623
               "["
622 624
               (reg-num gvm-opnd)
623 625
               "]"))
624 626
 
625 627
         ((stk? gvm-opnd)
626 628
          (let ((n (+ (stk-num gvm-opnd) (ctx-stack-base-offset ctx))))
627  
-           (gen (univ-global ctx "stack")
  629
+           (gen (univ-global ctx (univ-prefix ctx "stack"))
628 630
                 "["
629  
-                (univ-global ctx "sp")
  631
+                (univ-global ctx (univ-prefix ctx "sp"))
630 632
                 (cond ((= n 0)
631 633
                        (gen ""))
632 634
                       ((< n 0)
@@ -636,7 +638,7 @@
636 638
                 "]")))
637 639
 
638 640
         ((glo? gvm-opnd)
639  
-         (gen (univ-global ctx "glo")
  641
+         (gen (univ-global ctx (univ-prefix ctx "glo"))
640 642
               "["
641 643
               (object->string (symbol->string (glo-name gvm-opnd)))
642 644
               "]"))
@@ -694,27 +696,27 @@
694 696
 
695 697
     ((js)                               ;rts js
696 698
 #<<EOF
697  
-var glo = {};
698  
-var reg = [false];
699  
-var stack = [];
700  
-var sp = -1;
701  
-var nargs = 0;
702  
-var temp1 = false;
703  
-var temp2 = false;
704  
-var poll;
  699
+var Gambit_glo = {};
  700
+var Gambit_reg = [false];
  701
+var Gambit_stack = [];
  702
+var Gambit_sp = -1;
  703
+var Gambit_nargs = 0;
  704
+var Gambit_temp1 = false;
  705
+var Gambit_temp2 = false;
  706
+var Gambit_poll;
705 707
 
706 708
 if (this.hasOwnProperty('setTimeout')) {
707  
-  poll = function (wakeup) { setTimeout(function () { run(wakeup); }, 1); return false; };
  709
+  Gambit_poll = function (wakeup) { setTimeout(function () { Gambit_run(wakeup); }, 1); return false; };
708 710
 } else {
709  
-  poll = function (wakeup) { return wakeup; };
  711
+  Gambit_poll = function (wakeup) { return wakeup; };
710 712
 }
711 713
 
712 714
 
713  
-function Flonum(val) {
  715
+function Gambit_Flonum(val) {
714 716
   this.val = val;
715 717
 }
716 718
 
717  
-Flonum.prototype.toString = function ( ) {
  719
+Gambit_Flonum.prototype.toString = function ( ) {
718 720
   if (parseFloat(this.val) == parseInt(this.val)) {
719 721
     return this.val + ".";
720 722
   } else {
@@ -722,60 +724,60 @@ Flonum.prototype.toString = function ( ) {
722 724
   }
723 725
 }
724 726
 
725  
-var chars = {}
726  
-function Char(i) {
  727
+var Gambit_chars = {}
  728
+function Gambit_Char(i) {
727 729
   this.i = i;
728 730
 }
729 731
 
730  
-Char.integerToChar = function (i) {
731  
-    var ch = chars[i];
  732
+Gambit_Char.integerToChar = function (i) {
  733
+    var ch = Gambit_chars[i];
732 734
 
733 735
     if (!ch) {
734  
-        chars[i] = new Char(i);
735  
-        ch = chars[i];
  736
+        Gambit_chars[i] = new Gambit_Char(i);
  737
+        ch = Gambit_chars[i];
736 738
     }
737 739
     
738 740
     return ch;
739 741
 }
740 742
 
741  
-Char.prototype.toString = function ( ) {
  743
+Gambit_Char.prototype.toString = function ( ) {
742 744
     return String.fromCharCode(this.i);
743 745
 }
744 746
 
745  
-function Pair(car, cdr) {
  747
+function Gambit_Pair(car, cdr) {
746 748
     this.car = car;
747 749
     this.cdr = cdr;
748 750
 }
749 751
 
750  
-function _String(charray) {
  752
+function Gambit_String(charray) {
751 753
     this.charray = charray;
752 754
 }
753 755
 
754  
-_String.makestring = function ( n, c ) {
  756
+Gambit_String.makestring = function ( n, c ) {
755 757
     var a = new Array(n);
756 758
     c = c || "";
757 759
     for (i = 0; i < n; i++) {
758 760
         a[i] = c.i;
759 761
     }
760 762
 
761  
-    return new _String(a);
  763
+    return new Gambit_String(a);
762 764
 }
763 765
 
764  
-_String.prototype.stringlength = function ( ) {
  766
+Gambit_String.prototype.stringlength = function ( ) {
765 767
     return this.charray.length;
766 768
 }
767 769
 
768 770
 // srtring-ref
769  
-_String.prototype.stringref = function ( n ) {
  771
+Gambit_String.prototype.stringref = function ( n ) {
770 772
     return this.charray[n];
771 773
 }
772 774
 
773 775
 // string-set!
774  
-_String.prototype.stringset = function ( n, c ) {
  776
+Gambit_String.prototype.stringset = function ( n, c ) {
775 777
     this.charray[n] = c.i;
776 778
 }
777 779
 
778  
-_String.prototype.toString = function ( ) {
  780
+Gambit_String.prototype.toString = function ( ) {
779 781
     var s = "";
780 782
     for (i = 0; i < this.stringlength(); i++) {
781 783
         s = s.concat(String.fromCharCode(this.stringref(i)));
@@ -785,64 +787,64 @@ _String.prototype.toString = function ( ) {
785 787
 }
786 788
 
787 789
 
788  
-var syms = {};
789  
-function Symbol(s) {
  790
+var Gambit_syms = {};
  791
+function Gambit_Symbol(s) {
790 792
     this.symbolToString = function ( ) { return s; }
791 793
     this.toString = function ( ) { return s; }
792 794
 }
793 795
 
794  
-Symbol.stringToSymbol = function ( s ) {
795  
-    var sym = syms[s];
  796
+Gambit_Symbol.stringToSymbol = function ( s ) {
  797
+    var sym = Gambit_syms[s];
796 798
     
797 799
     if (!sym) {
798  
-        syms[s] = new Symbol(s);
799  
-        sym = syms[s];
  800
+        Gambit_syms[s] = new Gambit_Symbol(s);
  801
+        sym = Gambit_syms[s];
800 802
     }
801 803
     
802 804
     return sym;
803 805
 }
804 806
 
805  
-var kwds = {};
806  
-function Keyword(s) {
  807
+var Gambit_kwds = {};
  808
+function Gambit_Keyword(s) {
807 809
     s = s + ":";
808 810
 
809 811
     this.keywordToString = function( ) { return s.substring(0, s.length-1); }
810 812
     this.toString = function( ) { return s; }
811 813
 }
812 814
 
813  
-Keyword.stringToKeyword = function(s) {
814  
-    var kwd = kwds[s];
  815
+Gambit_Keyword.stringToKeyword = function(s) {
  816
+    var kwd = Gambit_kwds[s];
815 817
     
816 818
     if (!kwd) {
817  
-        kwds[s] = new Keyword(s);
818  
-        kwd = kwds[s];
  819
+        Gambit_kwds[s] = new Gambit_Keyword(s);
  820
+        kwd = Gambit_kwds[s];
819 821
     }
820 822
     
821 823
     return kwd;
822 824
 }
823 825
 
824 826
 function lbl1_println() { // println
825  
-  if (nargs !== 1)
  827
+  if (Gambit_nargs !== 1)
826 828
     throw "wrong number of arguments";
827  
-  if (reg[1] === false)
  829
+  if (Gambit_reg[1] === false)
828 830
     print("#f");
829  
-  else if (reg[1] === true)
  831
+  else if (Gambit_reg[1] === true)
830 832
     print("#t");
831  
-  else if (reg[1] instanceof Flonum)
832  
-    print(reg[1].toString());
833  
-  else if (reg[1] instanceof _String)
834  
-    print(reg[1].toString());
835  
-  else if (reg[1] instanceof Char)
836  
-    print(reg[1].toString());
  833
+  else if (Gambit_reg[1] instanceof Gambit_Flonum)
  834
+    print(Gambit_reg[1].toString());
  835
+  else if (Gambit_reg[1] instanceof Gambit_String)
  836
+    print(Gambit_reg[1].toString());
  837
+  else if (Gambit_reg[1] instanceof Gambit_Char)
  838
+    print(Gambit_reg[1].toString());
837 839
   else
838  
-    print(reg[1]);
839  
-  return reg[0];
  840
+    print(Gambit_reg[1]);
  841
+  return Gambit_reg[0];
840 842
 }
841 843
 
842  
-glo["println"] = lbl1_println;
  844
+Gambit_glo["println"] = lbl1_println;
843 845
 
844 846
 
845  
-function run(pc)
  847
+function Gambit_run(pc)
846 848
 {
847 849
   while (pc !== false)
848 850
     pc = pc();
@@ -858,18 +860,18 @@ EOF
858 860
 from array import array
859 861
 import ctypes
860 862
 
861  
-glo = {}
862  
-reg = {0:False}
863  
-stack = {}
864  
-sp = -1
865  
-nargs = 0
866  
-temp1 = False
867  
-temp2 = False
  863
+Gambit_glo = {}
  864
+Gambit_reg = {0:False}
  865
+Gambit_stack = {}
  866
+Gambit_sp = -1
  867
+Gambit_nargs = 0
  868
+Gambit_temp1 = False
  869
+Gambit_temp2 = False
868 870
 
869 871
 #
870 872
 # char
871 873
 #
872  
-class Char:
  874
+class Gambit_Char:
873 875
   chars = {}
874 876
   def __init__ ( self,  c ):
875 877
     self.c = c
@@ -878,25 +880,25 @@ class Char:
878 880
     return self.c
879 881
         
880 882
 # integer->char
881  
-def integerToChar ( i ):
882  
-  if Char.chars.has_key(i):
883  
-    return Char.chars[i]
  883
+def Gambit_integerToChar ( i ):
  884
+  if Gambit_Char.chars.has_key(i):
  885
+    return Gambit_Char.chars[i]
884 886
   else:
885  
-    Char.chars[i] = Char(unichr(i))
886  
-    return Char.chars[i]
  887
+    Gambit_Char.chars[i] = Gambit_Char(unichr(i))
  888
+    return Gambit_Char.chars[i]
887 889
 
888 890
 # char->integer
889  
-def charToInteger ( c ):
  891
+def Gambit_charToInteger ( c ):
890 892
   return ord(c.c)
891 893
 
892 894
 # char?
893  
-def charp ( c ):
  895
+def Gambit_charp ( c ):
894 896
   return (isinstance(c, Char))
895 897
 
896 898
 #
897 899
 # String
898 900
 #
899  
-class String:
  901
+class Gambit_String:
900 902
   def __init__ ( self, *args ):
901 903
     self.chars = array('u', list(args))
902 904
 
@@ -915,36 +917,36 @@ class String:
915 917
   def __str__ ( self ):
916 918
     return "".join(self.chars)
917 919
 
918  
-def makestring ( n, c ):
  920
+def Gambit_makestring ( n, c ):
919 921
   args = [c.c]*n
920  
-  return String(*args)
  922
+  return Gambit_String(*args)
921 923
     
922  
-def stringp ( s ):
  924
+def Gambit_stringp ( s ):
923 925
   return isinstance(s, String)
924 926
 
925 927
 
926 928
 def lbl1_println(): # println
927  
-  global glo, reg, stack, sp, nargs, temp1, temp2
928  
-  if nargs != 1:
  929
+  global Gambit_glo, Gambit_reg, Gambit_stack, Gambit_sp, Gambit_nargs, Gambit_temp1, Gambit_temp2
  930
+  if Gambit_nargs != 1:
929 931
     raise "wrong number of arguments"
930  
-  if reg[1] is False:
  932
+  if Gambit_reg[1] is False:
931 933
     print("#f")
932  
-  elif reg[1] is True:
  934
+  elif Gambit_reg[1] is True:
933 935
     print("#t")
934  
-  elif isinstance(reg[1], float) and (int(reg[1]) == round(reg[1])):
935  
-    print(str(int(reg[1])) + '.')
  936
+  elif isinstance(Gambit_reg[1], float) and (int(Gambit_reg[1]) == round(Gambit_reg[1])):
  937
+    print(str(int(Gambit_reg[1])) + '.')
936 938
   else:
937  
-    print(reg[1])
938  
-  return reg[0]
  939
+    print(Gambit_reg[1])
  940
+  return Gambit_reg[0]
939 941
 
940  
-glo["println"] = lbl1_println
  942
+Gambit_glo["println"] = lbl1_println
941 943
 
942 944
 
943  
-def poll(wakeup):
  945
+def Gambit_poll(wakeup):
944 946
   return wakeup
945 947
 
946 948
 
947  
-def run(pc):
  949
+def Gambit_run(pc):
948 950
   while pc != False:
949 951
     pc = pc()
950 952
 
@@ -955,16 +957,16 @@ EOF
955 957
 #<<EOF
956 958
 # encoding: utf-8
957 959
 
958  
-$glo = {}
959  
-$reg = {0=>false}
960  
-$stack = {}
961  
-$sp = -1
962  
-$nargs = 0
963  
-$temp1 = false
964  
-$temp2 = false
  960
+$Gambit_glo = {}
  961
+$Gambit_reg = {0=>false}
  962
+$Gambit_stack = {}
  963
+$Gambit_sp = -1
  964
+$Gambit_nargs = 0
  965
+$Gambit_temp1 = false
  966
+$Gambit_temp2 = false
965 967
 
966  
-$chars = {}
967  
-class Char
  968
+$Gambit_chars = {}
  969
+class Gambit_Char
968 970
   def initialize ( code )
969 971
     @code = code
970 972
   end
@@ -976,46 +978,46 @@ class Char
976 978
   end
977 979
 end
978 980
 
979  
-def integerToChar ( i )
980  
-  if $chars.has_key?(i)
981  
-    return $chars[i]
  981
+def Gambit_integerToChar ( i )
  982
+  if $Gambit_chars.has_key?(i)
  983
+    return $Gambit_chars[i]
982 984
   else
983  
-    c = Char.new(i)
984  
-    $chars[i] = c
  985
+    c = Gambit_Char.new(i)
  986
+    $Gambit_chars[i] = c
985 987
     return c
986 988
   end
987 989
 end
988 990
 
989 991
 $lbl1_println = lambda { # println
990  
-  if $nargs != 1
  992
+  if $Gambit_nargs != 1
991 993
     raise "wrong number of arguments"
992 994
   end
993 995
   
994  
-  if $reg[1] == false
  996
+  if $Gambit_reg[1] == false
995 997
     print("#f")
996  
-  elsif $reg[1] == true
  998
+  elsif $Gambit_reg[1] == true
997 999
     print("#t")
998  
-  elsif $reg[1].equal?(nil)
  1000
+  elsif $Gambit_reg[1].equal?(nil)
999 1001
     print("'()")
1000  
-  elsif $reg[1].class == Float && $reg[1] == $reg[1].round
1001  
-    print($reg[1].round.to_s() + ".")
  1002
+  elsif $Gambit_reg[1].class == Float && $Gambit_reg[1] == $Gambit_reg[1].round
  1003
+    print($Gambit_reg[1].round.to_s() + ".")
1002 1004
   else
1003  
-    print($reg[1])
  1005
+    print($Gambit_reg[1])
1004 1006
   end
1005 1007
   
1006 1008
   print("\n")
1007  
-  return $reg[0]
  1009
+  return $Gambit_reg[0]
1008 1010
 }
1009 1011
 
1010  
-$glo["println"] = $lbl1_println
  1012
+$Gambit_glo["println"] = $lbl1_println
1011 1013
 
1012 1014
 
1013  
-def poll(wakeup)
  1015
+def Gambit_poll(wakeup)
1014 1016
   return wakeup
1015 1017
 end
1016 1018
 
1017 1019
 
1018  
-def run(pc)
  1020
+def Gambit_run(pc)
1019 1021
   while pc != false
1020 1022
     pc = pc.call
1021 1023
   end
@@ -1043,10 +1045,10 @@ EOF
1043 1045
          (case (target-name (ctx-target ctx))
1044 1046
 
1045 1047
            ((js php)
1046  
-            (gen "run(" entry ");\n"))
  1048
+            (gen (univ-prefix ctx "run(") entry ");\n"))
1047 1049
 
1048 1050
            ((python ruby)
1049  
-            (gen "run(" entry ")\n"))
  1051
+            (gen (univ-prefix ctx "run(") entry ")\n"))
1050 1052
 
1051 1053
            (else
1052 1054
             (compiler-internal-error
@@ -1057,11 +1059,9 @@ EOF
1057 1059
 (define (univ-global ctx name)
1058 1060
   (case (target-name (ctx-target ctx))
1059 1061
 
1060  
-    ((js python php)
1061  
-     name)
  1062
+    ((js python php) name)
1062 1063
 
1063  
-    ((python ruby)
1064  
-     (gen "$" name))
  1064
+    ((ruby) (gen "$" name))
1065 1065
 
1066 1066
     (else
1067 1067
      (compiler-internal-error
@@ -1076,7 +1076,14 @@ EOF
1076 1076
 
1077 1077
          ((python)
1078 1078
           (gen "def " name "():\n"
1079  
-               (univ-indent "global glo, reg, stack, sp, nargs, temp1, temp2")
  1079
+               (univ-indent (gen "global "
  1080
+                                 (univ-prefix ctx "glo") ","
  1081
+                                 (univ-prefix ctx "reg") ","
  1082
+                                 (univ-prefix ctx "stack") ","
  1083
+                                 (univ-prefix ctx "sp") ","
  1084
+                                 (univ-prefix ctx "nargs") ","
  1085
+                                 (univ-prefix ctx "temp1") ","
  1086
+                                 (univ-prefix ctx "temp2")))
1080 1087
                header
1081 1088
                body))
1082 1089
 
@@ -1340,7 +1347,7 @@ EOF
1340 1347
                         (gen obj))))
1341 1348
                (case (target-name (ctx-target ctx))
1342 1349
                  ((js)
1343  
-                  (gen "new Flonum(" x ")"))
  1350
+                  (gen "new " (univ-prefix ctx "Flonum(") x ")"))
1344 1351
                  (else
1345 1352
                   x))))
1346 1353
             (else
@@ -1352,16 +1359,16 @@ EOF
1352 1359
     (case (target-name (ctx-target ctx))
1353 1360
 
1354 1361
       ((js)
1355  
-       (gen "Char.integerToChar("
  1362
+       (gen (univ-prefix ctx "Char.integerToChar(")
1356 1363
             code
1357 1364
             ")"))
1358 1365
 
1359 1366
       ((python ruby)
1360  
-       (gen "integerToChar("
  1367
+       (gen (univ-prefix ctx "integerToChar(")
1361 1368
             code
1362 1369
             ")"))
1363 1370
 
1364  
-      ((php) (gen code))
  1371
+      ((php) (gen code))                ;TODO: complete
1365 1372
 
1366 1373
       (else
1367 1374
        (compiler-internal-error
@@ -1395,16 +1402,16 @@ EOF
1395 1402
 
1396 1403
     ((js)
1397 1404
      (let ((s (object->string obj)))
1398  
-       (gen "new _String("
  1405
+       (gen "new " (univ-prefix ctx "String(")
1399 1406
             (string->charray (substring s 1 (- (string-length s) 1)))
1400 1407
             ")")))
1401 1408
     
1402 1409
     ((python)
1403  
-     (gen "String(*list(unicode("
  1410
+     (gen (univ-prefix ctx "String(*list(unicode(")
1404 1411
           (object->string obj)
1405 1412
           ")))"))
1406 1413
 
1407  
-    ((ruby php)
  1414
+    ((ruby php)                         ;TODO: complete
1408 1415
      (gen (object->string obj)))
1409 1416
 
1410 1417
     (else
@@ -1748,7 +1755,8 @@ EOF
1748 1755
     (case (target-name (ctx-target ctx))
1749 1756
 
1750 1757
       ((js)
1751  
-       (gen "new Pair("
  1758
+       (gen "new "
  1759
+            (univ-prefix ctx "Pair(")
1752 1760
             (translate-gvm-opnd ctx (list-ref opnds 0))
1753 1761
             ", "
1754 1762
             (translate-gvm-opnd ctx (list-ref opnds 1))
@@ -1873,14 +1881,14 @@ EOF
1873 1881
     (case (target-name (ctx-target ctx))
1874 1882
 
1875 1883
       ((js)
1876  
-       (gen "_String.makestring("
  1884
+       (gen (univ-prefix ctx "String.makestring(")
1877 1885
             (translate-gvm-opnd ctx (list-ref opnds 0))
1878 1886
             ", "
1879 1887
             (translate-gvm-opnd ctx (list-ref opnds 1))
1880 1888
             ")"))
1881 1889
       
1882 1890
       ((python)
1883  
-       (gen "makestring("
  1891
+       (gen (univ-prefix ctx "makestring(")
1884 1892
             (translate-gvm-opnd ctx (list-ref opnds 0))
1885 1893
             ", "
1886 1894
             (translate-gvm-opnd ctx (list-ref opnds 1))
@@ -1945,7 +1953,8 @@ EOF
1945 1953
     (case (target-name (ctx-target ctx))
1946 1954
 
1947 1955
       ((js)
1948  
-       (gen "new Char("
  1956
+       (gen "new "
  1957
+            (univ-prefix ctx "Char(")
1949 1958
             (translate-gvm-opnd ctx (list-ref opnds 0))
1950 1959
             ".stringref("
1951 1960
             (translate-gvm-opnd ctx (list-ref opnds 1))
@@ -2010,7 +2019,8 @@ EOF
2010 2019
 
2011 2020
       ((js)
2012 2021
        (gen (translate-gvm-opnd ctx (list-ref opnds 0))
2013  
-            " instanceof Flonum"))
  2022
+            " instanceof "
  2023
+            (univ-prefix ctx "Flonum")))
2014 2024
 
2015 2025
       ((python)
2016 2026
        (gen "isinstance("
@@ -2035,22 +2045,22 @@ EOF
2035 2045
   (lambda (ctx opnds)
2036 2046
     (case (target-name (ctx-target ctx))
2037 2047
 
2038  
-      ((js)
  2048
+      ((js php)
2039 2049
        (gen (translate-gvm-opnd ctx (list-ref opnds 0))
2040  
-            " instanceof Char"))
  2050
+            " instanceof "
  2051
+            (univ-prefix ctx "Char")))
2041 2052
 
2042 2053
       ((python)
2043 2054
        (gen "isinstance("
2044 2055
             (translate-gvm-opnd ctx (list-ref opnds 0))
2045  
-            ", Char)"))
  2056
+            ", "
  2057
+            (univ-prefix ctx "Char")))
2046 2058
 
2047 2059
       ((ruby)
2048 2060
        (gen (translate-gvm-opnd ctx (list-ref opnds 0))
2049  
-            ".class == Char"))
  2061
+            ".class == "
  2062
+            (univ-prefix ctx "Char")))
2050 2063
       
2051  
-      ((php)                       ;TODO: complete
2052  
-       (gen ""))
2053  
-
2054 2064
       (else
2055 2065
        (compiler-internal-error
2056 2066
         "##char?, unknown target")))))
@@ -2060,21 +2070,21 @@ EOF
2060 2070
   (lambda (ctx opnds)
2061 2071
     (case (target-name (ctx-target ctx))
2062 2072
 
2063  
-      ((js)
  2073
+      ((js php)
2064 2074
        (gen (translate-gvm-opnd ctx (list-ref opnds 0))
2065  
-            " instanceof Pair"))
  2075
+            " instanceof "
  2076
+            (univ-prefix ctx "Pair")))
2066 2077
 
2067 2078
       ((python)
2068 2079
        (gen "isinstance("
2069 2080
             (translate-gvm-opnd ctx (list-ref opnds 0))
2070  
-            ", Pair)"))
  2081
+            ", "
  2082
+            (univ-prefix ctx "Pair")))
2071 2083
       
2072 2084
       ((ruby)
2073 2085
        (gen (translate-gvm-opnd ctx (list-ref opnds 0))
2074  
-            ".class == Pair"))
2075  
-
2076  
-      ((php)                       ;TODO: complete
2077  
-       (gen ""))
  2086
+            ".class == "
  2087
+            (univ-prefix ctx "Pair")))
2078 2088
 
2079 2089
       (else
2080 2090
        (compiler-internal-error
@@ -2085,21 +2095,21 @@ EOF
2085 2095
   (lambda (ctx opnds)
2086 2096
     (case (target-name (ctx-target ctx))
2087 2097
 
2088  
-      ((js)
  2098
+      ((js php)
2089 2099
        (gen (translate-gvm-opnd ctx (list-ref opnds 0))
2090  
-            " instanceof String"))
  2100
+            " instanceof "
  2101
+            (univ-prefix ctx "String")))
2091 2102
 
2092 2103
       ((python)
2093 2104
        (gen "isinstance("
2094 2105
             (translate-gvm-opnd ctx (list-ref opnds 0))
2095  
-            ", _String)"))
  2106
+            ", "
  2107
+            (univ-prefix ctx "String")))
2096 2108
 
2097 2109
       ((ruby)
2098 2110
        (gen (translate-gvm-opnd ctx (list-ref opnds 0))
2099  
-            ".class == String"))
2100  
-
2101  
-      ((php)                       ;TODO: complete
2102  
-       (gen ""))
  2111
+            ".class == "
  2112
+            (univ-prefix ctx "String")))
2103 2113
 
2104 2114
       (else
2105 2115
        (compiler-internal-error
4  include/stamp.h
@@ -2,5 +2,5 @@
2 2
  * Time stamp of last source code repository commit.
3 3
  */
4 4
 
5  
-#define ___STAMP_YMD 20120608
6  
-#define ___STAMP_HMS 181110
  5
+#define ___STAMP_YMD 20120611
  6
+#define ___STAMP_HMS 185344

0 notes on commit 25c602b

Please sign in to comment.
Something went wrong with that request. Please try again.