@Gribouillis
The example you provided is in parantheses, so it will be considered as not comment. Of course, people can do different strange variations, but these cases are very rare and I can leave them. I need a common algorithm for common case.
Thank you for you suggestion, I edited #3 for such cases
2. AND IF there are no characters (except whitespaces) after the closing quotes (on the line where these quotes are)
3. AND IF the line is not between ( ) or [ ] or { }
4. AND IF the previous line of code does not end with \
The example you provided is in parantheses, so it will be considered as not comment. Of course, people can do different strange variations, but these cases are very rare and I can leave them. I need a common algorithm for common case.
Thank you for you suggestion, I edited #3 for such cases
my_dict = { "key1": "not comment", "key2": "Not comment" } my_list = [ "Not comment", "Not comment" ]1. IF there are no characters (except whitespaces) before the opening quotes (on the line of code where these quotes are)
2. AND IF there are no characters (except whitespaces) after the closing quotes (on the line where these quotes are)
3. AND IF the line is not between ( ) or [ ] or { }
4. AND IF the previous line of code does not end with \