IMCC's macro processor doesn't currently allow for uniquely generated
variable names. It's in the pdd (19), but not yet implemented.

You're right in that it only works for labels.

kjs


On Mon, Apr 14, 2008 at 1:32 PM, François Perrad
<[EMAIL PROTECTED]> wrote:
>
>  In Lua libraries, I wrote many time the same piece of code.
>  The purpose of this code is to register each function.
>  So, I try to write the following PIR macro :
>
>         .macro register(tname, fname)
>             .const .Sub $fname = .fname
>             $fname.'setfenv'(_lua__GLOBAL)
>             set $P1, .fname
>             .tname[$P1] = $fname
>         .endm
>
>  Currently, I obtain the following error :
>
>  error:imcc:'$fname' is not a valid register name
>         in macro '.register' line 30
>         included from 'src\lib\base64.pir' line 1
>  make: *** [src\lib\base64.pbc] Error 2
>
>  The notation $fname seems limited to local label (.label) and local
> variable (.macro_label).
>  Are there any other notation?
>  Or is this a new requirement?
>
>  The attached patch is a full example for languages/lua/lib/base64.pir
>
>  François Perrad.
>
>
>

Reply via email to