[Parrot-users] Compiler tools and case insensitive grammar

Fredrik Rothamel fredrik.rothamel at bahnhof.se
Mon Sep 6 08:31:32 UTC 2010


Patrick R. Michaud skrev 2010-09-03 16:22:
> On Fri, Sep 03, 2010 at 01:39:45PM +0200, Fredrik Rothamel wrote:
>> I have tried inserting :i or :ignorecase modifiers as suggested by
>> the docs but either get compilation errors or no noticeable effect.
>>
>> Are modifiers implemented in PGE and NQP ?
>
> Yes, but the modifiers currently have to go inside the regex.
> In other words, use
>
>      token xyz { :i [ abc | def ] }
>
> instead of
>
>      token xyz :i { abc | def }
>
> Or send us an example of something that isn't working for you and
> we can help troubleshoot it.  :-)
>
> Pm

Consider the following modified rule from Squaak's Grammar.pm:

rule statement:sym<for> {
     :i [ <sym> <for_init> ',' <EXPR> <step>?
     'do' <statement>* 'end' ]
}

This rule still only accepts lower case input. Surely at least the 
literal strings 'do' and 'end' should match upper case input?

BR,
Fredrik



More information about the Parrot-users mailing list