- }
- } else if (!got_eq) {
- if (type == TOKEN_EQUALS) {
- got_eq = TRUE;
- return;
- } else {
- yyerror("syntax error");
- }
- } else if (!got_val) {
- if (type == TOKEN_STRING) {
- s = token.string;
- got_val = type;
- return;
- } else if (type == TOKEN_BOOL) {
- b = token.bool;
- got_val = type;
- return;
- } else if (type == TOKEN_INTEGER) {
- i = token.integer;
- got_val = type;
- return;
- } else
- yyerror("syntax error");
- } else if (type != TOKEN_NEWLINE) {
- yyerror("syntax error");
- } else {
- ConfigValue v;
-
- switch (got_val) {
- case TOKEN_STRING:
- v.string = s;
- if (!config_set(id, Config_String, v))
- yyerror("invalid value type");
- break;
- case TOKEN_BOOL:
- v.bool = b;
- if (!config_set(id, Config_Bool, v))
- yyerror("invalid value type");
- break;
- case TOKEN_INTEGER:
- v.integer = i;
- if (!config_set(id, Config_Integer, v))
- yyerror("invalid value type");
- break;
- default:
- g_assert_not_reached(); /* unhandled type got parsed */
- }