mirror of https://github.com/davatorium/rofi.git
Update highlight style parsing
This commit is contained in:
parent
cf8796ccd3
commit
00e297c5ca
|
@ -544,22 +544,10 @@ if ( queue == NULL ){
|
||||||
<PROPERTIES>{WEST} { return T_POS_WEST; }
|
<PROPERTIES>{WEST} { return T_POS_WEST; }
|
||||||
<PROPERTIES>{SOUTH} { return T_POS_SOUTH; }
|
<PROPERTIES>{SOUTH} { return T_POS_SOUTH; }
|
||||||
<PROPERTIES>{NORTH} { return T_POS_NORTH; }
|
<PROPERTIES>{NORTH} { return T_POS_NORTH; }
|
||||||
<PROPERTIES>{NONE} {
|
<PROPERTIES>{NONE} { return T_NONE; }
|
||||||
yylval->ival = HL_NONE;
|
<PROPERTIES>{BOLD} { return T_BOLD; }
|
||||||
return T_HIGHLIGHT_STYLE;
|
<PROPERTIES>{ITALIC} { return T_ITALIC; }
|
||||||
}
|
<PROPERTIES>{UNDERLINE} { return T_UNDERLINE; }
|
||||||
<PROPERTIES>{BOLD} {
|
|
||||||
yylval->ival = HL_BOLD;
|
|
||||||
return T_HIGHLIGHT_STYLE;
|
|
||||||
}
|
|
||||||
<PROPERTIES>{ITALIC} {
|
|
||||||
yylval->ival = HL_ITALIC;
|
|
||||||
return T_HIGHLIGHT_STYLE;
|
|
||||||
}
|
|
||||||
<PROPERTIES>{UNDERLINE} {
|
|
||||||
yylval->ival = HL_UNDERLINE;
|
|
||||||
return T_HIGHLIGHT_STYLE;
|
|
||||||
}
|
|
||||||
<INITIAL><<EOF>> {
|
<INITIAL><<EOF>> {
|
||||||
ParseObject *po = g_queue_pop_head ( file_queue );
|
ParseObject *po = g_queue_pop_head ( file_queue );
|
||||||
if ( po ) {
|
if ( po ) {
|
||||||
|
|
|
@ -101,7 +101,6 @@ int yylex (YYSTYPE *, YYLTYPE *);
|
||||||
%token <fval> T_DOUBLE
|
%token <fval> T_DOUBLE
|
||||||
%token <sval> T_STRING
|
%token <sval> T_STRING
|
||||||
%token <sval> N_STRING "property name"
|
%token <sval> N_STRING "property name"
|
||||||
%token <ival> T_HIGHLIGHT_STYLE
|
|
||||||
%token <sval> NAME_ELEMENT "Element name"
|
%token <sval> NAME_ELEMENT "Element name"
|
||||||
%token <bval> T_BOOLEAN
|
%token <bval> T_BOOLEAN
|
||||||
%token <colorval> T_COLOR
|
%token <colorval> T_COLOR
|
||||||
|
@ -114,6 +113,11 @@ int yylex (YYSTYPE *, YYLTYPE *);
|
||||||
%token T_POS_NORTH "North"
|
%token T_POS_NORTH "North"
|
||||||
%token T_POS_SOUTH "South"
|
%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 BOPEN "bracket open ('{')"
|
||||||
%token BCLOSE "bracket close ('}')"
|
%token BCLOSE "bracket close ('}')"
|
||||||
|
@ -126,6 +130,7 @@ int yylex (YYSTYPE *, YYLTYPE *);
|
||||||
%token CONFIGURATION "Configuration block"
|
%token CONFIGURATION "Configuration block"
|
||||||
|
|
||||||
%type <ival> highlight_styles
|
%type <ival> highlight_styles
|
||||||
|
%type <ival> highlight_style
|
||||||
%type <wloc> t_position
|
%type <wloc> t_position
|
||||||
%type <wloc> t_position_ew
|
%type <wloc> t_position_ew
|
||||||
%type <wloc> t_position_sn
|
%type <wloc> t_position_sn
|
||||||
|
@ -292,12 +297,18 @@ t_position_sn
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Highlight style, allow mulitple styles to be combined.
|
* Highlight style, allow mulitple styles to be combined.
|
||||||
|
* Empty not allowed
|
||||||
*/
|
*/
|
||||||
highlight_styles:
|
highlight_styles
|
||||||
T_HIGHLIGHT_STYLE { $$ = $1; }
|
: highlight_style { $$ = $1;}
|
||||||
| highlight_styles T_HIGHLIGHT_STYLE {
|
| highlight_styles highlight_style { $$ = $1|$2;}
|
||||||
$$ = $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; }
|
pvalue: N_STRING { $$ = $1; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue