qmic/tests/hexdigits.qmi
Alex Elder 84f213e584 parser: properly support hexadecimal numbers
In yylex(), when parsing a number, an attempt is made to allow
hexadecimal values to be interpreted if the second character of the
token being parsed is 'x'.  However the parser is only otherwise
permitting digits 0-9 to be used.  Fix this by using isxdigit()
rather than isdigit().

The result still permits nonsensical values to be accepted, but at
least hexidecimal values containing [a-fA-F] will be interpreted
correctly.

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

16 lines
252 B
Plaintext

package test;
struct qmi_result {
u16 result;
u16 error;
};
request test_request {
# 0x1a should be interpreted as decimal 26 (not a parse error)
optional u16 weird = 0x1a;
} = 0x23;
response test_response {
required qmi_result r = 2;
} = 043;