Use isxdigit().

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9374 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Olly Betts 2006-09-28 06:45:46 +00:00
commit d46a4e1195
2 changed files with 8 additions and 14 deletions

View file

@ -886,7 +886,7 @@ int yylook(void) {
} }
break; break;
case 83: case 83:
/* Might be a hexidecimal or octal number */ /* Might be a hexadecimal or octal number */
if ((c = nextchar()) == 0) return(0); if ((c = nextchar()) == 0) return(0);
if (isdigit(c)) state = 84; if (isdigit(c)) state = 84;
else if ((c == 'x') || (c == 'X')) state = 85; else if ((c == 'x') || (c == 'X')) state = 85;
@ -916,10 +916,7 @@ int yylook(void) {
case 85: case 85:
/* This is an hex number */ /* This is an hex number */
if ((c = nextchar()) == 0) return (0); if ((c = nextchar()) == 0) return (0);
if ((isdigit(c)) || (c=='a') || (c=='b') || (c=='c') || if (isxdigit(c))
(c=='d') || (c=='e') || (c=='f') || (c=='A') ||
(c=='B') || (c=='C') || (c=='D') || (c=='E') ||
(c=='F'))
state = 85; state = 85;
else if ((c == 'l') || (c == 'L')) { else if ((c == 'l') || (c == 'L')) {
state = 87; state = 87;
@ -942,7 +939,6 @@ int yylook(void) {
retract(1); retract(1);
return(NUM_FLOAT); return(NUM_FLOAT);
} }
/* Parse a character constant. ie. 'a' */
break; break;
case 87 : case 87 :
@ -985,8 +981,9 @@ int yylook(void) {
retract(1); retract(1);
return(NUM_ULONG); return(NUM_ULONG);
} }
case 9: case 9:
/* Parse a character constant. ie. 'a' */
if ((c = nextchar()) == 0) return (0); if ((c = nextchar()) == 0) return (0);
if (c == '\\') { if (c == '\\') {
yylen--; yylen--;

View file

@ -232,7 +232,7 @@ look(SwigScanner *s) {
case 0 : case 0 :
if((c = nextchar(s)) == 0) return(0); if((c = nextchar(s)) == 0) return(0);
/* Process delimeters */ /* Process delimiters */
if (c == '\n') { if (c == '\n') {
return SWIG_TOKEN_ENDLINE; return SWIG_TOKEN_ENDLINE;
@ -529,7 +529,7 @@ look(SwigScanner *s) {
} }
break; break;
case 83: case 83:
/* Might be a hexidecimal or octal number */ /* Might be a hexadecimal or octal number */
if ((c = nextchar(s)) == 0) return SWIG_TOKEN_INT; if ((c = nextchar(s)) == 0) return SWIG_TOKEN_INT;
if (isdigit(c)) state = 84; if (isdigit(c)) state = 84;
else if ((c == 'x') || (c == 'X')) state = 85; else if ((c == 'x') || (c == 'X')) state = 85;
@ -559,10 +559,7 @@ look(SwigScanner *s) {
case 85: case 85:
/* This is an hex number */ /* This is an hex number */
if ((c = nextchar(s)) == 0) return SWIG_TOKEN_INT; if ((c = nextchar(s)) == 0) return SWIG_TOKEN_INT;
if ((isdigit(c)) || (c=='a') || (c=='b') || (c=='c') || if (isxdigit(c))
(c=='d') || (c=='e') || (c=='f') || (c=='A') ||
(c=='B') || (c=='C') || (c=='D') || (c=='E') ||
(c=='F'))
state = 85; state = 85;
else if ((c == 'l') || (c == 'L')) { else if ((c == 'l') || (c == 'L')) {
state = 87; state = 87;
@ -601,7 +598,7 @@ look(SwigScanner *s) {
} else { } else {
retract(s,1); retract(s,1);
return SWIG_TOKEN_LONG; return SWIG_TOKEN_LONG;
} }
break; break;
/* A long long integer */ /* A long long integer */