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 `vlog` Verilog compiler/checker
4 call ale#Set('verilog_vlog_executable', 'vlog')
5 " See `$ vlog -h` for more options
6 call ale#Set('verilog_vlog_options', '-quiet -lint')
8 function! ale_linters#verilog#vlog#GetCommand(buffer) abort
9 return '%e ' . ale#Pad(ale#Var(a:buffer, 'verilog_vlog_options')) . ' %t'
12 function! ale_linters#verilog#vlog#Handle(buffer, lines) abort
13 "Matches patterns like the following:
14 "** Warning: add.v(7): (vlog-2623) Undefined variable: C.
15 "** Error: file.v(1): (vlog-13294) Identifier must be declared with a port mode: C.
16 let l:pattern = '^**\s\(\w*\): \([a-zA-Z0-9\-\.\_\/ ]\+\)(\(\d\+\)):\s\+\(.*\)'
19 for l:match in ale#util#GetMatches(a:lines, l:pattern)
21 \ 'lnum': l:match[3] + 0,
22 \ 'type': l:match[1] is? 'Error' ? 'E' : 'W',
24 \ 'filename': l:match[2],
28 "Matches patterns like the following:
29 "** Warning: (vlog-2623) add.v(7): Undefined variable: C.
30 "** Error: (vlog-13294) file.v(1): Identifier must be declared with a port mode: C.
31 " let l:pattern = '^**\s\(\w*\):[a-zA-Z0-9\-\.\_\/ ]\+(\(\d\+\)):\s\+\(.*\)'
32 let l:pattern = '^**\s\(\w*\):\s\([^)]*)\) \([a-zA-Z0-9\-\.\_\/ ]\+\)(\(\d\+\)):\s\+\(.*\)'
34 for l:match in ale#util#GetMatches(a:lines, l:pattern)
36 \ 'lnum': l:match[4] + 0,
37 \ 'type': l:match[1] is? 'Error' ? 'E' : 'W',
38 \ 'text': l:match[2] . ' ' . l:match[5],
39 \ 'filename': l:match[3],
46 call ale#linter#Define('verilog', {
48 \ 'output_stream': 'stdout',
49 \ 'executable': {b -> ale#Var(b, 'verilog_vlog_executable')},
50 \ 'command': function('ale_linters#verilog#vlog#GetCommand'),
51 \ 'callback': 'ale_linters#verilog#vlog#Handle',