boots-developers team mailing list archive
-
boots-developers team
-
Mailing list archive
-
Message #00004
Re: Regarding the blueprint on Perform proper parsing on lingo input.
Hi
I went through that blog article, it is really very helpful in
understanding readline basics.
On Mon, Apr 5, 2010 at 5:44 AM, Monty Taylor <mordred@xxxxxxxxxxxx> wrote:
> 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.
>
I think that, if tab completion were to be done proper parsing has to be
done to identify the probable matches for completion in a particular
context.
I was unable find such parsing in boots source code. So, can you please
guide me to the part of source code does parsing for sql lingo.
>
> > 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.
>
>
Yes use of readline has great advantages. But I am not able to figure out
that could it also help in implementing syntax highlighting?
> Monty
>
Thanks,
Ashish
irc : _buck @ irc.freenode.net
openid : https://launchpad.net/~eraser029
Follow ups
References