| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 3712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3723 in_(in), | 3723 in_(in), |
| 3724 current_(kEndMarker), | 3724 current_(kEndMarker), |
| 3725 next_pos_(0), | 3725 next_pos_(0), |
| 3726 capture_count_(0), | 3726 capture_count_(0), |
| 3727 has_more_(true), | 3727 has_more_(true), |
| 3728 multiline_(multiline), | 3728 multiline_(multiline), |
| 3729 simple_(false), | 3729 simple_(false), |
| 3730 contains_anchor_(false), | 3730 contains_anchor_(false), |
| 3731 is_scanned_for_captures_(false), | 3731 is_scanned_for_captures_(false), |
| 3732 failed_(false) { | 3732 failed_(false) { |
| 3733 Advance(1); | 3733 Advance(); |
| 3734 } | 3734 } |
| 3735 | 3735 |
| 3736 | 3736 |
| 3737 uc32 RegExpParser::Next() { | 3737 uc32 RegExpParser::Next() { |
| 3738 if (has_next()) { | 3738 if (has_next()) { |
| 3739 return in()->Get(next_pos_); | 3739 return in()->Get(next_pos_); |
| 3740 } else { | 3740 } else { |
| 3741 return kEndMarker; | 3741 return kEndMarker; |
| 3742 } | 3742 } |
| 3743 } | 3743 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 3761 } | 3761 } |
| 3762 | 3762 |
| 3763 | 3763 |
| 3764 void RegExpParser::Reset(int pos) { | 3764 void RegExpParser::Reset(int pos) { |
| 3765 next_pos_ = pos; | 3765 next_pos_ = pos; |
| 3766 Advance(); | 3766 Advance(); |
| 3767 } | 3767 } |
| 3768 | 3768 |
| 3769 | 3769 |
| 3770 void RegExpParser::Advance(int dist) { | 3770 void RegExpParser::Advance(int dist) { |
| 3771 for (int i = 0; i < dist; i++) | 3771 next_pos_ += dist - 1; |
| 3772 Advance(); | 3772 Advance(); |
| 3773 } | 3773 } |
| 3774 | 3774 |
| 3775 | 3775 |
| 3776 bool RegExpParser::simple() { | 3776 bool RegExpParser::simple() { |
| 3777 return simple_; | 3777 return simple_; |
| 3778 } | 3778 } |
| 3779 | 3779 |
| 3780 RegExpTree* RegExpParser::ReportError(Vector<const char> message) { | 3780 RegExpTree* RegExpParser::ReportError(Vector<const char> message) { |
| 3781 failed_ = true; | 3781 failed_ = true; |
| 3782 *error_ = Factory::NewStringFromAscii(message, NOT_TENURED); | 3782 *error_ = Factory::NewStringFromAscii(message, NOT_TENURED); |
| (...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4693 Handle<String> source = Handle<String>(String::cast(script->source())); | 4693 Handle<String> source = Handle<String>(String::cast(script->source())); |
| 4694 result = parser.ParseProgram(source, info->is_global()); | 4694 result = parser.ParseProgram(source, info->is_global()); |
| 4695 } | 4695 } |
| 4696 } | 4696 } |
| 4697 | 4697 |
| 4698 info->SetFunction(result); | 4698 info->SetFunction(result); |
| 4699 return (result != NULL); | 4699 return (result != NULL); |
| 4700 } | 4700 } |
| 4701 | 4701 |
| 4702 } } // namespace v8::internal | 4702 } } // namespace v8::internal |
| OLD | NEW |