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