aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/builtin.c b/builtin.c
index 1b612f4a..ff4a53af 100644
--- a/builtin.c
+++ b/builtin.c
@@ -4112,7 +4112,10 @@ do_typeof(int nargs)
}
break;
case Node_val:
- switch (fixtype(arg)->flags & (STRING|NUMBER|USER_INPUT|REGEX)) {
+ switch (fixtype(arg)->flags & (STRING|NUMBER|USER_INPUT|REGEX|BOOL)) {
+ case NUMBER|BOOL:
+ res = "number|bool";
+ break;
case NUMBER:
res = "number";
break;
@@ -4321,3 +4324,18 @@ check_symtab_functab(NODE *dest, const char *fname, const char *msg)
else if (dest == func_table)
fatal(msg, fname, "FUNCTAB");
}
+
+/* do_mkbool --- create boolean values */
+
+NODE *
+do_mkbool(int nargs)
+{
+ NODE *tmp;
+ bool result;
+
+ tmp = POP_SCALAR();
+ result = boolval(tmp);
+ DEREF(tmp);
+
+ return make_bool_node(result);
+}