2 " Language: bc - An arbitrary precision calculator language
3 " Maintainer: Vladimir Scholtz <vlado@gjh.sk>
4 " Last change: 2001 May 09
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
11 elseif exists("b:current_syntax")
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
23 syn keyword bcType auto
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
31 syn match bcIdentifier "[a-z_][a-z0-9_]*"
34 syn match bcString "\"[^"]*\""
37 syn match bcNumber "[0-9]\+"
40 syn match bcComment "\#.*"
41 syn region bcComment start="/\*" end="\*/"
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 ")"
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")
59 let did_bc_syntax_inits = 1
60 command -nargs=+ HiLink hi link <args>
62 command -nargs=+ HiLink hi def link <args>
65 HiLink bcKeyword Statement
67 HiLink bcConstant Constant
68 HiLink bcNumber Number
69 HiLink bcComment Comment
70 HiLink bcString String
71 HiLink bcSpecialChar SpecialChar
72 HiLink bcParenError Error
77 let b:current_syntax = "bc"