summaryrefslogtreecommitdiffstats
path: root/usr.bin/indent
diff options
context:
space:
mode:
authorrnordier <rnordier@FreeBSD.org>1998-05-19 20:41:20 +0000
committerrnordier <rnordier@FreeBSD.org>1998-05-19 20:41:20 +0000
commitbee67649e2dfdecc00ee300a3148fa3955a6c40c (patch)
tree3b10d032d0eedd2acf3024d82f93469336327b5a /usr.bin/indent
parentad8fcbb0ce06f8f662cfff6bb56e20b80b45b110 (diff)
downloadFreeBSD-src-bee67649e2dfdecc00ee300a3148fa3955a6c40c.zip
FreeBSD-src-bee67649e2dfdecc00ee300a3148fa3955a6c40c.tar.gz
Support integer constant unsigned-suffix and long-long-suffix.
Diffstat (limited to 'usr.bin/indent')
-rw-r--r--usr.bin/indent/lexi.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/usr.bin/indent/lexi.c b/usr.bin/indent/lexi.c
index 69f2431..7a0929f 100644
--- a/usr.bin/indent/lexi.c
+++ b/usr.bin/indent/lexi.c
@@ -152,7 +152,8 @@ lexi()
if (isdigit(*buf_ptr) || buf_ptr[0] == '.' && isdigit(buf_ptr[1])) {
int seendot = 0,
- seenexp = 0;
+ seenexp = 0,
+ seensfx = 0;
if (*buf_ptr == '0' &&
(buf_ptr[1] == 'x' || buf_ptr[1] == 'X')) {
*e_token++ = *buf_ptr++;
@@ -183,8 +184,25 @@ lexi()
*e_token++ = *buf_ptr++;
}
}
- if (*buf_ptr == 'L' || *buf_ptr == 'l')
- *e_token++ = *buf_ptr++;
+ while (1) {
+ if (!(seensfx & 1) &&
+ (*buf_ptr == 'U' || *buf_ptr == 'u')) {
+ CHECK_SIZE_TOKEN;
+ *e_token++ = *buf_ptr++;
+ seensfx |= 1;
+ continue;
+ }
+ if (!(seensfx & 2) &&
+ (*buf_ptr == 'L' || *buf_ptr == 'l')) {
+ CHECK_SIZE_TOKEN;
+ if (buf_ptr[1] == buf_ptr[0])
+ *e_token++ = *buf_ptr++;
+ *e_token++ = *buf_ptr++;
+ seensfx |= 2;
+ continue;
+ }
+ break;
+ }
}
else
while (chartype[*buf_ptr] == alphanum) { /* copy it over */
OpenPOWER on IntegriCloud