summaryrefslogtreecommitdiff
path: root/src/lexer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lexer.cpp')
-rw-r--r--src/lexer.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/lexer.cpp b/src/lexer.cpp
index 3ebb0cf..46686c8 100644
--- a/src/lexer.cpp
+++ b/src/lexer.cpp
@@ -63,6 +63,26 @@ Token Lexer::nextToken()
63 } 63 }
64 break; 64 break;
65 65
66 case '$':
67 {
68 Bu::String *sTmp = new Bu::String();
69 for( iBufPos++; iBufPos < sBuf.getSize() &&
70 sBuf[iBufPos] != ' ' && sBuf[iBufPos] != '\t' &&
71 sBuf[iBufPos] != '+' && sBuf[iBufPos] != '-' &&
72 sBuf[iBufPos] != '*' && sBuf[iBufPos] != '/' &&
73 sBuf[iBufPos] != '(' && sBuf[iBufPos] != ')';
74 iBufPos++ )
75 {
76 sTmp->append( sBuf[iBufPos] );
77 }
78 return Token( Token::tVariable, sTmp );
79 }
80 break;
81
82 case '=':
83 iBufPos++;
84 return Token( Token::tEquals );
85
66 case '+': 86 case '+':
67 iBufPos++; 87 iBufPos++;
68 return Token( Token::tPlus ); 88 return Token( Token::tPlus );
@@ -115,26 +135,6 @@ Token Lexer::nextToken()
115 delete sTmp; 135 delete sTmp;
116 return Token( Token::tNumber, n ); 136 return Token( Token::tNumber, n );
117 } 137 }
118 else if( (sBuf[iBufPos]>=(ascRangeTop+1) && sBuf[iBufPos]<='z') ||
119 (sBuf[iBufPos]>='A' && sBuf[iBufPos]<='Z') ||
120 sBuf[iBufPos] == '_' )
121 {
122 for( ; iBufPos < sBuf.getSize(); iBufPos++ )
123 {
124 if( (sBuf[iBufPos]>='a' && sBuf[iBufPos]<='z') ||
125 (sBuf[iBufPos]>='A' && sBuf[iBufPos]<='Z') ||
126 (sBuf[iBufPos]>='0' && sBuf[iBufPos]<='9') ||
127 sBuf[iBufPos] == '_' )
128 {
129 sTmp->append( sBuf[iBufPos] );
130 }
131 else
132 {
133 break;
134 }
135 }
136 return Token( Token::tString, sTmp );
137 }
138 else 138 else
139 { 139 {
140 sBuf.clear(); 140 sBuf.clear();