On Mon, 05 May 2008, frank van nuffel wrote:

Hi Frank,

> Let's say the way ca-clipper keeps track of #line directives allows 
> postprocessing the .ppo file in such a way that it is clear at what point a 
> header is #include-d (possibly #include-ing others, which can also be 
> traced) and at what point the #line directive is 'back' at source level; 
> also calculating the exact placement of non-empty source lines depends on 
> that information; harbour respects correct line numbering afaik, but 
> sometimes skips mentioning that a (new) header has been included, which 
> makes this postprocessing tool loose track of where it is; a simple test 
> reveals that when a header is #include-d to the point where recursively 
> another header is #include-d, and when nothing was to be written to the 
> .ppo file in the meantime, the #line directive, such as #line 1 "test1.ch" 
> is omitted by harbour, only to show #line 2 "test2.ch"

OK, now I understand what you are looking for.
Harbour generates #line directives only when necessary.
It means that it does not generate them for empty files or
files which does not have any code which can be passed to
compiler, f.e. files with only empty lines or PP directives.
It's intentional so compiler receives #line tokens only
when it's necessary and should update current file name
and/or counter line number.
Anyhow I can add to PP optional support for strict Clipper
#line directives. I'll try to make it in few minutes and
I'll commit it. This mode will be enabled using some compile
time macro, f.e.: HB_PP_STRICT_LINEINFO_TOKEN. So it will
be enough to recompile Harbour compiler with:
   set C_USR=-DHB_PP_STRICT_LINEINFO_TOKEN
Please test and tell me if its what you need.
BTW if you need PP output then you can write your own
preprocessor as .prg code using functions from PPLIB.

best regards,
Przemek
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to