Ticket #1503 (closed bug: noreply)
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).