Hi list, A while ago Lex and I discussed improving custom filetypes, and the most promising thing was using Lua lexers.
*This is not a clear idea for adding support yet.*
Here follows snippets of the discussion and some new links at the end.
On Thu, 23 Sep 2010 13:39:34 +0100 Nick Treleaven nick.treleaven@btinternet.com wrote:
Some of my current work involves the customers domain specific language (DSL), forcing me to use EMACS since they have a mode for the DSL.
...
- Emacs is way more configurable due to elisp, thats why the mode to
support the DSL was done in Emacs. Of course the requirement to write language support in C/C++ is a tagmanager/Scintilla requirement, but Geany inherits that problem.
I think plugins can lex/highlight a document themselves through Scintilla's APIs, but it may be a bit awkward adapting an existing lexer for use by a plugin only. Although if a plugin wrapper for Scintilla lexers is possible, it would be useful for all lexers Geany doesn't include.
There is a project that uses Lua scripts to lex quite a lot of languages - a plugin using this for Geany might be a good idea.
I don't know Lua but I guess it would be better than having to build a dynamic loadable library from C/C++. Can the GeanyLua plugin do any of this? I've only glanced at it?
GeanyLua is for scripting, I was talking about a Scintilla Lua lexing addon - apparently SciTE now has support for this:
Interesting, I wasn't aware of this. Does it work in Geany?
Geany has no support for it, I haven't looked at how SciTE does it.
Found the original project that does this (the next version of SciTE will have support for this): http://code.google.com/p/scintillua/ http://code.google.com/p/scintillua/wiki/LexerList
Haven't looked at it really but it mentions universal color schemes, so I'll investigate sometime - this could be useful for adding named styles.
Nick
On 10/22/2010 06:00 AM, Nick Treleaven wrote:
Hi list, A while ago Lex and I discussed improving custom filetypes, and the most promising thing was using Lua lexers.
[snip]
Found the original project that does this (the next version of SciTE will have support for this): http://code.google.com/p/scintillua/ http://code.google.com/p/scintillua/wiki/LexerList
Haven't looked at it really but it mentions universal color schemes, so I'll investigate sometime - this could be useful for adding named styles.
Nick
Hi Nick,
I quickly skimmed over the documentation you linked, and it seems like it could be a great addition to Geany. I don't know any Lua (though I'm aware it's a popular scripting language), but it looks simple enough. I can imagine the potential usefulness in a few cases:
1) Rapidly prototyping new language lexers. 2) Extending currently-available native lexers(?) Example: making the JavaScript lexer (Actually, it's the C++ lexer!) aware of E4X [1] language features. Namely, the addition of XML as a first-class data type [2].
I'm not wuite sure about extending the native lexers, but that would be really cool! ;)
[1] ECMAScript for XML: http://en.wikipedia.org/wiki/E4X [2] https://sourceforge.net/tracker/?func=detail&atid=352439&aid=3005577...