I'll try to describe this (and this description may serve as the reason why I suppose this to be better than the cited above).
1. Erlang is case-sensitive; furthermore, the case of a identifier makes it an atom (all-lowercase or anything in single quotes) or a variable (has uppercase letters or starting with underscore).
2. We cannot use a list of lowercase letter prefixes to specify atoms, as it will override the folder opening/closing keywords; thus, the atoms are defined as standard style (and the DELIMINER2).
3. The variables are defined as a word starting with a upper-case letter or underscore (Words3).
4. Words2 defines a macro (i.e. a word starting with question mark); it is not quite true, as Erlang restricts macros to only uppercase letters and underscores; however, I cannot specify this here.
5. Comment line starts with a percent; it may be followed by any other character, so it must be treated as symbol.
6. Sharp (#) must be treated as an operator, or else constructs like Var#recordname are treated as a single variable, while really being a variable and an atom construct.
7. Colon should be treated as an operator, as it separates different atoms specifying module and function name (like in lists:nth/2).
8. Module names (including trailing colon) should not be keywords, as (a) they are countless, and (b) this use is only meaningful if they are treated as prefix, thus making the whole function name including the module name a keyword. And the same function without the module specification is not treated as keyword, thus creating an inconcistency.
Small additions of keywords are also made.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is an Erlang lexer in Scintilla, so it should be relatively easy to add it to Notepad++. Is there a reason why there are several lexers in Scintilla which are not listed by Notepad++ ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi can you please add erlang syntax highlighting!
Thanks for the great product!
Please consider adding this support!
There are multiple feature requests regarding this on the forum:
http://sourceforge.net/projects/notepad-plus/forums/forum/331753/topic/1739072
http://sourceforge.net/projects/notepad-plus/forums/forum/731514/topic/3498679
http://sourceforge.net/projects/notepad-plus/forums/forum/331753/topic/4066478
http://sourceforge.net/projects/notepad-plus/forums/forum/482781/topic/1856039
Please please :)
There is an Erlang user defined language definition file on NpWiki++ at http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=User_Defined_Language_Files Is it good enough?
CChris
I found the file you pointed at (http://notepad-plus.sourceforge.net/commun/userDefinedLang/userDefineLang_erlang.xml); also I've found a file made by Robert Horvick (http://www.roberthorvick.com/wp-content/uploads/2009/07/erlangSyntaxDefinition.zip).
They both aren't good enough.
Here is my settings:
I'll try to describe this (and this description may serve as the reason why I suppose this to be better than the cited above).
1. Erlang is case-sensitive; furthermore, the case of a identifier makes it an atom (all-lowercase or anything in single quotes) or a variable (has uppercase letters or starting with underscore).
2. We cannot use a list of lowercase letter prefixes to specify atoms, as it will override the folder opening/closing keywords; thus, the atoms are defined as standard style (and the DELIMINER2).
3. The variables are defined as a word starting with a upper-case letter or underscore (Words3).
4. Words2 defines a macro (i.e. a word starting with question mark); it is not quite true, as Erlang restricts macros to only uppercase letters and underscores; however, I cannot specify this here.
5. Comment line starts with a percent; it may be followed by any other character, so it must be treated as symbol.
6. Sharp (#) must be treated as an operator, or else constructs like Var#recordname are treated as a single variable, while really being a variable and an atom construct.
7. Colon should be treated as an operator, as it separates different atoms specifying module and function name (like in lists:nth/2).
8. Module names (including trailing colon) should not be keywords, as (a) they are countless, and (b) this use is only meaningful if they are treated as prefix, thus making the whole function name including the module name a keyword. And the same function without the module specification is not treated as keyword, thus creating an inconcistency.
Small additions of keywords are also made.
There is an Erlang lexer in Scintilla, so it should be relatively easy to add it to Notepad++. Is there a reason why there are several lexers in Scintilla which are not listed by Notepad++ ?
@mikekaganski:
I'lll upload your file shortly, citing you as th e maintainer
@frboyer:
Adding a language requires some N++ code changes - a setErlangLexer() procedure and all the things it can affact. This has been an old request in the forums, and see also http://sourceforge.net/apps/ideatorrent/notepad-plus/ideatorrent/idea/346/. I have +1'ed it long ago.
CChris
Hello CChris!
I see you have added me as the maintainer at http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=User_Defined_Language_Files. But my email is incorrect; it should end with gmail.com, not users.sourceforge.net.
Thank you.