1121
|
1 "------------------------------------------------------------------------------
|
|
2 " Description: Vim Ada/Dec Ada compiler file
|
|
3 " Language: Ada (Dec Ada)
|
|
4 " $Id$
|
|
5 " Copyright: Copyright (C) 2006 Martin Krischik
|
|
6 " Maintainer: Martin Krischik
|
|
7 " $Author$
|
|
8 " $Date$
|
|
9 " Version: 4.2
|
|
10 " $Revision$
|
|
11 " $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/decada.vim $
|
|
12 " History: 21.07.2006 MK New Dec Ada
|
|
13 " 15.10.2006 MK Bram's suggestion for runtime integration
|
|
14 " 05.11.2006 MK Bram suggested not to use include protection for
|
|
15 " autoload
|
|
16 " 05.11.2006 MK Bram suggested to save on spaces
|
|
17 " Help Page: compiler-decada
|
|
18 "------------------------------------------------------------------------------
|
|
19
|
|
20 if version < 700
|
|
21 finish
|
|
22 endif
|
|
23
|
|
24 function decada#Unit_Name () dict " {{{1
|
|
25 " Convert filename into acs unit:
|
|
26 " 1: remove the file extenstion.
|
|
27 " 2: replace all double '_' or '-' with an dot (which denotes a separate)
|
|
28 " 3: remove a trailing '_' (wich denotes a specification)
|
|
29 return substitute (substitute (expand ("%:t:r"), '__\|-', ".", "g"), '_$', "", '')
|
|
30 endfunction decada#Unit_Name " }}}1
|
|
31
|
|
32 function decada#Make () dict " {{{1
|
|
33 let l:make_prg = substitute (g:self.Make_Command, '%<', self.Unit_Name(), '')
|
|
34 let &errorformat = g:self.Error_Format
|
|
35 let &makeprg = l:make_prg
|
|
36 wall
|
|
37 make
|
|
38 copen
|
|
39 set wrap
|
|
40 wincmd W
|
|
41 endfunction decada#Build " }}}1
|
|
42
|
|
43 function decada#Set_Session (...) dict " {{{1
|
|
44 if a:0 > 0
|
|
45 call ada#Switch_Session (a:1)
|
|
46 elseif argc() == 0 && strlen (v:servername) > 0
|
|
47 call ada#Switch_Session (
|
|
48 \ expand('~')[0:-2] . ".vimfiles.session]" .
|
|
49 \ v:servername . ".vim")
|
|
50 endif
|
|
51 return
|
|
52 endfunction decada#Set_Session " }}}1
|
|
53
|
|
54 function decada#New () " }}}1
|
|
55 let Retval = {
|
|
56 \ 'Make' : function ('decada#Make'),
|
|
57 \ 'Unit_Name' : function ('decada#Unit_Name'),
|
|
58 \ 'Set_Session' : function ('decada#Set_Session'),
|
|
59 \ 'Project_Dir' : '',
|
|
60 \ 'Make_Command' : 'ACS COMPILE /Wait /Log /NoPreLoad /Optimize=Development /Debug %<',
|
|
61 \ 'Error_Format' : '%+A%%ADAC-%t-%m,%C %#%m,%Zat line number %l in file %f,' .
|
|
62 \ '%+I%%ada-I-%m,%C %#%m,%Zat line number %l in file %f'}
|
|
63
|
|
64 return Retval
|
|
65 endfunction decada#New " }}}1
|
|
66
|
|
67 finish " 1}}}
|
|
68
|
|
69 "------------------------------------------------------------------------------
|
|
70 " Copyright (C) 2006 Martin Krischik
|
|
71 "
|
|
72 " Vim is Charityware - see ":help license" or uganda.txt for licence details.
|
|
73 "------------------------------------------------------------------------------
|
|
74 " vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
|
|
75 " vim: foldmethod=marker
|