Closed KristofferC closed 1 year ago
How you are getting escaped strings in a PSF file?
Never mind, I see it now. The design field is simply the first line in a Spectre netlist, which may contain quote characters.
I have worked out the solution for this but won't release it until I look at and try to resolve your other issues. In the mean time you can replace line 163 with the following:
t_STRING = r'"([^\\\n"]|(\\.))*"'
That should resolve this problem.
I have pushed this fix on to GitHub. Please check it out and confirm that it works as expected. Once I hear back from you and things settle down, I will release it to PyPI.
For example, a file with the following header:
gives the error:
What is expected is to get a value of the unescaped string
("test" "sweep" "schematic" "")
I think this way of matching against strings:
https://github.com/KenKundert/psf_utils/blob/f0c354243f78b7ab3e76d150de6ca1b72521946a/psf_utils/parse.py#L162-L163
is a bit too simplistic in the presence of escaping.