[Plib-cvs] plib/src/psl pslCompiler.h,1.13,1.14 pslToken.cxx,1.15,1.16
Brought to you by:
sjbaker
From: Steve B. <sj...@us...> - 2002-09-12 03:17:09
|
Update of /cvsroot/plib/plib/src/psl In directory usw-pr-cvs1:/tmp/cvs-serv13491/plib/src/psl Modified Files: pslCompiler.h pslToken.cxx Log Message: Fixed #define and #undef to disallow tokens that aren't legal identifiers. Index: pslCompiler.h =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslCompiler.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- pslCompiler.h 11 Sep 2002 21:21:37 -0000 1.13 +++ pslCompiler.h 12 Sep 2002 03:17:06 -0000 1.14 @@ -61,6 +61,7 @@ int doPreProcessorCommand () ; void getToken ( char *s, int define_sub = TRUE ) ; void ungetToken ( const char *s ) ; + void skipToEOL () ; /* Write data into Code space */ Index: pslToken.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/psl/pslToken.cxx,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- pslToken.cxx 11 Sep 2002 21:21:37 -0000 1.15 +++ pslToken.cxx 12 Sep 2002 03:17:06 -0000 1.16 @@ -27,6 +27,16 @@ static char ungotten_token [ MAX_UNGET ][ MAX_TOKEN ] ; static int unget_token_stack_depth = 0 ; +void pslCompiler::skipToEOL () +{ + int c ; + + do + { + c = getChar () ; + } while ( c != '\n' && c != -1 ) ; [...86 lines suppressed...] + return '\n' ; } if ( strcmp ( token, "ifndef" ) == 0 ) @@ -228,13 +254,8 @@ error ( "Unrecognised preprocessor directive '%s'", token ) ; - /* Skip to the end of this line. */ - - int c ; - - do { c = getChar () ; } while ( c != '\n' && c != -1 ) ; - - return c ; + skipToEOL () ; + return '\n' ; } |