In case anyone is interested... here are some syntax highlighting regexes
for the nedit editor for rust. Just add to your .nedit
"nedit.highlightPatterns:" section.
Rust:1:0{\n\
Macro:"[\\l_]\\w*!":::Preprocessor1::D\n\
Function:"fn ([\\l_]\\w*)":::Keyword::D\n\
Function name:"\\1":""::Subroutine:Function:DC\n\
Module:"(?:[\\l_]\\w*::|::)":::Identifier2::\n\
Keyword:"<(?:as|fn|break|copy|if|else|drop|in|do|for|while|loop|return|trait|type|unsafe|use|let|match|print|println|mod|self|super|priv|pub|use|impl|false|true)>":::Keyword::D\n\
Storage Type:"<(?:mut|static|extern|struct|enum|ref)>":::Storage Type1::\n\
Numeric:"(?<!\\Y)(?:(?:0(?:x|X)[\\da-fA-F_]*)|(?:(?:\\d+\\.?\\d*)|(?:\\.\\d+)|_)(?:(?:e|E)(?:\\+|-)?\\d+)?(?:f32|f64)?)(?:L|l|u|U|F|f|u8|u16|u32|u64|i8|i16|i32|i64)?(?!\\Y)":::Numeric
Const::D\n\
String:"""":""""::String::\n\
String escape chars:"\\\\(?:.|\\n)":::String2:String:\n\
Storage:"<(?:float|f32|f64|int|i8|i16|i32|i64|uint|u8|u16|u32|u64|bool)>":::Storage
Type::\n\
Braces:"[{}]":::Keyword::D\n\
C99comment:"//":"$"::Comment::\n\
Comment:"/\\*":"\\*/"::Comment::\n\
Operators:"(?:-\\>|=\\>|\\(\\*\\))":::Operator::\n\
Generic:"\\<(?!\\s)":"\\>(?! *\\>)(?!,)":"[|;""=$-]":Pointer::\n\
Module Generic:"(?:[\\l_]\\w*::|::)":::Identifier1:Generic:\n\
Character:"'[\\\\\\w]*'":::Character Const::\n\
Pragma:"#\\[":"\\]"::Preprocessor::\n\
Pragma String:"""":"""":"\\n":String1:Pragma:\n\
Definition:"[a-z_]+[a-z\\d_]*[ ]*:":::Bold::\n\
String fmt:"\\{":"\\}":"""":Text Arg1:String:\n\
String fmt2:"\\{":"\\}":"(?:\\{|"")":Text Escape:String fmt:\n\
Lambda Params:"(?:(?<=[\\(,=])
*\\|[^\\n|]*\\||\\|[^\\n|]*\\|(?=\\s*\\{))":::Chocolate::\n\
}
I've used some hacks to get generics looking okay... but it mostly works.
Steven
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev