X-Git-Url: http://andersk.mit.edu/gitweb/splint.git/blobdiff_plain/8b63eb37025fe1afe1fe4d0160387db50fd77194..061ece7d6fedbde47030222fea74b575c12707dc:/src/cscannerHelp.c diff --git a/src/cscannerHelp.c b/src/cscannerHelp.c index e5c6e51..ae202f4 100644 --- a/src/cscannerHelp.c +++ b/src/cscannerHelp.c @@ -724,11 +724,15 @@ bool cscannerHelp_handleSpecial (char *yyt) cstring_free (exname); } + + cscannerHelp_handleNewLine (); // evans 2003-10-27: pragment increments line } else if (cstring_equalPrefixLit (olc, "ident")) { /* Some pre-processors will leave these in the code. Ignore rest of line */ + cscannerHelp_handleNewLine (); // evans 2003-10-27: ident increments line } + /* ** Yuk...Win32 filenames can have spaces in them...we need to read ** to the matching end quote. @@ -747,9 +751,7 @@ bool cscannerHelp_handleSpecial (char *yyt) } llassert (*tmp == '\"'); - tmp++; - fname = tmp; while (*tmp != '\"' && *tmp != '\0') @@ -758,7 +760,6 @@ bool cscannerHelp_handleSpecial (char *yyt) } llassert (*tmp == '\"'); - *tmp = '\0'; # if defined(OS2) || defined(MSDOS) || defined(WIN32) @@ -838,6 +839,7 @@ bool cscannerHelp_handleSpecial (char *yyt) ** We handle a plain # in the input file, by echoing it, and ignoring it in the post-pp-file. */ mstring_free (ol); + cscannerHelp_handleNewLine (); // evans 2003-10-27: increments line return FALSE; } else { voptgenerror @@ -845,6 +847,7 @@ bool cscannerHelp_handleSpecial (char *yyt) message ("Unrecognized pre-processor directive: #%s", cstring_fromChars (ol)), g_currentloc); + cscannerHelp_handleNewLine (); // evans 2003-10-27: increments line } sfree (ol); @@ -2685,7 +2688,12 @@ void cscannerHelp_advanceLine (void) int cscannerHelp_returnToken (int t) { - yylval.tok = lltok_create (t, fileloc_decColumn (g_currentloc, s_tokLength)); + if (s_tokLength > fileloc_column (g_currentloc)) { + yylval.tok = lltok_create (t, fileloc_copy (g_currentloc)); + } else { + yylval.tok = lltok_create (t, fileloc_decColumn (g_currentloc, s_tokLength)); + } + s_tokLength = 0; s_lastWasString = FALSE; return (t);