diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-03-27 10:10:54 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-03-27 10:10:54 +0000 |
commit | 60fbdba8e40f40ac6e1a497210a2fd4f6ac7dfaf (patch) | |
tree | 095b4b1332d4ed13b4d8394dacaf503b251f5944 /crawl-ref/source/util/levcomp.ypp | |
parent | 32c2060ed01ea4a574673cc613e066d63aa407ff (diff) | |
download | crawl-ref-60fbdba8e40f40ac6e1a497210a2fd4f6ac7dfaf.tar.gz crawl-ref-60fbdba8e40f40ac6e1a497210a2fd4f6ac7dfaf.zip |
Allow SUBST and SHUFFLE specs to be comma-separated.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1109 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/util/levcomp.ypp')
-rw-r--r-- | crawl-ref/source/util/levcomp.ypp | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/crawl-ref/source/util/levcomp.ypp b/crawl-ref/source/util/levcomp.ypp index aeccfb8aa2..83ae14bf5e 100644 --- a/crawl-ref/source/util/levcomp.ypp +++ b/crawl-ref/source/util/levcomp.ypp @@ -161,7 +161,7 @@ metaline : place | flags | mons | items - | symbol + | subst | tags | shuffle | kfeat @@ -199,15 +199,21 @@ kitem : KITEM { } $2, err.c_str()).c_str()); } -shuffle : SHUFFLE { } - | SHUFFLE STRING +shuffle : SHUFFLE shuffle_specifiers {} + ; + +shuffle_specifiers : shuffle_spec + | shuffle_spec COMMA shuffle_specifiers + ; + +shuffle_spec : ITEM_INFO { - std::string err = lc_map.map.add_shuffle($2); + std::string err = lc_map.map.add_shuffle($1); if (!err.empty()) yyerror( make_stringf( "Bad shuffle argument: '%s' (%s)", - $2, err.c_str() ).c_str() ); + $1, err.c_str() ).c_str() ); } tags : TAGS tagstrings {} @@ -222,15 +228,21 @@ tagstrings : /* empty */ } ; -symbol : SUBST {} - | SUBST STRING +subst : SUBST subst_specifiers { } + ; + +subst_specifiers : subst_spec + | subst_spec COMMA subst_specifiers + ; + +subst_spec : ITEM_INFO { - std::string err = lc_map.map.add_subst($2); + std::string err = lc_map.map.add_subst($1); if (!err.empty()) yyerror( make_stringf( "Bad SUBST argument: '%s' (%s)", - $2, err.c_str() ).c_str() ); + $1, err.c_str() ).c_str() ); } ; |