[PATCH 2/2] cclass: cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The table of charatcer classes: cclass[] used to contain information
about escaped chars but this is no more the case.

Simplify the table by merging sequence of character of same classes
and remove old comment about the escape.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 tokenize.c | 24 ++++++------------------
 1 file changed, 6 insertions(+), 18 deletions(-)

diff --git a/tokenize.c b/tokenize.c
index 7e68cf1ee..aa4dc1840 100644
--- a/tokenize.c
+++ b/tokenize.c
@@ -484,31 +484,19 @@ enum {
 };
 
 static const char cclass[257] = {
-	['0' + 1 ... '7' + 1] = Digit | Hex,	/* \<octal> */
-	['8' + 1 ... '9' + 1] = Digit | Hex,
+	['0' + 1 ... '9' + 1] = Digit | Hex,
 	['A' + 1 ... 'D' + 1] = Letter | Hex,
 	['E' + 1] = Letter | Hex | Exp,	/* E<exp> */
 	['F' + 1] = Letter | Hex,
 	['G' + 1 ... 'O' + 1] = Letter,
 	['P' + 1] = Letter | Exp,	/* P<exp> */
 	['Q' + 1 ... 'Z' + 1] = Letter,
-	['a' + 1 ... 'b' + 1] = Letter | Hex, /* \a, \b */
-	['c' + 1 ... 'd' + 1] = Letter | Hex,
-	['e' + 1] = Letter | Hex | Exp,/* \e, e<exp> */
-	['f' + 1] = Letter | Hex,	/* \f */
-	['g' + 1 ... 'm' + 1] = Letter,
-	['n' + 1] = Letter,	/* \n */
-	['o' + 1] = Letter,
+	['a' + 1 ... 'd' + 1] = Letter | Hex,
+	['e' + 1] = Letter | Hex | Exp,	/* e<exp> */
+	['f' + 1] = Letter | Hex,
+	['g' + 1 ... 'o' + 1] = Letter,
 	['p' + 1] = Letter | Exp,	/* p<exp> */
-	['q' + 1] = Letter,
-	['r' + 1] = Letter,	/* \r */
-	['s' + 1] = Letter,
-	['t' + 1] = Letter,	/* \t */
-	['u' + 1] = Letter,
-	['v' + 1] = Letter,	/* \v */
-	['w' + 1] = Letter,
-	['x' + 1] = Letter,	/* \x<hex> */
-	['y' + 1 ... 'z' + 1] = Letter,
+	['q' + 1 ... 'z' + 1] = Letter,
 	['_' + 1] = Letter,
 	['.' + 1] = Dot | ValidSecond,
 	['=' + 1] = ValidSecond,
-- 
2.14.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux