2 Commits

Author SHA1 Message Date
Alex Elder
e61ff7276e parser: fix another test file
In "tests/num_large.qmi", the same name is used twice for constant
symbols, which results in a parse error.  Fix this test file bug.

Fixes: ad48050 ("parser: properly support 64-bit numbers")
Signed-off-by: Alex Elder <elder@linaro.org>
2021-10-08 17:05:42 -05:00
Alex Elder
ad480502eb parser: properly support 64-bit numbers
The language supports specifying 64-bit unsigned values, but the num
field of the token structure is not guaranteed to be 64 bits wide.
Change its type to be unsigned long long, and change the code that
parses numbers to use strtoull() so we can actually accept a 64-bit
value.

This is also true of the value field of the token type.  Change it
to unsigned long long as well (and format it as unsigned).

Check the return value of strtoull(), and if the result is out of
range, report an error.

Signed-off-by: Alex Elder <elder@linaro.org>
Message-Id: <20211001232338.769309-23-elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-10-04 12:29:38 -05:00