aboutsummaryrefslogtreecommitdiff
path: root/src/html.lex.l
diff options
context:
space:
mode:
Diffstat (limited to 'src/html.lex.l')
-rw-r--r--src/html.lex.l27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/html.lex.l b/src/html.lex.l
index 9f323dd..931bfc1 100644
--- a/src/html.lex.l
+++ b/src/html.lex.l
@@ -45,5 +45,5 @@ N [0-9]+
{
yyerror ("unknown identifier");
- yylval.value.type = unspecified_value;
+ init_value (&yylval.value, unspecified_value, NULL);
}
return IDENT;
@@ -54,5 +54,5 @@ N [0-9]+
{
yyerror ("unknown identifier");
- yylval.value.type = unspecified_value;
+ init_value (&yylval.value, unspecified_value, NULL);
}
return IDENT;
@@ -64,5 +64,5 @@ N [0-9]+
{
yyerror ("unknown identifier");
- yylval.value.type = unspecified_value;
+ init_value (&yylval.value, unspecified_value, NULL);
}
else
@@ -72,4 +72,25 @@ N [0-9]+
return IDENT;
}
+\$\({NAME}:[^)]+\) {
+ pp_value_t val;
+ char *p = strchr (yytext, ':');
+ *p++ = 0;
+ if (find_value (yytext+2, &val))
+ {
+ yyerror ("unknown identifier");
+ init_value (&yylval.value, unspecified_value, NULL);
+ }
+ else
+ {
+ size_t len = strlen (p) - 1;
+ init_value (&yylval.value, val.type, &val.v);
+ yylval.value.prec = val.prec;
+ yylval.value.format = val.format;
+ yylval.value.fmt = xmalloc (len + 1);
+ memcpy (yylval.value.fmt, p, len);
+ yylval.value.fmt[len] = 0;
+ }
+ return IDENT;
+}
\$\{ return OBRACE;
\$\} return CBRACE;

Return to:

Send suggestions and report system problems to the System administrator.