Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61553 - in trunk/libs/spirit/example/scheme: scheme test
From: joel_at_[hidden]
Date: 2010-04-25 05:46:10


Author: djowel
Date: 2010-04-25 05:46:09 EDT (Sun, 25 Apr 2010)
New Revision: 61553
URL: http://svn.boost.org/trac/boost/changeset/61553

Log:
qi-compiler
Text files modified:
   trunk/libs/spirit/example/scheme/scheme/compiler.hpp | 2 ++
   trunk/libs/spirit/example/scheme/test/qi_interpreter.cpp | 6 +++---
   2 files changed, 5 insertions(+), 3 deletions(-)

Modified: trunk/libs/spirit/example/scheme/scheme/compiler.hpp
==============================================================================
--- trunk/libs/spirit/example/scheme/scheme/compiler.hpp (original)
+++ trunk/libs/spirit/example/scheme/scheme/compiler.hpp 2010-04-25 05:46:09 EDT (Sun, 25 Apr 2010)
@@ -556,6 +556,7 @@
             Source& in,
             std::string const& source_file = "",
             environment* outer = 0)
+ : env(outer)
         {
             if (outer == 0)
                 build_basic_environment(env);
@@ -569,6 +570,7 @@
         interpreter(
             utree const& program,
             environment* outer = 0)
+ : env(outer)
         {
             if (outer == 0)
                 build_basic_environment(env);

Modified: trunk/libs/spirit/example/scheme/test/qi_interpreter.cpp
==============================================================================
--- trunk/libs/spirit/example/scheme/test/qi_interpreter.cpp (original)
+++ trunk/libs/spirit/example/scheme/test/qi_interpreter.cpp 2010-04-25 05:46:09 EDT (Sun, 25 Apr 2010)
@@ -103,9 +103,9 @@
     build_qi_environment(fragments, env);
 
     {
- utree src = "(define (factorial n) (if (<= n 0) 1 (* n (factorial (- n 1)))))";
- interpreter program(src, &env);
- BOOST_TEST(program["factorial"](10) == 3628800);
+ utree src = "(define foo 123)";
+ interpreter parser(src, "parse.scm", &env);
+ std::cout << parser["qi:int_"]() << std::endl;
     }
 
     return boost::report_errors();


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk