1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 09:35:01 +08:00

Added missing commits

This commit is contained in:
Amir Salihefendic
2019-03-11 17:39:30 -03:00
parent f50b2142bc
commit bf7b5985f1
28 changed files with 1928 additions and 0 deletions

View File

@ -0,0 +1,36 @@
" Author: John Gentile <johncgentile17@gmail.com>
" Description: Adds support for Mentor Graphics Questa/ModelSim `vlog` Verilog compiler/checker
call ale#Set('verilog_vlog_executable', 'vlog')
" See `$ vlog -h` for more options
call ale#Set('verilog_vlog_options', '-quiet -lint')
function! ale_linters#verilog#vlog#GetCommand(buffer) abort
return '%e ' . ale#Pad(ale#Var(a:buffer, 'verilog_vlog_options')) . ' %t'
endfunction
function! ale_linters#verilog#vlog#Handle(buffer, lines) abort
"Matches patterns like the following:
"** Warning: add.v(7): (vlog-2623) Undefined variable: C.
"** Error: file.v(1): (vlog-13294) Identifier must be declared with a port mode: C.
let l:pattern = '^**\s\(\w*\):[a-zA-Z0-9\-\.\_\/ ]\+(\(\d\+\)):\s\+\(.*\)'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[2] + 0,
\ 'type': l:match[1] is? 'Error' ? 'E' : 'W',
\ 'text': l:match[3],
\})
endfor
return l:output
endfunction
call ale#linter#Define('verilog', {
\ 'name': 'vlog',
\ 'output_stream': 'stdout',
\ 'executable': {b -> ale#Var(b, 'verilog_vlog_executable')},
\ 'command': function('ale_linters#verilog#vlog#GetCommand'),
\ 'callback': 'ale_linters#verilog#vlog#Handle',
\})

View File

@ -0,0 +1,35 @@
" Author: John Gentile <johncgentile17@gmail.com>
" Description: Adds support for Xilinx Vivado `xvlog` Verilog compiler/checker
call ale#Set('verilog_xvlog_executable', 'xvlog')
call ale#Set('verilog_xvlog_options', '')
function! ale_linters#verilog#xvlog#GetCommand(buffer) abort
return '%e ' . ale#Pad(ale#Var(a:buffer, 'verilog_xvlog_options')) . ' %t'
endfunction
function! ale_linters#verilog#xvlog#Handle(buffer, lines) abort
"Matches patterns like the following:
" ERROR: [VRFC 10-1412] syntax error near output [/path/to/file.v:5]
let l:pattern = '^ERROR:\s\+\(\[.*\)\[.*:\([0-9]\+\)\]'
let l:output = []
" NOTE: `xvlog` only prints 'INFO' and 'ERROR' messages
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[2] + 0,
\ 'type': 'E',
\ 'text': l:match[1],
\})
endfor
return l:output
endfunction
call ale#linter#Define('verilog', {
\ 'name': 'xvlog',
\ 'output_stream': 'stdout',
\ 'executable': {b -> ale#Var(b, 'verilog_xvlog_executable')},
\ 'command': function('ale_linters#verilog#xvlog#GetCommand'),
\ 'callback': 'ale_linters#verilog#xvlog#Handle',
\})