summaryrefslogtreecommitdiff
path: root/src/core/function.c
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-10-19 17:48:21 +0000
committerPaul Buetow <paul@buetow.org>2008-10-19 17:48:21 +0000
commit3d7b35bb37c066489546751e100c2c2b823ccba3 (patch)
treea507be11afc3c55807e254ce5b24c5412367aa46 /src/core/function.c
parentd4657a5d7029ea66d19a5d238a9dd6bf75fe5bb0 (diff)
refs and syms
Diffstat (limited to 'src/core/function.c')
-rw-r--r--src/core/function.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/function.c b/src/core/function.c
index fda40b8..c25834d 100644
--- a/src/core/function.c
+++ b/src/core/function.c
@@ -575,6 +575,9 @@ function_is_buildin(Token *p_token_ident) {
if (strcmp("not", token_get_val(p_token_ident)) == 0)
return (true);
+ if (strcmp("refs", token_get_val(p_token_ident)) == 0)
+ return (true);
+
return (false);
}
@@ -812,6 +815,14 @@ function_process_buildin(Interpret *p_interpret, Token *p_token_ident,
break;
NO_DEFAULT;
}
+
+ } else if (strcmp("refs", token_get_val(p_token_ident)) == 0) {
+ if (0 == stack_size(p_stack_args))
+ _FUNCTION_ERROR("No argument given", p_token_ident);
+
+ Token *p_token_top = stack_pop(p_stack_args);
+ Token *p_token = token_new_integer(p_token_top->i_ref_count);
+ stack_push(p_stack_args, p_token);
}
}