tcl parser.

17 views
Skip to first unread message

William Coleda

unread,
Mar 26, 2005, 12:17:29 PM3/26/05
to Perl 6 Internals
The tcl parser (lib/parse.imc) has been removed and migrated to a method in a PMC.

(Anyone looking for a C task could go through and cleanup the parse method in tclparser.pmc - it's basically copied directly from the assembler style with many gotos, no loops, etc. If you make changes, just make sure no *more* tests fail in languages/tcl. =-)

One error I'm having trouble tracking down is when parsing code like:

puts "\n"

The quoted string triggers a recursive call to the parser (which appears to succeed). When that parser invocation returns, it takes the results, and passes them into languages/tcl/tclword.imc:concat_words, which then dumps core. Seems to not like the getattribute call on the object that's passed in.

When invoking a PIR-defined object from C, what's the proper call? pmc_new ? (Does that handle class_init) ?

FYI, There are still a few tests failing in tcl at the moment, but I think most of them are related to this issue.

Leopold Toetsch

unread,
Mar 27, 2005, 6:02:03 AM3/27/05
to William Coleda, perl6-i...@perl.org
William Coleda <wi...@coleda.com> wrote:

> When invoking a PIR-defined object from C, what's the proper call?
> pmc_new ? (Does that handle class_init) ?

I don't understand the question. Do you want to instantiate an object?
If yes, just do the same as the respective opcodes are doing:

cl = Parrot_class_lookup(interpreter, class_name_str);
REG_PMC(5) = arg1;
REG_INT(3) = 1;
REG_PMC(2) = cl;
o = VTABLE_instantiate(interpreter, cl);

or

type = pmc_type(interpreter, class_name_str);
o = pmc_new(interpreter, type);

In both cases the method class::__init is run if present.

leo

William Coleda

unread,
Mar 29, 2005, 12:19:43 AM3/29/05
to l...@toetsch.at, perl6-i...@perl.org

Leopold Toetsch wrote:
> William Coleda <wi...@coleda.com> wrote:
>
>
>>When invoking a PIR-defined object from C, what's the proper call?
>>pmc_new ? (Does that handle class_init) ?
>
>
> I don't understand the question. Do you want to instantiate an object?
> If yes, just do the same as the respective opcodes are doing:

I was referring to the class initialization, not the instance initialization. But it's moot, as the __class_init method has a @LOAD on it, so, yes, it's loaded.

Sadly, my problem was more mundane. Note to self, if you're going to have several boolean flags for an overloaded method, be sure to pass the flags in in the correct order.

Eliminating that bug brings us to 97.4% for languages/tcl.

Looks like recent changes have exposed an issue where I was cheating with namespaces, leaving two failures due to a bad signature spec in a method call made by the new PMC parser.

Back to 100%, whee!

Reply all
Reply to author
Forward
0 new messages