Friday, April 5, 2013

erroformat, unknown option

I'm trying to create a compiler plugin for my own needs and I'm trying to do it the proper way, i.e. by using the compiler directory. When I execute

compiler iar

Vim gives me an error:
Error detected while processing C:\Documents and Settings\user\vimfiles\compiler\iar.vim

line 54:
E518: Unknown option: %A%p~,%C

Does anybody know what is the issue? To me all those values look correct.

The code is provided below. Any help is appreciated.


let current_compiler = "iar"

if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif

"
" Setup error message format.
"
" Generic pattern for a single line error message.
" Match the filename, line number, and white space.
let s:line = '"%f"\,%l%*\s'
" Match first character of error type, the rest of the characters
" of the error type, white space, error number, column (:), and white space.
let s:line .= '%t%*\w%*\s%n:%*\s'
"Match the actual error message.
let s:line .= '%m'

" Match multi-line error message, type 1.
" Line 1. Start of the mulit-line error message (%A),
" %p~ means a string of spaces and then ~ to get a column number.
let myerrorformat = '%A%p~'.','
" Line 2. Continuation of the error line, %C, followed by generic pattern for
" a single line error message.
let myerrorformat .= '%C'.s:line.','
" Line 3, last line. End of the multi-line error message and white space.
let myerrorformat .= '%Z%*\s'

" Add another pattern for the error message.
let myerrorformat .= ','

" Match multi-line error message, type 2.
" Line 1. Start of the mulit-line error message, %A,
" %p^ means a string of spaces and then ^ to get a column number.
let myerrorformat .= '%A%p^'.','
" Line 2, last line. Match quoted filename, comma, line number and white space
let myerrorformat .= '%Z"%f"\,%l%*\s'
" Match first character of the error type, the rest of the characters of the
" error message, and the message itself.
let myerrorformat .= '%t%*\w%m'

" Add another pattern for the error message.
let myerrorformat .= ','

" Single line error message.
let myerrorformat .= s:line

execute 'CompilerSet errorformat = '.myerrorformat

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: