Last active
December 19, 2015 17:38
-
-
Save dwarring/5992874 to your computer and use it in GitHub Desktop.
Perl6 Case insensitive use of <sym> ?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
use Test; | |
grammar G { | |
## use rule :ignorecase; # nyi in rakudo. not what we want anyway | |
## use sym :ignorecase #?? | |
rule TOP { <prop> + } | |
rule num {[\d|'.']+} | |
proto rule prop {<...>} | |
rule prop:sym<line-width> {:i <sym> ':' <num> } | |
rule prop:sym<line-height>:i { <sym> ':' <num> } | |
} | |
for ('line-width: 42', 'line-height: 47', | |
'LINE-WIDTH: 42', 'LINE-HEIGHT: 47' # these don't parse | |
) { | |
ok(G.parse($_), "parse: $_"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment