Commit ada6538e authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Add production for sheet specific names. eg Sheet2!name


2000-07-02  Jody Goldberg <jgoldberg@home.com>

	* src/parser.y (exp) : Add production for sheet specific names.
	  eg Sheet2!name
parent 575b186c
2000-07-02 Jody Goldberg <jgoldberg@home.com>
* src/parser.y (exp) : Add production for sheet specific names.
eg Sheet2!name
2000-07-01 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-string.c (parse_search_strin) : Use g_strdup.
2000-07-01 Morten Welinder <terra@diku.dk>
* src/file.c (can_try_save_to): Constify. Handle empty name.
......
2000-07-02 Jody Goldberg <jgoldberg@home.com>
* src/parser.y (exp) : Add production for sheet specific names.
eg Sheet2!name
2000-07-01 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-string.c (parse_search_strin) : Use g_strdup.
2000-07-01 Morten Welinder <terra@diku.dk>
* src/file.c (can_try_save_to): Constify. Handle empty name.
......
2000-07-02 Jody Goldberg <jgoldberg@home.com>
* src/parser.y (exp) : Add production for sheet specific names.
eg Sheet2!name
2000-07-01 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-string.c (parse_search_strin) : Use g_strdup.
2000-07-01 Morten Welinder <terra@diku.dk>
* src/file.c (can_try_save_to): Constify. Handle empty name.
......
2000-07-02 Jody Goldberg <jgoldberg@home.com>
* src/parser.y (exp) : Add production for sheet specific names.
eg Sheet2!name
2000-07-01 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-string.c (parse_search_strin) : Use g_strdup.
2000-07-01 Morten Welinder <terra@diku.dk>
* src/file.c (can_try_save_to): Constify. Handle empty name.
......
2000-07-02 Jody Goldberg <jgoldberg@home.com>
* src/parser.y (exp) : Add production for sheet specific names.
eg Sheet2!name
2000-07-01 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-string.c (parse_search_strin) : Use g_strdup.
2000-07-01 Morten Welinder <terra@diku.dk>
* src/file.c (can_try_save_to): Constify. Handle empty name.
......
2000-07-02 Jody Goldberg <jgoldberg@home.com>
* src/parser.y (exp) : Add production for sheet specific names.
eg Sheet2!name
2000-07-01 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-string.c (parse_search_strin) : Use g_strdup.
2000-07-01 Morten Welinder <terra@diku.dk>
* src/file.c (can_try_save_to): Constify. Handle empty name.
......
2000-07-02 Jody Goldberg <jgoldberg@home.com>
* src/parser.y (exp) : Add production for sheet specific names.
eg Sheet2!name
2000-07-01 Jody Goldberg <jgoldberg@home.com>
* src/functions/fn-string.c (parse_search_strin) : Use g_strdup.
2000-07-01 Morten Welinder <terra@diku.dk>
* src/file.c (can_try_save_to): Constify. Handle empty name.
......
......@@ -301,17 +301,17 @@ parse_string_as_value (ExprTree *str)
static ExprTree *
parse_string_as_value_or_name (ExprTree *str)
{
NamedExpression *exprn;
NamedExpression *expr_name;
if (parse_string_as_value (str));
return str;
exprn = expr_name_lookup (parser_pos, str->constant.value->v_str.val->str);
if (exprn == NULL)
expr_name = expr_name_lookup (parser_pos, str->constant.value->v_str.val->str);
if (expr_name == NULL)
return str;
unregister_allocation (str); expr_tree_unref (str);
return register_expr_allocation (expr_tree_new_name (exprn));
return register_expr_allocation (expr_tree_new_name (expr_name));
}
/* Make byacc happier */
......@@ -394,6 +394,21 @@ exp: CONSTANT { $$ = $1; }
$$ = register_expr_allocation (expr_tree_new_funcall (func, $3));
}
| sheetref string_opt_quote {
NamedExpression *expr_name;
char *name = $2->constant.value->v_str.val->str;
ParsePos pos = *parser_pos;
pos.sheet = $1;
expr_name = expr_name_lookup (&pos, name);
unregister_allocation ($2); expr_tree_unref ($2);
if (expr_name == NULL) {
/* TODO : Get rid of ParseErr and replace it with something richer. */
parser_error = PARSE_ERR_SYNTAX;
return ERROR;
}
$$ = register_expr_allocation (expr_tree_new_name (expr_name));
}
;
string_opt_quote : STRING
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment