Ticket #899 (new bug)

Opened 12 years ago

Last modified 11 years ago

heredocs in a macro argument broken.

Reported by: coke Owned by:
Priority: normal Milestone:
Component: core Version: trunk
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:

Description

.macro qq(code)
    .code
.endm

.sub main :main
    say 'hi'

    say <<'FOO'
hi
FOO 

    .qq({
        say "hi"
    })

=for FAIL
    .qq({
        say <<"FOO"
hi
FOO
    }) 
    
=cut

.end

If you remove the pod comments, you get:

parrot foo.pir
error:imcc:The opcode 'say' (say<0>) was not found. Check the type and number of the arguments        in macro '.qq' line 3        included from 'foo.pir' line 1

I'd expect non-POD'd version to print out 'hi' 4 times (modulo whitespace)

Change History

Changed 11 years ago by jkeenan

  • component changed from none to core

Here's what I'm getting as of today:

$ cat tt899.pir; !533;cat xtt899.pir ; !535
cat tt899.pir; ./parrot tt899.pir ;cat xtt899.pir ; ./parrot xtt899.pir 
# Copyright (C) 2006-2009, Parrot Foundation.
# $Id: skeleton.pir 38369 2009-04-26 12:57:09Z fperrad $

.macro qq(code)
    .code
.endm

.sub main :main
    say 'hi'

    say <<'FOO'
hi
FOO 

    .qq({
        say "hi"
    })

=for FAIL
    .qq({
        say <<"FOO"
hi
FOO
    }) 
    
=cut

.end

# Local Variables:
#   mode: pir
#   fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:




error:imcc:syntax error, unexpected $undefined ('}')
        in file 'tt899.pir' line 24
error:imcc:syntax error ... somewhere
        in file 'tt899.pir' line 27
syntax error ... somewhere



# Copyright (C) 2006-2009, Parrot Foundation.
# $Id: skeleton.pir 38369 2009-04-26 12:57:09Z fperrad $

.macro qq(code)
    .code
.endm

.sub main :main
    say 'hi'

    say <<'FOO'
hi
FOO 

    .qq({
        say "hi"
    })

.end

# Local Variables:
#   mode: pir
#   fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:




error:imcc:The opcode 'say' (say<0>) was not found. 
  Check the type and number of the arguments
        in file 'xtt899.pir' line 25
Note: See TracTickets for help on using tickets.