Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(664)

Side by Side Diff: src/jsregexp.cc

Issue 1745017: Port regexp fix (backslash-b at end of input) to (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
Patch Set: '' Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regexp.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 4852 matching lines...) Expand 10 before | Expand all | Expand 10 after
4863 if (type == AssertionNode::AT_BOUNDARY || 4863 if (type == AssertionNode::AT_BOUNDARY ||
4864 type == AssertionNode::AT_NON_BOUNDARY) { 4864 type == AssertionNode::AT_NON_BOUNDARY) {
4865 // Check if the following character is known to be a word character 4865 // Check if the following character is known to be a word character
4866 // or known to not be a word character. 4866 // or known to not be a word character.
4867 ZoneList<CharacterRange>* following_chars = that->FirstCharacterSet(); 4867 ZoneList<CharacterRange>* following_chars = that->FirstCharacterSet();
4868 4868
4869 CharacterRange::Canonicalize(following_chars); 4869 CharacterRange::Canonicalize(following_chars);
4870 4870
4871 SetRelation word_relation = 4871 SetRelation word_relation =
4872 CharacterRange::WordCharacterRelation(following_chars); 4872 CharacterRange::WordCharacterRelation(following_chars);
4873 if (word_relation.ContainedIn()) { 4873 if (word_relation.Disjoint()) {
4874 // Includes the case where following_chars is empty (e.g., end-of-input).
4875 // Following character is definitely *not* a word character.
4876 type = (type == AssertionNode::AT_BOUNDARY) ?
4877 AssertionNode::AFTER_WORD_CHARACTER :
4878 AssertionNode::AFTER_NONWORD_CHARACTER;
4879 that->set_type(type);
4880 } else if (word_relation.ContainedIn()) {
4874 // Following character is definitely a word character. 4881 // Following character is definitely a word character.
4875 type = (type == AssertionNode::AT_BOUNDARY) ? 4882 type = (type == AssertionNode::AT_BOUNDARY) ?
4876 AssertionNode::AFTER_NONWORD_CHARACTER : 4883 AssertionNode::AFTER_NONWORD_CHARACTER :
4877 AssertionNode::AFTER_WORD_CHARACTER; 4884 AssertionNode::AFTER_WORD_CHARACTER;
4878 that->set_type(type);
4879 } else if (word_relation.Disjoint()) {
4880 // Following character is definitely *not* a word character.
4881 type = (type == AssertionNode::AT_BOUNDARY) ?
4882 AssertionNode::AFTER_WORD_CHARACTER :
4883 AssertionNode::AFTER_NONWORD_CHARACTER;
4884 that->set_type(type); 4885 that->set_type(type);
4885 } 4886 }
4886 } 4887 }
4887 } 4888 }
4888 4889
4889 4890
4890 ZoneList<CharacterRange>* RegExpNode::FirstCharacterSet() { 4891 ZoneList<CharacterRange>* RegExpNode::FirstCharacterSet() {
4891 if (first_character_set_ == NULL) { 4892 if (first_character_set_ == NULL) {
4892 if (ComputeFirstCharacterSet(kFirstCharBudget) < 0) { 4893 if (ComputeFirstCharacterSet(kFirstCharBudget) < 0) {
4893 // If we can't find an exact solution within the budget, we 4894 // If we can't find an exact solution within the budget, we
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
5246 node, 5247 node,
5247 data->capture_count, 5248 data->capture_count,
5248 pattern); 5249 pattern);
5249 } 5250 }
5250 5251
5251 5252
5252 int OffsetsVector::static_offsets_vector_[ 5253 int OffsetsVector::static_offsets_vector_[
5253 OffsetsVector::kStaticOffsetsVectorSize]; 5254 OffsetsVector::kStaticOffsetsVectorSize];
5254 5255
5255 }} // namespace v8::internal 5256 }} // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regexp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698