worldbank / stata-linter

MIT License
30 stars 15 forks source link

{} in comment creates error #57

Closed kbjarkefur closed 1 year ago

kbjarkefur commented 2 years ago

{} in a comment, for example * Missing space before {}, results in this error:


  File "<stdin>", line 1, in <module>
  File "c:\ado\plus\py\stata_linter_correct.py", line 177, in indent_in_bracket
    bracket_pair.append([loop_start.pop(), line_index, nest_level, bracket_start.pop()])
IndexError: pop from empty list
r(7102);```
luisesanmartin commented 2 years ago

I'm trying to replicate this error but it's not showing for me. When I try lint dofile.do in a dofile with this content

* Missing space before {}
set obs 10
gen var = _n

the expected output is returned image

I'm using the branch develop-v0-bugs as of July 18 2022. One possibility is that some of the errors I already worked on in this branch nd previously in develop addressed this problem.

@kbjarkefur when you have some time, please try to replicate this issue again and let me know how it goes. Thanks.