summaryrefslogtreecommitdiffstats
path: root/cpp/sca
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2009-10-03 21:50:47 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2009-10-03 21:50:47 +0000
commit980d94493097ba3f93d1f4390fe90fca24b68444 (patch)
treec21726066ff8b39b891ffaaec89595adeeec6db7 /cpp/sca
parent9d50a5f28dea714aca1e0941db4a2f87d40eb99c (diff)
Added minimal support for comments. Removed build output from version control.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@821428 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rwxr-xr-xcpp/sca/modules/eval/eval-testbin335912 -> 0 bytes
-rw-r--r--cpp/sca/modules/eval/primitive.hpp7
-rw-r--r--cpp/sca/modules/eval/read.hpp1
-rw-r--r--cpp/sca/test/store-script/store-script.scm16
4 files changed, 16 insertions, 8 deletions
diff --git a/cpp/sca/modules/eval/eval-test b/cpp/sca/modules/eval/eval-test
deleted file mode 100755
index 5505bfd1e8..0000000000
--- a/cpp/sca/modules/eval/eval-test
+++ /dev/null
Binary files differ
diff --git a/cpp/sca/modules/eval/primitive.hpp b/cpp/sca/modules/eval/primitive.hpp
index 5ee74fa5d4..c31f276e2f 100644
--- a/cpp/sca/modules/eval/primitive.hpp
+++ b/cpp/sca/modules/eval/primitive.hpp
@@ -94,6 +94,11 @@ const value valueDisplay(list<value>& args) {
return true;
}
+const value valueComment(list<value>& args) {
+ *evalOut << "# " << car(args);
+ return true;
+}
+
const value valueError(list<value>& args) {
std::cerr << (std::string)car(args);
return true;
@@ -143,6 +148,7 @@ const list<value> primitiveProcedureNames() {
l = cons<value>("/", l);
l = cons<value>("equal?", l);
l = cons<value>("display", l);
+ l = cons<value>(";", l);
return l;
}
@@ -159,6 +165,7 @@ const list<value> primitiveProcedureObjects() {
l = cons(primitiveProcedure(valueDiv), l);
l = cons(primitiveProcedure(valueEqual), l);
l = cons(primitiveProcedure(valueDisplay), l);
+ l = cons(primitiveProcedure(valueComment), l);
return l;
}
diff --git a/cpp/sca/modules/eval/read.hpp b/cpp/sca/modules/eval/read.hpp
index 6baf670a1e..a6e581c416 100644
--- a/cpp/sca/modules/eval/read.hpp
+++ b/cpp/sca/modules/eval/read.hpp
@@ -40,6 +40,7 @@ namespace tuscany
const value rightParenthesis(makeList<value>(")"));
const value leftParenthesis(makeList<value>("("));
+const value comment(makeList<value>(";"));
const double stringToNumber(const std::string& str) {
double d;
diff --git a/cpp/sca/test/store-script/store-script.scm b/cpp/sca/test/store-script/store-script.scm
index 8af88b45f0..aa4ea962f2 100644
--- a/cpp/sca/test/store-script/store-script.scm
+++ b/cpp/sca/test/store-script/store-script.scm
@@ -1,5 +1,5 @@
-(display "Currency implementation")
+(; "Currency implementation")
(define (currency_convert from to amount)
(if (equal? to "EUR") (* amount 0.70) amount)
@@ -16,11 +16,11 @@
)
)
-(display "Currency composite")
+(; "Currency composite")
(define (currency_service op . args) (currency_impl op args))
-(display "Catalog implementation")
+(; "Catalog implementation")
(define (catalog_get converter)
(define (convert price) (converter "convert" "USD" "USD" price))
@@ -40,11 +40,11 @@
)
)
-(display "Catalog composite")
+(; "Catalog composite")
(define (catalog_service op . args) (catalog_impl currency_service op args))
-(display "Cart implementation")
+(; "Cart implementation")
(define (cart_post content item)
(cons item content)
@@ -61,7 +61,7 @@
)
)
-(display "Store UI implementation")
+(; "Store UI implementation")
(define (storeui_post cart content item)
(cart "post" content item)
@@ -83,13 +83,13 @@
)
)
-(display "Store UI composite")
+(; "Store UI composite")
(define (cart_service op . args) (cart_impl op args))
(define (storeui_service op . args) (storeui_impl cart_service catalog_service op args))
-(display "Store UI test case")
+(; "Store UI test case")
(define catalog (storeui_service "getcatalog"))
(define empty (list))