Skip to content

Commit

Permalink
Strip out inline comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fergalwalsh committed Apr 25, 2024
1 parent 6e80326 commit e869f45
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tealish/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ def consume_line(self) -> str:
# check the type is not None
return # type: ignore
line = self.source_lines[self.line_no].strip()
# strip out inline comments
if not line.startswith("#"):
line = line.split("#")[0]
self.line_no += 1
return line

Expand Down

0 comments on commit e869f45

Please sign in to comment.