-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Rules] Improving removal of comments #4774
[Rules] Improving removal of comments #4774
Conversation
I see here regex usefull |
But is parsing regex fast? |
@TD-er check first if it is not already included (by any libs?). Regex is always slower. |
I'm not that fluent in regex, so not sure if reading a regex will be done in less time than my internal grey mass C++ parser needs :) |
There are some pages to test it over internet. |
…bugfix/Rules-improved-comments-removal
While I have quite some experience with regular expressions, this one is a bit complex, because of the 3 quotes that can be used to delimit a value, and have to match start/end to apply, within where the // is to be ignored. Having a dual character comment start isn't helping also. |
@tonhuisman maybe you could change these quotes temporary with one known just to find position of last |
@uzi18 I expect to have nailed it with current code, wouldn't want to complicate it further, and replacing quotes isn't going to help finding the comment-start quicker or easier, IMHO. |
Rules where quite rigorously stripped from comments, interfering with url's and // when used in strings.
Features:
http://myserver.local:8080/some/path
after the colon//
, the slashes are ignored when between matching quotes