summaryrefslogtreecommitdiffstats
path: root/lexer
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-01-05 18:22:34 +0100
committerDave Davenport <qball@gmpclient.org>2017-01-05 18:22:34 +0100
commit4cc21b93a5bd1a9e0abd329862473d88801a47a9 (patch)
tree951bab877c413b6b860a9c38e13ddc251601ac39 /lexer
parent50479057bcc33c4bcedf803d64ec5a860af442af (diff)
Allow linking to top level properties.
Diffstat (limited to 'lexer')
-rw-r--r--lexer/theme-lexer.l9
-rw-r--r--lexer/theme-parser.y6
2 files changed, 15 insertions, 0 deletions
diff --git a/lexer/theme-lexer.l b/lexer/theme-lexer.l
index 6a6f8687..1dc9bfe3 100644
--- a/lexer/theme-lexer.l
+++ b/lexer/theme-lexer.l
@@ -109,6 +109,10 @@ if ( queue == NULL ){
<PROPERTIES>{NUMBER}+ { yylval->ival = (int)g_ascii_strtoll(yytext, NULL, 10); return T_INT;}
<PROPERTIES>{NUMBER}+\.{NUMBER}+ { yylval->fval = g_ascii_strtod(yytext, NULL); return T_DOUBLE;}
<PROPERTIES>\"{STRING}\" { yytext[yyleng-1] = '\0'; yylval->sval = g_strdup(&yytext[1]); return T_STRING;}
+<PROPERTIES>@{WORD} {
+ yylval->sval = g_strdup(yytext);
+ return T_LINK;
+}
<PROPERTIES>{REAL}{EM} {
yylval->distance.distance = (double)g_ascii_strtod(yytext, NULL);
@@ -208,6 +212,11 @@ if ( queue == NULL ){
return T_COLOR;
}
+<*>'\n' {
+ printf("newlines\n");
+ yylloc->last_column = 1;
+ yylloc->last_line ++;
+};
<*>(\r\n) {
printf("newlines\n");
yylloc->last_column = 1;
diff --git a/lexer/theme-parser.y b/lexer/theme-parser.y
index 2a13f1a2..d520c299 100644
--- a/lexer/theme-parser.y
+++ b/lexer/theme-parser.y
@@ -42,6 +42,7 @@ int yylex (YYSTYPE *, YYLTYPE *);
%token <bval> T_BOOLEAN
%token <colorval> T_COLOR
%token <distance> T_PIXEL
+%token <sval> T_LINK
%token <sval> FIRST_NAME
%token BOPEN "bracket open";
@@ -146,6 +147,11 @@ property
$$->name = $1;
$$->value.s = $3;
}
+| pvalue PSEP T_LINK PCLOSE {
+ $$ = rofi_theme_property_create ( P_LINK );
+ $$->name = $1;
+ $$->value.link.name = $3;
+ }
| pvalue PSEP T_BOOLEAN PCLOSE {
$$ = rofi_theme_property_create ( P_BOOLEAN );
$$->name = $1;