- some example files would be helpful because most of us probably don't
know Erlang (at least me)
You'll find attached some source code from Twoorl (Twoorl is an open source Twitter clone written in Erlang using the ErlyWeb framework), this is the code I used to build this lexer. I slightly modified them to check some features. You can find the original source code here :
http://code.google.com/p/twoorl/
- what about the Scintilla Erlang Lexer? The copyright notice in the
lexer in your patch states you wrote it?
Waow, my fault :( I indeed wrote it, because I thought if it wasn't included in Geany, it wasn't in Scite/Scintilla too...
What's wrong with the Erlang
lexer available in Scintilla? Is it a different one? Is one the both
better? Why another one?
So, yes, it is a different one. Maybe not so better, but here is a short comparison :
Both supports :
- Comment, Module Attributes, Preprocessor, Functions, Numbers, Var, String, Char
Scite/Scintilla only :
- Code folding
- Exponent in numbers
- Node name (somename@somewhere)
- Parse error mode
Mine only :
- Separate colors for module:function_name
- Detects built-in functions
- Handle "_" as catch-all var
- EDoc (Javadoc like, for erlang)
- EDoc macros
- Support for Erlang Header files (*.hrl)
- Support 3 comment levels (EOL comments, Function comments and Module comments)
I don't really know if mine is "better" according to the code, but it seems to include more features.
I use 6 lists of "keywords" (Reserved words, BIFs, Module attributes, Preprocessor, Edoc, Edoc macro) while Scite/Scintilla use only one to detect reserved words. So one can simply add a keyword... and can have differents colors for each categories, rather than only one and for reserved words.
Also, Scite Lexer color erlang atoms. But, atoms, module name, and functions are colored the same way. I think that it is better to consider them independently to improve document reading.
- I forgot to add node name support and didn't know how to add code folding support too. But I can try to add them looking at Scite code...
- Doh. Forgot exponent in number too!
- I'll have some more work for parsing error. I didn't need it, but I will have a look.
- when creating patches, the unified diff format is preferred (-u
option for the diff command) or even simpler use: 'svn diff'
Okay, next time will be the good one!