Backslash implementation

Im implementing the ability to read a backslash and allow the next character to be allowed in the string. But how would i do that, I'm kinda confused. This is what i have now and it needs to stay the same but i need to add the ability to use the escape to allow a single wrote to not be read as the end of the string
but as a regular character.

if (c == SINGLE_QUOTE) {
type = PYSTRINGTOKEN;

lex = lex + c;
//eliminate the quotes on each end.
lex = lex.substr(1, lex.size() - 2);
c = in->get();
foundOne = true;

if (in->eof()) {
type = PYBADTOKEN;
}

} else {
if (in->eof()) {
type = PYBADTOKEN;
foundOne = true;
}
}

break;
Topic archived. No new replies allowed.