mcedit: basic syntax file for rust language

Laurent Wandrebeck l.wandrebeck at quelquesmots.fr
Tue Oct 4 11:03:05 UTC 2016


Hi there,

Please find attached a syntax file to add (basic, and probably still a
bit buggy) rust support.
Only addition needed to Syntax file is:

file .\*\\.rs$ Rust\ssource
include rust.syntax

Please evaluate it for inclusion.

Thanks,
-- 
Laurent Wandrebeck <l.wandrebeck at quelquesmots.fr>
-------------- next part --------------
# Syntax rules for the Rust programming language

# black, blue, brightblue, brightcyan, brightgreen, brightmagenta,
# brightred, brown, cyan, gray, green, lightgray, magenta, red, white,
# yellow 

context default
    keyword whole auto yellow
    keyword whole break yellow
    keyword whole bool yellow
    keyword whole case yellow
    keyword whole char yellow
    keyword whole const yellow
    keyword whole continue yellow
    keyword whole crate brightgreen
    keyword whole do yellow
    keyword whole double yellow
    keyword whole else yellow
    keyword whole enum yellow
    keyword whole extern yellow
    keyword whole f32 yellow
    keyword whole f64 yellow
    keyword whole fn yellow
    keyword whole for yellow
    keyword whole goto yellow
    keyword whole i8 yellow
    keyword whole i16 yellow
    keyword whole i32 yellow
    keyword whole i64 yellow
    keyword whole if yellow
    keyword whole impl yellow
    keyword whole isize yellow
    keyword whole let brightmagenta
    keyword whole match yellow
    keyword whole mut brightgreen
    keyword whole pub yellow
    keyword whole register yellow
    keyword whole return yellow
    keyword whole self yellow
    keyword whole sizeof yellow
    keyword whole static yellow
    keyword whole str yellow
    keyword whole String yellow
    keyword whole struct yellow
    keyword whole switch yellow
    keyword whole trait yellow
    keyword whole u8 yellow
    keyword whole u16 yellow
    keyword whole u32 yellow
    keyword whole u64 yellow
    keyword whole unsafe red
    keyword whole use yellow
    keyword whole usize yellow
    keyword whole while yellow
    keyword whole ... yellow
    keyword whole linestart \{\s\t\}\[\s\t\]#*\n brightmagenta
    keyword whole \[\s\t\]default yellow
    keyword whole \[\s\t\]\{ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz\}\[0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz\]! white
    keyword whole => yellow

    keyword /// brown
    keyword //! brown
    keyword /\* black
    keyword \*/ black
    keyword // black

    keyword Option cyan
    keyword Some cyan
    keyword None cyan
    keyword Result brightcyan
    keyword Ok brightcyan
    keyword Err brightcyan
    keyword :: brightgreen
    keyword '\\\{"abtnvfr\}' brightgreen
    keyword '\\\{0123\}\{01234567\}\{01234567\}' brightgreen
    keyword '\\'' brightgreen
    keyword '\\\\' brightgreen
    keyword '\\0' brightgreen
    keyword '\{\s!"#$%&()\*\+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ\}' brightgreen

# punctuation characters, sorted by ASCII code
    keyword ! yellow
    keyword % yellow
    keyword && yellow
    keyword & brightmagenta
    keyword ( brightcyan
    keyword ) brightcyan
    keyword \* yellow
    keyword \+ yellow
    keyword , brightcyan
    keyword - yellow
    keyword / yellow
    keyword : brightcyan
    keyword ; brightmagenta
    keyword < yellow
    keyword = yellow
    keyword > yellow
    keyword ? brightcyan
    keyword [ brightcyan
    keyword ] brightcyan
    keyword ^ brightmagenta
    keyword { brightcyan
    keyword || yellow
    keyword | brightmagenta
    keyword } brightcyan
    keyword ~ brightmagenta

context exclusive /// \n brown
    spellcheck

context exclusive //! \n brown
    spellcheck

# put in black because it does not follow rust automatic documentation guidelines
context exclusive /\* \*/ black
    spellcheck

# put in black because it does not follow rust automatic documentation guidelines
context exclusive // \n black
    spellcheck

context linestart # \n brightred
    keyword \\\n yellow
    keyword /\**\*/ brown
    keyword //*\n brown
    keyword "+" red
    keyword <+> red

context " " green
    spellcheck
    keyword \\" brightgreen
    keyword %% brightgreen
    keyword %\[#0\s-\+,\]\[0123456789\*\]\[.\]\[0123456789\*\]\[L\]\{eEfgGoxX\} brightgreen
    keyword %\[0\s-\+,\]\[0123456789\*\]\[.\]\[0123456789\*\]\[hl\]\{diuxX\} brightgreen
    keyword %\[hl\]n brightgreen
    keyword %\[-\]\[0123456789\*\]\[.\]\[0123456789\*\]s brightgreen
    keyword %[*] brightgreen
    keyword %c brightgreen
    keyword %p brightgreen
    keyword \\\{0123\}\{01234567\}\{01234567\} brightgreen
    keyword \\\\ brightgreen
    keyword \\' brightgreen
    keyword \\\{abtnvfr\} brightgreen


More information about the mc-devel mailing list