Add support for :winpos
[MacVim.git] / runtime / syntax / bc.vim
blobdcfaf486a5e8940284966b74e91a3ebfefdcbc41
1 " Vim syntax file
2 " Language:     bc - An arbitrary precision calculator language
3 " Maintainer:   Vladimir Scholtz <vlado@gjh.sk>
4 " Last change:  2001 Sep 02
5 " Available on: www.gjh.sk/~vlado/bc.vim
7 " For version 5.x: Clear all syntax items
8 " For version 6.x: Quit when a syntax file was already loaded
9 if version < 600
10   syntax clear
11 elseif exists("b:current_syntax")
12   finish
13 endif
15 syn case ignore
17 " Keywords
18 syn keyword bcKeyword if else while for break continue return limits halt quit
19 syn keyword bcKeyword define
20 syn keyword bcKeyword length read sqrt print
22 " Variable
23 syn keyword bcType auto
25 " Constant
26 syn keyword bcConstant scale ibase obase last
27 syn keyword bcConstant BC_BASE_MAX BC_DIM_MAX BC_SCALE_MAX BC_STRING_MAX
28 syn keyword bcConstant BC_ENV_ARGS BC_LINE_LENGTH
30 " Any other stuff
31 syn match bcIdentifier          "[a-z_][a-z0-9_]*"
33 " String
34  syn match bcString             "\"[^"]*\""
36 " Number
37 syn match bcNumber              "[0-9]\+"
39 " Comment
40 syn match bcComment             "\#.*"
41 syn region bcComment            start="/\*" end="\*/"
43 " Parent ()
44 syn cluster bcAll contains=bcList,bcIdentifier,bcNumber,bcKeyword,bcType,bcConstant,bcString,bcParentError
45 syn region bcList               matchgroup=Delimiter start="(" skip="|.\{-}|" matchgroup=Delimiter end=")" contains=@bcAll
46 syn region bcList               matchgroup=Delimiter start="\[" skip="|.\{-}|" matchgroup=Delimiter end="\]" contains=@bcAll
47 syn match bcParenError                  "]"
48 syn match bcParenError                  ")"
52 syn case match
54 " Define the default highlighting.
55 " For version 5.7 and earlier: only when not done already
56 " For version 5.8 and later: only when an item doesn't have highlighting yet
57 if version >= 508 || !exists("did_bc_syntax_inits")
58   if version < 508
59     let did_bc_syntax_inits = 1
60     command -nargs=+ HiLink hi link <args>
61   else
62     command -nargs=+ HiLink hi def link <args>
63   endif
65   HiLink bcKeyword              Statement
66   HiLink bcType         Type
67   HiLink bcConstant             Constant
68   HiLink bcNumber               Number
69   HiLink bcComment              Comment
70   HiLink bcString               String
71   HiLink bcSpecialChar          SpecialChar
72   HiLink bcParenError           Error
74   delcommand HiLink
75 endif
77 let b:current_syntax = "bc"
78 " vim: ts=8