I am attempting to write a grammar for a small language utility using the python library parsimonious, but I am struggling with writing a part, which covers strings, especially strings with escaped quotes and other special characters.
I have the following:
string = doubleString / singleString
doubleString = "\"" escapedString "\""
singleString = "'" escapedString "'"
escapedString
is as if yet undefined, but should accept anything one would reasonably expect a string in a programming language to accept. I cannot think of where to begin. Does anyone have any suggestions?