# New Ticket Created by  Sir Robert Burbridge 
# Please include the string:  [perl #113808]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=113808 >


Bug report.  The snippet below (and associated github gist) says it all.

-Sir

20:07 < sirrobert> I'm learning to write grammars, but having a wierd
problem.  (I think there's something I don't get about newlines or
something).
20:07 < sirrobert> https://gist.github.com/2980628
20:08 < pmichaud> \s* doesn't really make sense in a rule
20:08 < sirrobert> ok...
20:08 < pmichaud> since whitespaces in the rule already implies \s*
20:08 < sirrobert> I can't get it to ignore the first part of a slurped file
20:08 < pmichaud> inside of method verb($/), you might want 'eq' instead of
'=='
20:09 < sirrobert> oh, yeah
20:10 < sirrobert> Still, adding a blank line at the top of the file breaks
it
20:10 < sirrobert> even with the \s* removed
20:10 < pmichaud> looking
20:11 < sirrobert> (cleaned up the gist by replacing == with 'eq' and
removed the \s* in all places.  Same problem)
20:13 < pmichaud> ah, it's the ^ that's an issue.
20:14 < pmichaud> it's somewhat of a rakudobug; the whitespace before the ^
is eating up the newline before testing for "start of string", and with
'rule' there's no backtracking.
20:14 < sirrobert> ok!
20:14 < pmichaud> I think a recentish spec change causes leading whitespace
before a ^ to be ignored... but rakudo doesn't implement that.
20:14 < sirrobert> glad it's not me =)
20:14 < pmichaud> so, eliminate the space before the ^ and maybe it will
work.
20:14 < pmichaud> or, switch TOP to be a 'token' instead of a 'rule'
20:15 < sirrobert> ok, great.

Reply via email to