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

Side by Side Diff: src/jsregexp.cc

Issue 371067: Add parentheses to prevent precedence errors.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 1 month 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 | no next file » | 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 4059 matching lines...) Expand 10 before | Expand all | Expand 10 after
4070 return; 4070 return;
4071 } 4071 }
4072 } 4072 }
4073 4073
4074 // Step through the range finding equivalent characters. 4074 // Step through the range finding equivalent characters.
4075 ZoneList<unibrow::uchar> *characters = new ZoneList<unibrow::uchar>(100); 4075 ZoneList<unibrow::uchar> *characters = new ZoneList<unibrow::uchar>(100);
4076 for (int i = bottom; i <= top; i++) { 4076 for (int i = bottom; i <= top; i++) {
4077 int length = uncanonicalize.get(i, '\0', chars); 4077 int length = uncanonicalize.get(i, '\0', chars);
4078 for (int j = 0; j < length; j++) { 4078 for (int j = 0; j < length; j++) {
4079 uc32 chr = chars[j]; 4079 uc32 chr = chars[j];
4080 if (chr != i && chr < bottom || chr > top) { 4080 if (chr != i && (chr < bottom || chr > top)) {
4081 characters->Add(chr); 4081 characters->Add(chr);
4082 } 4082 }
4083 } 4083 }
4084 } 4084 }
4085 4085
4086 // Step through the equivalent characters finding simple ranges and 4086 // Step through the equivalent characters finding simple ranges and
4087 // adding ranges to the character class. 4087 // adding ranges to the character class.
4088 if (characters->length() > 0) { 4088 if (characters->length() > 0) {
4089 int new_from = characters->at(0); 4089 int new_from = characters->at(0);
4090 int new_to = new_from; 4090 int new_to = new_from;
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
4600 RegExpMacroAssemblerIrregexp macro_assembler(codes); 4600 RegExpMacroAssemblerIrregexp macro_assembler(codes);
4601 #endif 4601 #endif
4602 4602
4603 return compiler.Assemble(&macro_assembler, 4603 return compiler.Assemble(&macro_assembler,
4604 node, 4604 node,
4605 data->capture_count, 4605 data->capture_count,
4606 pattern); 4606 pattern);
4607 } 4607 }
4608 4608
4609 }} // namespace v8::internal 4609 }} // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698