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.
1 " Author: John Gentile <johncgentile17@gmail.com>
2 " Description: Adds support for Mentor Graphics Questa/ModelSim `vcom` VHDL compiler/checker
4 call ale#Set('vhdl_vcom_executable', 'vcom')
5 " Use VHDL-2008. See `$ vcom -h` for more options
6 call ale#Set('vhdl_vcom_options', '-2008 -quiet -lint')
8 function! ale_linters#vhdl#vcom#GetCommand(buffer) abort
9 return '%e ' . ale#Pad(ale#Var(a:buffer, 'vhdl_vcom_options')) . ' %t'
12 function! ale_linters#vhdl#vcom#Handle(buffer, lines) abort
13 "Matches patterns like the following:
14 "** Warning: ../path/to/file.vhd(218): (vcom-1236) Shared variables must be of a protected type.
15 "** Error: tb_file.vhd(73): (vcom-1136) Unknown identifier "aresetn".
16 "** Error: tb_file.vhd(73): Bad resolution function (STD_LOGIC) for type (error).
17 "** Error: tb_file.vhd(73): near ":": (vcom-1576) expecting ';' or ')'.
18 let l:pattern = '^**\s\(\w*\):[a-zA-Z0-9\-\.\_\/ ]\+(\(\d\+\)):\s\+\(.*\)'
21 for l:match in ale#util#GetMatches(a:lines, l:pattern)
23 \ 'lnum': l:match[2] + 0,
24 \ 'type': l:match[1] is? 'Error' ? 'E' : 'W',
32 call ale#linter#Define('vhdl', {
34 \ 'output_stream': 'stdout',
35 \ 'executable': {b -> ale#Var(b, 'vhdl_vcom_executable')},
36 \ 'command': function('ale_linters#vhdl#vcom#GetCommand'),
37 \ 'callback': 'ale_linters#vhdl#vcom#Handle',