I found the answer in my latest post, please look at that for the new question I have...
After looking at that post, it seems that implementing the changes I mentioned here should alleviate the problem. In particular, the change mentioned in the third code block is what'll fix the string issue. I've put it below for reference:
if char == "\"" or char == "'":
tok = tok[:-1] # get rid of the " or ' added to tok
state = True # set the state to be in a string
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.