Jürgen Bömmels (via RT) wrote:
# New Ticket Created by Jürgen Bömmels # Please include the string: [perl #21033]
# in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=21033 >
I have now committed this patch for easier rediffing. Two minor changes: in imcc.y I did add one missing semicolon, in imcc.l is one fataly() instead of yyerror().
Segfaults are fixed already, tests with ".constant" and with embed NULs in strings are still failing.
Test result for:
$ IMCC=languages/imcc/imcc perl t/harness -O1 t/[op]*/*.t
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/op/macro.t 4 1024 15 4 26.67% 10-13
t/op/string.t 1 256 99 1 1.01% 81
t/pmc/pmc.t 1 256 80 1 1.25% 52
7 subtests skipped.
Additionally in these patch are many optimizations WRT constants.
Thanks again for the patch,
leo
PS
Here is Juergens announce again for reference.
Hello,
I just implemented macro expansion in imcc.
This brings us one step closer to substitude assemble.pl
The following things are working:
macro definition with parameters
macro expansion with parameters
parameter expansion
local labels
including of files
Following bugs still exist:
.constant not yet implemented
string constants with embedded NUL characters segfault
Compound keys are not working, but thats also in an unpatched imcc
The macroexpansion is done by storing the neccessary information of the state of the current buffer in a linked list and continue the lexing
with the expansion of macro. After finishing the lexing of the macro
expansion the old buffer is restored (in the yywrap function) and the
lexing is continued. The reading of the macro does not use the
yyparse but calls custom functions which recursivly call yylex again.
The local labels are implemented by storing an an illegal label
which is transformed into a regular unique label upon expansion.
bye
boe