Install vim74
[msysgit.git] / share / vim / vim74 / syntax / bc.vim
blob965afc35b1479407b2b1b4dc190dbf46eaef9446
1 " Vim syntax file
2 " Language:     bc - An arbitrary precision calculator language
3 " Maintainer:   Vladimir Scholtz <vlado@gjh.sk>
4 " Last change:  2012 Jun 01
5 "               (Dominique Pelle added @Spell)
6 " Available on: www.gjh.sk/~vlado/bc.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 syn case ignore
18 " Keywords
19 syn keyword bcKeyword if else while for break continue return limits halt quit
20 syn keyword bcKeyword define
21 syn keyword bcKeyword length read sqrt print
23 " Variable
24 syn keyword bcType auto
26 " Constant
27 syn keyword bcConstant scale ibase obase last
28 syn keyword bcConstant BC_BASE_MAX BC_DIM_MAX BC_SCALE_MAX BC_STRING_MAX
29 syn keyword bcConstant BC_ENV_ARGS BC_LINE_LENGTH
31 " Any other stuff
32 syn match bcIdentifier          "[a-z_][a-z0-9_]*"
34 " String
35  syn match bcString             "\"[^"]*\"" contains=@Spell
37 " Number
38 syn match bcNumber              "[0-9]\+"
40 " Comment
41 syn match bcComment             "\#.*" contains=@Spell
42 syn region bcComment            start="/\*" end="\*/" contains=@Spell
44 " Parent ()
45 syn cluster bcAll contains=bcList,bcIdentifier,bcNumber,bcKeyword,bcType,bcConstant,bcString,bcParentError
46 syn region bcList               matchgroup=Delimiter start="(" skip="|.\{-}|" matchgroup=Delimiter end=")" contains=@bcAll
47 syn region bcList               matchgroup=Delimiter start="\[" skip="|.\{-}|" matchgroup=Delimiter end="\]" contains=@bcAll
48 syn match bcParenError                  "]"
49 syn match bcParenError                  ")"
53 syn case match
55 " Define the default highlighting.
56 " For version 5.7 and earlier: only when not done already
57 " For version 5.8 and later: only when an item doesn't have highlighting yet
58 if version >= 508 || !exists("did_bc_syntax_inits")
59   if version < 508
60     let did_bc_syntax_inits = 1
61     command -nargs=+ HiLink hi link <args>
62   else
63     command -nargs=+ HiLink hi def link <args>
64   endif
66   HiLink bcKeyword              Statement
67   HiLink bcType         Type
68   HiLink bcConstant             Constant
69   HiLink bcNumber               Number
70   HiLink bcComment              Comment
71   HiLink bcString               String
72   HiLink bcSpecialChar          SpecialChar
73   HiLink bcParenError           Error
75   delcommand HiLink
76 endif
78 let b:current_syntax = "bc"
79 " vim: ts=8