annotate runtime/syntax/ada.vim @ 2636:6ee9d7fa5df6 v7.3.057

updated for version 7.3.057 Problem: Segfault with command line abbreviation. (Randy Morris) Solution: Don't retrigger the abbreviation when abandoning the command line. Continue editing the command line after the error.
author Bram Moolenaar <bram@vim.org>
date Tue, 16 Nov 2010 14:06:08 +0100
parents 7bc41231fbc7
children d1e4abe8342c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
1 "----------------------------------------------------------------------------
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
2 " Description: Vim Ada syntax file
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
3 " Language: Ada (2005)
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
4 " $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
5 " Copyright: Copyright (C) 2006 Martin Krischik
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
6 " Maintainer: Martin Krischik
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
7 " David A. Wheeler <dwheeler@dwheeler.com>
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
8 " Simon Bradley <simon.bradley@pitechnology.com>
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
9 " Contributors: Preben Randhol.
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
10 " $Author: krischik $
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
11 " $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
12 " Version: 4.6
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1668
diff changeset
13 " $Revision: 887 $
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
14 " $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/syntax/ada.vim $
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
15 " http://www.dwheeler.com/vim
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
16 " History: 24.05.2006 MK Unified Headers
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
17 " 26.05.2006 MK ' should not be in iskeyword.
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
18 " 16.07.2006 MK Ada-Mode as vim-ball
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
19 " 02.10.2006 MK Better folding.
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
20 " 15.10.2006 MK Bram's suggestion for runtime integration
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
21 " 05.11.2006 MK Spell check for comments and strings only
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
22 " 05.11.2006 MK Bram suggested to save on spaces
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
23 " Help Page: help ft-ada-syntax
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
24 "------------------------------------------------------------------------------
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
25 " The formal spec of Ada 2005 (ARM) is the "Ada 2005 Reference Manual".
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
26 " For more Ada 2005 info, see http://www.gnuada.org and http://www.adapower.com.
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
27 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
28 " This vim syntax file works on vim 7.0 only and makes use of most of Voim 7.0
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
29 " advanced features.
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
30 "------------------------------------------------------------------------------
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
32 if exists("b:current_syntax") || version < 700
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
33 finish
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
36 let b:current_syntax = "ada"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
38 " Section: Ada is entirely case-insensitive. {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
39 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
40 syntax case ignore
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
42 " Section: Highlighting commands {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
43 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
44 " There are 72 reserved words in total in Ada2005. Some keywords are
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
45 " used in more than one way. For example:
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 " 1. "end" is a general keyword, but "end if" ends a Conditional.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 " 2. "then" is a conditional, but "and then" is an operator.
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
48 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
49 for b:Item in g:ada#Keywords
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
50 " Standard Exceptions (including I/O).
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
51 " We'll highlight the standard exceptions, similar to vim's Python mode.
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
52 " It's possible to redefine the standard exceptions as something else,
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
53 " but doing so is very bad practice, so simply highlighting them makes sense.
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
54 if b:Item['kind'] == "x"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
55 execute "syntax keyword adaException " . b:Item['word']
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
56 endif
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
57 if b:Item['kind'] == "a"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
58 execute 'syntax match adaAttribute "\V' . b:Item['word'] . '"'
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
59 endif
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
60 " We don't normally highlight types in package Standard
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
61 " (Integer, Character, Float, etc.). I don't think it looks good
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
62 " with the other type keywords, and many Ada programs define
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
63 " so many of their own types that it looks inconsistent.
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
64 " However, if you want this highlighting, turn on "ada_standard_types".
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
65 " For package Standard's definition, see ARM section A.1.
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
66 if b:Item['kind'] == "t" && exists ("g:ada_standard_types")
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
67 execute "syntax keyword adaBuiltinType " . b:Item['word']
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
68 endif
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
69 endfor
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
71 " Section: others {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
72 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
73 syntax keyword adaLabel others
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
75 " Section: Operatoren {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
76 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
77 syntax keyword adaOperator abs mod not rem xor
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
78 syntax match adaOperator "\<and\>"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
79 syntax match adaOperator "\<and\s\+then\>"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
80 syntax match adaOperator "\<or\>"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
81 syntax match adaOperator "\<or\s\+else\>"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
82 syntax match adaOperator "[-+*/<>&]"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
83 syntax keyword adaOperator **
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
84 syntax match adaOperator "[/<>]="
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
85 syntax keyword adaOperator =>
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
86 syntax match adaOperator "\.\."
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
87 syntax match adaOperator "="
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
89 " Section: <> {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
90 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
91 " Handle the box, <>, specially:
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
92 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
93 syntax keyword adaSpecial <>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
95 " Section: rainbow color {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
96 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
97 if exists("g:ada_rainbow_color")
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
98 syntax match adaSpecial "[:;.,]"
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
99 call rainbow_parenthsis#LoadRound ()
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
100 call rainbow_parenthsis#Activate ()
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
101 else
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
102 syntax match adaSpecial "[:;().,]"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
105 " Section: := {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
106 "
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 " We won't map "adaAssignment" by default, but we need to map ":=" to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 " something or the "=" inside it will be mislabelled as an operator.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 " Note that in Ada, assignment (:=) is not considered an operator.
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
110 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
111 syntax match adaAssignment ":="
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
113 " Section: Numbers, including floating point, exponents, and alternate bases. {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
114 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
115 syntax match adaNumber "\<\d[0-9_]*\(\.\d[0-9_]*\)\=\([Ee][+-]\=\d[0-9_]*\)\=\>"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
116 syntax match adaNumber "\<\d\d\=#\x[0-9A-Fa-f_]*\(\.\x[0-9A-Fa-f_]*\)\=#\([Ee][+-]\=\d[0-9_]*\)\="
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
118 " Section: Identify leading numeric signs {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
119 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
120 " In "A-5" the "-" is an operator, " but in "A:=-5" the "-" is a sign. This
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
121 " handles "A3+-5" (etc.) correctly. " This assumes that if you put a
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
122 " don't put a space after +/- when it's used " as an operator, you won't
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
123 " put a space before it either -- which is true " in code I've seen.
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
124 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
125 syntax match adaSign "[[:space:]<>=(,|:;&*/+-][+-]\d"lc=1,hs=s+1,he=e-1,me=e-1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
127 " Section: Labels for the goto statement. {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
128 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
129 syntax region adaLabel start="<<" end=">>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
131 " Section: Boolean Constants {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 " Boolean Constants.
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
133 syntax keyword adaBoolean true false
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
135 " Section: Warn C/C++ {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
136 "
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 " Warn people who try to use C/C++ notation erroneously:
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
138 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
139 syntax match adaError "//"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
140 syntax match adaError "/\*"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
141 syntax match adaError "=="
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
144 " Section: Space Errors {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
145 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
146 if exists("g:ada_space_errors")
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
147 if !exists("g:ada_no_trail_space_error")
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
148 syntax match adaSpaceError excludenl "\s\+$"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
149 endif
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
150 if !exists("g:ada_no_tab_space_error")
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
151 syntax match adaSpaceError " \+\t"me=e-1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
152 endif
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
153 if !exists("g:ada_all_tab_usage")
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
154 syntax match adaSpecial "\t"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
155 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
158 " Section: end {{{1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 " Unless special ("end loop", "end if", etc.), "end" marks the end of a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 " begin, package, task etc. Assiging it to adaEnd.
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents: 1125
diff changeset
161 syntax match adaEnd /\<end\>/
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
163 syntax keyword adaPreproc pragma
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
164
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
165 syntax keyword adaRepeat exit for loop reverse while
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
166 syntax match adaRepeat "\<end\s\+loop\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
168 syntax keyword adaStatement accept delay goto raise requeue return
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
169 syntax keyword adaStatement terminate
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
170 syntax match adaStatement "\<abort\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
172 " Section: Handle Ada's record keywords. {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
173 "
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 " 'record' usually starts a structure, but "with null record;" does not,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 " and 'end record;' ends a structure. The ordering here is critical -
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 " 'record;' matches a "with null record", so make it a keyword (this can
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 " match when the 'with' or 'null' is on a previous line).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 " 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
179 " pattern as adaStructure (and it won't match the "record;" pattern).
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
180 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
181 syntax match adaStructure "\<record\>" contains=adaRecord
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
182 syntax match adaStructure "\<end\s\+record\>" contains=adaRecord
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
183 syntax match adaKeyword "\<record;"me=e-1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
185 " Section: type classes {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
186 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
187 syntax keyword adaStorageClass abstract access aliased array at constant delta
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
188 syntax keyword adaStorageClass digits limited of private range tagged
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
189 syntax keyword adaStorageClass interface synchronized
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
190 syntax keyword adaTypedef subtype type
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
192 " Section: Conditionals {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
193 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
194 " "abort" after "then" is a conditional of its own.
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
195 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
196 syntax match adaConditional "\<then\>"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
197 syntax match adaConditional "\<then\s\+abort\>"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
198 syntax match adaConditional "\<else\>"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
199 syntax match adaConditional "\<end\s\+if\>"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
200 syntax match adaConditional "\<end\s\+case\>"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
201 syntax match adaConditional "\<end\s\+select\>"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
202 syntax keyword adaConditional if case select
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
203 syntax keyword adaConditional elsif when
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
205 " Section: other keywords {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
206 syntax match adaKeyword "\<is\>" contains=adaRecord
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
207 syntax keyword adaKeyword all do exception in new null out
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
208 syntax keyword adaKeyword separate until overriding
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
210 " Section: begin keywords {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
211 "
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 " These keywords begin various constructs, and you _might_ want to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 " highlight them differently.
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
214 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
215 syntax keyword adaBegin begin body declare entry generic
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
216 syntax keyword adaBegin protected renames task
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
218 syntax match adaBegin "\<function\>" contains=adaFunction
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
219 syntax match adaBegin "\<procedure\>" contains=adaProcedure
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
220 syntax match adaBegin "\<package\>" contains=adaPackage
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
222 if exists("ada_with_gnat_project_files")
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
223 syntax keyword adaBegin project
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
224 endif
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
225
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
226 " Section: with, use {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
227 "
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 if exists("ada_withuse_ordinary")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
229 " Don't be fancy. Display "with" and "use" as ordinary keywords in all cases.
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
230 syntax keyword adaKeyword with use
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 else
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
232 " Highlight "with" and "use" clauses like C's "#include" when they're used
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
233 " to reference other compilation units; otherwise they're ordinary keywords.
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
234 " If we have vim 6.0 or later, we'll use its advanced pattern-matching
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
235 " capabilities so that we won't match leading spaces.
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
236 syntax match adaKeyword "\<with\>"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
237 syntax match adaKeyword "\<use\>"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
238 syntax match adaBeginWith "^\s*\zs\(\(with\(\s\+type\)\=\)\|\(use\)\)\>" contains=adaInc
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
239 syntax match adaSemiWith ";\s*\zs\(\(with\(\s\+type\)\=\)\|\(use\)\)\>" contains=adaInc
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
240 syntax match adaInc "\<with\>" contained contains=NONE
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
241 syntax match adaInc "\<with\s\+type\>" contained contains=NONE
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
242 syntax match adaInc "\<use\>" contained contains=NONE
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
243 " Recognize "with null record" as a keyword (even the "record").
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
244 syntax match adaKeyword "\<with\s\+null\s\+record\>"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
245 " Consider generic formal parameters of subprograms and packages as keywords.
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
246 syntax match adaKeyword ";\s*\zswith\s\+\(function\|procedure\|package\)\>"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
247 syntax match adaKeyword "^\s*\zswith\s\+\(function\|procedure\|package\)\>"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
248 endif
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
249
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
250 " Section: String and character constants. {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
251 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
252 syntax region adaString contains=@Spell start=+"+ skip=+""+ end=+"+
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
253 syntax match adaCharacter "'.'"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
254
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
255 " Section: Todo (only highlighted in comments) {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
256 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
257 syntax keyword adaTodo contained TODO FIXME XXX NOTE
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
258
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
259 " Section: Comments. {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
260 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
261 syntax region adaComment
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
262 \ oneline
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
263 \ contains=adaTodo,adaLineError,@Spell
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
264 \ start="--"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
265 \ end="$"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
266
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
267 " Section: line errors {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
268 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
269 " Note: Line errors have become quite slow with Vim 7.0
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
270 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
271 if exists("g:ada_line_errors")
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
272 syntax match adaLineError "\(^.\{79}\)\@<=." contains=ALL containedin=ALL
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
273 endif
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
274
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
275 " Section: syntax folding {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
276 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
277 " Syntax folding is very tricky - for now I still suggest to use
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
278 " indent folding
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
279 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
280 if exists("g:ada_folding") && g:ada_folding[0] == 's'
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
281 if stridx (g:ada_folding, 'p') >= 0
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
282 syntax region adaPackage
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
283 \ start="\(\<package\s\+body\>\|\<package\>\)\s*\z(\k*\)"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
284 \ end="end\s\+\z1\s*;"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
285 \ keepend extend transparent fold contains=ALL
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
286 endif
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
287 if stridx (g:ada_folding, 'f') >= 0
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
288 syntax region adaProcedure
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
289 \ start="\<procedure\>\s*\z(\k*\)"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
290 \ end="\<end\>\s\+\z1\s*;"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
291 \ keepend extend transparent fold contains=ALL
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
292 syntax region adaFunction
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
293 \ start="\<procedure\>\s*\z(\k*\)"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
294 \ end="end\s\+\z1\s*;"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
295 \ keepend extend transparent fold contains=ALL
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
296 endif
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
297 if stridx (g:ada_folding, 'f') >= 0
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
298 syntax region adaRecord
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
299 \ start="\<is\s\+record\>"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
300 \ end="\<end\s\+record\>"
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
301 \ keepend extend transparent fold contains=ALL
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
302 endif
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
303 endif
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
304
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
305 " Section: The default methods for highlighting. Can be overridden later. {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
306 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
307 highlight def link adaCharacter Character
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
308 highlight def link adaComment Comment
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
309 highlight def link adaConditional Conditional
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
310 highlight def link adaKeyword Keyword
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
311 highlight def link adaLabel Label
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
312 highlight def link adaNumber Number
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
313 highlight def link adaSign Number
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
314 highlight def link adaOperator Operator
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
315 highlight def link adaPreproc PreProc
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
316 highlight def link adaRepeat Repeat
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
317 highlight def link adaSpecial Special
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
318 highlight def link adaStatement Statement
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
319 highlight def link adaString String
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
320 highlight def link adaStructure Structure
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
321 highlight def link adaTodo Todo
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
322 highlight def link adaType Type
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
323 highlight def link adaTypedef Typedef
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
324 highlight def link adaStorageClass StorageClass
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
325 highlight def link adaBoolean Boolean
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
326 highlight def link adaException Exception
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
327 highlight def link adaAttribute Tag
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
328 highlight def link adaInc Include
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
329 highlight def link adaError Error
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
330 highlight def link adaSpaceError Error
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
331 highlight def link adaLineError Error
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
332 highlight def link adaBuiltinType Type
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
333 highlight def link adaAssignment Special
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
334
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
335 " Subsection: Begin, End {{{2
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
336 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
337 if exists ("ada_begin_preproc")
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
338 " This is the old default display:
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
339 highlight def link adaBegin PreProc
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
340 highlight def link adaEnd PreProc
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
341 else
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
342 " This is the new default display:
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
343 highlight def link adaBegin Keyword
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
344 highlight def link adaEnd Keyword
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
349 " Section: sync {{{1
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
350 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
351 " We don't need to look backwards to highlight correctly;
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
352 " this speeds things up greatly.
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
353 syntax sync minlines=1 maxlines=1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
355 finish " 1}}}
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
356
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
357 "------------------------------------------------------------------------------
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
358 " Copyright (C) 2006 Martin Krischik
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
359 "
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
360 " Vim is Charityware - see ":help license" or uganda.txt for licence details.
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
361 "------------------------------------------------------------------------------
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
362 "vim: textwidth=78 nowrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
363 "vim: foldmethod=marker