summaryrefslogtreecommitdiff
path: root/src/lexer.cpp
diff options
context:
space:
mode:
authorMike Buland <mike@xagasoft.com>2013-04-23 13:15:06 -0600
committerMike Buland <mike@xagasoft.com>2013-04-23 13:15:06 -0600
commit4bd16214f0c6d2b4079b01d68b7e36ad408406d4 (patch)
tree1bed3875ee881a276701824ed823dcce27ccd73c /src/lexer.cpp
parent23affa8ed0b37ec0162177a716047260cc5b7cf1 (diff)
downloadclic-4bd16214f0c6d2b4079b01d68b7e36ad408406d4.tar.gz
clic-4bd16214f0c6d2b4079b01d68b7e36ad408406d4.tar.bz2
clic-4bd16214f0c6d2b4079b01d68b7e36ad408406d4.tar.xz
clic-4bd16214f0c6d2b4079b01d68b7e36ad408406d4.zip
Now supports modulus (strange for fractions).
Diffstat (limited to 'src/lexer.cpp')
-rw-r--r--src/lexer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lexer.cpp b/src/lexer.cpp
index 46686c8..2521b40 100644
--- a/src/lexer.cpp
+++ b/src/lexer.cpp
@@ -70,6 +70,7 @@ Token Lexer::nextToken()
70 sBuf[iBufPos] != ' ' && sBuf[iBufPos] != '\t' && 70 sBuf[iBufPos] != ' ' && sBuf[iBufPos] != '\t' &&
71 sBuf[iBufPos] != '+' && sBuf[iBufPos] != '-' && 71 sBuf[iBufPos] != '+' && sBuf[iBufPos] != '-' &&
72 sBuf[iBufPos] != '*' && sBuf[iBufPos] != '/' && 72 sBuf[iBufPos] != '*' && sBuf[iBufPos] != '/' &&
73 sBuf[iBufPos] != '%' &&
73 sBuf[iBufPos] != '(' && sBuf[iBufPos] != ')'; 74 sBuf[iBufPos] != '(' && sBuf[iBufPos] != ')';
74 iBufPos++ ) 75 iBufPos++ )
75 { 76 {
@@ -99,6 +100,10 @@ Token Lexer::nextToken()
99 iBufPos++; 100 iBufPos++;
100 return Token( Token::tDivide ); 101 return Token( Token::tDivide );
101 102
103 case '%':
104 iBufPos++;
105 return Token( Token::tModulus );
106
102 case '(': 107 case '(':
103 iBufPos++; 108 iBufPos++;
104 return Token( Token::tOpenParen ); 109 return Token( Token::tOpenParen );