roxmltree icon indicating copy to clipboard operation
roxmltree copied to clipboard

RFC: Drop tokenizer::Token intermediate data structure and XmlEvent trait

Open adamreichold opened this issue 1 year ago • 2 comments

As discussed previously here, this simplifies the code base, especially the interaction between tokenizer and parser. However, it also appears to imply that we have to drop the tokenizer test which intimately rely on the intermediate token representation.

Further code clean-ups are possible, e.g. standardizing on methods on Context instead of free functions, but this change aims for a minimal change while we discuss this.

adamreichold avatar Jan 26 '25 09:01 adamreichold

Looks good, but we must keep the tests. Removing them is not an option. Not sure what we can do about it.

RazrFalcon avatar Jan 28 '25 10:01 RazrFalcon

Not sure what we can do about it.

The only thing that comes to my mind is conditional compilation, i.e. have a cfg flag that yields a completely different definition and implementation of Context which still collects tokens. But to be honest, considering that the devirtualization has already reaped most of the available performance benefits, I am not sure if this is worth it. Especially since it negates the main benefit of this change: simplifying the code.

adamreichold avatar Jan 28 '25 18:01 adamreichold