summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2022-08-13 16:18:36 +0100
committerMichael Drake <mdrake.unique@gmail.com>2022-08-29 13:49:20 +0100
commit1338ceef5c2ff3cccbf288d39162a50b03491497 (patch)
treea45cf4fad534065892d1999d3df4de27e1afac05 /src
parent2dfdb62e3af0bc3a6b74efeb8af1df6b87491e6f (diff)
downloadlibcss-1338ceef5c2ff3cccbf288d39162a50b03491497.tar.gz
libcss-1338ceef5c2ff3cccbf288d39162a50b03491497.tar.bz2
Parse: Update code generator to support new values
Diffstat (limited to 'src')
-rw-r--r--src/parse/properties/css_property_parser_gen.c46
1 files changed, 42 insertions, 4 deletions
diff --git a/src/parse/properties/css_property_parser_gen.c b/src/parse/properties/css_property_parser_gen.c
index 24cc536..1e8b007 100644
--- a/src/parse/properties/css_property_parser_gen.c
+++ b/src/parse/properties/css_property_parser_gen.c
@@ -169,18 +169,38 @@ void output_ident(FILE *outputf, bool only_ident, struct keyval *parseid, struct
"if (");
if (!only_ident) {
fprintf(outputf,
- "(token->type == CSS_TOKEN_IDENT) && ");
+ "(token->type == CSS_TOKEN_IDENT) &&\n\t\t\t");
}
fprintf(outputf,
- "(lwc_string_caseless_isequal(token->idata, c->strings[%s], &match) == lwc_error_ok && match)) {\n",
+ "(lwc_string_caseless_isequal(\n"
+ "\t\t\ttoken->idata, c->strings[%s],\n"
+ "\t\t\t&match) == lwc_error_ok && match)) {\n",
ckv->key);
if (strcmp(ckv->key,"INHERIT") == 0) {
fprintf(outputf,
- "\t\t\terror = css_stylesheet_style_inherit(result, %s);\n",
+ "\t\terror = css_stylesheet_style_inherit(result,\n"
+ "\t\t\t\t%s);\n\n",
+ parseid->val);
+ } else if (strcmp(ckv->key,"INITIAL") == 0) {
+ fprintf(outputf,
+ "\t\terror = css_stylesheet_style_initial(result,\n"
+ "\t\t\t\t%s);\n\n",
+ parseid->val);
+ } else if (strcmp(ckv->key,"REVERT") == 0) {
+ fprintf(outputf,
+ "\t\terror = css_stylesheet_style_revert(result,\n"
+ "\t\t\t\t%s);\n\n",
+ parseid->val);
+ } else if (strcmp(ckv->key,"UNSET") == 0) {
+ fprintf(outputf,
+ "\t\terror = css_stylesheet_style_unset(result,\n"
+ "\t\t\t\t%s);\n\n",
parseid->val);
} else {
fprintf(outputf,
- "\t\t\terror = css__stylesheet_style_appendOPV(result, %s, %s);\n",
+ "\t\terror = css__stylesheet_style_appendOPV(result,\n"
+ "\t\t\t\t%s,\n"
+ "\t\t\t\t%s);\n\n",
parseid->val,
ckv->val);
}
@@ -466,10 +486,22 @@ void output_wrap(FILE *outputf, struct keyval *parseid, struct keyval_list *WRAP
}
char str_INHERIT[] = "INHERIT";
+char str_INITIAL[] = "INITIAL";
+char str_REVERT[] = "REVERT";
+char str_UNSET[] = "UNSET";
struct keyval ident_inherit = {
.key = str_INHERIT,
};
+struct keyval ident_initial = {
+ .key = str_INITIAL,
+};
+struct keyval ident_unset = {
+ .key = str_UNSET,
+};
+struct keyval ident_revert = {
+ .key = str_REVERT,
+};
int main(int argc, char **argv)
{
@@ -554,6 +586,12 @@ int main(int argc, char **argv)
curlist = &base;
} else if (strcmp(rkv->val, str_INHERIT) == 0) {
IDENT.item[IDENT.count++] = &ident_inherit;
+ } else if (strcmp(rkv->val, str_INITIAL) == 0) {
+ IDENT.item[IDENT.count++] = &ident_initial;
+ } else if (strcmp(rkv->val, str_REVERT) == 0) {
+ IDENT.item[IDENT.count++] = &ident_revert;
+ } else if (strcmp(rkv->val, str_UNSET) == 0) {
+ IDENT.item[IDENT.count++] = &ident_unset;
}
} else if (strcmp(rkv->key, "IDENT_LIST") == 0) {
if (rkv->val[0] == '(') {