On Tue Mar 31 12:50:50 2015, drf...@pobox.com wrote:
> OS: Ubuntu Linux 14.04 LTS in VirtualBox
> Host: Windows 8
> Rakudo version: git pull from 25/3/2015
> 
> Issue 1: Are we missing the line:
> 
> ------>   token TOP { <term>⏏ % \n }
> 
> in the error message?
> 
> Issue 2: Should the quantifier be required?
> 
> Assume you're debugging this grammar fragment: " token top-level { 
> <list>* % \, } token list { [ <list> | <term> ]* % \, } " - A fairly 
> simple (albeit left-recursive) fragment of a common grammar pattern.
> If you're allowed to temporarily delete the quantifiers, $/<top-level> 
> is an array reference to a single $/<list> match, and your actions get 
> what they're expecting, an array.
> If you're not allowed to delete the quantifiers, you get " token 
> top-level { <list> } token list { [ <list> | <term> ] } " and 
> $/<top-level> is simply a $/<list>, and not $/<top-level>[0] as your 
> actions expect. So you have to change the actions as well.
> 
> Error:
> --cut here--
> perl6 ~/bug.t
> ===SORRY!=== Error while compiling /home/jgoff/bug.t
> Missing quantifier on the left argument of %
> at /home/jgoff/bug.t:3
> --cut here--
> 
> --cut here--
> grammar Bug {
>    token term { a }
>    token TOP { <term> % \n }
> }
> Bug.parse( 'a' );
> --cut here--

This is fixed, and closable with tests.

$ perl6 /tmp/a.p6
===SORRY!=== Error while compiling /tmp/a.p6
Missing quantifier on the left argument of %
at /tmp/a.p6:3
------>    token TOP { <term> %⏏ \n }

-- 
Will "Coke" Coleda

Reply via email to