Grupos de Google ya no admite nuevas publicaciones ni suscripciones de Usenet. El contenido anterior sigue siendo visible.

[perl #39905] [TODO] TGE - line number reporting.

Visto 7 veces
Saltar al primer mensaje no leído

Will Coleda

no leída,
21 jul 2006, 18:03:0721/7/06
a bugs-bi...@rt.perl.org
# New Ticket Created by Will Coleda
# Please include the string: [perl #39905]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=39905 >


Once a .tg file is compiled to a .pir file, any errors in the
embedded PIR are reported against the line number
of the generated PIR file.

Instead, the line numbers should be reported against the original .tg
file.


--
Will "Coke" Coleda
wi...@coleda.com


Patrick R. Michaud

no leída,
3 ago 2006, 11:30:083/8/06
a perl6-i...@perl.org

Is there an imcc pragma for setting the line number to be reported
for an error? Or what's the general approach to getting the generated
PIR file to report the correct line number?

Pm

Will Coleda

no leída,
3 ago 2006, 11:36:253/8/06
a Patrick R. Michaud,perl6-i...@perl.org
From docs/compiler_faq.pod:

=head2 How do I embed source locations in my code for debugging?

You can do this using either the C<setfile> and C<setline> opcodes or
with C-like C<#line> comments:

#line 27 "my_source.file"

Simply set the source file name or line number whenever it changes.
But note that currently (Parrot 0.3.0) both are ignored in the lexer.

--
Will "Coke" Coleda
wi...@coleda.com


Patrick R. Michaud via RT

no leída,
8 ene 2007, 18:03:448/1/07
a perl6-i...@perl.org
Now resolved in r16509.

Kudos to Jonathan for implementing RT#40806, which enabled the
#line <nnn> "file" directive needed for this to work.

TGE now reports errors relative to the original .tg file. Thus

error:imcc:The opcode 'say_ic' (say<1>) was not found. Check the type
and number of the arguments
in file 'src/PASTGrammar.tg' line 124

instead of

error:imcc:The opcode 'say_ic' (say<1>) was not found. Check the type
and number of the arguments
in file 'src/PASTGrammar_gen.pir' line 152

I'll note that the line number reported is off-by-one from where it
actually occurs in the file, but that's because Parrot reports PIR
errors as off-by-one, not because of this patch. (When Parrot reports
the correct line number, this will work here also.)

Marking this ticket as "resolved".

Pm


0 mensajes nuevos