aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tokenize.c
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-09-19 04:46:07 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-09-19 04:50:18 +0200
commit1fd525bb8759ef0abb2379f3a47bb18bf12b7835 (patch)
treea39c2e4bf300f12d9148179ff2e2d8b2dcd98b4e /tokenize.c
parent875ba5e5b58803043248034ba4d9259bd0a0016c (diff)
downloadsparse-dev-1fd525bb8759ef0abb2379f3a47bb18bf12b7835.tar.gz
cclass: cleanup
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@gmail.com>
Diffstat (limited to 'tokenize.c')
-rw-r--r--tokenize.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/tokenize.c b/tokenize.c
index 7e68cf1e..aa4dc184 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,