root/downloads/minid.vim

Revision 420, 4.6 kB (checked in by JarrettBillingsley, 4 weeks ago)

We have class-based OO, once again.

Line 
1 " Vim syntax file
2 " Language: MiniD
3 " Maintainer: Jarrett Billingsley
4 " Last Change:  2008-06-10
5
6 if !exists("main_syntax")
7   if version < 600
8     syntax clear
9   elseif exists("b:current_syntax")
10     finish
11   endif
12   let main_syntax = 'minid'
13 endif
14
15 syn case match
16
17 " Keywords
18 syn keyword minidExternal     import module
19 syn keyword minidConditional  if else switch case default
20 syn keyword minidBranch       break continue
21 syn keyword minidRepeat       while for do foreach
22 syn keyword minidBoolean      true false
23 syn keyword minidConstant     null
24 syn keyword minidStructure    class coroutine namespace function
25 syn keyword minidExceptions   throw try catch finally
26 syn keyword minidStatement    return yield assert
27 syn keyword minidReserved     in vararg this super with is as
28 syn keyword minidStorageClass local global
29 if exists("minid_hl_operator_overload")
30     syn keyword minidOpOverload opAdd opAdd_r opAddAssign opAnd opAnd_r opAndAssign
31     syn keyword minidOpOverload opApply opCall opCat opCat_r opCatAssign opCmp opCom
32     syn keyword minidOpOverload opDec opDiv opDiv_r opDivAssign opEquals opField
33     syn keyword minidOpOverload opFieldAssign opIn opInc opIndex opIndexAssign
34     syn keyword minidOpOverload opLength opLengthAssign opMethod opMod opMod_r opModAssign
35     syn keyword minidOpOverload opMul opMul_r opMulAssign opNeg opOr opOr_r opOrAssign
36     syn keyword minidOpOverload opShl opShl_r opShlAssign opShr opShr_r opShrAssign
37     syn keyword minidOpOverload opSlice opSliceAssign opSub opSub_r opSubAssign
38     syn keyword minidOpOverload opUShr opUShr_r opUShrAssign opXor opXor_r opXorAssign
39 endif
40
41 " Comments
42 syn keyword minidTodo          contained TODO FIXME TEMP XXX
43 syn match   minidCommentStar   contained "^\s*\*[^/]"me=e-1
44 syn match   minidCommentStar   contained "^\s*\*$"
45 syn match   minidCommentPlus   contained "^\s*+[^/]"me=e-1
46 syn match   minidCommentPlus   contained "^\s*+$"
47 syn region  minidBlockComment  start="/\*"  end="\*/" contains=minidBlockCommentString,minidTodo,@Spell
48 syn region  minidNestedComment start="/+"  end="+/" contains=minidNestedComment,minidNestedCommentString,minidTodo,@Spell
49 syn match   minidLineComment   "//.*" contains=minidLineCommentString,minidTodo,@Spell
50
51 hi link minidLineCommentString minidBlockCommentString
52 hi link minidBlockCommentString minidString
53 hi link minidNestedCommentString minidString
54 hi link minidCommentStar  minidBlockComment
55 hi link minidCommentPlus  minidNestedComment
56
57 syn sync minlines=25
58
59 " Characters
60 syn match minidSpecialCharError contained "[^']"
61
62 " Escape sequences
63 syn match minidEscSequence "\\\([\"\\'abfnrtv]\|x\x\x\|u\x\{4}\|U\x\{8}\|\d\{1,3}\)"
64 syn match minidCharacter   "'[^']*'" contains=minidEscSequence,minidSpecialCharError
65 syn match minidCharacter   "'\\''" contains=minidEscSequence
66 syn match minidCharacter   "'[^\\]'"
67
68 " Strings
69 syn region minidString start=+"+ end=+"+ contains=minidEscSequence,@Spell
70 syn region minidRawString start=+`+ end=+`+ contains=@Spell
71 syn region minidRawString start=+@"+ skip=+""+ end=+"+ contains=@Spell
72
73 " Numbers
74 syn case ignore
75 syn match minidInt        display "\<\d[0-9_]*\>"
76 " Hex number
77 syn match minidHex        display "\<0x[0-9a-f_]\+\>"
78 " Octal number
79 syn match minidOctal      display "\<0c[0-7_]\+\>"
80 "floating point number, with dot, optional exponent
81 syn match minidFloat      display "\<\d[0-9_]*\.[0-9_]*\(e[-+]\=[0-9_]\+\)\="
82 "floating point number, starting with a dot, optional exponent
83 syn match minidFloat      display "\(\.[0-9_]\+\)\(e[-+]\=[0-9_]\+\)\=\>"
84 "floating point number, without dot, with exponent
85 syn match minidFloat      display "\<\d[0-9_]*e[-+]\=[0-9_]\+\>"
86 " binary number
87 syn match minidBinary     display "\<0b[01_]\+\>"
88 syn case match
89
90 " The default highlighting.
91 hi def link minidBinary             Number
92 hi def link minidInt                Number
93 hi def link minidHex                Number
94 hi def link minidOctal              Number
95 hi def link minidFloat              Float
96 hi def link minidBranch             Conditional
97 hi def link minidConditional        Conditional
98 hi def link minidRepeat             Repeat
99 hi def link minidExceptions         Exception
100 hi def link minidStatement          Statement
101 hi def link minidStorageClass       StorageClass
102 hi def link minidBoolean            Boolean
103 hi def link minidRawString          String
104 hi def link minidString             String
105 hi def link minidCharacter          Character
106 hi def link minidEscSequence        SpecialChar
107 hi def link minidSpecialCharError   Error
108 hi def link minidOpOverload         Operator
109 hi def link minidConstant           Constant
110 hi def link minidStructure          Structure
111 hi def link minidTodo               Todo
112 hi def link minidLineComment        Comment
113 hi def link minidBlockComment       Comment
114 hi def link minidNestedComment      Comment
115 hi def link minidExternal           Include
116
117 let b:current_syntax = "minid"
118
119 " vim: ts=4
Note: See TracBrowser for help on using the browser.