Leopold Toetsch <[EMAIL PROTECTED]> wrote:
> Luke Palmer wrote:

> The question is, if the sub should already be run, when the subroutine
> is parsed. If yes, the example code would run, if the whole parser/lexer
> thingy were reentrant.

I've that example running now. Compiling is basically reentrant already.
But while at it I'll cleanup all the globals, which will take some time.

> The code just compiles the enum type constant, classoffsets could just
> follow that scheme.

[ example again ]

> .sub first @IMMEDIATE, @ANON
>      .local pmc T
>      T = newclass "Test"
>      addattribute T, "a"
>      addattribute T, "b"
>      $I0 = find_type "Test"
>      .local pmc comp
>      comp = compreg "PIR"
>      $S0 = ".const int T_TYPE = "
>      $S1 = $I0
>      $S0 .= $S1
>      $S0 .= "\n"
>      ## print $S0
>      $P0 = compile comp, $S0
> .end
> .sub _main @MAIN
>      .local pmc t
>      t = new T_TYPE
>      print t
> .end

> .namespace ["Test"]
> .sub __get_string
>      .return ("ok\n")
> .end

leo

Reply via email to