Ticket #1125 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

[BUG] imcc handles backslashes improperly in sub names

Reported by: pmichaud Owned by: pmichaud
Priority: critical Milestone:
Component: nqp Version: 1.7.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:

Description

Sub declarations that contain backslashes in the name aren't processed correctly. Here's a demonstration script:

$ cat z.pir
.sub main
    say "xyz:<\" \">"
    .const 'Sub' $P0 = 'foo'
    say $P0

    say ""

    say "xyz:<\\>"
    .const 'Sub' $P1 = 'bar'
    say $P1
.end


.sub "xyz:<\" \">" :subid('foo')
    say "xyz-quote"
.end

.sub "xyz:<\\>" :subid('bar')
    say "xyz-backslash"
.end

$ ./parrot z.pir
xyz:<" ">
xyz:<\" \">

xyz:<\>
xyz:<\\>
$ 

The strings for the subnames should end up having the save value as the printed strings above them.

Pm

Change History

Changed 5 years ago by chromatic

  • status changed from new to closed
  • version changed from 1.6.0 to 1.7.0
  • resolution set to fixed

Tests stolen from your example and fixed in r41992, thanks!

Note: See TracTickets for help on using tickets.