Created
July 31, 2009 20:39
-
-
Save jyotty/159435 to your computer and use it in GitHub Desktop.
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
# this causes a 'null PMC access' in rakudo | |
# which is an obvious improvement. | |
use v6; | |
grammar Apache { | |
regex TOP { | |
<directive>+ | |
} | |
regex directive { | |
\h* [ | |
| <directive_name> [\h+ <argument>]+\n+ | |
| '<'<directive_name> [\h+ <argument>]?'>'\n <directive>+ '</'$0'>'\n | |
] | |
} | |
token directive_name { | |
(\w+) | |
} | |
regex argument { | |
| '"' (<-["]>*) '"' | |
| (\S+) | |
} | |
} | |
my $conf = $*IN.slurp; | |
Apache.parse($conf); | |
$/.perl.say; |
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
TestDirective ArgOne "Arg Two" | |
ServerRoot "/test" | |
Include other/*.conf | |
<Asdf jkl> | |
DirectoryIndex index.html "test index.html" | |
</Asdf> | |
# it seems to be any angle bracket rule causes the error | |
#<Directory "/Documents and Settings/user/etc"> | |
DirectoryIndex index.html "test index.html" | |
Allow from All | |
</Directory> | |
#<Directory /> | |
Options FollowSymLinks | |
AllowOverride None | |
Order deny,allow | |
Deny from all | |
</Directory> | |
<IfModule log_config_module> | |
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined | |
</IfModule> | |
ExampleDirective ArgOne "Arg Two" \ | |
ArgThree |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment