summaryrefslogtreecommitdiffstats
path: root/dimension/common.rules
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-11-07 17:39:23 -0500
committerTavian Barnes <tavianator@gmail.com>2010-11-07 17:39:23 -0500
commit4ddd6b7f2ec82155b7535062b4af67618ce70e30 (patch)
treed5a552473831b3b92030d0e33a1bafe7169737b8 /dimension/common.rules
parentd3250a168254ebc6aa0087dfcfee5d7dfead9703 (diff)
downloaddimension-4ddd6b7f2ec82155b7535062b4af67618ce70e30.tar.xz
Support checkered pigments in dimension.
Diffstat (limited to 'dimension/common.rules')
-rw-r--r--dimension/common.rules30
1 files changed, 26 insertions, 4 deletions
diff --git a/dimension/common.rules b/dimension/common.rules
index dc8d0b3..7abae80 100644
--- a/dimension/common.rules
+++ b/dimension/common.rules
@@ -506,12 +506,20 @@ PIGMENT: "pigment" "{"
{
$$ = dmnsn_new_astnode2(DMNSN_AST_PIGMENT, @$, $3, $4);
}
+ | "pigment" "{"
+ "checker" COLOR_LIST2
+ PIGMENT_MODIFIERS
+ "}"
+ {
+ dmnsn_astnode checker = dmnsn_new_astnode(DMNSN_AST_CHECKER, @3);
+ dmnsn_astnode pattern = dmnsn_new_astnode1(DMNSN_AST_PATTERN, @3,
+ checker);
+ dmnsn_array_push($5.children, &$4);
+ $$ = dmnsn_new_astnode2(DMNSN_AST_PIGMENT, @$, pattern, $5);
+ }
;
-PIGMENT_TYPE: /* empty */ {
- $$ = dmnsn_new_astnode(DMNSN_AST_NONE, @$);
- }
- | COLOR
+PIGMENT_TYPE: COLOR
| "image_map" "{"
BITMAP_TYPE STRING
"}"
@@ -541,6 +549,20 @@ PIGMENT_MODIFIERS: /* empty */ {
}
;
+COLOR_LIST2: /* empty */ {
+ dmnsn_astnode list = dmnsn_new_astnode(DMNSN_AST_ARRAY, @$);
+ $$ = dmnsn_new_astnode1(DMNSN_AST_COLOR_LIST, @$, list);
+ }
+ | COLOR {
+ dmnsn_astnode list = dmnsn_new_astnode1(DMNSN_AST_ARRAY, @$, $1);
+ $$ = dmnsn_new_astnode1(DMNSN_AST_COLOR_LIST, @$, list);
+ }
+ | COLOR "," COLOR {
+ dmnsn_astnode list = dmnsn_new_astnode2(DMNSN_AST_ARRAY, @$,
+ $1, $3);
+ $$ = dmnsn_new_astnode1(DMNSN_AST_COLOR_LIST, @$, list);
+ }
+
/* Finishes */
FINISH: "finish" "{"
FINISH_ITEMS