Merge remote-tracking branch 'lenormf/fix-lint'

This commit is contained in:
Maxime Coste 2018-07-22 21:12:06 +10:00
commit 5fb43478ff

View File

@ -55,10 +55,12 @@ define-command lint -docstring 'Parse the current buffer with a linter' %{
/:[0-9]+:[0-9]+:/ { /:[0-9]+:[0-9]+:/ {
kind = substr($4, 2) kind = substr($4, 2)
error = $2 "." $3 "," $2 "." $3 "|" kind error = $2 "." $3 "," $2 "." $3 "|" kind
msg = ""
# fix case where $5 is not the last field because of extra colons in the message # fix case where $5 is not the last field because of extra colons in the message
for (i=5; i<=NF; i++) error = error "\\:" $i for (i=5; i<=NF; i++) msg = msg ":" $i
error = error " (col " $3 ")" gsub(/\|/, "\\|", msg)
gsub("'\''", "'"''"'", error) gsub("'\''", "'"''"'", msg)
error = error msg " (col " $3 ")"
errors = errors " '\''" error "'\''" errors = errors " '\''" error "'\''"
} }
END { END {