The idea behind per-word highlighting is to show things that are different different and thing which are the same - the same. So 'edx' is visually much different from 'ebx' and 'uint_16' from 'uint_64'. I've been using per-word highlighting for reviewing code in C, C++ and Assembly and it has always been a great help.
Here's an example of what I mean: http://awesomescreenshot.com/0bd3072r87 The above is plain code and below is the same piece per-word highlighted.
On the other hand, in high level languages we woudn't mix 'if' for 'else' anyway, but we'd like this words to denote a code structure, so syntax highlighting, not per-word, is preferable.
I've made a hack, that brings complementary per-word highlighting over syntax highlighting provided by 'pygments'.
Here's the code for a colorer:
https://github.com/akalenuk/codrspace/blob/master/apps/codrspace/pygments/over_pygments.py
And that's about how I think of patching the templatetag, so one could chose per-word coloring for user defined words by adding 'more_colors' to a 'code' tag:
akalenuk@29ea2fc#diff-1
It's all ready and working in my fork (the example from above is a locally hosted Codrspace screenshot) and I'm ready to send a pull request any moment. Yet I'm not sure about if this hack is the right way to go. I mean, it isn't orthogonal to pygments and it is not a fair patch on it. It just parasites on its output. If I were to review my own code, I would mark this as a potential malleability issue.
So, what do you think?