From 442d53dd12fba68e87c9afbd5a1aaa3252977a9f Mon Sep 17 00:00:00 2001 From: johanknol Date: Sat, 23 Jun 2001 16:25:28 +0000 Subject: [PATCH] warn about a stray \ git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@938 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCC.lex | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/SDCC.lex b/src/SDCC.lex index 365d56f2..b4c5cfb4 100644 --- a/src/SDCC.lex +++ b/src/SDCC.lex @@ -39,7 +39,7 @@ IS (u|U|l|L)* char *stringLiteral(); char *currFname; -extern int lineno ; +extern int lineno, column; extern char *filename ; extern char *fullSrcFileName ; int yylineno = 1 ; @@ -245,6 +245,13 @@ struct options save_options ; "\r\n" { count(); } "\n" { count(); } [ \t\v\f] { count(); } +\\ { + char ch=input(); + if (ch!='\n') { + werror (W_STRAY_BACKSLASH, column); + unput(ch); + } +} . { count() ; } %% @@ -409,7 +416,6 @@ char *stringLiteral () { while ((ch = input()) && (isspace(ch) || ch=='\\')) { switch (ch) { case '\\': - //werror (W_STRAY_BACKSLASH) break; case '\n': yylineno++; -- 2.30.2