[Top][All Lists]

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

Patch to correct off-by-one error in scan-skel.l

From: Paul Hilfinger
Subject: Patch to correct off-by-one error in scan-skel.l
Date: Sun, 12 May 2002 17:48:46 -0700

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.  scan-skel.l, however, put the
line number *of the #line directive itself* in place of __oline__,
causing mildly annoying behavior when debugging.

The patch below (previously discussed, now committed) fixes the

Paul Hilfinger

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

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

Index: src/scan-skel.l
RCS file: /cvsroot/bison/bison/src/scan-skel.l,v
retrieving revision 1.9
diff -u -r1.9 scan-skel.l
--- src/scan-skel.l     25 Apr 2002 14:36:38 -0000      1.9
+++ src/scan-skel.l     13 May 2002 00:43:03 -0000
@@ -41,7 +41,7 @@
 "@<:@" 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]