diff options
author | Dejan Jovanović <dejan.jovanovic@gmail.com> | 2009-12-18 20:40:02 +0000 |
---|---|---|
committer | Dejan Jovanović <dejan.jovanovic@gmail.com> | 2009-12-18 20:40:02 +0000 |
commit | 9d57ed6b7e78373bec9db88adfb9878e377abb97 (patch) | |
tree | 9671948a7fb6023b3e33826548bcf604395ae696 /src/main | |
parent | deaeed0271fcaa39c071ced30fb21946ca2e6d0f (diff) |
Changing some deatils on the parser. Now we know we are done if command is null, or expression is null.
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/main.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/main/main.cpp b/src/main/main.cpp index 595915100..4731c536e 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -108,15 +108,13 @@ int main(int argc, char *argv[]) { } // Parse and execute commands until we are done - while(!parser->done()) { - // Parse the next command - Command *cmd = parser->parseNextCommand(); - if(cmd) { - if(options.verbosity > 0) - cout << "Invoking: " << *cmd << endl; - cmd->invoke(&smt); - delete cmd; + Command* cmd; + while((cmd = parser->parseNextCommand())) { + if(options.verbosity > 0) { + cout << "Invoking: " << *cmd << endl; } + cmd->invoke(&smt); + delete cmd; } // Remove the parser |