Timeline for Which is a more efficient approach to decoding escape sequences in text?
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 23, 2018 at 12:24 | comment | added | user251748 | The universe seems to have a deep crack in it, in that so many things break down to two irreconcilable cases! Duality. | |
| Sep 12, 2017 at 21:43 | vote | accept | rgchris | ||
| Sep 11, 2017 at 13:22 | history | tweeted | twitter.com/StackSoftEng/status/907232790953054208 | ||
| Sep 11, 2017 at 5:36 | comment | added | rgchris | @kevincline It's less the how and more the where in the tokenization process you recognize and resolve escape sequences (see first answer). It isn't exclusively a Rebol question—I just use Rebol notation to illustrate the different approaches and it is frequently encountered topic in Rebol parsing. | |
| Sep 11, 2017 at 3:14 | comment | added | kevin cline | Suggest putting rebol in the question instead of leaving it for the tag. | |
| Sep 10, 2017 at 19:20 | answer | added | amon | timeline score: 6 | |
| Sep 10, 2017 at 19:10 | comment | added | rgchris | @kevincline Note the rebol tag—there is no regex and Parse can act like one big finite state machine. Making copies of portions of the input string is one consideration, as is over-processing each instance of an escape sequence which each approach above has a danger of in its own way. | |
| Sep 10, 2017 at 19:03 | comment | added | rgchris | @kevin-cline The problem is deciding which of these approaches to go with. They all have their own complexities. | |
| Sep 10, 2017 at 18:59 | comment | added | kevin cline | What's the problem? Are you having trouble recognizing the string token or converting a the string with escape sequences into the desired string value? The first is easily done with a regular expression, the second problem is similar but a hand-written finite-state machine will be fine. These techniques are maximally efficient. Just be careful not to make unneeded intermediate copies of the input text. | |
| Sep 10, 2017 at 18:44 | history | asked | rgchris | CC BY-SA 3.0 |