diff --git a/vyper/ast/parse.py b/vyper/ast/parse.py index 7c3f285050..20cc483a63 100644 --- a/vyper/ast/parse.py +++ b/vyper/ast/parse.py @@ -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