summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/util/levcomp.ypp
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/util/levcomp.ypp')
-rw-r--r--crawl-ref/source/util/levcomp.ypp23
1 files changed, 20 insertions, 3 deletions
diff --git a/crawl-ref/source/util/levcomp.ypp b/crawl-ref/source/util/levcomp.ypp
index 74cc7ff68f..98b71047b4 100644
--- a/crawl-ref/source/util/levcomp.ypp
+++ b/crawl-ref/source/util/levcomp.ypp
@@ -53,7 +53,7 @@ level_range set_range(const char *s, int start, int end)
%expect 2
%token <i> DEFAULT_DEPTH SHUFFLE SUBST TAGS KFEAT KITEM KMONS KMASK
-%token <i> NAME DEPTH ORIENT PLACE CHANCE MONS ITEM MARKER
+%token <i> NAME DEPTH ORIENT PLACE CHANCE MONS ITEM MARKER COLOUR
%token <i> PRELUDE MAIN VALIDATE VETO NSUBST WELCOME LFLAGS BFLAGS
%token <i> COMMA INTEGER CHARACTER
@@ -158,6 +158,7 @@ metaline : place
| marker
| subst
| nsubst
+ | colour
| shuffle
| tags
| lflags
@@ -342,11 +343,27 @@ mspec_segment : STRING
}
;
+colour : COLOUR colour_specifiers { }
+ ;
+
+colour_specifiers : colour_specifier { }
+ | colour_specifiers COMMA colour_specifier { }
+ ;
+
+colour_specifier : ITEM_INFO
+ {
+ lc_map.main.add(
+ yylineno,
+ make_stringf("colour(\"%s\")",
+ quote_lua_string($1).c_str()));
+ }
+ ;
+
nsubst : NSUBST nsubst_specifiers { }
;
-nsubst_specifiers : nsubst_spec
- | nsubst_specifiers COMMA nsubst_spec
+nsubst_specifiers : nsubst_spec { }
+ | nsubst_specifiers COMMA nsubst_spec { }
;
nsubst_spec : ITEM_INFO