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

Needs better regexp so as to consider quoted comments as strings/literals #2

Open
ahmedazhar05 opened this issue Jun 18, 2022 · 0 comments

Comments

@ahmedazhar05
Copy link
Owner

#(" - 'line # not comment'", " - 'line # not comment'"), # TODO: test fails here, needs fixing
#("key: ' # value'", "key: ' # value'"), # TODO: test fails here, needs fixing
#("- line ' #not a comment here' : value", "- line ' #not a comment here' : value"), # TODO: test fails here, needs fixing
#("'obje #ct': value", "'obje #ct': value") # TODO: test fails here, needs fixing

The lines above are test-cases that are failing because the quoted lines are considered as comments but are supposed to be considered as strings/literals instead.

To fix that there needs to be a better regular expression for the line below.

mat = re.match(r' *(?!#)[^ \n].*?(?=$|\n| +#)', line)

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

No branches or pull requests

1 participant