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

View file

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