We are relying on a hacky bespoke algorithm to parse escape sequences, but it is inefficient as we have to scan all possibility each time a a character is added. Using a trie would let us quickly match the character. We could also keep some kind of state about progress in the trie in the parser.
This is probably a substantial performance improvement on input parsing, although input parsing is probably not a super performance sensitive concern for most applications. The current hacky solution seems to work well enough to be reasonably responsive for most cases.
We are relying on a hacky bespoke algorithm to parse escape sequences, but it is inefficient as we have to scan all possibility each time a a character is added. Using a trie would let us quickly match the character. We could also keep some kind of state about progress in the trie in the parser.
This is probably a substantial performance improvement on input parsing, although input parsing is probably not a super performance sensitive concern for most applications. The current hacky solution seems to work well enough to be reasonably responsive for most cases.