Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pypreprocessor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ def __if(self):

# evaluate
def lexer(self, line):
# return values are (squelch, metadata)
# strip any and all leading whitespace characters
line = line.lstrip()
# return values are (squelch, metadata)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the sake of docstrings, I would suggest the other way around:

"""Returns (squelch, metadata)."""
# strip leading whitespace characters for compatibility with the C preprocessor.
line = line.lstrip()

if not (self.__ifblocks or self.__excludeblock):
if 'pypreprocessor.parse()' in line:
return True, True
Expand Down