Fix: error on invalid value numbers

This commit is contained in:
Istvan Ruzman
2020-08-07 16:39:17 +02:00
parent 9d7d40806a
commit dc2a24402b
2 changed files with 107 additions and 62 deletions

View File

@@ -460,7 +460,15 @@ class Dictionary:
)
(attr_name, key, vvalue) = tokens[1:]
value = _parse_number(vvalue)
try:
if '.' in vvalue:
# quick and dirty way to make floats values an error
raise ValueError
value = _parse_number(vvalue)
except ValueError:
raise ParseError(filename,
f"Invalid number {vvalue} for VALUE {key}",
line_num)
attribute = self.attrindex[attr_name]
try: