Created
August 31, 2012 13:32
-
-
Save SineSwiper/3552700 to your computer and use it in GitHub Desktop.
multi rule declaration
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
sunday_morning: Im waking up | ( cant even focus on a coffee_cup ) | |
coffee_cup: dont even know whos bed Im in | |
# Parser problems | |
lyric: | |
where | |
do | |
I | |
start | |
where | |
do | |
I | |
begin: / ( <WORD> ) / | |
# Works, but requires ; | |
lyric: | |
where | |
do | |
I | |
start | |
; | |
where | |
do | |
I | |
begin: / ( <WORD> ) / | |
# Might be a better route, since {} is never used in parser so far | |
lyric: | |
where | |
do | |
I | |
start | |
{ where do I begin }: / ( <WORD> ) / | |
Bah, the <!NAME!>
form is backwards... The naming stuff needs to go in the rule_name part, but that section is more sensitive to symbols/changes. Need to think about that angle some more...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also, use something like
<P_!NAME!_END>
, meaning "prefix all of these with P_ and suffix with _END". The normal form would be<!NAME!>
.This would go along with some new meta attrs:
The
%prefix / %suffix
would be a "default" prefix/suffix for all declared rules. It only applies to rule names and only ones that don't already have a prefix/suffix declaration (like the<!NAME!>
form above). The latter two are for adding prefix/suffix info to Atoms. This helps me out with things like keyword "ALWAYS" bumping into Atom "ALWAYS". Instead, prefixes can fix those:Obviously, the prefix/suffixes need to be manually used in rules: