|
|
Author: bernhard
Date: Wed Jan 9 09:54:26 2008
New Revision: 24704
Added:
trunk/languages/eclectus/t/procedures.pl
- copied unchanged from r24703,
/trunk/languages/eclectus/t/local_variables.pl
trunk/languages/eclectus/t/procedures.t
- copied, changed from r24703,
/trunk/languages/eclectus/t/local_variables.t
Modified:
trunk/MANIFEST
trunk/languages/eclectus/compiler.scm
trunk/languages/eclectus/docs/eclectus.pod
Log:
[Eclectus]
Add stub for test script that tests procedures.
Mild code tidying in compiler.scm
Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST (original)
+++ trunk/MANIFEST Wed Jan 9 09:54:26 2008
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Wed Jan 9 03:14:47 2008 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Wed Jan 9 17:36:48 2008 UT
#
# See tools/dev/install_files.pl for documentation on the
# format of this file.
@@ -1380,6 +1380,8 @@
languages/eclectus/t/learning_scheme.t [eclectus]
languages/eclectus/t/local_variables.pl [eclectus]
languages/eclectus/t/local_variables.t [eclectus]
+languages/eclectus/t/procedures.pl [eclectus]
+languages/eclectus/t/procedures.t [eclectus]
languages/eclectus/t/strings.pl [eclectus]
languages/eclectus/t/strings.t [eclectus]
languages/eclectus/t/unary_primitives.pl [eclectus]
Modified: trunk/languages/eclectus/compiler.scm
==============================================================================
--- trunk/languages/eclectus/compiler.scm (original)
+++ trunk/languages/eclectus/compiler.scm Wed Jan 9 09:54:26 2008
@@ -121,9 +121,10 @@
(define immediate?
(lambda (x)
(or (fixnum? x)
- (boolean? x)
- (char? x)
- (and (list? x) (= (length x) 0)))))
+ (boolean? x)
+ (char? x)
+ (and (list? x)
+ (= (length x) 0)))))
(define variable?
(lambda (x)
@@ -161,12 +162,14 @@
; is x a primitive?
(define primitive?
(lambda (x)
- (and (symbol? x) (getprop x '*is-prim*))))
+ (and (symbol? x)
+ (getprop x '*is-prim*))))
; is x a call to a primitive?
(define primcall?
(lambda (x)
- (and (pair? x) (primitive? (car x)))))
+ (and (pair? x)
+ (primitive? (car x)))))
; a primitive function is a symbol with the properties
; *is-prim*, *arg-count* and *emitter*
@@ -367,7 +370,8 @@
[(char? x)
(quasiquote (@ (value (unquote (char->integer x)))
(returns "EclectusCharacter")))]
- [(and (list? x) (= (length x) 0))
+ [(and (list? x)
+ (= (length x) 0))
(quasiquote (@ (value 0)
(returns "EclectusEmptyList")))]
[(boolean? x)
@@ -453,9 +457,9 @@
[(= (length (cdr tree)) 1) (transform-and-or (cadr tree))]
[else (quasiquote
(if
- (unquote (transform-and-or (cadr tree)))
- (unquote (transform-and-or (quasiquote (and
(unquote-splicing (cddr tree))))))
- #f))])]
+ (unquote (transform-and-or (cadr tree)))
+ (unquote (transform-and-or (quasiquote (and
(unquote-splicing (cddr tree))))))
+ #f))])]
[(eqv? (car tree) 'or)
( cond [(null? (cdr tree)) #f]
[(= (length (cdr tree)) 1) (transform-and-or (cadr tree))]
Modified: trunk/languages/eclectus/docs/eclectus.pod
==============================================================================
--- trunk/languages/eclectus/docs/eclectus.pod (original)
+++ trunk/languages/eclectus/docs/eclectus.pod Wed Jan 9 09:54:26 2008
@@ -23,7 +23,7 @@
=head1 TODO
-- local variables
+- procedures
- allow running the tests with 'petite' itself
- allow test-description per test case
- In the longterm, Eclectus should become self-hosting
Copied: trunk/languages/eclectus/t/procedures.t (from r24703,
/trunk/languages/eclectus/t/local_variables.t)
==============================================================================
--- /trunk/languages/eclectus/t/local_variables.t (original)
+++ trunk/languages/eclectus/t/procedures.t Wed Jan 9 09:54:26 2008
@@ -2,15 +2,10 @@
(load "tests-driver.scm") ; this should come first
+(skip-all "procedures are not supported yet")
+
(add-tests-with-string-output "local variables"
- [(let() 13) => "13\n"]
- [(let (($var_a 17)) 13) => "13\n"]
- [(let (($var_a 14)) $var_a) => "14\n"]
- [(let (($var_a 17) ($var_b 21)) 13) => "13\n"]
- [(let (($var_a 13) ($var_b 21)) (fxadd1 $var_a)) => "14\n"]
- [(let (($var_a 13) ($var_b 21)) (fx+ $var_a $var_b)) => "34\n"]
- [(let (($var_a 13) ($var_b 21)) (fx> $var_a $var_b)) => "#f\n"]
- [(let (($var_a 13) ($var_b 21)) (fx> $var_b $var_a)) => "#t\n"]
+ [((lambda () 18))) => "18\n"]
)
(load "compiler.scm")
|
|