News for hackers. Stuff that matters.
Re:The Definitive Guide to Syntax Highlighting by platz on Sunday September 28, 2014 @02:19AM (#8379090)
I've seen more than one talk where the presenter lamented a lack of highlighting based on highly nested structures. So, for example, changing the color based on the closure that one is in. Or, changing the color based on the execution context one is in (so one can make sure they are modifying the variable in the appropriate context).

This would be useful in langues that make heavy use of callbacks such as javascript or scala.

Not sure how hard it would be to implement though - it might require a full parse or compiler pass.

Re:The Definitive Guide to Syntax Highlighting by philbo on Sunday September 28, 2014 @06:20AM (#8379363)
There are actually a few implementations of this for JS, it is an approach that Crockford has championed quite a bit (e.g https://plus.google.com/+DouglasCrockfordEsq/posts/XXkzgJEoE...).

Some implementations that I'm aware of, there may be others:

* http://www.vim.org/scripts/script.php?script_id=4748

* https://github.com/mazurov/sublime-levels

* https://github.com/daniellmb/JavaScript-Scope-Context-Colori...

Re:The Definitive Guide to Syntax Highlighting by seanmcdirmid on Sunday September 28, 2014 @05:23AM (#8379303)
Parsing is easy to do incrementally, but you could get there just by matching braces. I think Python-like offside rules are better for highlight purposes, however; e.g. see:

http://research.microsoft.com/en-us/projects/liveprogramming...