Syntax Highlighting for D programming language
gamer Chad
gamerchad at gmail.com
Mon Mar 12 07:48:44 CET 2007
Hello,
I wrote some syntax highlighting in nedit for the D programming
language, and was wondering if you could add it to nedit for others to
use.
I'm assuming all of the relevant bits are in ~/.nedit/nedit.rc and I
figured that would be the best way to send this info, so here it is:
--- The D highlighting chunk ---
D:1:0{\n\
comment single line:"//":"$"::Comment::D\n\
comment multiline:"/\\*":"\\*/"::Comment::\n\
comment nested 1:"/\\+":"\\+/"::Comment::\n\
comment nested 2:"/\\+":"\\+/"::Comment:comment nested 1:\n\
comment nested 3:"/\\+":"\\+/"::Comment:comment nested 2:\n\
comment nested 4:"/\\+":"\\+/"::Comment:comment nested 3:\n\
comment nested 5:"/\\+":"\\+/"::Comment:comment nested 4:\n\
comment nested 6:"/\\+":"\\+/"::Comment:comment nested 5:\n\
comment nested 7:"/\\+":"\\+/"::Comment:comment nested 6:\n\
comment nested 8:"/\\+":"\\+/"::Comment:comment nested 7:\n\
comment nested 9:"/\\+":"\\+/"::Comment:comment nested 8:\n\
comment nested 10:"/\\+":"\\+/"::Comment:comment nested 9:\n\
string:"x?""":"""[cdw]?"::String::\n\
string qoute escape:"((\\\\"")|[^""])*":::String:string:\n\
wysiwyg string:"(`(.|[\\n])*?`)|(r""(.|[\\n])*?"")":::String::\n\
character:"'((\\\\['""?\\abfnrtv])|[^']){0,1}'":::Preprocessor1::D\n\
keywords - special
values:"<(?:true|false|null|this|super)>":::Numeric Const::D\n\
keywords - basic
types:"<(?:delegate|function|bit|bool|byte|ubyte|short|ushort|int|uint|long|ulong|cent|char|wchar|dchar|float|double|real|ifloat|idouble|ireal|cfloat|cdouble|creal|void)>":::Storage
Type::D\n\
keywords - everything
else:"<(?:abstract|alias|align|asm|assert|auto|body|break|case|cast|catch|class|const|continue|debug|default|delete|deprecated|do|else|enum|export|extern|final|finally|for|foreach|foreach_reverse|goto|if|import|in|inout|interface|invariant|is|lazy|mixin|module|new|out|override|package|pragma|private|protected|public|return|scope|static|struct|switch|synchronized|template|throw|try|typedef|typeid|typeof|union|unittest|ushort|version|volatile|while|withdelegate|function|bit|bool|byte|ubyte|short|ushort|int|uint|long|ulong|cent|char|wchar|dchar|float|double|real|ifloat|idouble|ireal|cfloat|cdouble|creal|void)>":::Keyword::D\n\
hex float:"<(0[xX][A-Fa-f0-9_]+(\\.[A-Fa-f0-9_]+)?([pP][-+]?[0-9_]+)?[fFL]?i?)>":::Numeric
Const::D\n\
dec float:"<([0-9_]+(\\.[0-9_]+)?([eE][-+]?[0-9_]+)?[fFL]?i?)>":::Numeric
Const::D\n\
binary:"<(0[bB][01_]+(L[uU]?|[uU]L?)?)>":::Numeric Const::D\n\
hex:"<(0[xX][A-Fa-f0-9_]+(L[uU]?|[uU]L?)?)>":::Numeric Const::D\n\
decimal:"<([0-9_]+(L[uU]?|[uU]L?)?)>":::Numeric Const::D\n\
braces:"[{}]":::Keyword::\n\
}
--- D filetype line (pretty much the same as C, but with .d and .di) ---
D:.d .di::::::".,/\\`'!|@#%^&*()-=+{}[]"":;<>?~":\n\
More information about the Develop
mailing list