Changeset ea0c5e3 for src/Parser
- Timestamp:
- Sep 11, 2017, 8:45:54 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- a54840b, beec62c
- Parents:
- cd218e8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
rcd218e8 rea0c5e3 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 11 08:22:25201713 // Update Count : 278 312 // Last Modified On : Mon Sep 11 18:12:00 2017 13 // Update Count : 2787 14 14 // 15 15 … … 65 65 bool appendStr( string & to, string & from ) { 66 66 // 1. Multiple strings are concatenated into a single string but not combined internally. The reason is that 67 // "\x12" "3" is treated as 2 characters versus 3because "escape sequences are converted into single members of67 // "\x12" "3" is treated as 2 characters versus 1 because "escape sequences are converted into single members of 68 68 // the execution character set just prior to adjacent string literal concatenation" (C11, Section 6.4.5-8). It is 69 69 // easier to let the C compiler handle this case. … … 75 75 if ( from[0] != '"' ) { // encoding ? 76 76 if ( to[0] != '"' ) { // encoding ? 77 if ( to[0] != from[0] ) {// different encodings ?77 if ( to[0] != from[0] || to[1] != from[1] ) { // different encodings ? 78 78 yyerror( "non-matching string encodings for string-literal concatenation" ); 79 79 return false; // parse error, must call YYERROR in action 80 } else if ( from[1] == '8' ) { 81 from.erase( 0, 1 ); // remove 2nd encoding 80 82 } // if 81 83 } else { 82 to = from[0] + to; // move encoding to start 84 if ( from[1] == '8' ) { // move encoding to start 85 to = "u8" + to; 86 from.erase( 0, 1 ); // remove 2nd encoding 87 } else { 88 to = from[0] + to; 89 } // if 83 90 } // if 84 91 from.erase( 0, 1 ); // remove 2nd encoding
Note: See TracChangeset
for help on using the changeset viewer.