- Timestamp:
- Sep 11, 2024, 4:31:16 PM (8 weeks ago)
- Branches:
- master
- Children:
- 05f8761
- Parents:
- 20c2ade
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ExpressionNode.cpp
r20c2ade r5b95e67 9 9 // Author : Peter A. Buhr 10 10 // Created On : Sat May 16 13:17:07 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Fri Aug 23 10:22:00202413 // Update Count : 108 811 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Sep 11 16:28:06 2024 13 // Update Count : 1089 14 14 // 15 15 … … 477 477 if ( '\\' != str[pos] ) return 1; 478 478 switch ( str[pos + 1] ) { 479 // Simple Escape Sequence (\_ where _ is one of the following):480 case '\'': case '\"': case '?': case '\\':481 case 'a': case 'b': case 'f': case 'n': case 'r': case 't': case 'v':482 // GCC Escape Sequence (as simple, just some different letters):483 case 'e':479 // Simple Escape Sequence (\_ where _ is one of the following): 480 case '\'': case '\"': case '?': case '\\': 481 case 'a': case 'b': case 'f': case 'n': case 'r': case 't': case 'v': 482 // GCC Escape Sequence (as simple, just some different letters): 483 case 'e': 484 484 return 2; 485 // Numeric Escape Sequence (\___ where _ is 1-3 octal digits):486 case '0': case '1': case '2': case '3':487 case '4': case '5': case '6': case '7':485 // Numeric Escape Sequence (\___ where _ is 1-3 octal digits): 486 case '0': case '1': case '2': case '3': 487 case '4': case '5': case '6': case '7': 488 488 return ( !isoctal( str[pos + 2] ) ) ? 2 : 489 490 // Numeric Escape Sequence (\x_ where _ is 1 or more hexadecimal digits):491 case 'x': {492 size_t length = 2;493 while ( ishexadecimal( str[pos + length] ) ) ++length;494 return length;495 }496 // Uniersal Character Name (\u____ where _ is 4 decimal digits):497 case 'u':489 ( !isoctal( str[pos + 3] ) ) ? 3 : 4; 490 // Numeric Escape Sequence (\x_ where _ is 1 or more hexadecimal digits): 491 case 'x': { 492 size_t length = 2; 493 while ( ishexadecimal( str[pos + length] ) ) ++length; 494 return length; 495 } 496 // Universal Character Name (\u____ where _ is 4 decimal digits): 497 case 'u': 498 498 return 6; 499 // Uniersal Character Name (\U________ where _ is 8 decimal digits):500 case 'U':499 // Universal Character Name (\U________ where _ is 8 decimal digits): 500 case 'U': 501 501 return 10; 502 default:502 default: 503 503 assertf( false, "Unknown escape sequence (start %c).", str[pos] ); 504 504 return 1;
Note: See TracChangeset
for help on using the changeset viewer.