]> git.draconx.ca Git - cdecl99.git/commit
libcdecl: Fix scanning of hexadecimal constants.
authorNick Bowler <nbowler@draconx.ca>
Wed, 27 Dec 2023 01:34:20 +0000 (20:34 -0500)
committerNick Bowler <nbowler@draconx.ca>
Thu, 28 Dec 2023 04:14:34 +0000 (23:14 -0500)
commitfed6418a32d3b0fd6036d169bd325c1172b391b5
treea50e3faaf31580684ab7f533d6a5e2f5cd1be0d5
parent1260ac474046e883b8e499a72739c9289097933f
libcdecl: Fix scanning of hexadecimal constants.

Due to an oversight, hexadecimal constants such as 0X1234 are not
parsed correctly, scanning as two tokens: the integer 0, and the
identifier X1234.

A mistake in the same area also scans plain 0x as two tokens in
the same way, rather than returning a syntax error (although
there should not be any valid parses if such tokens are returned,
so this is a minor issue).

Fix both of these problems, and add a new internal test case
which directly verifies the scanner output for a selection of
integer constants.
Makefile.am
src/scan.l
t/.gitignore
t/crossparse.c
t/scantest.c [new file with mode: 0644]
tests/internal.at