#include "grealpath.h"
int lineno;
+char linebuf[2000];
#undef YY_BUF_SIZE
#define YY_BUF_SIZE 1048576
%%
-"\n" { ++lineno; } /* " */
+\n.* { strncpy(linebuf, yytext+1, sizeof(linebuf)); /* save the next line */
+ linebuf[sizeof(linebuf)-1]='\0';
+ /* printf("%4d:%s\n",lineno,linebuf); */
+ yyless(1); /* give back all but the \n to rescan */
+ ++lineno;
+ }
"\\\n" { ++lineno; }
[\t\f\v\r ]+ { /* Ignore whitespace. */ }
extern FILE *yyin;
extern int lineno;
+extern char linebuf[2000];
extern char *yytext;
extern int yylex (GISourceScanner *scanner);
* have valid expressions */
if (!scanner->macro_scan)
{
- fprintf(stderr, "%s:%d: %s\n",
- scanner->current_filename, lineno, s);
+ fprintf(stderr, "%s:%d: %s in '%s' at '%s'\n",
+ scanner->current_filename, lineno, s, linebuf, yytext);
}
}