# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #58846]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=58846 >


In Rakudo r31069, matching directly against a rule containing \n
works, but matching against a rule that calls that rule doesn't:

$ cat newline-in-token.bug
grammar A {
  token foo { ^ [<alnum>||<sp>]+ $ };
  token sp { ' ' | \n };
}

say ?(" " ~~ A::sp);
say ?("\n" ~~ A::sp);

say ?("foo" ~~ A::foo);
say ?("foo bar" ~~ A::foo);
say ?("foo\nbar" ~~ A::foo);

$ ./perl6 newline-in-token.bug
1
1
1
1
0

# I would expect that last one to be 1, too.

Reply via email to