mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-16 01:07:06 +08:00
PHP: Make parser work with more error messages
This commit is contained in:
@@ -5,7 +5,7 @@ function! ale_linters#php#php#Handle(buffer, lines) abort
|
||||
" Matches patterns like the following:
|
||||
"
|
||||
" PHP Parse error: syntax error, unexpected ';', expecting ']' in - on line 15
|
||||
let l:pattern = ':\s\+\(.\+unexpected ''\(.\{-}\)''.*\) in - on line \(\d\+\)'
|
||||
let l:pattern = 'Parse error:\s\+\(.\{-}unexpected ''\(.\{-}\)''.\{-}\|.*\) in - on line \(\d\+\)'
|
||||
|
||||
let l:output = []
|
||||
|
||||
@@ -21,7 +21,7 @@ function! ale_linters#php#php#Handle(buffer, lines) abort
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'lnum': l:match[3] + 0,
|
||||
\ 'vcol': 0,
|
||||
\ 'col': match(getline(l:match[3]), l:match[2]) + 1,
|
||||
\ 'col': empty(l:match[2]) ? 0 : stridx(getline(l:match[3]), l:match[2]) + 1,
|
||||
\ 'text': l:match[1],
|
||||
\ 'type': 'E',
|
||||
\ 'nr': -1,
|
||||
|
||||
Reference in New Issue
Block a user