You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 3798 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
If a grammar action cals Grammar.Entry.parse (on an unrelated stream), then the
locations in the outer ("original") parsing are wrong after that.
A concrete example - when using pa_macro on a file that contains an "INCLUDE"
directive (which causes the included file to be parsed at that point), all
locations for the expressions after the INCLUDE directive in the original file
are off by the "# of lines in the INCLUDE file).
P.S. Most likely, this is another instance of the problem originally reported in #2954.
P.P.S. I tried looking at the code. I believe that the problem comes from the
following:
pa_o (same for pa_r) calls Plexer.make_lexer once when it's initialized
(and never does it again).
Plexer.make_lexer calles Plexer.func
Plexer.func creates bol_pos and lnum ref cells that are shared among all the
future invocations of this lexer and are never reset!
The text was updated successfully, but these errors were encountered:
Here is a patch/workaround that fixes the pa_macro instance of #3798.
IMHO the proper way of solving #2954/3407/3798 would involve getting
rid of these "shared" bol/lnum refs, but this provides a workaround
until the time that this might be fixed properly. I am guessing that a
similar workaround can be used by anybody who experiences #2954/3407.
This patch also ensures that the INCLUDE files will be closed (pa_macro
was forgetting to do that).
Original bug ID: 3798
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Aleksey Nogin
Version: 3.08.4
OS: Fedora Core 3
Submission from: dsl57-22.uninet.ee (194.204.57.22)
If a grammar action cals Grammar.Entry.parse (on an unrelated stream), then the
locations in the outer ("original") parsing are wrong after that.
A concrete example - when using pa_macro on a file that contains an "INCLUDE"
directive (which causes the included file to be parsed at that point), all
locations for the expressions after the INCLUDE directive in the original file
are off by the "# of lines in the INCLUDE file).
P.S. Most likely, this is another instance of the problem originally reported in
#2954.
P.P.S. I tried looking at the code. I believe that the problem comes from the
following:
pa_o (same for pa_r) calls Plexer.make_lexer once when it's initialized
(and never does it again).
Plexer.make_lexer calles Plexer.func
Plexer.func creates bol_pos and lnum ref cells that are shared among all the
future invocations of this lexer and are never reset!
The text was updated successfully, but these errors were encountered: