Ticket #1503 (closed bug: noreply)

Opened 5 years ago

Last modified 3 years ago

quote_delimited action misbehaves with single non-string quote_atom

Reported by: arnsholt Owned by: pmichaud
Priority: normal Milestone:
Component: nqp Version: 2.1.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform: darwin

Description

quote_delimited in HLL/Actions.pm, when it gets only a single quote_atom in will return the bare atom's AST (as long as the two first tests inside the for loop don't hit). This means that if it gets a single quote_atom that is not a string, the result will be a non-string.

As far as I can make out, the solution should probably look something like this (starting at line 144 of HLL/Actions.pm in nqp-rx fc0d84):

if !@parts {
    # Insert magic here, to ensure stringness of $past.
}
else {
    while @parts {
        $past := PAST::Op.new( $past, @parts.shift, :pirop('concat') );
    }
}

I tried fixing this, along the lines of $past := PAST::Op.new( $past, :pirop('set SP') ); (see also  http://paste.lisp.org/display/96049, proposed patch fixing this in Rakudo) but couldn't get it to work (it broke the build during stage2).

Change History

Changed 3 years ago by pmichaud

  • status changed from new to closed
  • resolution set to noreply

Closing ticket as being outdated. If it's still a problem, please re-submit the ticket to nqp-rx's issue list, and include an example of failing code.

Thanks,

Pm

Note: See TracTickets for help on using tickets.