summaryrefslogtreecommitdiff
path: root/src/lexer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lexer.cpp')
-rw-r--r--src/lexer.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lexer.cpp b/src/lexer.cpp
index fbcaafb..55d155d 100644
--- a/src/lexer.cpp
+++ b/src/lexer.cpp
@@ -26,15 +26,15 @@ Lexer::~Lexer()
26 26
27void Lexer::nextToken() 27void Lexer::nextToken()
28{ 28{
29 if( iLookAheadSize <= 1 ) 29 if( iLookAheadUsed <= 1 )
30 { 30 {
31 iLookAheadSize = 0; 31 iLookAheadUsed = 0;
32 iLookAheadStart = 0; 32 iLookAheadStart = 0;
33 } 33 }
34 else 34 else
35 { 35 {
36 iLookAheadStart = (iLookAheadStart+1)%iLookAheadSize; 36 iLookAheadStart = (iLookAheadStart+1)%iLookAheadSize;
37 iLookAheadSize--; 37 iLookAheadUsed--;
38 } 38 }
39} 39}
40 40
@@ -55,11 +55,16 @@ void Lexer::fillToken()
55 default: 55 default:
56 throw Bu::ExceptionBase("Invalid mode."); 56 throw Bu::ExceptionBase("Invalid mode.");
57 } 57 }
58 58/*
59 Bu::sio << "read[" 59 Bu::sio << "read["
60 << ((iLookAheadUsed+iLookAheadStart)%iLookAheadSize) 60 << ((iLookAheadUsed+iLookAheadStart)%iLookAheadSize)
61 << "]: " 61 << "]: "
62 << aLookAhead[(iLookAheadUsed+iLookAheadStart)%iLookAheadSize].eType; 62 << aLookAhead[(iLookAheadUsed+iLookAheadStart)%iLookAheadSize].eType;
63 if( aLookAhead[(iLookAheadUsed+iLookAheadStart)%iLookAheadSize].eType == Token::tNumber )
64 Bu::sio << "("
65 << aLookAhead[(iLookAheadUsed+iLookAheadStart)%iLookAheadSize].nVal->toString() << ")";
66 Bu::sio << Bu::sio.nl;
67*/
63} 68}
64 69
65Token Lexer::nextTokenNormal() 70Token Lexer::nextTokenNormal()