From b96daa4e9849ac9caf5c0dfcea8daac28267ea19 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 1 Dec 2016 10:40:43 -0700 Subject: 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. --- src/options.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/options.cpp') 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 @@ #include "number.h" #include "lexer.h" #include "parser.h" +#include "scriptengine.h" #include #include @@ -197,9 +198,11 @@ int Options::execute( Bu::StringArray aArgs ) Lexer lex( mbIn ); lex.setScale( iScale ); lex.setRadix( iRadix ); - Parser parser( lex, mbOut ); - parser.parse(); - Bu::print( mbOut.getString() ); + Parser parser( lex ); + Expression *pExp = parser.parse(); + ScriptEngine se; + Number n = se.exec( pExp ); + Bu::println( n.toString() ); exit( 0 ); return aArgs.getSize(); } -- cgit v1.2.3