···1+The `%code` causes Color definition to be added in both parser.h and parser.c
2+causing duplicate definitions error. This ensures that once it has been included
3+as part of parser.h, it wont be redefined in parser.c
4+5+--- xsw-0.1.2-src/src/parser.y 1969-12-31 16:00:01.000000000 -0800
6++++ xsw-0.1.2-src/src/parser.y 2016-06-28 13:21:35.707027770 -0700
7+@@ -38,7 +38,13 @@
8+9+ %}
10+11+-%code requires { typedef struct { unsigned char c; } Color; }
12++%code requires
13++{
14++#ifndef COLORDEF
15++#define COLORDEF
16++typedef struct { unsigned char c; } Color;
17++#endif
18++}
19+20+ %token SLIDE COLON HIFEN TEXT X Y W H IMAGE SIZE SCALE TEMPLATE BACKGROUND FONT
21+ %token STYLE ALIGN EXPAND PLUS IMAGE_PATH