]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/autoload/ale/handlers/gawk.vim

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '56df844d3c39ec494dacc69eae34272b27db185a' as '.vim/bundle/asyncomplete'
[etc/vim.git] / .vim / bundle / ale / autoload / ale / handlers / gawk.vim
1 " Author: Anthony DeDominic <adedomin@gmail.com>
2 " Description: Handle output from gawk's --lint option
3
4 function! ale#handlers#gawk#HandleGawkFormat(buffer, lines) abort
5     " Look for lines like the following:
6     " gawk: /tmp/v0fddXz/1/something.awk:1: ^ invalid char ''' in expression
7     let l:pattern = '^.\{-}:\(\d\+\):\s\+\(warning:\|\^\)\s*\(.*\)'
8     let l:output = []
9
10     for l:match in ale#util#GetMatches(a:lines, l:pattern)
11         let l:ecode = 'E'
12
13         if l:match[2] is? 'warning:'
14             let l:ecode = 'W'
15         endif
16
17         call add(l:output, {
18         \   'lnum': l:match[1] + 0,
19         \   'col': 0,
20         \   'text': l:match[3],
21         \   'code': 0,
22         \   'type': l:ecode,
23         \})
24     endfor
25
26     return l:output
27 endfunction