Add /src/vim/release.sh, a script to compile and install vim
[msysgit.git] / share / vim / vim58 / syntax / r.vim
blobc86fec2d9e58119852980c97fd835665c4100af7
1 " Vim syntax file
2 " Language:     R (GNU S)
3 " Maintainer:   Tom Payne <tom@tompayne.org>
4 " Last Change:  2001 May 10
5 " Filenames:    *.r
6 " URL:          http://www.tompayne.org/vim/syntax/r.vim
8 " For version 5.x: Clear all syntax items
9 " For version 6.x: Quit when a syntax file was already loaded
10 if version < 600
11   syntax clear
12 elseif exists("b:current_syntax")
13   finish
14 endif
16 if version >= 600
17   setlocal iskeyword=@,48-57,_,.
18 else
19   set iskeyword=@,48-57,_,.
20 endif
22 syn case match
24 " Comment
25 syn match rComment /\#.*/
27 " Constant
28 " string enclosed in double quotes
29 syn region rString start=/"/ skip=/\\\\\|\\"/ end=/"/
30 " string enclosed in single quotes
31 syn region rString start=/'/ skip=/\\\\\|\\'/ end=/'/
32 " number with no fractional part or exponent
33 syn match rNumber /\d\+/
34 " floating point number with integer and fractional parts and optional exponent
35 syn match rFloat /\d\+\.\d*\([Ee][-+]\=\d\+\)\=/
36 " floating point number with no integer part and optional exponent
37 syn match rFloat /\.\d\+\([Ee][-+]\=\d\+\)\=/
38 " floating point number with no fractional part and optional exponent
39 syn match rFloat /\d\+[Ee][-+]\=\d\+/
41 " Identifier
42 " identifier with leading letter and optional following keyword characters
43 syn match rIdentifier /\a\k*/
44 " identifier with leading period, one or more digits, and at least one non-digit keyword character
45 syn match rIdentifier /\.\d*\K\k*/
47 " Statement
48 syn keyword rStatement   break next return
49 syn keyword rConditional if else
50 syn keyword rRepeat      for in repeat while
52 " Constant
53 syn keyword rConstant LETTERS letters month.ab month.name pi
54 syn keyword rConstant NULL
55 syn keyword rBoolean  FALSE TRUE
56 syn keyword rNumber   NA
58 " Type
59 syn keyword rType array category character complex double function integer list logical matrix numeric vector
61 " Special
62 syn match rDelimiter /[,;:]/
64 " Error
65 syn region rRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError
66 syn region rRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rError,rBraceError,rParenError
67 syn region rRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ transparent contains=ALLBUT,rError,rCurlyError,rParenError
68 syn match rError      /[)\]}]/
69 syn match rBraceError /[)}]/ contained
70 syn match rCurlyError /[)\]]/ contained
71 syn match rParenError /[\]}]/ contained
73 " Define the default highlighting.
74 " For version 5.7 and earlier: only when not done already
75 " For version 5.8 and later: only when an item doesn't have highlighting yet
76 if version >= 508 || !exists("did_r_syn_inits")
77   if version < 508
78     let did_r_syn_inits = 1
79     command -nargs=+ HiLink hi link <args>
80   else
81     command -nargs=+ HiLink hi def link <args>
82   endif
83   HiLink rComment     Comment
84   HiLink rConstant    Constant
85   HiLink rString      String
86   HiLink rNumber      Number
87   HiLink rBoolean     Boolean
88   HiLink rFloat       Float
89   HiLink rStatement   Statement
90   HiLink rConditional Conditional
91   HiLink rRepeat      Repeat
92   HiLink rIdentifier  Identifier
93   HiLink rType        Type
94   HiLink rDelimiter   Delimiter
95   HiLink rError       Error
96   HiLink rBraceError  Error
97   HiLink rCurlyError  Error
98   HiLink rParenError  Error
99   delcommand HiLink
100 endif
102 let b:current_syntax="r"
104 " vim: ts=8 sw=2