Bram Moolenaar | 3c2881d | 2017-03-21 19:18:29 +0100 | [diff] [blame] | 1 | " Vim compiler file |
| 2 | " Compiler: Rust Compiler |
| 3 | " Maintainer: Chris Morgan <me@chrismorgan.info> |
| 4 | " Latest Revision: 2013 Jul 12 |
| 5 | " For bugs, patches and license go to https://github.com/rust-lang/rust.vim |
| 6 | |
| 7 | if exists("current_compiler") |
| 8 | finish |
| 9 | endif |
| 10 | let current_compiler = "rustc" |
| 11 | |
| 12 | let s:cpo_save = &cpo |
| 13 | set cpo&vim |
| 14 | |
| 15 | if exists(":CompilerSet") != 2 |
| 16 | command -nargs=* CompilerSet setlocal <args> |
| 17 | endif |
| 18 | |
| 19 | if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent != 0 |
| 20 | CompilerSet makeprg=rustc |
| 21 | else |
| 22 | CompilerSet makeprg=rustc\ \% |
| 23 | endif |
| 24 | |
| 25 | " Old errorformat (before nightly 2016/08/10) |
| 26 | CompilerSet errorformat= |
| 27 | \%f:%l:%c:\ %t%*[^:]:\ %m, |
| 28 | \%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m, |
| 29 | \%-G%f:%l\ %s, |
| 30 | \%-G%*[\ ]^, |
| 31 | \%-G%*[\ ]^%*[~], |
| 32 | \%-G%*[\ ]... |
| 33 | |
| 34 | " New errorformat (after nightly 2016/08/10) |
| 35 | CompilerSet errorformat+= |
| 36 | \%-G, |
| 37 | \%-Gerror:\ aborting\ %.%#, |
| 38 | \%-Gerror:\ Could\ not\ compile\ %.%#, |
| 39 | \%Eerror:\ %m, |
| 40 | \%Eerror[E%n]:\ %m, |
| 41 | \%Wwarning:\ %m, |
| 42 | \%Inote:\ %m, |
| 43 | \%C\ %#-->\ %f:%l:%c |
| 44 | |
| 45 | let &cpo = s:cpo_save |
| 46 | unlet s:cpo_save |