From: Roger Pack Date: 2009-05-27T20:37:52+09:00 Subject: Re: Pythonic indentation (or: beating a dead horse) > This script uses RubyLexer to extract a stream of tokens and modify > it, then turn those tokens back into ruby code. Since RubyLexer is a > complete stand-alone lexer, this should be a very thorough solution, > free of insoluable little problems due to the script's inability to > follow where comments and strings start and stop. (That said, I'm sure > there will be some problems with it, as it's pretty raw code.) > > As different programs have a variety of interpretations as to the > width of a tab character, tabs for indentation are absolutely > forbidden by endless.rb. > > If you're interested, please see: > http://gist.github.com/117694 Could you post us a few examples of what code formatted this way looks like (or must look like)? I assume it handles here documents well? The italics part of that gist is somewhat hard to read :) @Michael: I don't think having "either or" syntax would be such a terrible thing in terms of team re-use or resources--you should be able to convert the code back and forth at will (a la ruby2ruby, parsetree [rubylexer has a parsetree compatibility mode] etc.) Cheers! -=r -- Posted via http://www.ruby-forum.com/.