annotate runtime/syntax/ada.vim @ 886:ddfb6f3f3b2b v7.0.012

updated for version 7.0-012
author vimboss
date Sat, 13 May 2006 12:48:30 +0000
parents 3fc0f57ecb91
children 96cd8222a819
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: Ada (95)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: David A. Wheeler <dwheeler@dwheeler.com>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " URL: http://www.dwheeler.com/vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " Last Change: 2001-11-02
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " Former Maintainer: Simon Bradley <simon.bradley@pitechnology.com>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " (was <sib93@aber.ac.uk>)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " Other contributors: Preben Randhol.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " The formal spec of Ada95 (ARM) is the "Ada95 Reference Manual".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " For more Ada95 info, see http://www.gnuada.org and http://www.adapower.com.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 " This vim syntax file works on vim 5.6, 5.7, 5.8 and 6.x.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " It implements Bram Moolenaar's April 25, 2001 recommendations to make
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " the syntax file maximally portable across different versions of vim.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 " If vim 6.0+ is available,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " this syntax file takes advantage of the vim 6.0 advanced pattern-matching
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " functions to avoid highlighting uninteresting leading spaces in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 " some expressions containing "with" and "use".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " Ada is entirely case-insensitive.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 " We don't need to look backwards to highlight correctly;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 " this speeds things up greatly.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn sync minlines=1 maxlines=1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 " Highlighting commands. There are 69 reserved words in total in Ada95.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 " Some keywords are used in more than one way. For example:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " 1. "end" is a general keyword, but "end if" ends a Conditional.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " 2. "then" is a conditional, but "and then" is an operator.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 " Standard Exceptions (including I/O).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 " We'll highlight the standard exceptions, similar to vim's Python mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 " It's possible to redefine the standard exceptions as something else,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 " but doing so is very bad practice, so simply highlighting them makes sense.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn keyword adaException Constraint_Error Program_Error Storage_Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn keyword adaException Tasking_Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn keyword adaException Status_Error Mode_Error Name_Error Use_Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn keyword adaException Device_Error End_Error Data_Error Layout_Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn keyword adaException Length_Error Pattern_Error Index_Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn keyword adaException Translation_Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn keyword adaException Time_Error Argument_Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn keyword adaException Tag_Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn keyword adaException Picture_Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 " Interfaces
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn keyword adaException Terminator_Error Conversion_Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syn keyword adaException Pointer_Error Dereference_Error Update_Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 " This isn't in the Ada spec, but a GNAT extension.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syn keyword adaException Assert_Failure
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 " We don't list ALL exceptions defined in particular compilers (e.g., GNAT),
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 " because it's quite reasonable to define those phrases as non-exceptions.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 " We don't normally highlight types in package Standard
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 " (Integer, Character, Float, etc.). I don't think it looks good
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 " with the other type keywords, and many Ada programs define
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 " so many of their own types that it looks inconsistent.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 " However, if you want this highlighting, turn on "ada_standard_types".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 " For package Standard's definition, see ARM section A.1.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 if exists("ada_standard_types")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn keyword adaBuiltinType Boolean Integer Natural Positive Float
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn keyword adaBuiltinType Character Wide_Character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 syn keyword adaBuiltinType String Wide_String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 syn keyword adaBuiltinType Duration
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 " These aren't listed in ARM section A.1's code, but they're noted as
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 " options in ARM sections 3.5.4 and 3.5.7:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 syn keyword adaBuiltinType Short_Integer Short_Short_Integer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 syn keyword adaBuiltinType Long_Integer Long_Long_Integer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 syn keyword adaBuiltinType Short_Float Short_Short_Float
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 syn keyword adaBuiltinType Long_Float Long_Long_Float
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 " There are MANY other predefined types; they've not been added, because
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 " determining when they're a type requires context in general.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 " One potential addition would be Unbounded_String.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 syn keyword adaLabel others
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 syn keyword adaOperator abs mod not rem xor
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 syn match adaOperator "\<and\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 syn match adaOperator "\<and\s\+then\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 syn match adaOperator "\<or\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 syn match adaOperator "\<or\s\+else\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 syn match adaOperator "[-+*/<>&]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 syn keyword adaOperator **
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 syn match adaOperator "[/<>]="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 syn keyword adaOperator =>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 syn match adaOperator "\.\."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 syn match adaOperator "="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 " We won't map "adaAssignment" by default, but we need to map ":=" to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 " something or the "=" inside it will be mislabelled as an operator.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 " Note that in Ada, assignment (:=) is not considered an operator.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 syn match adaAssignment ":="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 " Handle the box, <>, specially:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 syn keyword adaSpecial <>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 " Numbers, including floating point, exponents, and alternate bases.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 syn match adaNumber "\<\d[0-9_]*\(\.\d[0-9_]*\)\=\([Ee][+-]\=\d[0-9_]*\)\=\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 syn match adaNumber "\<\d\d\=#\x[0-9A-Fa-f_]*\(\.\x[0-9A-Fa-f_]*\)\=#\([Ee][+-]\=\d[0-9_]*\)\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 " Identify leading numeric signs. In "A-5" the "-" is an operator,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 " but in "A:=-5" the "-" is a sign. This handles "A3+-5" (etc.) correctly.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 " This assumes that if you put a don't put a space after +/- when it's used
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 " as an operator, you won't put a space before it either -- which is true
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 " in code I've seen.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 syn match adaSign "[[:space:]<>=(,|:;&*/+-][+-]\d"lc=1,hs=s+1,he=e-1,me=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 " Labels for the goto statement.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 syn region adaLabel start="<<" end=">>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 " Boolean Constants.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 syn keyword adaBoolean true false
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 " Warn people who try to use C/C++ notation erroneously:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 syn match adaError "//"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 syn match adaError "/\*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 syn match adaError "=="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 if exists("ada_space_errors")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 if !exists("ada_no_trail_space_error")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 syn match adaSpaceError excludenl "\s\+$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 if !exists("ada_no_tab_space_error")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 syn match adaSpaceError " \+\t"me=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 " Unless special ("end loop", "end if", etc.), "end" marks the end of a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 " begin, package, task etc. Assiging it to adaEnd.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 syn match adaEnd "\<end\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 syn keyword adaPreproc pragma
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 syn keyword adaRepeat exit for loop reverse while
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 syn match adaRepeat "\<end\s\+loop\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 syn keyword adaStatement accept delay goto raise requeue return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 syn keyword adaStatement terminate
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 syn match adaStatement "\<abort\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 " Handle Ada's record keywords.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 " 'record' usually starts a structure, but "with null record;" does not,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 " and 'end record;' ends a structure. The ordering here is critical -
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 " 'record;' matches a "with null record", so make it a keyword (this can
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 " match when the 'with' or 'null' is on a previous line).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 " We see the "end" in "end record" before the word record, so we match that
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 " pattern as adaStructure (and it won't match the "record;" pattern).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 syn match adaStructure "\<record\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 syn match adaStructure "\<end\s\+record\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 syn match adaKeyword "\<record;"me=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 syn keyword adaStorageClass abstract access aliased array at constant delta
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 syn keyword adaStorageClass digits limited of private range tagged
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 syn keyword adaTypedef subtype type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 " Conditionals. "abort" after "then" is a conditional of its own.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 syn match adaConditional "\<then\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 syn match adaConditional "\<then\s\+abort\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 syn match adaConditional "\<else\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 syn match adaConditional "\<end\s\+if\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 syn match adaConditional "\<end\s\+case\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 syn match adaConditional "\<end\s\+select\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 syn keyword adaConditional if case select
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 syn keyword adaConditional elsif when
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 syn keyword adaKeyword all do exception in is new null out
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 syn keyword adaKeyword separate until
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 " These keywords begin various constructs, and you _might_ want to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 " highlight them differently.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 syn keyword adaBegin begin body declare entry function generic
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 syn keyword adaBegin package procedure protected renames task
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 if exists("ada_withuse_ordinary")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 " Don't be fancy. Display "with" and "use" as ordinary keywords in all cases.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 syn keyword adaKeyword with use
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 " Highlight "with" and "use" clauses like C's "#include" when they're used
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 " to reference other compilation units; otherwise they're ordinary keywords.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 " If we have vim 6.0 or later, we'll use its advanced pattern-matching
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 " capabilities so that we won't match leading spaces.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 syn match adaKeyword "\<with\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 syn match adaKeyword "\<use\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 syn match adaBeginWith "^\s*\(\(with\(\s\+type\)\=\)\|\(use\)\)\>" contains=adaInc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 syn match adaSemiWith ";\s*\(\(with\(\s\+type\)\=\)\|\(use\)\)\>"lc=1 contains=adaInc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 syn match adaBeginWith "^\s*\zs\(\(with\(\s\+type\)\=\)\|\(use\)\)\>" contains=adaInc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 syn match adaSemiWith ";\s*\zs\(\(with\(\s\+type\)\=\)\|\(use\)\)\>" contains=adaInc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 syn match adaInc "\<with\>" contained contains=NONE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 syn match adaInc "\<with\s\+type\>" contained contains=NONE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 syn match adaInc "\<use\>" contained contains=NONE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 " Recognize "with null record" as a keyword (even the "record").
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 syn match adaKeyword "\<with\s\+null\s\+record\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 " Consider generic formal parameters of subprograms and packages as keywords.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 syn match adaKeyword ";\s*with\s\+\(function\|procedure\|package\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 syn match adaKeyword "^\s*with\s\+\(function\|procedure\|package\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 syn match adaKeyword ";\s*\zswith\s\+\(function\|procedure\|package\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 syn match adaKeyword "^\s*\zswith\s\+\(function\|procedure\|package\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223 " String and character constants.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224 syn region adaString start=+"+ skip=+""+ end=+"+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 syn match adaCharacter "'.'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 " Todo (only highlighted in comments)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 syn keyword adaTodo contained TODO FIXME XXX
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 " Comments.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 syn region adaComment oneline contains=adaTodo start="--" end="$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237 " 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
238 if version >= 508 || !exists("did_ada_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
239 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240 let did_ada_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
241 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
243 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
244 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246 " The default methods for highlighting. Can be overridden later.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 HiLink adaCharacter Character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 HiLink adaComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249 HiLink adaConditional Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 HiLink adaKeyword Keyword
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251 HiLink adaLabel Label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 HiLink adaNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 HiLink adaSign Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254 HiLink adaOperator Operator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255 HiLink adaPreproc PreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 HiLink adaRepeat Repeat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257 HiLink adaSpecial Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258 HiLink adaStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259 HiLink adaString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
260 HiLink adaStructure Structure
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261 HiLink adaTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262 HiLink adaType Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263 HiLink adaTypedef Typedef
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 HiLink adaStorageClass StorageClass
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265 HiLink adaBoolean Boolean
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266 HiLink adaException Exception
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 HiLink adaInc Include
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268 HiLink adaError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 HiLink adaSpaceError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 HiLink adaBuiltinType Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272 if exists("ada_begin_preproc")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 " This is the old default display:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274 HiLink adaBegin PreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 HiLink adaEnd PreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277 " This is the new default display:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278 HiLink adaBegin Keyword
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279 HiLink adaEnd Keyword
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285 let b:current_syntax = "ada"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287 " vim: ts=8