Loading ...
Sorry, an error occurred while loading the content.

erroformat, unknown option

Expand Messages
  • FlashBurn
    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
    Message 1 of 5 , Apr 5, 2013
    • 0 Attachment
      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@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Gary Johnson
      ... The message says that the error in on line 54. There are not 54 lines in what you provided. Nevertheless, the problem is the last line: execute
      Message 2 of 5 , Apr 5, 2013
      • 0 Attachment
        On 2013-04-05, FlashBurn wrote:
        > 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.

        The message says that the error in on line 54. There are not 54
        lines in what you provided.

        Nevertheless, the problem is the last line:

        execute 'CompilerSet errorformat = '.myerrorformat

        ":help :CompilerSet" shows that the CompilerSet command is a type of
        :set command, and :set commands do not accept spaces on either side
        of the =. The following should solve that problem.

        execute 'CompilerSet errorformat='.myerrorformat

        Regards,
        Gary

        --
        --
        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@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • FlashBurn
        ... Gary, You were right. I needed to eliminate the spaces. But then I also needed to to the following execute CompilerSet
        Message 3 of 5 , Apr 8, 2013
        • 0 Attachment
          On Friday, April 5, 2013 6:49:43 PM UTC-4, Gary Johnson wrote:
          > On 2013-04-05, FlashBurn wrote:
          >
          > > 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.
          >
          >
          >
          > The message says that the error in on line 54. There are not 54
          >
          > lines in what you provided.
          >
          >
          >
          > Nevertheless, the problem is the last line:
          >
          >
          >
          > execute 'CompilerSet errorformat = '.myerrorformat
          >
          >
          >
          > ":help :CompilerSet" shows that the CompilerSet command is a type of
          >
          > :set command, and :set commands do not accept spaces on either side
          >
          > of the =. The following should solve that problem.
          >
          >
          >
          > execute 'CompilerSet errorformat='.myerrorformat
          >
          >
          >
          > Regards,
          >
          > Gary

          Gary,

          You were right. I needed to eliminate the spaces. But then I also needed to to the following

          execute 'CompilerSet errorformat='.escape(s:myerrorformat,'",\'), i.e I needed to escape comma, quotation mark, and backslash. I can't quite to figure out why, does anybody have any ideas?

          --
          --
          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@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Gary Johnson
          ... The comma is the separator between entries of the errorformat . Therefore, any comma within an errorformat entry must be escaped. In the context of a
          Message 4 of 5 , Apr 8, 2013
          • 0 Attachment
            On 2013-04-08, FlashBurn wrote:

            > Gary,
            >
            > You were right. I needed to eliminate the spaces. But then I also
            > needed to to the following
            >
            > execute 'CompilerSet errorformat='.escape(s:myerrorformat,'",\'),
            > i.e I needed to escape comma, quotation mark, and backslash. I
            > can't quite to figure out why, does anybody have any ideas?

            The comma is the separator between entries of the 'errorformat'.
            Therefore, any comma within an 'errorformat' entry must be
            escaped.

            In the context of a :set command, a quotation mark starts a comment,
            so a quotation mark that is part of the :set command must be
            escaped.

            The backslash is the escape character, so to include a literal
            escape in just about any context in Vim, it must be escaped.

            See
            :help efm-entries
            :help option-backslash

            Regards,
            Gary

            --
            --
            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@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • FlashBurn
            ... Gary, Thanks for the help. I really appreciate it. -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the
            Message 5 of 5 , Apr 8, 2013
            • 0 Attachment
              On Monday, April 8, 2013 11:09:55 AM UTC-4, Gary Johnson wrote:
              > On 2013-04-08, FlashBurn wrote:
              >
              >
              >
              > > Gary,
              >
              > >
              >
              > > You were right. I needed to eliminate the spaces. But then I also
              >
              > > needed to to the following
              >
              > >
              >
              > > execute 'CompilerSet errorformat='.escape(s:myerrorformat,'",\'),
              >
              > > i.e I needed to escape comma, quotation mark, and backslash. I
              >
              > > can't quite to figure out why, does anybody have any ideas?
              >
              >
              >
              > The comma is the separator between entries of the 'errorformat'.
              >
              > Therefore, any comma within an 'errorformat' entry must be
              >
              > escaped.
              >
              >
              >
              > In the context of a :set command, a quotation mark starts a comment,
              >
              > so a quotation mark that is part of the :set command must be
              >
              > escaped.
              >
              >
              >
              > The backslash is the escape character, so to include a literal
              >
              > escape in just about any context in Vim, it must be escaped.
              >
              >
              >
              > See
              >
              > :help efm-entries
              >
              > :help option-backslash
              >
              >
              >
              > Regards,
              >
              > Gary

              Gary,

              Thanks for the help. I really appreciate it.

              --
              --
              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@....
              For more options, visit https://groups.google.com/groups/opt_out.
            Your message has been successfully submitted and would be delivered to recipients shortly.