On Wed, Dec 21, 2011 at 15:03, Andrea Crotti <andrea.crott...@gmail.com> wrote:
> I just had the following (maybe stupid) idea.

Not at all... it sounds like you want to look at the ast module.

Matthew Desmarais gave a talk on doing things like this (mostly for
code analysis) at PyCon, called "What Would You Do With An AST?"; a
quick Google should find both the video and the slides.

> Now would not it be possible to write a simple tokenizer that takes a python
> file and returns a nice structured format of the same, that python-mode
> can interpret to colorize/manage the code?

Most of that is already done in ast; the hard(er) part is walking the
tree and using the results.

-- 
Tim Lesher <tles...@gmail.com>
_______________________________________________
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode

Reply via email to