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