bc.vim (1791B)
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 7 8 " quit when a syntax file was already loaded 9 if exists("b:current_syntax") 10 finish 11 endif 12 13 syn case ignore 14 15 " Keywords 16 syn keyword bcKeyword if else while for break continue return limits halt quit 17 syn keyword bcKeyword define 18 syn keyword bcKeyword length read sqrt print 19 20 " Variable 21 syn keyword bcType auto 22 23 " Constant 24 syn keyword bcConstant scale ibase obase last 25 syn keyword bcConstant BC_BASE_MAX BC_DIM_MAX BC_SCALE_MAX BC_STRING_MAX 26 syn keyword bcConstant BC_ENV_ARGS BC_LINE_LENGTH 27 28 " Any other stuff 29 syn match bcIdentifier "[a-z_][a-z0-9_]*" 30 31 " String 32 syn match bcString "\"[^"]*\"" contains=@Spell 33 34 " Number 35 syn match bcNumber "[0-9]\+" 36 37 " Comment 38 syn match bcComment "\#.*" contains=@Spell 39 syn region bcComment start="/\*" end="\*/" contains=@Spell 40 41 " Parent () 42 syn cluster bcAll contains=bcList,bcIdentifier,bcNumber,bcKeyword,bcType,bcConstant,bcString,bcParentError 43 syn region bcList matchgroup=Delimiter start="(" skip="|.\{-}|" matchgroup=Delimiter end=")" contains=@bcAll 44 syn region bcList matchgroup=Delimiter start="\[" skip="|.\{-}|" matchgroup=Delimiter end="\]" contains=@bcAll 45 syn match bcParenError "]" 46 syn match bcParenError ")" 47 48 49 50 syn case match 51 52 " Define the default highlighting. 53 " Only when an item doesn't have highlighting yet 54 55 hi def link bcKeyword Statement 56 hi def link bcType Type 57 hi def link bcConstant Constant 58 hi def link bcNumber Number 59 hi def link bcComment Comment 60 hi def link bcString String 61 hi def link bcSpecialChar SpecialChar 62 hi def link bcParenError Error 63 64 65 let b:current_syntax = "bc" 66 " vim: ts=8