Permalink
Browse files

Patched _t-univ so that 4-strprim/makestr.scm doesn't crash on py/rb/php

  • Loading branch information...
1 parent 6d79963 commit f8b1a2153f667dfea99ac9fd68b89de96730a23f @Gabriano Gabriano committed Jun 6, 2012
Showing with 37 additions and 3 deletions.
  1. +36 −2 gsc/_t-univ.scm
  2. +1 −1 include/stamp.h
View
@@ -1242,7 +1242,7 @@ EOF
(let ((code (char->integer ch)))
(case (target-name (ctx-target ctx))
- ((js) (gen code))
+ ((js python ruby php) (gen code))
(else
(compiler-internal-error
@@ -1551,6 +1551,29 @@ EOF
#f)
+(univ-define-prim "##null?" #f #f
+
+ (lambda (ctx opnds)
+ (case (target-name (ctx-target ctx))
+
+ ((js)
+ (gen "("
+ (translate-gvm-opnd ctx (list-ref opnds 0))
+ " === null)"))
+
+ ((python)
+ (gen "("
+ (translate-gvm-opnd ctx (list-ref opnds 0))
+ " is None)"))
+ ((ruby php) ;TODO: complete
+ (gen ""))
+
+ (else
+ (compiler-internal-error
+ "##null?, unknown target"))))
+
+ #f)
+
(univ-define-prim "##make-string" #f #f
(lambda (ctx opnds)
@@ -1562,7 +1585,9 @@ EOF
", "
(translate-gvm-opnd ctx (list-ref opnds 1))
")"))
-
+
+ ((python ruby php) ;TODO: complete
+ (gen ""))
(else
(compiler-internal-error
@@ -1642,6 +1667,9 @@ EOF
(translate-gvm-opnd ctx (list-ref opnds 0))
", Char)"))
+ ((ruby php) ;TODO: complete
+ (gen ""))
+
(else
(compiler-internal-error
"##char?, unknown target")))))
@@ -1659,6 +1687,9 @@ EOF
(gen "isinstance("
(translate-gvm-opnd ctx (list-ref opnds 0))
", Pair)"))
+
+ ((ruby php) ;TODO: complete
+ (gen ""))
(else
(compiler-internal-error
@@ -1678,6 +1709,9 @@ EOF
(translate-gvm-opnd ctx (list-ref opnds 0))
", String)"))
+ ((ruby php) ;TODO: complete
+ (gen ""))
+
(else
(compiler-internal-error
"##string?, unknown target")))))
View
@@ -3,4 +3,4 @@
*/
#define ___STAMP_YMD 20120606
-#define ___STAMP_HMS 214722
+#define ___STAMP_HMS 220747

0 comments on commit f8b1a21

Please sign in to comment.