#1503: quote_delimited action misbehaves with single non-string quote_atom
----------------------+-----------------------------------------------------
 Reporter:  arnsholt  |       Owner:  pmichaud
     Type:  bug       |      Status:  new     
 Priority:  normal    |   Milestone:          
Component:  nqp       |     Version:  2.1.0   
 Severity:  medium    |    Keywords:          
     Lang:            |       Patch:          
 Platform:  darwin    |  
----------------------+-----------------------------------------------------
 `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).

-- 
Ticket URL: <https://trac.parrot.org/parrot/ticket/1503>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets

Reply via email to