Dan Sugalski <[EMAIL PROTECTED]> wrote:Looks like compiler modules may be done in one of three ways:
1) A plain sub, which is passed in the string to compile and returns a sub PMC that represents the compiled code (if it actually does something) 2) An NCI sub with the signature pIt 3) A Compiler PMC, in which case invoke is called and we hit a twisty maze of little subclassed methods. (Or I'm reading things wrong)
Mostly true?
Yes. A plain sub doesn't really fit into that scheme, though. But if you register that sub as a compiler, then you get case 3)
Yeah, that's what I was trying to say, albeit really awkwardly.
A compiler PMC (returned by the compreg opcode) returns another invokable item, which when invoked, compiles the code. A compiler normally returns a PMC holding the compiled code in a packfile sgement.
Just to double-check--it's OK to register *any* sub as a compiler module, though for right now it'll ultimately need to call compile itself to either the pasm or pir compiler module and return the result of that, yes?
If so, great, I'll start on some docs and we can see about getting packfile metadata stuff going so we can skip even that.
--
Dan
--------------------------------------"it's like this"------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk