Skip to content
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

fix(regex): Add negative lookbehind for string #32

Merged
merged 1 commit into from
Oct 6, 2021

Conversation

GMishx
Copy link
Member

@GMishx GMishx commented Apr 28, 2021

Add negative lookbehind to single line comment regex to make sure the comment symbol is not part of a string ('#' is a string, not a comment).

Add new function hashNoCurl() for Ruby's #{} string syntax.

Also, updated readMultiLineSame() to check if the comment starts and ends in the same line and do not pick a line with comment symbol in string.

Removed the unused sign from readSingleLine().

Signed-off-by: Gaurav Mishra mishra.gaurav@siemens.com

Add negative lookbehind to single line comment regex to make sure the
comment symbol is not part of a string ('#' is a string, not a comment).

Add new function `hashNoCurl()` for Ruby's #{} string syntax.

Also, updated `readMultiLineSame()` to check if the comment starts and
ends in the same line and do not pick a line with comment symbol in
string.

Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
@GMishx GMishx force-pushed the fix/comment-in-string branch from a335e4a to f0f14c0 Compare April 28, 2021 15:43
@GMishx
Copy link
Member Author

GMishx commented Apr 28, 2021

Test cases are fixed in #33 along with code quality improvements. Should I cherry-pick them or the branches can be merged separately?

@Kaushl2208
Copy link
Member

Kaushl2208 commented Oct 6, 2021

Hey @GMishx , You can cherry pick them! It will be easier to test as well!

@GMishx
Copy link
Member Author

GMishx commented Oct 6, 2021

I wanted to keep the fixes for test cases separate. There are many other changes as well in how test cases work. So I created separate PR #33

@Kaushl2208 Kaushl2208 merged commit 98f57de into master Oct 6, 2021
@GMishx GMishx deleted the fix/comment-in-string branch October 6, 2021 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants