mirror of
git://projects.qi-hardware.com/fped.git
synced 2025-04-21 12:27:27 +03:00
- when editing a value list, we need to return the values and free them in case
of successful validation - free previous expression in set_col_values - added rapid entry also for table values (fill the row) git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5460 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
21
expr.c
21
expr.c
@@ -483,7 +483,7 @@ void free_expr(struct expr *expr)
|
||||
}
|
||||
|
||||
|
||||
/* ----- var = value, ... shortcut ----------------------------------------- */
|
||||
/* ----- [var =] value, ... shortcuts -------------------------------------- */
|
||||
|
||||
|
||||
int parse_var(const char *s, const char **id, struct value **values,
|
||||
@@ -497,8 +497,7 @@ int parse_var(const char *s, const char **id, struct value **values,
|
||||
return -1;
|
||||
if (id)
|
||||
*id = var_id;
|
||||
if (values)
|
||||
*values = var_value_list;
|
||||
*values = var_value_list;
|
||||
n = 0;
|
||||
for (value = var_value_list; value; value = value->next)
|
||||
n++;
|
||||
@@ -509,6 +508,22 @@ int parse_var(const char *s, const char **id, struct value **values,
|
||||
}
|
||||
|
||||
|
||||
int parse_values(const char *s, struct value **values)
|
||||
{
|
||||
const struct value *value;
|
||||
int n;
|
||||
|
||||
scan_values(s);
|
||||
if (yyparse())
|
||||
return -1;
|
||||
*values = var_value_list;
|
||||
n = 0;
|
||||
for (value = var_value_list; value; value = value->next)
|
||||
n++;
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
void free_values(struct value *values, int keep_expr)
|
||||
{
|
||||
struct value *next;
|
||||
|
||||
Reference in New Issue
Block a user