summaryrefslogtreecommitdiff
path: root/src/options.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2016-12-01 10:40:43 -0700
committerMike Buland <eichlan@xagasoft.com>2016-12-01 10:40:43 -0700
commitb96daa4e9849ac9caf5c0dfcea8daac28267ea19 (patch)
tree9be42c8cfe8b875f396b5887742bb936bd081c65 /src/options.cpp
parent4efeaef41e57b25d6004e7f91828f7d5b5cd0b20 (diff)
downloadclic-b96daa4e9849ac9caf5c0dfcea8daac28267ea19.tar.gz
clic-b96daa4e9849ac9caf5c0dfcea8daac28267ea19.tar.bz2
clic-b96daa4e9849ac9caf5c0dfcea8daac28267ea19.tar.xz
clic-b96daa4e9849ac9caf5c0dfcea8daac28267ea19.zip
Scripts are executable now!
The main interactive interface doesn't work, and there's a lot left to do with the unit tests, other command line options, etc. but it's pretty exciting. I also still have to figure out how commands will work. I'm thinking they'll be stored in an Expression and executed by the engine as normal.
Diffstat (limited to 'src/options.cpp')
-rw-r--r--src/options.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/options.cpp b/src/options.cpp
index 3c016a6..672858a 100644
--- a/src/options.cpp
+++ b/src/options.cpp
@@ -7,6 +7,7 @@
7#include "number.h" 7#include "number.h"
8#include "lexer.h" 8#include "lexer.h"
9#include "parser.h" 9#include "parser.h"
10#include "scriptengine.h"
10 11
11#include <bu/streamstack.h> 12#include <bu/streamstack.h>
12#include <bu/sio.h> 13#include <bu/sio.h>
@@ -197,9 +198,11 @@ int Options::execute( Bu::StringArray aArgs )
197 Lexer lex( mbIn ); 198 Lexer lex( mbIn );
198 lex.setScale( iScale ); 199 lex.setScale( iScale );
199 lex.setRadix( iRadix ); 200 lex.setRadix( iRadix );
200 Parser parser( lex, mbOut ); 201 Parser parser( lex );
201 parser.parse(); 202 Expression *pExp = parser.parse();
202 Bu::print( mbOut.getString() ); 203 ScriptEngine se;
204 Number n = se.exec( pExp );
205 Bu::println( n.toString() );
203 exit( 0 ); 206 exit( 0 );
204 return aArgs.getSize(); 207 return aArgs.getSize();
205} 208}