From b4510a2861acabf1f27ecbd8c42602a0c342763d Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 28 Nov 2014 11:01:34 -0700 Subject: Switched to using bin2cpp for the help. I think that's a better practice, it'll be a lot easier to expand it and format it in general, plus it could be compressed if it got too much bigger. --- src/parser.cpp | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) (limited to 'src/parser.cpp') diff --git a/src/parser.cpp b/src/parser.cpp index f97078a..72f7bb3 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -1,6 +1,7 @@ #include "parser.h" #include "lexer.h" #include "number.h" +#include "datafiles.h" #include #include @@ -35,6 +36,7 @@ void Parser::parse() if( !tsTerminal.isEmpty() ) { Bu::println( rOut, "%1").arg( deref( tsTerminal.peek() ) ); + hVars.insert("ans", deref( tsTerminal.peek() ) ); } tsTerminal.clear(); lex.setMode( Lexer::modeNormal ); @@ -118,30 +120,7 @@ void Parser::parse() } else if( *t.sVal == "help" || *t.sVal == "h" || *t.sVal == "?" ) { - Bu::println( rOut, - "All commands start with a '\\'. The following commands are defined:\n" - " \\help, \\h, \\? - This help\n" - " \\exit, \\quit - Exit the program\n" - " \\radix - Display the current radix (base)\n" - " \\radix - Set the radix to anything between 2 and 36 (inclusive)\n" - " \\scale - Display the current scale\n" - " \\scale - Set the current scale\n" - " \\vars - List all defined variables\n" - "\n" - "All variables must prefixed with a $ but otherwise can be used anywhere a\n" - "number can be used. To assign a variable use =, i.e.:\n" - " $amnt = $rate * 144000.09\n" - "\n" - "When using a radix greater than 10 all extended digits are lowercase letters\n" - "starting with 'a'. Upper case is not currently supported.\n" - "\n" - "All numeric command parameters (i.e. \\scale, \\radix) are in base 10 no\n" - "matter what radix is currently set. These are also displayed in base 10\n" - "at all times.\n" - "\n" - "Changing the radix always clears all variables.\n" - ); - + Bu::println( rOut, Datafiles::getString("parserhelp.txt") ); } else { -- cgit v1.2.3