2017-11-08 06:11:49 +00:00
|
|
|
" Author: Taylor Blau <me@ttaylorr.com>
|
|
|
|
|
|
|
|
function! ale_linters#dafny#dafny#Handle(buffer, lines) abort
|
|
|
|
let l:pattern = '\v(.*)\((\d+),(\d+)\): (.*): (.*)'
|
|
|
|
let l:output = []
|
|
|
|
|
|
|
|
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
|
|
|
call add(l:output, {
|
|
|
|
\ 'bufnr': a:buffer,
|
|
|
|
\ 'col': l:match[3] + 0,
|
|
|
|
\ 'lnum': l:match[2] + 0,
|
|
|
|
\ 'text': l:match[5],
|
|
|
|
\ 'type': l:match[4] =~# '^Error' ? 'E' : 'W'
|
|
|
|
\ })
|
|
|
|
endfor
|
2018-09-04 15:51:18 +00:00
|
|
|
|
2017-11-08 06:11:49 +00:00
|
|
|
return l:output
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
call ale#linter#Define('dafny', {
|
|
|
|
\ 'name': 'dafny',
|
|
|
|
\ 'executable': 'dafny',
|
|
|
|
\ 'command': 'dafny %s /compile:0',
|
|
|
|
\ 'callback': 'ale_linters#dafny#dafny#Handle',
|
2017-11-08 17:28:24 +00:00
|
|
|
\ 'lint_file': 1,
|
2017-11-08 06:11:49 +00:00
|
|
|
\ })
|