[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch for off-by-one error in scan-skel.l

From: Paul Hilfinger
Subject: Patch for off-by-one error in scan-skel.l
Date: Wed, 08 May 2002 19:54:58 -0700

I guess that bison.simple, etc. are so firm that you guys never
noticed this one; I, on the other hand, am developing a new, bug-prone,
experimental skeleton, so I did :-).  

A #line directive, such as

  #line 15 "somefile.c"

means that the NEXT line of the file containing it corresponds to line
15 of somefile.c.  The current scan-skel.l code, however, puts the
line number *of the #line directive itself* in place of __oline__,
causing mildly annoying behavior when debugging.

OK to commit?

P. Hilfinger

[P.S. Akim: Perhaps I did not understand your last message 
      re: Patch b4_uint_type and b4_sint_type range problem.  Were you
      asking me to commit that patch?]


2002-05-07  Paul Hilfinger  <address@hidden>

        * src/scan-skel.l: Correct off-by-one error in handling of __oline__.

Index: bison-1_5.5/src/scan-skel.l
--- bison-1_5.5/src/scan-skel.l Thu, 02 May 2002 15:41:15 -0700 hilfingr 
(glrbison/e/23_scan-skel. 1.1 644)
+++ 2.16(w)/src/scan-skel.l Tue, 07 May 2002 19:14:01 -0700 hilfingr 
(glrbison/f/51_scan-skel. 1.2 644)
@@ -41,7 +41,7 @@ static char *yyoutname = NULL;
 "@<:@" fputc ('[', yyout);
 "@:>@" fputc (']', yyout);
-"__oline__"      fprintf (yyout, "%d", yylineno);
+"__oline__"      fprintf (yyout, "%d", yylineno+1);
 "__ofile__"      fprintf (yyout, "%s", yyoutname);
 address@hidden         ECHO;
 \n+              yylineno += yyleng; ECHO;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]