- }
- } else if (!got_val) {
- if (token->type == TOKEN_STRING) {
- s = token->data.string;
- got_val = token->type;
- return;
- } else if (token->type == TOKEN_BOOL) {
- b = token->data.bool;
- got_val = token->type;
- return;
- } else if (token->type == TOKEN_INTEGER) {
- i = token->data.integer;
- got_val = token->type;
- return;
- } else
- yyerror("syntax error");
- } else if (token->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 */
- }