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

c_no_curly_error doesn't seem to work with nested braces

Expand Messages
  • William Budd
    Hi! The following example contains a valid C99 (and C11) compound literal: post( letter, &(struct envelope){ .stamp = { .value = ONE_CENT, .pic = RAT },
    Message 1 of 2 , Apr 26, 2013
    • 0 Attachment
      Hi! The following example contains a valid C99 (and C11) compound literal:

      post(
      letter,
      &(struct envelope){
      .stamp = {
      .value = ONE_CENT,
      .pic = RAT
      },
      .address = &address
      }
      );

      Yet even after setting "let c_no_curly_error = 1", the last closing
      parenthesis remains highlighted in red as if it were an error.

      However, if I remove the ".stamp = { ... }" struct member, the
      highlight disappears, so it seems to me that c_no_curly_error can only
      ignore un-nested pairs of braces within any given pair of parentheses.

      Can this be fixed and/or is there a workaround? I wouldn't mind
      disabling parentheses-related error checking all together, should that
      be what it takes.

      Thanks,
      Will

      --
      --
      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.
    • William Budd
      ... Sending this to vim-dev since I got no reply on the vim user list, and because I guess it s fair to call the above a bug (vim 7.3.875). I considered
      Message 2 of 2 , Apr 29, 2013
      • 0 Attachment
        > Hi! The following example contains a valid C99 (and C11) compound literal:
        >
        > post(
        > letter,
        > &(struct envelope){
        > .stamp = {
        > .value = ONE_CENT,
        > .pic = RAT
        > },
        > .address = &address
        > }
        > );
        >
        > Yet even after setting "let c_no_curly_error = 1", the last closing
        > parenthesis remains highlighted in red as if it were an error.
        >
        > However, if I remove the ".stamp = { ... }" struct member, the
        > highlight disappears, so it seems to me that c_no_curly_error can only
        > ignore un-nested pairs of braces within any given pair of parentheses.
        >
        > Can this be fixed and/or is there a workaround? I wouldn't mind
        > disabling parentheses-related error checking all together, should that
        > be what it takes.

        Sending this to vim-dev since I got no reply on the vim user list, and
        because I guess it's fair to call the above a bug (vim 7.3.875).

        I considered sending a patch of syntax/c.vim, but given that file's
        complexity, chances are I'd end up breaking something without even
        noticing. Would be happy if a dev could take a look.

        Thanks,
        Will

        --
        --
        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.