Closed bfontaine closed 4 years ago
I mistakenly clicked on “New PR” instead of “New Draft PR” 🤦♂
Thanks bfontaine
I ended up removing the tests: since this is just passing options down to PLY, testing this would mean testing PLY’s internals.
PLY It doesn’t close its debug file (https://github.com/dabeaz/ply/issues/200) so we have no way to guarantee that os.path.isfile("…path to the debug file…")
is True
at any point before the end of the program.
This adds a way to remove the warnings in #65.
This is a draft PR because this works appear to work when I try it but I don’t know why my tests don’t pass. It’s midnight here so I’ll look into it tomorrow.
This PR adds two keyword arguments to the
parse
andparse_all
functions:debug
(default:False
): this allows to control PLY’sparser.out
debug file. Instead of relying on__debug__
, which is virtually alwaystrue
, we now default on not writing this file unless one passesdebug=True
.write_ply_tables
(default:True
): this is passed to PLY’syacc.yacc
aswrite_tables
(see the docs). It’sTrue
by default because it’s PLY’s default behavior, but one can disable this to prevent PLY from trying to write aparsetab.py
cache file. It’s less efficient to do so, but it may help some people like on #65.