Nasal: better error message for non-numeric string.

This commit is contained in:
Thomas Geymayer
2014-06-21 00:21:36 +02:00
parent 03d2a166b7
commit f2f1b36df9

View File

@@ -71,7 +71,9 @@ static double numify(naContext ctx, naRef o)
else if(IS_NIL(o)) ERR(ctx, "nil used in numeric context");
else if(!IS_STR(o)) ERR(ctx, "non-scalar in numeric context");
else if(naStr_tonum(o, &n)) return n;
else ERR(ctx, "non-numeric string in numeric context");
else naRuntimeError( ctx,
"non-numeric string in numeric context: '%s'",
naStr_data(o) );
return 0;
}