annotate runtime/syntax/b.vim @ 1624:18ee39301b82 v7.2a

updated for version 7.2a
author vimboss
date Tue, 24 Jun 2008 22:58:06 +0000
parents 73fe8baea242
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: B (A Formal Method with refinement and mathematical proof)
1620
73fe8baea242 updated for version 7.2a
vimboss
parents: 1121
diff changeset
3 " Maintainer: Mathieu Clabaut <mathieu.clabaut@gmail.com>
73fe8baea242 updated for version 7.2a
vimboss
parents: 1121
diff changeset
4 " Contributor: Csaba Hoch
73fe8baea242 updated for version 7.2a
vimboss
parents: 1121
diff changeset
5 " LastChange: 8 Dec 2007
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " A bunch of useful B keywords
1620
73fe8baea242 updated for version 7.2a
vimboss
parents: 1121
diff changeset
18 syn keyword bStatement MACHINE MODEL SEES OPERATIONS INCLUDES DEFINITIONS CONSTRAINTS CONSTANTS VARIABLES CONCRETE_CONSTANTS CONCRETE_VARIABLES ABSTRACT_CONSTANTS ABSTRACT_VARIABLES HIDDEN_CONSTANTS HIDDEN_VARIABLES ASSERT ASSERTIONS EXTENDS IMPLEMENTATION REFINEMENT IMPORTS USES INITIALISATION INVARIANT PROMOTES PROPERTIES REFINES SETS VALUES VARIANT VISIBLE_CONSTANTS VISIBLE_VARIABLES THEORY XLS THEOREMS LOCAL_OPERATIONS
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 syn keyword bLabel CASE IN EITHER OR CHOICE DO OF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 syn keyword bConditional IF ELSE SELECT ELSIF THEN WHEN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn keyword bRepeat WHILE FOR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn keyword bOps bool card conc closure closure1 dom first fnc front not or id inter iseq iseq1 iterate last max min mod perm pred prj1 prj2 ran rel rev seq seq1 size skip succ tail union
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 syn keyword bKeywords LET VAR BE IN BEGIN END POW POW1 FIN FIN1 PRE SIGMA STRING UNION IS ANY WHERE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn keyword bBoolean TRUE FALSE bfalse btrue
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn keyword bConstant PI MAXINT MININT User_Pass PatchProver PatchProverH0 PatchProverB0 FLAT ARI DED SUB RES
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn keyword bGuard binhyp band bnot bguard bsearch bflat bfresh bguardi bget bgethyp barith bgetresult bresult bgoal bmatch bmodr bnewv bnum btest bpattern bprintf bwritef bsubfrm bvrb blvar bcall bappend bclose
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn keyword bLogic or not
1620
73fe8baea242 updated for version 7.2a
vimboss
parents: 1121
diff changeset
30 syn match bLogic "\(!\|#\|%\|&\|+->>\|+->\|-->>\|->>\|-->\|->\|/:\|/<:\|/<<:\|/=\|/\\\|/|\\\|::\|:\|;:\|<+\|<->\|<--\|<-\|<:\|<<:\|<<|\|<=>\|<|\|==\|=>\|>+>>\|>->\|>+>\|||\||->\)"
73fe8baea242 updated for version 7.2a
vimboss
parents: 1121
diff changeset
31 syn match bNothing /:=/
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn keyword cTodo contained TODO FIXME XXX
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 " String and Character constants
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 " Highlight special characters (those which have a backslash) differently
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn match bSpecial contained "\\[0-7][0-7][0-7]\=\|\\."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn region bString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=bSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn match bCharacter "'[^\\]'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn match bSpecialCharacter "'\\.'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn match bSpecialCharacter "'\\[0-7][0-7]'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn match bSpecialCharacter "'\\[0-7][0-7][0-7]'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 "catch errors caused by wrong parenthesis
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn region bParen transparent start='(' end=')' contains=ALLBUT,bParenError,bIncluded,bSpecial,bTodo,bUserLabel,bBitField
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn match bParenError ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match bInParen contained "[{}]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 "integer number, or floating point number without a dot and with "f".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn match bNumber "\<[0-9]\+\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 "syn match bIdentifier "\<[a-z_][a-z0-9_]*\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn region bComment start="/\*" end="\*/" contains=bTodo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn match bComment "//.*" contains=bTodo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syntax match bCommentError "\*/"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syn keyword bType INT INTEGER BOOL NAT NATURAL NAT1 NATURAL1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn region bPreCondit start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=bComment,bString,bCharacter,bNumber,bCommentError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn region bIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn match bIncluded contained "<[^>]*>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn match bInclude "^\s*#\s*include\>\s*["<]" contains=bIncluded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn region bDefine start="^\s*#\s*\(define\>\|undef\>\)" skip="\\$" end="$" contains=ALLBUT,bPreCondit,bIncluded,bInclude,bDefine,bInParen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn region bPreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" contains=ALLBUT,bPreCondit,bIncluded,bInclude,bDefine,bInParen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 syn sync ccomment bComment minlines=10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 if version >= 508 || !exists("did_b_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 let did_b_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 " The default methods for highlighting. Can be overridden later
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 HiLink bLabel Label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 HiLink bUserLabel Label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 HiLink bConditional Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 HiLink bRepeat Repeat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 HiLink bLogic Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 HiLink bCharacter Character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 HiLink bSpecialCharacter bSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 HiLink bNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 HiLink bFloat Float
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 HiLink bOctalError bError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 HiLink bParenError bError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 " HiLink bInParen bError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 HiLink bCommentError bError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 HiLink bBoolean Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 HiLink bConstant Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 HiLink bGuard Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 HiLink bOperator Operator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 HiLink bKeywords Operator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 HiLink bOps Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 HiLink bStructure Structure
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 HiLink bStorageClass StorageClass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 HiLink bInclude Include
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 HiLink bPreProc PreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 HiLink bDefine Macro
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 HiLink bIncluded bString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 HiLink bError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 HiLink bStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 HiLink bPreCondit PreCondit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 HiLink bType Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 HiLink bCommentError bError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 HiLink bCommentString bString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 HiLink bComment2String bString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 HiLink bCommentSkip bComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 HiLink bString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 HiLink bComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 HiLink bSpecial SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 HiLink bTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 "hi link bIdentifier Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 7
diff changeset
125 let b:current_syntax = "b"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 " vim: ts=8