Hi,
it seems to me this syntax error message indicates that it doesn't know the
opcode 'rebless_subclass'. The parser expects a '(', which indicates that it
wants to parse rebless_subclass as a sub name.

Haven't built parrot in 10 days myself now, so can't tell why it's not
working and whether it should. I expect other people will be able to tell
you that. Just wanted to clarify the syntax error.

kjs



On Fri, Dec 26, 2008 at 11:41 PM, via RT Markus Laker <
parrotbug-follo...@parrotcode.org> wrote:

> # New Ticket Created by  Markus Laker
> # Please include the string:  [perl #61744]
> # in the subject line of all future correspondence about this issue.
> # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=61744 >
>
>
> Hello,
>
> I'm attempting to compile Parrot and Perl 6 for the first time using gcc
> 4.1.2
> on Linux.  I've checked out revision 34399 form svn.  Parrot compiles
> successfully, but languages/perl6 fails like this:
>
>
> m...@edward:~/parrot/languages/perl6$ make
> cd src/pmc && /usr/bin/perl /home/msl/parrot/tools/build/dynpmc.pl generate
> perl6str objectref perl6scalar mutablevar perl6multisub
> cd src/pmc && /usr/bin/perl /home/msl/parrot/tools/build/dynpmc.pl compile
> perl6str objectref perl6scalar mutablevar perl6multisub
> cd src/pmc && /usr/bin/perl /home/msl/parrot/tools/build/dynpmc.pl linklibs
> perl6str objectref perl6scalar mutablevar perl6multisub
> cd src/pmc && /usr/bin/perl /home/msl/parrot/tools/build/dynpmc.pl
> copy --destination=/home/msl/parrot/runtime/parrot/dynext perl6str
> objectref
> perl6scalar mutablevar perl6multisub
> ../../parrot  -o perl6.pbc perl6.pir
> error:imcc:syntax error, unexpected VAR, expecting '(' ('var')
>        in file 'src/builtins/op.pir' line 434
>        included from 'src/gen_builtins.pir' line 25
>        included from 'perl6.pir' line 1
> make: *** [perl6.pbc] Error 1
> m...@edward:~/parrot/languages/perl6$
>
>
> The line in question is the `rebless_subclass' instruction two paragraphs
> before the end of this function:
>
>
> .sub 'infix:does'
>    .param pmc var
>    .param pmc role
>    .param pmc init_value      :optional
>    .param int have_init_value :opt_flag
>
>    # Get the class of the variable we're adding roles to.
>    .local pmc p6meta, parrot_class
>    parrot_class = class var
>
>    # Derive a new class that does the role(s) specified.
>    .local pmc derived
>    derived = new 'Class'
>    addparent derived, parrot_class
>    $I0 = isa role, 'Role'
>    if $I0 goto one_role
>    $I0 = isa role, 'List'
>    if $I0 goto many_roles
>    'die'("'does' expects a role or a list of roles")
>
>  one_role:
>    '!keyword_does'(derived, role)
>    goto added_roles
>
>  many_roles:
>    .local pmc role_it, cur_role
>    role_it = iter role
>  roles_loop:
>    unless role_it goto roles_loop_end
>    cur_role = shift role_it
>    '!keyword_does'(derived, cur_role)
>    goto roles_loop
>  roles_loop_end:
>  added_roles:
>
>    # Register proto-object.
>    .local pmc p6meta, proto
>    p6meta = get_hll_global ['Perl6Object'], '$!P6META'
>    proto = var.'WHAT'()
>    p6meta.'register'(derived, 'protoobject'=>proto)
>
>    # Instantiate the class to make it form itself.
>    $P0 = new derived
>
>    # Re-bless the object into the subclass.
>    rebless_subclass var, derived
>
>    # If we were given something to initialize with, do so.
>    unless have_init_value goto no_init
>    .local pmc attrs
>    .local string attr_name
>    attrs = inspect role, "attributes"
>    attrs = attrs.'keys'()
>    $I0 = elements attrs
>    if $I0 != 1 goto attr_error
>    attr_name = attrs[0]
>    attr_name = substr attr_name, 2 # lop of sigil and twigil
>    $P0 = var.attr_name()
>    assign $P0, init_value
>  no_init:
>
>    # We're done - return.
>    .return (var)
>
>
> I'm not familiar enough with Parrot to correct the syntax.  However, if I
> comment out the line, I get a clean build.  Will I lose any more than the
> C<does> keyword?
>
> Thanks and regards,
>
> Markus
>

Reply via email to