develooper Front page | perl.perl6.compiler | Postings from February 2012

[perl #109874] BUG: should match: grammar A { rule TOP { ^ } }; say A.parse(' ')

From:
Stephane Payrard
Date:
February 5, 2012 09:50
Subject:
[perl #109874] BUG: should match: grammar A { rule TOP { ^ } }; say A.parse(' ')
Message ID:
rt-3.6.HEAD-14510-1328464237-707.109874-82-0@perl.org
# New Ticket Created by  Stephane Payrard 
# Please include the string:  [perl #109874]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=109874 >


> grammar A { rule TOP { ^  } }; say A.parse(' ')
#<failed match>
>

The relevant spec is probably S05:355

When you write

    rule TOP { ^ <stuff> $ }

this is the same as

    token TOP { ^ <.ws> <stuff> <.ws> $ <.ws> }


discussed with jonathan at http://irclog.perlgeek.de/perl6/2012-02-05#i_5106223

A test should probably added spec/S05-grammar/ws.t :

grammar A { rule TOP { ^  } };
ok ?A.parse(' '), 'no <.ws> shoved before ^';


-- 
cognominal stef



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About