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

Re: awk indentation

Expand Messages
  • erik
    Zvezdan, Thanks for your time to make your elaborate reply. This makes a valuable set of code for regression testing. 1.During the work this item was bothering
    Message 1 of 40 , Oct 2, 2011
      Zvezdan,

      Thanks for your time to make your elaborate reply. This makes a
      valuable set of code for regression testing.

      1.During the work this item was bothering me as well. My preference
      goes to option
      (a), so that's what I'll do.

      2. :) I like this one. A continued statement, type 1, inside what the
      indenter
      considers a continued statement, type 2. I scanned my remaining awk
      code, it
      is not much, and I was surprised to see I never do this, while in C++
      I break if's
      all the time.

      3. This is caused by new code to catch if statements that complete in
      a single line. Easy fix.

      4. Well... what a disappointment. It is supposed to support } else
      { and ignore comments now.

      5. My quick judgement is it is (are) another occurence(s) of issue 2.
      (so what you say)


      Coming week is a busy one for me, so i'll look into it after that.
      (but my plan is not to wait 6 years before the next reply like last
      time :))

      Erik.


      On 1 okt, 06:03, Zvezdan Petkovic <zpetko...@...> wrote:
      > On Sep 30, 2011, at 8:45 AM, erik wrote:
      >
      > > I think I have this issue is fixed, as well as every other pending
      > > complaint.
      >
      > Not all issues yet. :-)
      >

      --
      You received this message from the "vim_dev" 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
    • erik
      ... I tend to agree with Thilo that prefixing locals with l: is mandatory for defensive coding. I actually used names like lnum , and I had problems before
      Message 40 of 40 , Nov 14, 2011
        >
        >                                                 *local-variable* *l:var*
        > Inside functions local variables are accessed without prepending anything.
        > But you can also prepend "l:" if you like.  However, without prepending "l:"
        > you may run into reserved variable names.  For example "count".  By itself it
        > refers to "v:count".  Using "l:count" you can have a local variable with the
        > same name.


        I tend to agree with Thilo that prefixing locals with l: is mandatory
        for defensive coding.
        I actually used names like 'lnum', and I had problems before
        forgetting to declare variables in the indent script.
        Combine it and you hit variables with wider scipe. Every abbreviated
        name seems to already have a meaning anyway

        For readability I don't like it very much. I would prefer having to
        prefix everything else with s:, v: whatever and keep the locals clean
        so one can focus on the algorithm.


        The updated script can be found at the link from the earlier posts.

        Erik.

        --
        You received this message from the "vim_dev" 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
      Your message has been successfully submitted and would be delivered to recipients shortly.