Skip to content

Commit

Permalink
Adds support for inline #comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dmalan committed Jan 26, 2023
1 parent 98b7cbc commit d172580
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion render50
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ def main():
if args.INPUT:
inputs = args.INPUT
else:
inputs = [line.strip() for line in sys.stdin.readlines()]
inputs = []
for line in sys.stdin.readlines():
elements = re.split(r"(?:^|[^\\])#", line.strip())
if element := elements[0].rstrip().replace("\#", "#"):
inputs += [element]

# Check for includes
includes = []
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
python_requires=">=3.6",
scripts=["render50"],
url="https://github.com/cs50/render50",
version="9.0.3"
version="9.1.0"
)

0 comments on commit d172580

Please sign in to comment.