have typeof produce "string" not "str" (as in C impl)

This commit is contained in:
John Kerl 2020-11-29 22:21:26 -05:00
parent 5c44838e0a
commit 73ba344da8
3 changed files with 20 additions and 28 deletions

View file

@ -4,9 +4,6 @@ BUG:
rrv ./reg-test/cases/case-c-dsl-mapvar-assignments.sh
* probably buggy in the C impl
rrv ./reg-test/cases/case-c-dsl-split-join.sh
* splitnv narg 2 vs 3 ?!?
rrv ./reg-test/cases/case-c-dsl-forbind-typedecl.sh
rrv ./reg-test/cases/case-c-dsl-localvar-typedecl.sh
rrv ./reg-test/cases/case-c-dsl-local-map-variable-typedecl.sh
@ -17,11 +14,6 @@ rrv ./reg-test/cases/case-c-dsl-triple-for-loops.sh
* Needs to do this:
"Continuation statements are split into the final boolean, and the statements before (if any)."
================================================================
MULTIPLE ISSUES:
* typeof prints different things -- regularize ...
================================================================
LF/CRLF ETC.

View file

@ -6,20 +6,20 @@ mlr --j2p --from ./reg-test/input/typecast.json put
$float = float($a);
$boolean = boolean($a);
then reorder -f t,a
t a string int float boolean
str abc abc (error) (error) (error)
int 0 0 0 0 false
int 2 2 2 2 true
float 0.0 0.0 0 0.0 false
float 2.3 2.3 2 2.3 true
bool false false 0 0 false
bool true true 1 1 true
str 0 0 0 0 (error)
str 2 2 2 2 (error)
str 0.0 0.0 (error) 0 (error)
str 2.3 2.3 (error) 2.3 (error)
str false false (error) (error) false
str true true (error) (error) true
t a string int float boolean
string abc abc (error) (error) (error)
int 0 0 0 0 false
int 2 2 2 2 true
float 0.0 0.0 0 0.0 false
float 2.3 2.3 2 2.3 true
bool false false 0 0 false
bool true true 1 1 true
string 0 0 0 0 (error)
string 2 2 2 2 (error)
string 0.0 0.0 (error) 0 (error)
string 2.3 2.3 (error) 2.3 (error)
string false false (error) (error) false
string true true (error) (error) true
mlr --idkvp --opprint --from ./reg-test/input/s.dkvp put
for (k, v in $*) {
@ -27,11 +27,11 @@ mlr --idkvp --opprint --from ./reg-test/input/s.dkvp put
}
$tnonesuch = typeof($nonesuch)
a b i x y ta tb ti tx ty tnonesuch
pan pan 1 0.3467901443380824 0.7268028627434533 str str int float float absent
eks pan 2 0.7586799647899636 0.5221511083334797 str str int float float absent
wye wye 3 0.20460330576630303 0.33831852551664776 str str int float float absent
eks wye 4 0.38139939387114097 0.13418874328430463 str str int float float absent
a b i x y ta tb ti tx ty tnonesuch
pan pan 1 0.3467901443380824 0.7268028627434533 string string int float float absent
eks pan 2 0.7586799647899636 0.5221511083334797 string string int float float absent
wye wye 3 0.20460330576630303 0.33831852551664776 string string int float float absent
eks wye 4 0.38139939387114097 0.13418874328430463 string string int float float absent
mlr --idkvp --opprint --from ./reg-test/input/s.dkvp put
for (k, v in $*) {

View file

@ -100,7 +100,7 @@ var TYPE_NAMES = [MT_DIM]string{
"error",
"absent",
"void",
"str",
"string",
"int",
"float",
"bool",