implemnting a backslash escape key

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 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.