[Lexer] Fix nested () in variable default field.

- var ( a, rgba(0,0,0,0)) was broke

Fixes: #936
This commit is contained in:
Dave Davenport 2019-03-21 10:33:50 +01:00
parent 6fffe427c4
commit e17d63f5ae
2 changed files with 7 additions and 9 deletions

View file

@ -519,11 +519,11 @@ if ( queue == NULL ){
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT>{VAR_START}{S_T_PARENT_LEFT} {
g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) );
BEGIN(PROPERTIES_VAR);
return T_VAR_START;
return T_PARENT_LEFT;
}
<PROPERTIES_VAR>{S_T_PARENT_RIGHT} {
BEGIN(GPOINTER_TO_INT(g_queue_pop_head ( queue )));
return T_VAR_CLOSE;
return T_PARENT_RIGHT;
}
<PROPERTIES_VAR>{COMMA} {
g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) );
@ -534,10 +534,10 @@ if ( queue == NULL ){
// Pop 2.
g_queue_pop_head ( queue );
BEGIN(GPOINTER_TO_INT(g_queue_pop_head ( queue )));
return T_VAR_CLOSE;
return T_PARENT_RIGHT;
}
<PROPERTIES,PROPERTIES_ENV>{S_T_PARENT_LEFT} { return T_PARENT_LEFT; }
<PROPERTIES,PROPERTIES_ENV>{S_T_PARENT_RIGHT} { return T_PARENT_RIGHT; }
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT>{S_T_PARENT_LEFT} { return T_PARENT_LEFT; }
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT>{S_T_PARENT_RIGHT} { return T_PARENT_RIGHT; }
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT,PROPERTIES_LIST>{COMMA} { return T_COMMA; }
<PROPERTIES,PROPERTIES_ENV,PROPERTIES_VAR_DEFAULT>{LIST_OPEN} {
g_queue_push_head ( queue, GINT_TO_POINTER (YY_START) );

View file

@ -199,8 +199,6 @@ static ThemeColor hwb_to_rgb ( double h, double w, double b)
%token T_COL_HWB "hwb colorscheme"
%token T_COL_CMYK "cmyk colorscheme"
%token T_VAR_START "Variable"
%token T_VAR_CLOSE "Variable close"
%token T_PARENT_LEFT "Parent left ('(')"
%token T_PARENT_RIGHT "Parent right (')')"
%token T_COMMA "comma separator (',')"
@ -368,12 +366,12 @@ t_property
$$ = $3;
$$->name = $1;
}
| t_property_name T_PSEP T_VAR_START T_ELEMENT T_VAR_CLOSE T_PCLOSE{
| t_property_name T_PSEP T_PARENT_LEFT T_ELEMENT T_PARENT_RIGHT T_PCLOSE{
$$ = rofi_theme_property_create ( P_LINK );
$$->name = $1;
$$->value.link.name = $4;
}
| t_property_name T_PSEP T_VAR_START T_ELEMENT T_COMMA t_property_element T_VAR_CLOSE T_PCLOSE{
| t_property_name T_PSEP T_PARENT_LEFT T_ELEMENT T_COMMA t_property_element T_PARENT_RIGHT T_PCLOSE{
$$ = rofi_theme_property_create ( P_LINK );
$$->name = $1;
$$->value.link.name = $4;