blob: 61872c9595441e3bff3cad9ca82afdc3f8b681a4 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim compiler file
Bram Moolenaar6b730e12005-09-16 21:47:57 +00002" Language: Ruby
3" Function: Syntax check and/or error reporting
4" Maintainer: Tim Hammerquist <timh at rubyforge.org>
5" Info: $Id$
6" URL: http://vim-ruby.rubyforge.org
7" Anon CVS: See above site
8" Licence: GPL (http://www.gnu.org)
9" Disclaimer:
10" This program is distributed in the hope that it will be useful,
11" but WITHOUT ANY WARRANTY; without even the implied warranty of
12" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13" GNU General Public License for more details.
14" ----------------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +000015"
16" Changelog:
17" 0.2: script saves and restores 'cpoptions' value to prevent problems with
18" line continuations
19" 0.1: initial release
20"
21" Contributors:
22" Hugh Sasse <hgs@dmu.ac.uk>
Bram Moolenaar293ee4d2004-12-09 21:34:53 +000023" Doug Kearns <djkea2@gus.gscit.monash.edu.au>
Bram Moolenaar071d4272004-06-13 20:20:40 +000024"
25" Todo:
26" match error type %m
27"
28" Comments:
29" I know this file isn't perfect. If you have any questions, suggestions,
30" patches, etc., please don't hesitate to let me know.
31"
32" This is my first experience with 'errorformat' and compiler plugins and
33" I welcome any input from more experienced (or clearer-thinking)
34" individuals.
Bram Moolenaar6b730e12005-09-16 21:47:57 +000035" ----------------------------------------------------------------------------
Bram Moolenaar071d4272004-06-13 20:20:40 +000036
37if exists("current_compiler")
38 finish
39endif
40let current_compiler = "ruby"
41
42if exists(":CompilerSet") != 2 " older Vim always used :setlocal
43 command -nargs=* CompilerSet setlocal <args>
44endif
45
46let s:cpo_save = &cpo
47set cpo-=C
48
49" default settings runs script normally
50" add '-c' switch to run syntax check only:
51"
52" CompilerSet makeprg=ruby\ -wc\ $*
53"
54" or add '-c' at :make command line:
55"
56" :make -c %<CR>
57"
58CompilerSet makeprg=ruby\ -w\ $*
59
60CompilerSet errorformat=
61 \%+E%f:%l:\ parse\ error,
62 \%W%f:%l:\ warning:\ %m,
63 \%E%f:%l:in\ %*[^:]:\ %m,
64 \%E%f:%l:\ %m,
65 \%-C%\tfrom\ %f:%l:in\ %.%#,
66 \%-Z%\tfrom\ %f:%l,
67 \%-Z%p^,
68 \%-G%.%#
69
70let &cpo = s:cpo_save
71unlet s:cpo_save
72
Bram Moolenaar6b730e12005-09-16 21:47:57 +000073" vim: nowrap sw=2 sts=2 ts=8 ff=unix: