| 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 4131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4142 | 4142 |
| 4143 if (type == '(') { | 4143 if (type == '(') { |
| 4144 RegExpCapture* capture = new RegExpCapture(body, capture_index); | 4144 RegExpCapture* capture = new RegExpCapture(body, capture_index); |
| 4145 captures_->at(capture_index - 1) = capture; | 4145 captures_->at(capture_index - 1) = capture; |
| 4146 return capture; | 4146 return capture; |
| 4147 } else if (type == ':') { | 4147 } else if (type == ':') { |
| 4148 return body; | 4148 return body; |
| 4149 } else { | 4149 } else { |
| 4150 ASSERT(type == '=' || type == '!'); | 4150 ASSERT(type == '=' || type == '!'); |
| 4151 bool is_positive = (type == '='); | 4151 bool is_positive = (type == '='); |
| 4152 return new RegExpLookahead(body, is_positive); | 4152 return new RegExpLookahead(body, |
| 4153 is_positive, |
| 4154 end_capture_index - capture_index, |
| 4155 capture_index); |
| 4153 } | 4156 } |
| 4154 } | 4157 } |
| 4155 | 4158 |
| 4156 | 4159 |
| 4157 CharacterRange RegExpParser::ParseClassAtom(uc16* char_class) { | 4160 CharacterRange RegExpParser::ParseClassAtom(uc16* char_class) { |
| 4158 ASSERT_EQ(0, *char_class); | 4161 ASSERT_EQ(0, *char_class); |
| 4159 uc32 first = current(); | 4162 uc32 first = current(); |
| 4160 if (first == '\\') { | 4163 if (first == '\\') { |
| 4161 switch (Next()) { | 4164 switch (Next()) { |
| 4162 case 'w': case 'W': case 'd': case 'D': case 's': case 'S': { | 4165 case 'w': case 'W': case 'd': case 'D': case 's': case 'S': { |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4350 start_position, | 4353 start_position, |
| 4351 is_expression); | 4354 is_expression); |
| 4352 return result; | 4355 return result; |
| 4353 } | 4356 } |
| 4354 | 4357 |
| 4355 | 4358 |
| 4356 #undef NEW | 4359 #undef NEW |
| 4357 | 4360 |
| 4358 | 4361 |
| 4359 } } // namespace v8::internal | 4362 } } // namespace v8::internal |
| OLD | NEW |