| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * | 10 * |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 static const char regexSpecialCharacters[] = "[](){}+-*.,?\\^$|"; | 42 static const char regexSpecialCharacters[] = "[](){}+-*.,?\\^$|"; |
| 43 } | 43 } |
| 44 | 44 |
| 45 static String createSearchRegexSource(const String& text) | 45 static String createSearchRegexSource(const String& text) |
| 46 { | 46 { |
| 47 StringBuilder result; | 47 StringBuilder result; |
| 48 String specials(regexSpecialCharacters); | 48 String specials(regexSpecialCharacters); |
| 49 | 49 |
| 50 for (unsigned i = 0; i < text.length(); i++) { | 50 for (unsigned i = 0; i < text.length(); i++) { |
| 51 if (specials.find(text[i]) != kNotFound) | 51 if (specials.find(text[i]) != kNotFound) |
| 52 result.append("\\"); | 52 result.append('\\'); |
| 53 result.append(text[i]); | 53 result.append(text[i]); |
| 54 } | 54 } |
| 55 | 55 |
| 56 return result.toString(); | 56 return result.toString(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 static Vector<pair<int, String> > getScriptRegexpMatchesByLines(const ScriptRege
xp* regex, const String& text) | 59 static Vector<pair<int, String> > getScriptRegexpMatchesByLines(const ScriptRege
xp* regex, const String& text) |
| 60 { | 60 { |
| 61 Vector<pair<int, String> > result; | 61 Vector<pair<int, String> > result; |
| 62 if (text.isEmpty()) | 62 if (text.isEmpty()) |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 } | 179 } |
| 180 | 180 |
| 181 String findSourceMapURL(const String& content, MagicCommentType commentType, boo
l* deprecated) | 181 String findSourceMapURL(const String& content, MagicCommentType commentType, boo
l* deprecated) |
| 182 { | 182 { |
| 183 return findMagicComment(content, "sourceMappingURL", commentType, deprecated
); | 183 return findMagicComment(content, "sourceMappingURL", commentType, deprecated
); |
| 184 } | 184 } |
| 185 | 185 |
| 186 } // namespace ContentSearchUtils | 186 } // namespace ContentSearchUtils |
| 187 } // namespace blink | 187 } // namespace blink |
| 188 | 188 |
| OLD | NEW |