Perl-Critic / PPI

53 stars 44 forks source link

Unescape results from PPI::Token::QuoteLike::Words::literal #124 #127

Closed moregan closed 9 years ago

moregan commented 9 years ago

PPI::Token::QuoteLike::Words->literal() was not un-escaping the words, meaning that the caller would get words like ")" and have to do the unescaping. The method's documentation does not address unescaping, but unescaping seems like the right thing to do.

Lots more test coverage, including nested delimiters and whitespace other than spaces.

wchristian commented 9 years ago

And merged with some refactoring.

moregan commented 9 years ago

To explain/justify this change better than "unescaping seems like the right thing to do" above, the literal method in other classes--PPI::Token::Number::Hex, PPI::Token::Quote::Single, etc.--does unescaping or some other kind of normalization. PPI::Token::QuoteLike::Words was the only one that would pass the content straight through. Now it behaves like the others.

wchristian commented 7 years ago

Thanks, this has been cherry-picked and released. :)