diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-05-09 14:12:03 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-05-09 14:12:03 +0200 |
commit | 00e297c5caefa21daf896a22ab1092131d60999a (patch) | |
tree | e9cd47a2bacd0e62d5bed15e2999fbf44f942ffc /lexer/theme-parser.y | |
parent | cf8796ccd3cf04b4ab1029f3da32c7784443e1d1 (diff) |
Update highlight style parsing
Diffstat (limited to 'lexer/theme-parser.y')
-rw-r--r-- | lexer/theme-parser.y | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y index 6a414f70..d82dc4a5 100644 --- a/lexer/theme-parser.y +++ b/lexer/theme-parser.y @@ -101,7 +101,6 @@ int yylex (YYSTYPE *, YYLTYPE *); %token <fval> T_DOUBLE %token <sval> T_STRING %token <sval> N_STRING "property name" -%token <ival> T_HIGHLIGHT_STYLE %token <sval> NAME_ELEMENT "Element name" %token <bval> T_BOOLEAN %token <colorval> T_COLOR @@ -114,6 +113,11 @@ int yylex (YYSTYPE *, YYLTYPE *); %token T_POS_NORTH "North" %token T_POS_SOUTH "South" +%token T_NONE "None" +%token T_BOLD "Bold" +%token T_ITALIC "Italic" +%token T_UNDERLINE "Underline" + %token BOPEN "bracket open ('{')" %token BCLOSE "bracket close ('}')" @@ -126,6 +130,7 @@ int yylex (YYSTYPE *, YYLTYPE *); %token CONFIGURATION "Configuration block" %type <ival> highlight_styles +%type <ival> highlight_style %type <wloc> t_position %type <wloc> t_position_ew %type <wloc> t_position_sn @@ -292,12 +297,18 @@ t_position_sn /** * Highlight style, allow mulitple styles to be combined. + * Empty not allowed */ -highlight_styles: - T_HIGHLIGHT_STYLE { $$ = $1; } -| highlight_styles T_HIGHLIGHT_STYLE { - $$ = $1 | $2; -} +highlight_styles +: highlight_style { $$ = $1;} +| highlight_styles highlight_style { $$ = $1|$2;} +; +/** Single style. */ +highlight_style +: T_NONE { $$ = HL_NONE; } +| T_BOLD { $$ = HL_BOLD; } +| T_UNDERLINE { $$ = HL_UNDERLINE; } +| T_ITALIC { $$ = HL_ITALIC; } ; pvalue: N_STRING { $$ = $1; } |