summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Israelsson Tampe <stefan.itampe@gmail.com>2018-04-05 14:49:56 +0200
committerStefan Israelsson Tampe <stefan.itampe@gmail.com>2018-04-05 14:49:56 +0200
commitcf6475b2a895db02b7558dec341db7ba1ca8be20 (patch)
tree9b134a07f860e3e1f585ef8b343322707b50c3e7
parent427fe943328dc964bfe75448e86abe15682accda (diff)
python parser
-rw-r--r--modules/language/python/compile.scm13
1 files changed, 10 insertions, 3 deletions
diff --git a/modules/language/python/compile.scm b/modules/language/python/compile.scm
index 8f5139d..ad341a5 100644
--- a/modules/language/python/compile.scm
+++ b/modules/language/python/compile.scm
@@ -1276,8 +1276,11 @@
(#:return
- ((_ . x)
- `(,(fluid-ref return) ,@(map (g vs exp) x))))
+ ((_ x)
+ (if x
+ `(,(fluid-ref return) ,@(map (g vs exp) x))
+ `(,(fluid-ref return)))))
+
(#:dict
((_ . #f)
@@ -1917,10 +1920,14 @@
(define-syntax boolit
- (syntax-rules (and or not)
+ (syntax-rules (and or not < <= > >=)
((_ (and x y)) (and (boolit x) (boolit y)))
((_ (or x y)) (or (boolit x) (boolit y)))
((_ (not x )) (not (boolit x)))
+ ((_ (< x y)) (< x y))
+ ((_ (<= x y)) (<= x y))
+ ((_ (> x y)) (> x y))
+ ((_ (>= x y)) (>= x y))
((_ #t) #t)
((_ #f) #f)
((_ x ) (bool x))))