monit-dev
[Top][All Lists]
Advanced

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

Re: monitrc erroneous line numbering off by one


From: Christian Hopp
Subject: Re: monitrc erroneous line numbering off by one
Date: Thu, 12 Feb 2004 15:29:30 +0100 (CET)

On Thu, 12 Feb 2004, Jan-Henrik Haukeland wrote:

> Martin Pala <address@hidden> writes:
>
> >> 2.) parser increments the line position (lineno) by all empty and
> >> comment lines following the invalid line, which is reported. Can
> >> some flex guru look on it? Both attached configurations still
> >> produces this kind of error.
> >>
> >
> > This problem remains. Is here some way how to ignore "\n" for empty
> > and comment lines following invalid statement line?
>
> It's tricky because when the statement is treated in the action block
> of the parser, flex has already scanned to the next token, and if
> there was white space or comments "#.." the lineno variable will be
> increased (at least that is the hypothesis). In other words when we
> report an error in lineno, the actual line number can/will be off by
> the number of whitespace lines to the next valid token. Hmm, food for
> thoughts.. how to fix this whiteout hacking to much. Christian, any
> ideas?

This problem happens as soon as we deal with strings (same for paths,...)
and statements with variable arguments... like allow.

My idea is to save the position when ever a string type is parsed.  And
whenever an error is referring to such an error we use the saved pos
instead of the lineno.  It seems to work but it needs further testing.

CHopp

-- 
Christian Hopp                                email: address@hidden
Institut für Elektrische Informationstechnik             fon: +49-5323-72-2113
TU Clausthal, Leibnizstr. 28, 38678 Clausthal-Zellerf.   fax: +49-5323-72-3197
                             pgpkey: https://www.iei.tu-clausthal.de/pgp-keys/





reply via email to

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