Skip to content

Commit

Permalink
fix 0-line files
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Nov 18, 2024
1 parent 56f851f commit 9f9ced9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vyper/ast/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ def generic_visit(self, node):
node.lineno = 1
node.col_offset = 0
node.end_lineno = len(self.source_lines)
node.end_col_offset = len(self.source_lines[-1])

if len(self.source_lines) > 0:
node.end_col_offset = len(self.source_lines[-1])
else:
node.end_col_offset = 0

adjustments = self._pre_parse_result.adjustments

Expand Down

0 comments on commit 9f9ced9

Please sign in to comment.