| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 4159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4170 *min_out = min; | 4170 *min_out = min; |
| 4171 *max_out = max; | 4171 *max_out = max; |
| 4172 return true; | 4172 return true; |
| 4173 } | 4173 } |
| 4174 | 4174 |
| 4175 | 4175 |
| 4176 // Upper and lower case letters differ by one bit. | 4176 // Upper and lower case letters differ by one bit. |
| 4177 STATIC_CHECK(('a' ^ 'A') == 0x20); | 4177 STATIC_CHECK(('a' ^ 'A') == 0x20); |
| 4178 | 4178 |
| 4179 uc32 RegExpParser::ParseControlLetterEscape() { | 4179 uc32 RegExpParser::ParseControlLetterEscape() { |
| 4180 if (!has_more()) { | 4180 if (!has_more()) |
| 4181 ReportError(CStrVector("\\c at end of pattern")); | 4181 return 'c'; |
| 4182 return '\0'; | |
| 4183 } | |
| 4184 uc32 letter = current() & ~(0x20); // Collapse upper and lower case letters. | 4182 uc32 letter = current() & ~(0x20); // Collapse upper and lower case letters. |
| 4185 if (letter < 'A' || 'Z' < letter) { | 4183 if (letter < 'A' || 'Z' < letter) { |
| 4186 // Non-spec error-correction: "\c" followed by non-control letter is | 4184 // Non-spec error-correction: "\c" followed by non-control letter is |
| 4187 // interpreted as an IdentityEscape of 'c'. | 4185 // interpreted as an IdentityEscape of 'c'. |
| 4188 return 'c'; | 4186 return 'c'; |
| 4189 } | 4187 } |
| 4190 Advance(); | 4188 Advance(); |
| 4191 return letter & 0x1f; // Remainder modulo 32, per specification. | 4189 return letter & 0x1f; // Remainder modulo 32, per specification. |
| 4192 } | 4190 } |
| 4193 | 4191 |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4563 start_position, | 4561 start_position, |
| 4564 is_expression); | 4562 is_expression); |
| 4565 return result; | 4563 return result; |
| 4566 } | 4564 } |
| 4567 | 4565 |
| 4568 | 4566 |
| 4569 #undef NEW | 4567 #undef NEW |
| 4570 | 4568 |
| 4571 | 4569 |
| 4572 } } // namespace v8::internal | 4570 } } // namespace v8::internal |
| OLD | NEW |