From 4b869de2e87e78a04079d5bf6d0db7087501cc5a Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Mon, 21 Jan 2013 19:43:14 +0000 Subject: [PATCH] Cosmetic changes to previous (unicode literals) commit --- Source/Swig/scanner.c | 106 +++++++++++++++++++++--------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/Source/Swig/scanner.c b/Source/Swig/scanner.c index c3562c7cc..6389cc988 100644 --- a/Source/Swig/scanner.c +++ b/Source/Swig/scanner.c @@ -953,59 +953,6 @@ static int look(Scanner * s) { break; - case 77: /*identifier or wide string literal*/ - if ((c = nextchar(s)) == 0) - return SWIG_TOKEN_ID; - else if (c == '\"') { - s->start_line = s->line; - Clear(s->text); - state = 78; - } - else if (c == '\'') { - s->start_line = s->line; - Clear(s->text); - state = 79; - } - else if (isalnum(c) || (c == '_') || (c == '$')) - state = 7; - else { - retract(s, 1); - return SWIG_TOKEN_ID; - } - break; - - case 78: /* Processing a wide string literal*/ - if ((c = nextchar(s)) == 0) { - Swig_error(cparse_file, cparse_start_line, "Unterminated wide string\n"); - return SWIG_TOKEN_ERROR; - } - if (c == '\"') { - Delitem(s->text, DOH_END); - return SWIG_TOKEN_WSTRING; - } else if (c == '\\') { - if ((c = nextchar(s)) == 0) { - Swig_error(cparse_file, cparse_start_line, "Unterminated wide string\n"); - return SWIG_TOKEN_ERROR; - } - } - break; - - case 79: /* Processing a wide char literal */ - if ((c = nextchar(s)) == 0) { - Swig_error(cparse_file, cparse_start_line, "Unterminated character constant\n"); - return SWIG_TOKEN_ERROR; - } - if (c == '\'') { - Delitem(s->text, DOH_END); - return (SWIG_TOKEN_WCHAR); - } else if (c == '\\') { - if ((c = nextchar(s)) == 0) { - Swig_error(cparse_file, cparse_start_line, "Unterminated wide char literal\n"); - return SWIG_TOKEN_ERROR; - } - } - break; - case 75: /* Special identifier $ */ if ((c = nextchar(s)) == 0) return SWIG_TOKEN_DOLLAR; @@ -1028,6 +975,59 @@ static int look(Scanner * s) { return SWIG_TOKEN_ID; break; + case 77: /*identifier or wide string literal*/ + if ((c = nextchar(s)) == 0) + return SWIG_TOKEN_ID; + else if (c == '\"') { + s->start_line = s->line; + Clear(s->text); + state = 78; + } + else if (c == '\'') { + s->start_line = s->line; + Clear(s->text); + state = 79; + } + else if (isalnum(c) || (c == '_') || (c == '$')) + state = 7; + else { + retract(s, 1); + return SWIG_TOKEN_ID; + } + break; + + case 78: /* Processing a wide string literal*/ + if ((c = nextchar(s)) == 0) { + Swig_error(cparse_file, cparse_start_line, "Unterminated wide string\n"); + return SWIG_TOKEN_ERROR; + } + if (c == '\"') { + Delitem(s->text, DOH_END); + return SWIG_TOKEN_WSTRING; + } else if (c == '\\') { + if ((c = nextchar(s)) == 0) { + Swig_error(cparse_file, cparse_start_line, "Unterminated wide string\n"); + return SWIG_TOKEN_ERROR; + } + } + break; + + case 79: /* Processing a wide char literal */ + if ((c = nextchar(s)) == 0) { + Swig_error(cparse_file, cparse_start_line, "Unterminated wide character constant\n"); + return SWIG_TOKEN_ERROR; + } + if (c == '\'') { + Delitem(s->text, DOH_END); + return (SWIG_TOKEN_WCHAR); + } else if (c == '\\') { + if ((c = nextchar(s)) == 0) { + Swig_error(cparse_file, cparse_start_line, "Unterminated wide character literal\n"); + return SWIG_TOKEN_ERROR; + } + } + break; + case 8: /* A numerical digit */ if ((c = nextchar(s)) == 0) return SWIG_TOKEN_INT;