Thread Previous • Date Previous • Date Next • Thread Next |
On 04/04/2010 04:04 PM, Eric Day wrote:
I'm not up on Python lexers/parser generators. Can anyone else comment on Ply?
It's already being used in boots - so there should be some decent example code in there.
> Also I have questions related to it. > Q0. Am I right ?So far it sounds good, I'd see what some of the other devs have to say.> Q1. Do we then need to do a character by character scan to look for > tokens as they come? I think that if this blueprint is to support > syntax-highlighting in future then character by character scan will be > needed.Initially I would only worry about scanning for completion on TAB, but you certainly could do scans for each character for things like syntax highlighting.
I would highly recommend not building your own completion scanner by hand. The readline module or the rlcompleter module in the python standard library are probably what you want to use for this. Check out:
http://blog.doughellmann.com/2008/11/pymotw-readline.html For a quick how-to on how to use it.Using readline also gives you history and command line editing in addition to hooks for completion.
Monty
Thread Previous • Date Previous • Date Next • Thread Next |