Description
See the linked review comments for more details. The jist of it is that when an %ES; is in a delimiter, the associated DFA is not getting compiled correctly, and it actually will match a literal %ES;. There is code in DelimiterParser.scala that inefficiently looks for ES when a match isn't found, and accepts it as an empty match. Instead, the DFA scanner should be returning the %ES; as a successful match in the parse results, and then DelimiterParser.scala can use the same logic to determine which DFA matched. This would allow us to get rid of the hasES functions and be more efficient.
Note that some things may be tricky because when scanning for a delimiter, we have to ignore the %ES;, since they'll match anything. We may need new iterators that ignore these.
This is a fairly major change, only relates to parsing. The only negatives of not fixing this is 1) performance could be improved and 2) this could match a literal %ES; in the data. Since this release is focued on unparsing and it's very unlikely for data to have a literal %ES; in it, we'll punt this to the next release.