Permalink
Browse files

Merge branch 'master' of github.com:briandkid/yotta

  • Loading branch information...
sporgj committed Nov 13, 2011
2 parents 9294e18 + 5c5cae4 commit 811de847e01d101b83187e2901dee52f6c02ff3f
Showing with 5 additions and 7 deletions.
  1. +5 −7 src/backbone/scanner.cpp
View
@@ -69,7 +69,7 @@ TObject* Scanner::get(){
if(c==END_OF_BUFFER)
{
//FIXME please update this, better handling
- return new TObject(new string(1, char(0)), 0, 0);
+ return new TObject(new string(1, char(0)), NULL_TOKEN, line, char_line);
}
//next determine the type
switch(short type = token_type(c)){
@@ -230,7 +230,7 @@ TObject* Scanner::extractIdentifier(char c){
void Scanner::skipWS(char c){
do{
- if(c==' ' || c=='\t' || c=='\r' || c=='\n'){
+ if(token_type(c)==WHITESPACE){
c = getChar();
}else{
break;
@@ -243,12 +243,10 @@ void Scanner::skipWS(char c){
}
void Scanner::skipCMT(char c){
- if(c=='%'){
+ c = getChar();
+ //then keep up skipping till we find an \n
+ while(c!='\n' && c!=END_OF_BUFFER)
c = getChar();
- //then keep up skipping till we find an \n
- while(c!='\n' && c!=END_OF_BUFFER)
- c = getChar();
- }
}
void Scanner::putback(){

0 comments on commit 811de84

Please sign in to comment.