New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mk_language_shell.pl generates broken PMC boilerplate #315
Comments
1372 byte attachment from ellefu
METHOD PMC* get() {
|
Trac commenter: ellefu
Patch for mk_language_shell.pl bug |
1584 byte attachment from ellefu ```Index: tools/dev/mk_language_shell.in--- tools/dev/mk_language_shell.in (revision 49475) +/* Returns a vector-like PMC.
|
I tried mk_language_shell --with-pmc with parrot 49387 and it compiled and passed tests. Can you attach the output of "parrot_config revision" and the complete error message that you get when compiling? |
Trac commenter: ellefu Aha! I see the problem. In SVN, there's a separate bug which is masking this bug -- a missing C open-comment after init(). I'll attach a new patch. It may be compiling on your system, but it's not working -- it's just ignoring everything in the .pmc file after init()! pmc2c's almost complete lack of error reporting is becoming quite troublesome. If I add this patch to my working copy: --- tools/dev/mk_language_shell.in (revision 49475) +++ tools/dev/mk_language_shell.in (working copy) @@ -647,6 +647,8 @@ SUPER(); }; +/* + =item C<PMC\* get()> Returns a vector-like PMC.
...I get this output when I try to do parrot setup.pir build: cc -c -o src/pmc/yourmom.o [ten million gcc switches] src/pmc/yourmom.c ./src/pmc/yourmom.pmc: In function âParrot_YourMom_nci_getâ: ./src/pmc/yourmom.pmc:111: error: âshapeâ undeclared (first use in this function) ./src/pmc/yourmom.pmc:111: error: (Each undeclared identifier is reported only once ./src/pmc/yourmom.pmc:111: error: for each function it appears in.) exit status: 256 ...which is the bug my initial patch addressed. I'll update the attachment to contain both fixes. Thanks! |
ellefu, I applied (but didn't commit) your patch (updated_patch.txt), and while it does fix some obvious problems, the generated PMC still doesn't build. You're welcome to get the PMC to build properly (and I'll be glad to apply such a patch). If you're feeling more ambitious, I think it'd be helpful if new HLL developers had a more user-friendly PMC as a template. Looking at the generated PMC, it's not entirely clear what it is or what it's supposed to do. When a new developer comes along, it'd be better to present a PMC with common semantics (i.e. Integer, Hash, etc) so that the developer won't have to spend as much time figuring out what the PMC does before moving on to figuring out how it does it. That said, I'm sure any new developer will spend lots of time looking at Parrot's core PMCs and any dynpmcs available, so there's no need for the template PMC to be anything more than a good clear starting point. |
When one runs mk_language_shell.pl --with-pmc, the resulting boilerplate .pmc file doesn't even compile. There's a "property" variable that's used uninitialized, and a mysterious "shape" variable that's never defined. What's up with that?
Patch attached.
Originally http://trac.parrot.org/parrot/ticket/1819 by ellefu
The text was updated successfully, but these errors were encountered: