diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-06-26 12:46:54 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-06-26 12:46:54 +0300 |
commit | 8a4905be350313d41f6c0b20497809760d7fa84e (patch) | |
tree | 0169eb762b2175202db1c9cd889a2b2bc8bbb4bc /builtin.c | |
parent | 0a2de15cba710ff67107bc340950515e1a29edb5 (diff) | |
download | egawk-8a4905be350313d41f6c0b20497809760d7fa84e.tar.gz egawk-8a4905be350313d41f6c0b20497809760d7fa84e.tar.bz2 egawk-8a4905be350313d41f6c0b20497809760d7fa84e.zip |
Improve values returned by typeof. Fix tests and doc.
Diffstat (limited to 'builtin.c')
-rw-r--r-- | builtin.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -3891,11 +3891,13 @@ do_typeof(int nargs) case Node_val: case Node_var: if (arg == Nnull_string) - res = "untyped"; - else if ((arg->flags & STRING) != 0) - res = "scalar_s"; - else if ((arg->flags & NUMBER) != 0) - res = "scalar_n"; + res = "unassigned"; + else if ((arg->flags & STRING) != 0) { + res = "string"; + if ((arg->flags & MAYBE_NUM) != 0) + res = "strnum"; + } else if ((arg->flags & NUMBER) != 0) + res = "number"; break; case Node_var_new: res = "untyped"; |