2 ms·
Reminds me of Steve Yegge's introduction of js2-mode, a new JavaScript mode for Emacs, and how hard it was to get its indentation right: Amazingly, surprisingl
by AceJohnny2 8y ago
Reminds me of Steve Yegge's introduction of js2-mode, a new JavaScript mode for Emacs, and how hard it was to get its indentation right:
Amazingly, surprisingly, counterintuitively, the indentation problem is almost totally orthogonal to parsing and syntax validation. I'd never have guessed it. But for indentation you care about totally different things that don't matter at all to parsers. Say you have a JavaScript argument list: it's just (blah, blah, blah): a paren-delimited, comma-separated, possibly empty list of identifiers. Parsing that is pretty easy. But for indentation purposes, that list is rife with possibility!
http://steve-yegge.blogspot.com/2008/03/js2-mode-new-javascript-mode-for-emacs.html http://steve-yegge.blogspot.com/2008/03/js2-mode-new-javascr...