Open lindig opened 5 years ago
This could be useful also in other places. Like the json parser, e.g. https://github.com/nojb/tinyjson/blob/master/lib/json.mll
On a separate note, I think markup.ml has the most comprehensive dictionary of entities for encode and decode: https://github.com/aantron/markup.ml/blob/master/src/entities.ml
This is nice example for the power of OCamlLex and how to effectively use the different states (or sub-scanners).
This is just an idea: the implementation of escape rules for Xml (or other transports) could be also delegated to an efficient regexp engine specified by OCamlLex: