Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: compiled/filter/RegExpFilter.cpp

Issue 29574665: Issue 5159 - Expose collapse property for BlockingFilter (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Created Oct. 12, 2017, 6:41 p.m.
Right Patch Set: Fix test Created Nov. 21, 2017, 5:42 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « compiled/filter/RegExpFilter.h ('k') | test/filterClasses.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 { 211 {
212 data.mSitekeysStart = valueStart; 212 data.mSitekeysStart = valueStart;
213 data.mSitekeysEnd = valueEnd; 213 data.mSitekeysEnd = valueEnd;
214 } 214 }
215 } 215 }
216 else if (name.equals(u"match-case"_str)) 216 else if (name.equals(u"match-case"_str))
217 data.mMatchCase = !reverse; 217 data.mMatchCase = !reverse;
218 else if (name.equals(u"third-party"_str)) 218 else if (name.equals(u"third-party"_str))
219 data.mThirdParty = reverse ? TrippleState::NO : TrippleState::YES; 219 data.mThirdParty = reverse ? TrippleState::NO : TrippleState::YES;
220 else if (name.equals(u"collapse"_str)) 220 else if (name.equals(u"collapse"_str))
221 data.mCollapse = reverse ? false : true; 221 data.mCollapse = !reverse;
222 else 222 else
223 error.reset(u"filter_unknown_option"_str); 223 error.reset(u"filter_unknown_option"_str);
224 } 224 }
225 225
226 void ParseOptions(String& text, DependentString& error, RegExpFilterData& data , 226 void ParseOptions(String& text, DependentString& error, RegExpFilterData& data ,
227 String::size_type optionsStart) 227 String::size_type optionsStart)
228 { 228 {
229 data.mMatchCase = false; 229 data.mMatchCase = false;
230 data.mThirdParty = TrippleState::ANY; 230 data.mThirdParty = TrippleState::ANY;
231 data.mCollapse = true; 231 data.mCollapse = true;
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 return false; 388 return false;
389 } 389 }
390 390
391 if (!mData.RegExpParsingDone()) 391 if (!mData.RegExpParsingDone())
392 { 392 {
393 const OwnedString pattern(mData.GetRegExpSource(mText)); 393 const OwnedString pattern(mData.GetRegExpSource(mText));
394 mData.SetRegExp(GenerateRegExp(RegExpFromSource(pattern), mData.mMatchCase)) ; 394 mData.SetRegExp(GenerateRegExp(RegExpFromSource(pattern), mData.mMatchCase)) ;
395 } 395 }
396 return TestRegExp(mData.mRegexpId, location); 396 return TestRegExp(mData.mRegexpId, location);
397 } 397 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld