comparison runtime/syntax/bc.vim @ 0:76efa0be13f1

Initial revision
author atsuki
date Sat, 10 Nov 2007 15:07:22 +0900
parents
children 67300faee616
comparison
equal deleted inserted replaced
-1:000000000000 0:76efa0be13f1
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
6
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
14
15 syn case ignore
16
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
21
22 " Variable
23 syn keyword bcType auto
24
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
29
30 " Any other stuff
31 syn match bcIdentifier "[a-z_][a-z0-9_]*"
32
33 " String
34 syn match bcString "\"[^"]*\""
35
36 " Number
37 syn match bcNumber "[0-9]\+"
38
39 " Comment
40 syn match bcComment "\#.*"
41 syn region bcComment start="/\*" end="\*/"
42
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 ")"
49
50
51
52 syn case match
53
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
64
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
73
74 delcommand HiLink
75 endif
76
77 let b:current_syntax = "bc"
78 " vim: ts=8