fparser icon indicating copy to clipboard operation
fparser copied to clipboard

fparser2 fails to generate code if Specification Part is empty

Open arporter opened this issue 3 years ago • 0 comments

In PSyclone we still manipulate the fparser2 parse tree in certain circumstances. I've found that if one deletes all the content from a Specification_Part node then asking for the string representation of the parse tree fails with:

>       start = self.content[0]
E       IndexError: list index out of range

/home/me/.python_envs/py3/lib/python3.8/site-packages/fparser/two/utils.py:774: IndexError

I would expect this to just return an empty string.

arporter avatar Jun 27 '22 12:06 arporter