diff options
Diffstat (limited to 'src/lexer.cpp')
-rw-r--r-- | src/lexer.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lexer.cpp b/src/lexer.cpp index 87d603a..9c8b36a 100644 --- a/src/lexer.cpp +++ b/src/lexer.cpp | |||
@@ -96,7 +96,13 @@ Token Lexer::nextTokenNormal() | |||
96 | { | 96 | { |
97 | sTmp->append( sBuf[iBufPos] ); | 97 | sTmp->append( sBuf[iBufPos] ); |
98 | } | 98 | } |
99 | return Token( Token::tCommand, sTmp ); | 99 | if( *sTmp == "quit" || *sTmp == "exit" ) |
100 | return Token( Token::tCmdExit ); | ||
101 | else if( *sTmp == "scale" ) | ||
102 | return Token( Token::tCmdScale ); | ||
103 | else if( *sTmp == "radix" ) | ||
104 | return Token( Token::tCmdRadix ); | ||
105 | return Token( Token::tCmdExtended, sTmp ); | ||
100 | } | 106 | } |
101 | break; | 107 | break; |
102 | 108 | ||
@@ -196,13 +202,13 @@ Token Lexer::nextTokenCommand() | |||
196 | if( iBufPos >= sBuf.getSize() ) | 202 | if( iBufPos >= sBuf.getSize() ) |
197 | { | 203 | { |
198 | iBufPos = -1; | 204 | iBufPos = -1; |
199 | return Token( Token::tEndOfLine ); | 205 | return Token( Token::tCmdEndParams ); |
200 | } | 206 | } |
201 | 207 | ||
202 | if( iBufPos < 0 ) | 208 | if( iBufPos < 0 ) |
203 | { | 209 | { |
204 | if( rIn.isEos() ) | 210 | if( rIn.isEos() ) |
205 | return Token( Token::tEndOfInput ); | 211 | return Token( Token::tCmdEndParams ); |
206 | 212 | ||
207 | sBuf = rIn.readLine(); | 213 | sBuf = rIn.readLine(); |
208 | if( sBuf.getSize() == 0 ) | 214 | if( sBuf.getSize() == 0 ) |