Commit 217a63bd authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

add OPER_SET. ditto. ditto. (expr_tree_equal) : ditto. (expr_eval_real) :

2001-11-25  Jody Goldberg <jody@gnome.org>

	* src/eval.c (handle_tree_deps) : add OPER_SET.
	* src/expr-name.c (name_refer_circular) :  ditto.
	* src/expr.c (do_expr_tree_unref) : ditto.
	(expr_tree_equal) : ditto.
	(expr_eval_real) : ditto.
	(expr_rewrite) : ditto.
	(do_expr_tree_as_string) : ditto.
	(expr_tree_new_funcall) : use ExprList.
	(expr_parse_string) : delete.
	(expr_tree_new_set) : new.
	(expr_list_unref) : new.
	(expr_list_equal) : new.
	(expr_list_as_string) : new.

	* src/gnumeric.h : Add ExprList and ExprSet

	* src/parser.y (expr_parse_str) : renamed from gnumeric_expr_parser.
	  Add support for multiple expressions.
	(line) : add support for multiple expressions.

	* src/ranges.c (global_range_parse) : Use expr_parse_str
	(global_range_list_parse) : rewrite to use expr_parse_str and use the
	  new multi-expression support in the parser.

	* src/commands.c (cmd_area_set_text_redo) : Use expr_parse_str.
	* src/xml-io.c (xml_read_style_condition_chain) : ditto.
	(xml_cell_set_array_expr) : ditto.
	* src/workbook-view.c (wb_view_auto_expr) : ditto.
	* src/workbook-edit.c (wbcg_edit_finish) : ditto.
	* src/sheet-object-widget.c (sheet_widget_checkbox_read_xml) : ditto.
	* src/parse-util.c (parse_text_value_or_expr) : ditto.

	* src/auto-format.c (do_af_suggest) : Use ExprList instead of GList
	(do_af_suggest_list) : ditto.
	* src/collect.c (collect_floats) : ditto.
	(collect_floats_value) : ditto.
	(float_range_function) : ditto.
	* src/consolidate.c (simple_consolidate) : ditto.
	(colrow_formula_args_build) : ditto.
	(consolidate_apply) : ditto.
parent cf9dce69
......@@ -8,6 +8,8 @@ release, and longer term bugs.
Release Critical
----------------
http://bugzilla.gnome.org/show_bug.cgi?id=65112
Pending Patches
---------------
......
2001-11-25 Jody Goldberg <jody@gnome.org>
* src/eval.c (handle_tree_deps) : add OPER_SET.
* src/expr-name.c (name_refer_circular) : ditto.
* src/expr.c (do_expr_tree_unref) : ditto.
(expr_tree_equal) : ditto.
(expr_eval_real) : ditto.
(expr_rewrite) : ditto.
(do_expr_tree_as_string) : ditto.
(expr_tree_new_funcall) : use ExprList.
(expr_parse_string) : delete.
(expr_tree_new_set) : new.
(expr_list_unref) : new.
(expr_list_equal) : new.
(expr_list_as_string) : new.
* src/gnumeric.h : Add ExprList and ExprSet
* src/parser.y (expr_parse_str) : renamed from gnumeric_expr_parser.
Add support for multiple expressions.
(line) : add support for multiple expressions.
* src/ranges.c (global_range_parse) : Use expr_parse_str
(global_range_list_parse) : rewrite to use expr_parse_str and use the
new multi-expression support in the parser.
* src/commands.c (cmd_area_set_text_redo) : Use expr_parse_str.
* src/xml-io.c (xml_read_style_condition_chain) : ditto.
(xml_cell_set_array_expr) : ditto.
* src/workbook-view.c (wb_view_auto_expr) : ditto.
* src/workbook-edit.c (wbcg_edit_finish) : ditto.
* src/sheet-object-widget.c (sheet_widget_checkbox_read_xml) : ditto.
* src/parse-util.c (parse_text_value_or_expr) : ditto.
* src/auto-format.c (do_af_suggest) : Use ExprList instead of GList
(do_af_suggest_list) : ditto.
* src/collect.c (collect_floats) : ditto.
(collect_floats_value) : ditto.
(float_range_function) : ditto.
* src/consolidate.c (simple_consolidate) : ditto.
(colrow_formula_args_build) : ditto.
(consolidate_apply) : ditto.
2001-11-25 Abel Cheung <maddog@linux.org.hk>
* configure.in: Removed zh_TW from ALL_LINGUAS. Traditional
......
......@@ -11,6 +11,8 @@ Andreas:
Jody:
* Tricky corner cases for style applications.
* Rework sheetname quoting (Good idea Andreas)
* Support multiple expressions in the parser and clean up
expression lists.
--------------------------------------------------------------------------
Gnumeric 0.76
......
2001-11-25 Jody Goldberg <jody@gnome.org>
* src/eval.c (handle_tree_deps) : add OPER_SET.
* src/expr-name.c (name_refer_circular) : ditto.
* src/expr.c (do_expr_tree_unref) : ditto.
(expr_tree_equal) : ditto.
(expr_eval_real) : ditto.
(expr_rewrite) : ditto.
(do_expr_tree_as_string) : ditto.
(expr_tree_new_funcall) : use ExprList.
(expr_parse_string) : delete.
(expr_tree_new_set) : new.
(expr_list_unref) : new.
(expr_list_equal) : new.
(expr_list_as_string) : new.
* src/gnumeric.h : Add ExprList and ExprSet
* src/parser.y (expr_parse_str) : renamed from gnumeric_expr_parser.
Add support for multiple expressions.
(line) : add support for multiple expressions.
* src/ranges.c (global_range_parse) : Use expr_parse_str
(global_range_list_parse) : rewrite to use expr_parse_str and use the
new multi-expression support in the parser.
* src/commands.c (cmd_area_set_text_redo) : Use expr_parse_str.
* src/xml-io.c (xml_read_style_condition_chain) : ditto.
(xml_cell_set_array_expr) : ditto.
* src/workbook-view.c (wb_view_auto_expr) : ditto.
* src/workbook-edit.c (wbcg_edit_finish) : ditto.
* src/sheet-object-widget.c (sheet_widget_checkbox_read_xml) : ditto.
* src/parse-util.c (parse_text_value_or_expr) : ditto.
* src/auto-format.c (do_af_suggest) : Use ExprList instead of GList
(do_af_suggest_list) : ditto.
* src/collect.c (collect_floats) : ditto.
(collect_floats_value) : ditto.
(float_range_function) : ditto.
* src/consolidate.c (simple_consolidate) : ditto.
(colrow_formula_args_build) : ditto.
(consolidate_apply) : ditto.
2001-11-25 Abel Cheung <maddog@linux.org.hk>
* configure.in: Removed zh_TW from ALL_LINGUAS. Traditional
......
2001-11-25 Jody Goldberg <jody@gnome.org>
* src/eval.c (handle_tree_deps) : add OPER_SET.
* src/expr-name.c (name_refer_circular) : ditto.
* src/expr.c (do_expr_tree_unref) : ditto.
(expr_tree_equal) : ditto.
(expr_eval_real) : ditto.
(expr_rewrite) : ditto.
(do_expr_tree_as_string) : ditto.
(expr_tree_new_funcall) : use ExprList.
(expr_parse_string) : delete.
(expr_tree_new_set) : new.
(expr_list_unref) : new.
(expr_list_equal) : new.
(expr_list_as_string) : new.
* src/gnumeric.h : Add ExprList and ExprSet
* src/parser.y (expr_parse_str) : renamed from gnumeric_expr_parser.
Add support for multiple expressions.
(line) : add support for multiple expressions.
* src/ranges.c (global_range_parse) : Use expr_parse_str
(global_range_list_parse) : rewrite to use expr_parse_str and use the
new multi-expression support in the parser.
* src/commands.c (cmd_area_set_text_redo) : Use expr_parse_str.
* src/xml-io.c (xml_read_style_condition_chain) : ditto.
(xml_cell_set_array_expr) : ditto.
* src/workbook-view.c (wb_view_auto_expr) : ditto.
* src/workbook-edit.c (wbcg_edit_finish) : ditto.
* src/sheet-object-widget.c (sheet_widget_checkbox_read_xml) : ditto.
* src/parse-util.c (parse_text_value_or_expr) : ditto.
* src/auto-format.c (do_af_suggest) : Use ExprList instead of GList
(do_af_suggest_list) : ditto.
* src/collect.c (collect_floats) : ditto.
(collect_floats_value) : ditto.
(float_range_function) : ditto.
* src/consolidate.c (simple_consolidate) : ditto.
(colrow_formula_args_build) : ditto.
(consolidate_apply) : ditto.
2001-11-25 Abel Cheung <maddog@linux.org.hk>
* configure.in: Removed zh_TW from ALL_LINGUAS. Traditional
......
2001-11-25 Jody Goldberg <jody@gnome.org>
* src/eval.c (handle_tree_deps) : add OPER_SET.
* src/expr-name.c (name_refer_circular) : ditto.
* src/expr.c (do_expr_tree_unref) : ditto.
(expr_tree_equal) : ditto.
(expr_eval_real) : ditto.
(expr_rewrite) : ditto.
(do_expr_tree_as_string) : ditto.
(expr_tree_new_funcall) : use ExprList.
(expr_parse_string) : delete.
(expr_tree_new_set) : new.
(expr_list_unref) : new.
(expr_list_equal) : new.
(expr_list_as_string) : new.
* src/gnumeric.h : Add ExprList and ExprSet
* src/parser.y (expr_parse_str) : renamed from gnumeric_expr_parser.
Add support for multiple expressions.
(line) : add support for multiple expressions.
* src/ranges.c (global_range_parse) : Use expr_parse_str
(global_range_list_parse) : rewrite to use expr_parse_str and use the
new multi-expression support in the parser.
* src/commands.c (cmd_area_set_text_redo) : Use expr_parse_str.
* src/xml-io.c (xml_read_style_condition_chain) : ditto.
(xml_cell_set_array_expr) : ditto.
* src/workbook-view.c (wb_view_auto_expr) : ditto.
* src/workbook-edit.c (wbcg_edit_finish) : ditto.
* src/sheet-object-widget.c (sheet_widget_checkbox_read_xml) : ditto.
* src/parse-util.c (parse_text_value_or_expr) : ditto.
* src/auto-format.c (do_af_suggest) : Use ExprList instead of GList
(do_af_suggest_list) : ditto.
* src/collect.c (collect_floats) : ditto.
(collect_floats_value) : ditto.
(float_range_function) : ditto.
* src/consolidate.c (simple_consolidate) : ditto.
(colrow_formula_args_build) : ditto.
(consolidate_apply) : ditto.
2001-11-25 Abel Cheung <maddog@linux.org.hk>
* configure.in: Removed zh_TW from ALL_LINGUAS. Traditional
......
2001-11-25 Jody Goldberg <jody@gnome.org>
* applix-read.c (applix_read_cells) : use expr_parse_str, it is
simpler.
2001-11-19 Jody Goldberg <jgoldberg@home.com>
* Release 0.76
......
......@@ -974,7 +974,6 @@ applix_read_cells (ApplixReadState *state)
if (content_type == ';') {
gboolean is_array = FALSE;
ParseError perr;
if (*expr_string == '~') {
Sheet *start_sheet, *end_sheet;
......@@ -1006,14 +1005,13 @@ applix_read_cells (ApplixReadState *state)
continue;
}
expr = gnumeric_expr_parser (expr_string+1,
expr = expr_parse_str (expr_string+1,
parse_pos_init_cell (&pos, cell),
GNM_PARSER_USE_APPLIX_REFERENCE_CONVENTIONS |
GNM_PARSER_CREATE_PLACEHOLDER_FOR_UNKNOWN_FUNC,
NULL, parse_error_init (&perr));
NULL, NULL);
if (expr == NULL) {
(void) applix_parse_error (state, "Invalid expression");
parse_error_free (&perr);
continue;
}
......
2001-11-25 Jody Goldberg <jody@gnome.org>
* ms-formula-read.c : s/ParseList/ExprList/
* ms-formula-write.c : ditto.
2001-11-20 Jody Goldberg <jgoldberg@home.com>
* ms-excel-read.c (biff_boundsheet_data_new) : Doh!
......
......@@ -511,10 +511,8 @@ getRefV8 (guint16 row, guint16 gbitcl, int curcol, int currow,
return cr;
}
typedef GList ParseList;
static void
parse_list_push (ParseList **list, ExprTree *pd)
parse_list_push (ExprList **list, ExprTree *pd)
{
#ifndef NO_DEBUG_EXCEL
if (ms_excel_formula_debug > 5) {
......@@ -523,23 +521,23 @@ parse_list_push (ParseList **list, ExprTree *pd)
#endif
if (!pd)
printf ("FIXME: Pushing nothing onto excel function stack\n");
*list = g_list_prepend (*list, pd);
*list = expr_list_prepend (*list, pd);
}
static void
parse_list_push_raw (ParseList **list, Value *v)
parse_list_push_raw (ExprList **list, Value *v)
{
parse_list_push (list, expr_tree_new_constant (v));
}
static ExprTree *
parse_list_pop (ParseList **list)
parse_list_pop (ExprList **list)
{
/* Get the head */
ParseList *tmp = g_list_nth (*list, 0);
ExprList *tmp = g_slist_nth (*list, 0);
if (tmp != NULL)
{
ExprTree *ans = tmp->data;
*list = g_list_remove (*list, ans);
*list = g_slist_remove (*list, ans);
#ifndef NO_DEBUG_EXCEL
if (ms_excel_formula_debug > 5) {
printf ("Pop 0x%x\n", (int)ans);
......@@ -555,18 +553,18 @@ parse_list_pop (ParseList **list)
/**
* Returns a new list composed of the last n items pop'd off the list.
**/
static ParseList *
parse_list_last_n (ParseList **list, gint n)
static ExprList *
parse_list_last_n (ExprList **list, gint n)
{
ParseList *l=0;
ExprList *l = NULL;
while (n-->0)
l=g_list_prepend (l, parse_list_pop(list));
l = g_slist_prepend (l, parse_list_pop(list));
return l;
}
static void
parse_list_free (ParseList **list)
parse_list_free (ExprList **list)
{
while (*list)
expr_tree_unref (parse_list_pop(list));
......@@ -613,7 +611,7 @@ make_inter_sheet_ref_v7 (ExcelWorkbook *wb, guint16 extn_idx,
}
static gboolean
make_function (ParseList **stack, int fn_idx, int numargs)
make_function (ExprList **stack, int fn_idx, int numargs)
{
FunctionDefinition *name = NULL;
......@@ -624,7 +622,7 @@ make_function (ParseList **stack, int fn_idx, int numargs)
* name should be on top of the stack.
*/
/* FIXME FIXME FIXME : How to handle missing trailing args ?? */
ParseList *args = parse_list_last_n (stack, numargs-1);
ExprList *args = parse_list_last_n (stack, numargs-1);
ExprTree *tmp = parse_list_pop (stack);
char const *f_name = NULL;
......@@ -656,7 +654,7 @@ make_function (ParseList **stack, int fn_idx, int numargs)
return TRUE;
} else if (fn_idx >= 0 && fn_idx < FORMULA_FUNC_DATA_LEN) {
const FormulaFuncData *fd = &formula_func_data[fn_idx];
ParseList *args;
ExprList *args;
#ifndef NO_DEBUG_EXCEL
if (ms_excel_formula_debug > 0) {
......@@ -667,7 +665,7 @@ make_function (ParseList **stack, int fn_idx, int numargs)
/* Right args for multi-arg funcs. */
if (fd->num_args >= 0) {
int const available_args =
(*stack != NULL) ? g_list_length(*stack) : 0;
(*stack != NULL) ? g_slist_length(*stack) : 0;
numargs = fd->num_args;
/* handle missing trailing arguments */
if (numargs > available_args)
......@@ -763,7 +761,7 @@ ms_excel_parse_formula (ExcelSheet const *sheet, guint8 const *mem,
guint8 const *array_data = mem + length;
int len_left = length;
ParseList *stack = NULL;
ExprList *stack = NULL;
gboolean error = FALSE;
if (array_element != NULL)
......@@ -1415,7 +1413,7 @@ ms_excel_parse_formula (ExcelSheet const *sheet, guint8 const *mem,
if (!stack)
return expr_tree_string ("Stack too short - unusual");
if (g_list_length(stack) > 1) {
if (expr_list_length (stack) > 1) {
parse_list_free (&stack);
return expr_tree_string ("Too much data on stack - probable cause: "
"fixed args function is var-arg, put '-1' in the table above");
......
......@@ -170,12 +170,11 @@ ms_formula_build_pre_data (ExcelSheet *sheet, ExprTree const *tree)
case OPER_FUNCALL:
{
GList *l;
ExprList *l;
FormulaCacheEntry *fce;
const gchar *name = function_def_get_name (tree->func.func);
for (l = tree->func.arg_list; l;
l = g_list_next (l))
for (l = tree->func.arg_list; l; l = l->next)
ms_formula_build_pre_data (sheet, l->data);
fce = get_formula_index (sheet, name);
......@@ -456,7 +455,7 @@ write_ref (PolishData *pd, const CellRef *ref)
static void
write_funcall (PolishData *pd, FormulaCacheEntry *fce, ExprTree *tree)
{
GList *args = tree->func.arg_list;
ExprList *args = tree->func.arg_list;
gint num_args = 0;
gboolean prompt = 0;
gboolean cmdequiv = 0;
......@@ -477,9 +476,8 @@ write_funcall (PolishData *pd, FormulaCacheEntry *fce, ExprTree *tree)
}
}
while (args) {
for (; args ; args = args->next) {
write_node (pd, args->data, 0);
args = g_list_next (args);
num_args++;
}
......
......@@ -1149,7 +1149,7 @@ callback_function_imoper (const EvalPos *ep, Value *value, void *closure)
}
static Value *
gnumeric_improduct (FunctionEvalInfo *ei, GList *expr_node_list)
gnumeric_improduct (FunctionEvalInfo *ei, ExprList *expr_node_list)
{
Value *v;
eng_imoper_t p;
......@@ -1183,7 +1183,7 @@ static char *help_imsum = {
};
static Value *
gnumeric_imsum (FunctionEvalInfo *ei, GList *expr_node_list)
gnumeric_imsum (FunctionEvalInfo *ei, ExprList *expr_node_list)
{
Value *v;
eng_imoper_t p;
......
......@@ -2317,7 +2317,7 @@ callback_function_npv (const EvalPos *ep, Value *value, void *closure)
}
static Value *
gnumeric_npv (FunctionEvalInfo *ei, GList *nodes)
gnumeric_npv (FunctionEvalInfo *ei, ExprList *nodes)
{
Value *v;
financial_npv_t p;
......
......@@ -466,12 +466,12 @@ static char *help_iserror = {
* directly
*/
static Value *
gnumeric_check_for_err (FunctionEvalInfo *ei, GList *expr_node_list,
gnumeric_check_for_err (FunctionEvalInfo *ei, ExprList *expr_node_list,
Value ** err)
{
Value * tmp;
if (g_list_length (expr_node_list) != 1) {
if (expr_list_length (expr_node_list) != 1) {
*err = value_new_error(ei->pos,
_("Argument mismatch"));
return NULL;
......@@ -487,7 +487,7 @@ gnumeric_check_for_err (FunctionEvalInfo *ei, GList *expr_node_list,
}
static Value *
gnumeric_iserror (FunctionEvalInfo *ei, GList *expr_node_list)
gnumeric_iserror (FunctionEvalInfo *ei, ExprList *expr_node_list)
{
Value * res, *err = NULL;
res = gnumeric_check_for_err (ei, expr_node_list, &err);
......@@ -522,7 +522,7 @@ static char *help_isna = {
* the error handling mechanism
*/
static Value *
gnumeric_isna (FunctionEvalInfo *ei, GList *expr_node_list)
gnumeric_isna (FunctionEvalInfo *ei, ExprList *expr_node_list)
{
Value * res, *err = NULL;
gboolean b;
......@@ -553,7 +553,7 @@ static char *help_iserr = {
};
static Value *
gnumeric_iserr (FunctionEvalInfo *ei, GList *expr_node_list)
gnumeric_iserr (FunctionEvalInfo *ei, ExprList *expr_node_list)
{
Value * res, *err = NULL;
gboolean b;
......@@ -591,7 +591,7 @@ static char *help_error_type = {
};
static Value *
gnumeric_error_type (FunctionEvalInfo *ei, GList *expr_node_list)
gnumeric_error_type (FunctionEvalInfo *ei, ExprList *expr_node_list)
{
int retval = -1;
char const * mesg;
......@@ -686,11 +686,11 @@ static char *help_isblank = {
};
static Value *
gnumeric_isblank (FunctionEvalInfo *ei, GList *expr_node_list)
gnumeric_isblank (FunctionEvalInfo *ei, ExprList *expr_node_list)
{
gboolean result = FALSE;
ExprTree *expr;
if (g_list_length (expr_node_list) != 1)
if (expr_list_length (expr_node_list) != 1)
return value_new_error (ei->pos,
_("Invalid number of arguments"));
......@@ -757,11 +757,11 @@ static char *help_islogical = {
};
static Value *
gnumeric_islogical (FunctionEvalInfo *ei, GList *expr_node_list)
gnumeric_islogical (FunctionEvalInfo *ei, ExprList *expr_node_list)
{
enum Value_Class cl;
if (g_list_length (expr_node_list) != 1)
if (expr_list_length (expr_node_list) != 1)
return value_new_error (ei->pos,
_("Invalid number of arguments"));
......@@ -787,9 +787,9 @@ static char *help_isnontext = {
};
static Value *
gnumeric_isnontext (FunctionEvalInfo *ei, GList *expr_node_list)
gnumeric_isnontext (FunctionEvalInfo *ei, ExprList *expr_node_list)
{
if (g_list_length (expr_node_list) != 1)
if (expr_list_length (expr_node_list) != 1)
return value_new_error (ei->pos,
_("Invalid number of arguments"));
......@@ -814,9 +814,9 @@ static char *help_isnumber = {
};
static Value *
gnumeric_isnumber (FunctionEvalInfo *ei, GList *expr_node_list)
gnumeric_isnumber (FunctionEvalInfo *ei, ExprList *expr_node_list)
{
if (g_list_length (expr_node_list) != 1)
if (expr_list_length (expr_node_list) != 1)
return value_new_error (ei->pos,
_("Invalid number of arguments"));
......@@ -863,11 +863,11 @@ static char *help_isref = {
};
static Value *
gnumeric_isref (FunctionEvalInfo *ei, GList *expr_node_list)
gnumeric_isref (FunctionEvalInfo *ei, ExprList *expr_node_list)
{
ExprTree *t;
if (g_list_length (expr_node_list) != 1)
if (expr_list_length (expr_node_list) != 1)
return value_new_error (ei->pos,
_("Invalid number of arguments"));
......@@ -895,9 +895,9 @@ static char *help_istext = {
};
static Value *
gnumeric_istext (FunctionEvalInfo *ei, GList *expr_node_list)
gnumeric_istext (FunctionEvalInfo *ei, ExprList *expr_node_list)
{
if (g_list_length (expr_node_list) != 1)
if (expr_list_length (expr_node_list) != 1)
return value_new_error (ei->pos,
_("Invalid number of arguments"));
......@@ -962,9 +962,9 @@ static char *help_type = {
};
static Value *
gnumeric_type (FunctionEvalInfo *ei, GList *expr_node_list)
gnumeric_type (FunctionEvalInfo *ei, ExprList *expr_node_list)
{
if (g_list_length (expr_node_list) != 1)
if (expr_list_length (expr_node_list) != 1)
return value_new_error (ei->pos,
_("Invalid number of arguments"));
......
......@@ -56,7 +56,7 @@ callback_function_and (const EvalPos *ep, Value *value, void *closure)
}
static Value *
gnumeric_and (FunctionEvalInfo *ei, GList *nodes)
gnumeric_and (FunctionEvalInfo *ei, ExprList *nodes)
{
int result = -1;
......@@ -140,7 +140,7 @@ callback_function_or (const EvalPos *ep, Value *value, void *closure)
}
static Value *
gnumeric_or (FunctionEvalInfo *ei, GList *nodes)
gnumeric_or (FunctionEvalInfo *ei, ExprList *nodes)
{
int result = -1;
......@@ -180,7 +180,7 @@ static char *help_if = {
};
static Value *
gnumeric_if (FunctionEvalInfo *ei, GList *expr_node_list)
gnumeric_if (FunctionEvalInfo *ei, ExprList *expr_node_list)
{
ExprTree *expr;
Value *value;
......@@ -188,7 +188,7 @@ gnumeric_if (FunctionEvalInfo *ei, GList *expr_node_list)
gboolean err;
/* Type checking */
args = g_list_length (expr_node_list);
args = expr_list_length (expr_node_list);
if (args < 1 || args > 3)
return value_new_error (ei->pos,
_("Invalid number of arguments"));
......
......@@ -439,13 +439,13 @@ static char *help_choose = {
};
static Value *
gnumeric_choose (FunctionEvalInfo *ei, GList *l)
gnumeric_choose (FunctionEvalInfo *ei, ExprList *l)
{
int index;
int argc;
Value *v;
argc = g_list_length (l);
argc = expr_list_length (l);
if (argc < 1 || !l->data)
return value_new_error (ei->pos, _("#ARG!"));
......@@ -461,13 +461,10 @@ gnumeric_choose (FunctionEvalInfo *ei, GList *l)
index = value_get_as_int(v);
value_release (v);
l = g_list_next (l);
while (l){
for (l = l->next; l != NULL ; l = l->next) {
index--;
if (!index)
return expr_eval (l->data, ei->pos, EVAL_PERMIT_NON_SCALAR);
l = g_list_next (l);
}
return value_new_error (ei->pos, gnumeric_err_VALUE);
}
......@@ -754,8 +751,8 @@ gnumeric_indirect (FunctionEvalInfo *ei, Value **args)
ExprTree *expr;
char *text = value_get_as_string (args[0]);
expr = expr_parse_string (text,
parse_pos_init_evalpos (&pp, ei->pos), NULL, NULL);
expr = expr_parse_str_simple (text,
parse_pos_init_evalpos (&pp, ei->pos));
g_free (text);
if (expr != NULL) {
......@@ -848,7 +845,7 @@ static char *help_column = {
};
static Value *
gnumeric_column (FunctionEvalInfo *ei, GList *nodes)
gnumeric_column (FunctionEvalInfo *ei, ExprList *nodes)
{
ExprTree *expr;
......@@ -990,7 +987,7 @@ static char *help_row = {
};
static Value *
gnumeric_row (FunctionEvalInfo *ei, GList *nodes)
gnumeric_row (FunctionEvalInfo *ei, ExprList *nodes)
{
ExprTree *expr;
......
......@@ -152,7 +152,7 @@ range_gcd (const gnum_float *xs, int n, gnum_float *res)
}
static Value *
gnumeric_gcd (FunctionEvalInfo *ei, GList *nodes)
gnumeric_gcd (FunctionEvalInfo *ei, ExprList *nodes)
{
return float_range_function (nodes, ei,
range_gcd,
......@@ -208,7 +208,7 @@ range_lcm (const gnum_float *xs, int n, gnum_float *res)
}
static Value *
gnumeric_lcm (FunctionEvalInfo *ei, GList *nodes)
gnumeric_lcm (FunctionEvalInfo *ei, ExprList *nodes)
{
return float_range_function (nodes, ei,
range_lcm,
......@@ -1458,7 +1458,7 @@ static char *help_sum = {
};
static Value *
gnumeric_sum (FunctionEvalInfo *ei, GList *nodes)
gnumeric_sum (FunctionEvalInfo *ei, ExprList *nodes)
{
return float_range_function (nodes, ei,
range_sum,
......@@ -1490,7 +1490,7 @@ static char *help_suma = {
};
static Value *
gnumeric_suma (FunctionEvalInfo *ei, GList *nodes)
gnumeric_suma (FunctionEvalInfo *ei, ExprList *nodes)
{
return float_range_function (nodes, ei,
range_sum,
......@@ -1521,7 +1521,7 @@ static char *help_sumsq = {
static Value *
gnumeric_sumsq (FunctionEvalInfo *ei, GList *nodes)
gnumeric_sumsq (FunctionEvalInfo *ei, ExprList *nodes)
{
return float_range_function (nodes, ei,
range_sumsq,
......@@ -1550,7 +1550,7 @@ static char *help_multinomial = {
static Value *
gnumeric_multinomial (FunctionEvalInfo *ei, GList *nodes)
gnumeric_multinomial (FunctionEvalInfo *ei, ExprList *nodes)
{
return float_range_function (nodes, ei,
range_multinomial,
......@@ -1589,7 +1589,7 @@ range_bogusproduct (const gnum_float *xs, int n, gnum_float *res)
}
static Value *
gnumeric_product (FunctionEvalInfo *ei, GList *nodes)
gnumeric_product (FunctionEvalInfo *ei, ExprList *nodes)
{
return float_range_function (nodes, ei,
range_bogusproduct,
......@@ -1616,7 +1616,7 @@ static char *help_g_product = {
};
static Value *
gnumeric_g_product (FunctionEvalInfo *ei, GList *nodes)
gnumeric_g_product (FunctionEvalInfo *ei, ExprList *nodes)
{
return float_range_function (nodes, ei,
range_product,
......@@ -2794,7 +2794,7 @@ static char *help_subtotal = {