citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

clay.vim (2851B)


      1 " Vim syntax file
      2 " Language: clay
      3 " Maintainer: Joe Groff <joe@duriansoftware.com>
      4 " Last Change: 2011 Nov 21
      5 
      6 " Quit when a custom syntax file was already loaded
      7 if exists("b:current_syntax")
      8     finish
      9 endif
     10 
     11 " Include ! and ? in keyword characters
     12 setlocal iskeyword=33,48-57,63,65-90,95,97-122
     13 
     14 syn keyword clayKeyword public private import record variant instance define overload external alias inline enum var if else goto return while switch break continue for try catch throw onerror finally
     15 
     16 syn keyword clayLabelKeyword case default
     17 syn keyword clayOperatorKeyword and or not static forward ref as in rvalue
     18 
     19 syn keyword clayType Bool Int8 Int16 Int32 Int64 Int128 UInt8 UInt16 UInt32 UInt64 UInt128 Float32 Float64 Float80 Float128 Pointer CodePointer RefCodePointer CCodePointer StdCallCodePointer FastCallCodePointer RawPointer OpaquePointer Array Tuple Void Byte UByte Char Short UShort Int UInt Long ULong Float Double RawPointer SizeT PtrInt UPtrInt StringConstant Vec Union Static
     20 
     21 syn keyword clayBoolean true false
     22 
     23 syn keyword clayDebug observeTo observe observeCallTo observeCall
     24 
     25 syn region clayString start=+"+ skip=+\\\\\|\\"+ end=+"+
     26 syn region clayIdentifier start=+#"+ skip=+\\\\\|\\"+ end=+"+
     27 syn region clayTripleString start=+"""+ skip=+\\\\\|\\"+ end=+""""\@!+
     28 syn region clayTripleIdentifier start=+#"""+ skip=+\\\\\|\\"+ end=+""""\@!+
     29 
     30 syn region clayComment start="/\*" end="\*/"
     31 syn region clayComment start="//" end="$"
     32 
     33 syn match clayDecimal /\.\@<![+\-]\?\<\([0-9][0-9_]*\)\([.][0-9_]*\)\?\([eE][+\-]\?[0-9][0-9_]*\)\?\(i\|i8\|u8\|i16\|u16\|i32\|u32\|i64\|i128\|u64\|u128\|f32\|f64\|f80\|f128\|u\|f\|fj\|j\|j32\|j64\|j80\|j128\)\?\w\@!/
     34 syn match clayHex /\.\@<![+\-]\?\<0x[0-9A-Fa-f][0-9A-Fa-f_]*\(\([.][0-9A-Fa-f_]*\)\?[pP][+\-]\?[0-9][0-9_]*\)\?\(i\|i8\|u8\|i16\|u16\|i32\|u32\|i64\|u64\|f32\|f64\|f80\|f128\|u\|f\|fj\|j\|j32\|j64\|j80\|j128\)\?\>/
     35 syn match claySimpleIdentifier /#[A-Za-z_?][A-Za-z0-9_?]*\>/
     36 syn match clayChar /'\([^'\\]\|\\\(["'trnf0$\\]\|x[0-9a-fA-F]\{2}\)\)'/
     37 syn match clayGotoLabel /^\s*[A-Za-z_?][A-Za-z0-9_?]*\(:\s*$\)\@=/
     38 
     39 syn match clayMultiValue /\.\.\.\?/
     40 syn match clayLambda /=>\|->/
     41 
     42 hi def link clayKeyword     Statement
     43 hi def link clayType        Type
     44 hi def link clayBoolean     Boolean
     45 hi def link clayComment     Comment
     46 hi def link clayTripleString String
     47 hi def link clayString      String
     48 hi def link clayChar        Character
     49 hi def link clayDecimal     Number
     50 hi def link clayHex         Number
     51 hi def link claySimpleIdentifier Constant
     52 hi def link clayIdentifier Constant
     53 hi def link clayTripleIdentifier Constant
     54 hi def link clayOperatorKeyword Operator
     55 hi def link clayLabelKeyword Label
     56 hi def link clayGotoLabel    Label
     57 hi def link clayMultiValue   Special
     58 hi def link clayLambda       Special
     59 hi def link clayDebug        Todo
     60 
     61 let b:current_syntax = "clay"