[code] [Textadept] Enriching Lua highlighting, have some questions

From: Advert Slaxxor <advertslaxxor.att.gmail.com>
Date: Sat, 29 Mar 2014 22:40:46 +0000

I'm thinking about adding some features to Textadept's Lua lexer and
module, but I was wondering if anyone has attempted (or done) this before.
I'm also looking for some feedback, suggestions, and the like :)

What I'm looking to do is:

- Add more tokens, for styling/highlighting/coloring (I'll call this
'styling' from now on) different things. (i.e `and not or` -> different
style than `false nil true` -- I've already tested the waters by doing
this, it was surprisingly easy, thanks to the great documentation!)

- Style 'fields' (table.<field>), locals, 'surprise globals' (unknown to
the editor, i.e one-line file: `print(x)` -- `x` would be a 'surprise
global', since it's referenced before it's assigned), and globals
differently from one another.

- Think about more stuff to do once this is done. There's lots I want to
mess around with, but the above are probably the most useful/practical.

My plan of attack so far:

- Make the lexer strict. My problem with this is that the current one does
not track state, except for when it's doing embedded lexers.

- Lots of new tokens. Need to name them reasonably, but that'll be the easy
part :)

- Generate AST from the lexer, somehow. Maybe just use the token stream to
generate AST.
This shouldn't be necessary if the lexer can keep state, but there's so
much fun stuff that's possible with AST.

Does this look good? Is there anything I'm missing? How about features you
would like to see added? Maybe it's too bloat-y? (though, I don't mind
going all out on styling/inspection)

- Advert

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Sat 29 Mar 2014 - 18:40:46 EDT

This archive was generated by hypermail 2.2.0 : Sun 30 Mar 2014 - 06:29:06 EDT