Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make \n resolve to $?NL.
This means it produces \r\n on Windows, \n elsewhere, and can be
controlled using the `use newline` pragma.
  • Loading branch information
jnthn committed Nov 5, 2015
1 parent 772cb2a commit 4f276be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Perl6/Actions.nqp
Expand Up @@ -8441,7 +8441,7 @@ class Perl6::QActions is HLL::Actions does STDActions {
method backslash:sym<c>($/) { make $<charspec>.ast }
method backslash:sym<e>($/) { make "\c[27]" }
method backslash:sym<f>($/) { make "\c[12]" }
method backslash:sym<n>($/) { make "\n" }
method backslash:sym<n>($/) { make nqp::unbox_s($*W.find_symbol(['$?NL'])); }
method backslash:sym<o>($/) { make self.ints_to_string( $<octint> ?? $<octint> !! $<octints><octint> ) }
method backslash:sym<r>($/) { make "\r" }
method backslash:sym<rn>($/) { make "\r\n" }
Expand Down

1 comment on commit 4f276be

@nanis
Copy link

@nanis nanis commented on 4f276be Dec 13, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit and the philosophy behind it are rather surprising to me. See RT#126881 as well as my comments on /r/perl6.

Please sign in to comment.