allow Inf and Nan in numbers

This commit is contained in:
zimoch
2010-09-07 12:46:45 +00:00
parent c65823731a
commit 1d8b249aa2
+5 -5
View File
@@ -4,8 +4,8 @@
version () {
echo '$Author: zimoch $' >&2
echo '$Date: 2009/09/07 10:01:53 $' >&2
echo '$Revision: 1.4 $' >&2
echo '$Date: 2010/09/07 12:46:45 $' >&2
echo '$Revision: 1.5 $' >&2
echo '$Source: /cvs/G/EPICS/App/scripts/externalLinks,v $' >&2
exit 1
}
@@ -377,12 +377,12 @@ function expandFile () {
}
}
} else if (isnumeric[rtype,field]) {
if (!match(value,/^ *[+-]?([0-9]+.?[0-9]*|[0-9]*.?[0-9]+)([eE][-+]?[0-9]+)? *$/)) {
if (!match(tolower(value),/^ *[+-]?(([0-9]+.?[0-9]*|[0-9]*.?[0-9]+)(e[-+]?[0-9]+)?|inf|nan) *$/)) {
printf("value \"%s\" in %s.%s (%s) should be numeric\n",
value, record, field, rtype) > "/dev/stderr"
}
} else if (isinteger[rtype,field]) {
if (!match(value,/^ *[+-]?(0[xX][0-9A-Fa-f]+|[0-9]+) *$/)) {
if (!match(tolower(value),/^ *[+-]?(0x[0-9a-f]+|[0-9]+) *$/)) {
printf("value \"%s\" in %s.%s (%s) should be integer %d...%d\n",
value, record, field, rtype, -range[rtype,field]-1, range[rtype,field]) > "/dev/stderr"
}
@@ -391,7 +391,7 @@ function expandFile () {
value, record, field, rtype, -range[rtype,field]-1, range[rtype,field]) > "/dev/stderr"
}
} else if (isunsigned[rtype,field]) {
if (!match(value,/^ *+?(0[xX][0-9A-Fa-f]+|[0-9]+) *$/)) {
if (!match(tolower(value),/^ *+?(0x[0-9a-f]+|[0-9]+) *$/)) {
printf("value \"%s\" in %s.%s (%s) should be unsigned integer 0...%d\n",
value, record, field, rtype, range[rtype,field]) > "/dev/stderr"
}