diff options
Diffstat (limited to 'TAO/TAO_IDL/fe/idl.ll')
-rw-r--r-- | TAO/TAO_IDL/fe/idl.ll | 123 |
1 files changed, 67 insertions, 56 deletions
diff --git a/TAO/TAO_IDL/fe/idl.ll b/TAO/TAO_IDL/fe/idl.ll index f20f40f3b90..bd30731ffc6 100644 --- a/TAO/TAO_IDL/fe/idl.ll +++ b/TAO/TAO_IDL/fe/idl.ll @@ -750,66 +750,77 @@ idl_atof(char *s) static char idl_escape_reader( char *str -) + ) { - if (str[0] != '\\') { - return str[0]; - } - - switch (str[1]) { - case 'n': - return '\n'; - case 't': - return '\t'; - case 'v': - return '\v'; - case 'b': - return '\b'; - case 'r': - return '\r'; - case 'f': - return '\f'; - case 'a': - return '\a'; - case '\\': - return '\\'; - case '\?': - return '?'; - case '\'': - return '\''; - case '"': - return '"'; - case 'x': - { - int i; - // hex value - for (i = 2; str[i] != '\0' && isxdigit(str[i]); i++) { - continue; - } - char save = str[i]; - str[i] = '\0'; - char out = (char)idl_atoui(&str[2], 16); - str[i] = save; - return out; - } - ACE_NOTREACHED (break;) - default: - // check for octal value - if (str[1] >= '0' && str[1] <= '7') { - int i; - for (i = 1; str[i] >= '0' && str[i] <= '7'; i++) { - continue; + if (str[0] != '\\') + { + return str[0]; + } + + switch (str[1]) + { + case 'n': + return '\n'; + case 't': + return '\t'; + case 'v': + return '\v'; + case 'b': + return '\b'; + case 'r': + return '\r'; + case 'f': + return '\f'; + case 'a': + return '\a'; + case '\\': + return '\\'; + case '\?': + return '?'; + case '\'': + return '\''; + case '"': + return '"'; + case 'x': + { + int i; + + // hex value + for (i = 2; str[i] != '\0' && isxdigit (str[i]); ++i) + { + continue; + } + + char save = str[i]; + str[i] = '\0'; + char out = (char)idl_atoui(&str[2], 16); + str[i] = save; + return out; + } + ACE_NOTREACHED (break;) + default: + // check for octal value + if (str[1] >= '0' && str[1] <= '7') + { + int i; + + for (i = 1; str[i] >= '0' && str[i] <= '7'; ++i) + { + continue; } - char save = str[i]; - str[i] = '\0'; - char out = (char)idl_atoui(&str[1], 8); - str[i] = save; - return out; - } else { + + char save = str[i]; + str[i] = '\0'; + char out = (char)idl_atoui(&str[1], 8); + str[i] = save; + return out; + } + else + { return str[1] - 'a'; } - ACE_NOTREACHED (break;) - } + ACE_NOTREACHED (break;) + } } /* * Convert escaped hex digits into a wchar |