Fix the bug I introduced in the last commit, which broke line contuation

where newline is followed by whitespace.  Do not return a newline token
to the parser in that case (logically still the same line).
This commit is contained in:
gwr 1996-11-12 17:42:47 +00:00
parent 7cc5f9cd7a
commit 7fa1418031
1 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,5 @@
%{
/* $NetBSD: scan.l,v 1.9 1996/11/11 23:54:18 gwr Exp $ */
/* $NetBSD: scan.l,v 1.10 1996/11/12 17:42:47 gwr Exp $ */
/*
* Copyright (c) 1992, 1993
@ -130,6 +130,14 @@ with { return WITH; }
yylval.val = strtol(yytext, NULL, 10);
return NUMBER;
}
\n/[ \t] {
/*
* Note: newline followed by whitespace is always a
* continuation of the previous line, so do NOT
* return a token in this case.
*/
yyline++;
}
\n {
yyline++;
return '\n';