On Fri, Feb 26, 2010 at 4:06 PM, Edward K. Ream <[email protected]> wrote:
> That's about it. I have studied 2to3 and pylint in enough detail to > be quite confident that my approach is fundamentally simpler than > using ast's or streams of tokens. > > It would also be reasonable to convert 2to3 into a pep8 fixer. After > all, both rewrite code. But the mechanics behind 2to3 are > horrendously complex. I want to base my code on something dirt > simple: a generic python scanner. It's the way I think. More > importantly, many fixers are fundamentally involved with characters. > Trying to "abstract" characters away actually makes things harder. P.S. I have just now seen why my approach is fundamentally sound. We can use a scanner to do the work because the work is like the (token) scanner pass of a compiler. Otoh, it would be unreasonable to implement pylint this way--pylint uses ast (parse) trees because pylint must analyze program structure like an (optimizing) compiler would. In contrast, the pep8 fixer needs no such information; it simply does localized string replacements. EKR -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
