diff options
author | Mike Buland <eichlan@xagasoft.com> | 2009-12-21 22:24:48 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2009-12-21 22:24:48 +0000 |
commit | 97c0fcbbef19012f825cba0fc3f16037322ce84c (patch) | |
tree | 4169f36e050f4df84280c948148f8f054c37091e /src/functionast.cpp | |
parent | 8ebc3f17961ef6a0cf708cc6bdca948d77817ee0 (diff) | |
download | build-97c0fcbbef19012f825cba0fc3f16037322ce84c.tar.gz build-97c0fcbbef19012f825cba0fc3f16037322ce84c.tar.bz2 build-97c0fcbbef19012f825cba0fc3f16037322ce84c.tar.xz build-97c0fcbbef19012f825cba0fc3f16037322ce84c.zip |
We're getting closer and closer, qt4 is more configurable and gets QT flags
for you for CXXFLAGS and LDFLAGS, added a bunch more stuff and fixed a strange
function input bug.
Diffstat (limited to 'src/functionast.cpp')
-rw-r--r-- | src/functionast.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/functionast.cpp b/src/functionast.cpp index 0d9a938..ceee460 100644 --- a/src/functionast.cpp +++ b/src/functionast.cpp | |||
@@ -4,6 +4,9 @@ | |||
4 | #include "runner.h" | 4 | #include "runner.h" |
5 | #include "context.h" | 5 | #include "context.h" |
6 | 6 | ||
7 | #include <bu/sio.h> | ||
8 | using namespace Bu; | ||
9 | |||
7 | FunctionAst::FunctionAst( const AstBranch *pRoot, class Runner *pRunner ) : | 10 | FunctionAst::FunctionAst( const AstBranch *pRoot, class Runner *pRunner ) : |
8 | pRoot( pRoot ), | 11 | pRoot( pRoot ), |
9 | pRunner( pRunner ) | 12 | pRunner( pRunner ) |
@@ -22,9 +25,20 @@ Bu::FString FunctionAst::getName() const | |||
22 | return sName; | 25 | return sName; |
23 | } | 26 | } |
24 | 27 | ||
25 | Variable FunctionAst::call( Variable &input, VarList /*lParams*/ ) | 28 | Variable FunctionAst::call( Variable &input, VarList lParams ) |
26 | { | 29 | { |
27 | pContext->pushScope(); | 30 | pContext->pushScope(); |
31 | |||
32 | AstBranch::NodeList::const_iterator vName = | ||
33 | (*(pRoot->getBranchBegin()+1)).begin(); | ||
34 | VarList::iterator vValue = lParams.begin(); | ||
35 | for( ; vName && vValue; vName++, vValue++ ) | ||
36 | { | ||
37 | pContext->addVariable( | ||
38 | dynamic_cast<const AstLeaf *>(*vName)->getStrValue(), | ||
39 | *vValue | ||
40 | ); | ||
41 | } | ||
28 | pContext->addVariable("INPUT", input ); | 42 | pContext->addVariable("INPUT", input ); |
29 | Variable vRet = pRunner->run( (*(pRoot->getBranchBegin()+2)).begin() ); | 43 | Variable vRet = pRunner->run( (*(pRoot->getBranchBegin()+2)).begin() ); |
30 | pContext->popScope(); | 44 | pContext->popScope(); |