mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00
clang-format: Set IndentCaseBlocks to false
This commit is contained in:
parent
02206f3215
commit
4423574d26
58 changed files with 4729 additions and 4766 deletions
86
src/util.cc
86
src/util.cc
|
@ -183,67 +183,67 @@ int expand_escape(const char*& s)
|
|||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
{ // \<octal>{1,3}
|
||||
--s; // put back the first octal digit
|
||||
const char* start = s;
|
||||
{ // \<octal>{1,3}
|
||||
--s; // put back the first octal digit
|
||||
const char* start = s;
|
||||
|
||||
// require at least one octal digit and parse at most three
|
||||
// require at least one octal digit and parse at most three
|
||||
|
||||
int result = parse_octal_digit(*s++);
|
||||
int result = parse_octal_digit(*s++);
|
||||
|
||||
if ( result < 0 )
|
||||
{
|
||||
reporter->Error("bad octal escape: %s", start);
|
||||
return 0;
|
||||
}
|
||||
if ( result < 0 )
|
||||
{
|
||||
reporter->Error("bad octal escape: %s", start);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// second digit?
|
||||
int digit = parse_octal_digit(*s);
|
||||
// second digit?
|
||||
int digit = parse_octal_digit(*s);
|
||||
|
||||
if ( digit >= 0 )
|
||||
{
|
||||
result = (result << 3) | digit;
|
||||
++s;
|
||||
|
||||
// third digit?
|
||||
digit = parse_octal_digit(*s);
|
||||
|
||||
if ( digit >= 0 )
|
||||
{
|
||||
result = (result << 3) | digit;
|
||||
++s;
|
||||
|
||||
// third digit?
|
||||
digit = parse_octal_digit(*s);
|
||||
|
||||
if ( digit >= 0 )
|
||||
{
|
||||
result = (result << 3) | digit;
|
||||
++s;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
case 'x':
|
||||
{ /* \x<hex> */
|
||||
const char* start = s;
|
||||
{ /* \x<hex> */
|
||||
const char* start = s;
|
||||
|
||||
// Look at most 2 characters, so that "\x0ddir" -> "^Mdir".
|
||||
// Look at most 2 characters, so that "\x0ddir" -> "^Mdir".
|
||||
|
||||
int result = parse_hex_digit(*s++);
|
||||
int result = parse_hex_digit(*s++);
|
||||
|
||||
if ( result < 0 )
|
||||
{
|
||||
reporter->Error("bad hexadecimal escape: %s", start);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// second digit?
|
||||
int digit = parse_hex_digit(*s);
|
||||
|
||||
if ( digit >= 0 )
|
||||
{
|
||||
result = (result << 4) | digit;
|
||||
++s;
|
||||
}
|
||||
|
||||
return result;
|
||||
if ( result < 0 )
|
||||
{
|
||||
reporter->Error("bad hexadecimal escape: %s", start);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// second digit?
|
||||
int digit = parse_hex_digit(*s);
|
||||
|
||||
if ( digit >= 0 )
|
||||
{
|
||||
result = (result << 4) | digit;
|
||||
++s;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
default:
|
||||
return s[-1];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue