scintillua
scintillua copied to clipboard
Add xml lexer performance improvement used in vis
This adds performance improvements for the xml lexer added to vis in commits: 7e9e0a2ca868aaa214fb38a79fe71da34d6e00da and baa51e934ce057af5b5be829d6a73a3e8b4c03d0
This change does not correctly handle the following input:
<size
width=100
height=100>
The "width=100" line will not be highlighted correctly, but the line below it will. This is why I had to use a function for look-behind.
Note that currently there is no performance penalty because that look-behind function is not called. ('=' is not highlighted at all, and "=[number]" sequences are still highlighted, but not necessarily in the context of attributes.)
This change does not correctly handle the following input:
<size width=100 height=100>
Just that this is not correct XML, attributes must be quoted. For my test text (18 MB text of Bible) it seems to work just fine:
All three related PRs are rebased on the current master
in the devel
branch, i.e. in https://git.sr.ht/~mcepl/vis/commit/92e7198cfc81
Closing per comments in #118.