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

RE: Syntax Question

Expand Messages
  • Geoffrey Mann
    Piet, Thanks for your response. Unfortunately, all 4 of the below lines give me the same response for the below text. 1) syn region sasProcGplot start=/proc/
    Message 1 of 6 , Feb 1, 2003
    • 0 Attachment
      Piet,
      Thanks for your response. Unfortunately, all 4 of the below lines give me the same response for the below text.
      1) syn region sasProcGplot start=/proc/ skipwhite end=/gplot/
      2) syn region sasProcGplot start=/proc/ skip=/\_s\+/ end=/gplot/
      3) syn region sasProcGplot start=/proc/ skip=/\_s/ end=/gplot/
      4) syn region sasProcGplot start=/proc/ end=/test/ oneline

      %preprocess(data=rp,vars=&rvars1,bw=500,cut=2.5,shift=10)
      run;


      /*---plots using time-of-flight on the x-axis---*/
      symbol i=join r=20;
      proc gplot data=rp1prep;

      Sorry for the rich text but I needed the highlight to show that it is going to the first "proc" string it sees and goes to the gplot. Do I want to use a cluster? I have exhaustively read the doc (which I am knowledgeable in regexp so it is hurting me), and have been playing with a lot of different combinations. Any more suggestions would be greatly appreciated.

      Geoff


      -----Original Message-----
      From: Piet Delport [mailto:pjd@...]
      Sent: Saturday, February 01, 2003 10:00 AM
      To: vim@...
      Subject: Re: Syntax Question


      On Fri, 31 Jan 2003 at 23:19:41 -0500, Geoffrey Mann wrote:
      >
      > At the moment, in the sas.vim syntax file, a specific proc is
      > specified as such:
      >
      > syn region sasProcs start="PROC FORMAT" end="\W"
      >
      > This is quite limiting because there might be two spaces or 3, who
      > knows? One thing I am sure of is that FORMAT must follow PROC in
      > order to be highlighted (although it could be on the next line). I
      > have been trying to play with combinations of match, region and/or
      > cluster to get this to work. I have been trying to think of an
      > example syntax file which has this sort of highlighting characteristic
      > but am coming up with butkus.

      Try using \_s\+ instead of the space? This will match any amount of
      whitespace, including newlines. (See :h /\s and :h /\_ for more info.)

      --
      Piet Delport
      Today's subliminal thought is: << File: ATT00013.dat >>
    • Geoffrey Mann
      OK, that should read I am not knowledgeable of regexp . :( ... From: Geoffrey Mann Sent: Saturday, February 01, 2003 3:08 PM To: Piet Delport; vim@vim.org
      Message 2 of 6 , Feb 1, 2003
      • 0 Attachment
        OK, that should read "I am not knowledgeable of regexp". :(

        -----Original Message-----
        From: Geoffrey Mann
        Sent: Saturday, February 01, 2003 3:08 PM
        To: Piet Delport; vim@...
        Subject: RE: Syntax Question


        Piet,
        Thanks for your response. Unfortunately, all 4 of the below lines give me the same response for the below text.
        1) syn region sasProcGplot start=/proc/ skipwhite end=/gplot/
        2) syn region sasProcGplot start=/proc/ skip=/\_s\+/ end=/gplot/
        3) syn region sasProcGplot start=/proc/ skip=/\_s/ end=/gplot/
        4) syn region sasProcGplot start=/proc/ end=/test/ oneline

        %preprocess(data=rp,vars=&rvars1,bw=500,cut=2.5,shift=10)
        run;


        /*---plots using time-of-flight on the x-axis---*/
        symbol i=join r=20;
        proc gplot data=rp1prep;

        Sorry for the rich text but I needed the highlight to show that it is going to the first "proc" string it sees and goes to the gplot. Do I want to use a cluster? I have exhaustively read the doc (which I am knowledgeable in regexp so it is hurting me), and have been playing with a lot of different combinations. Any more suggestions would be greatly appreciated.

        Geoff


        -----Original Message-----
        From: Piet Delport [mailto:pjd@...]
        Sent: Saturday, February 01, 2003 10:00 AM
        To: vim@...
        Subject: Re: Syntax Question


        On Fri, 31 Jan 2003 at 23:19:41 -0500, Geoffrey Mann wrote:
        >
        > At the moment, in the sas.vim syntax file, a specific proc is
        > specified as such:
        >
        > syn region sasProcs start="PROC FORMAT" end="\W"
        >
        > This is quite limiting because there might be two spaces or 3, who
        > knows? One thing I am sure of is that FORMAT must follow PROC in
        > order to be highlighted (although it could be on the next line). I
        > have been trying to play with combinations of match, region and/or
        > cluster to get this to work. I have been trying to think of an
        > example syntax file which has this sort of highlighting characteristic
        > but am coming up with butkus.

        Try using \_s\+ instead of the space? This will match any amount of
        whitespace, including newlines. (See :h /\s and :h /\_ for more info.)

        --
        Piet Delport
        Today's subliminal thought is: << File: ATT00013.dat >>
      • Geoffrey Mann
        Thought I had tried this before sending mail but looks like this works: syn match sasProcGplot /proc/ nextgroup=gplot skipwhite syn match gplot /gplot/
        Message 3 of 6 , Feb 1, 2003
        • 0 Attachment
          Thought I had tried this before sending mail but looks like this works:

          syn match sasProcGplot /proc/ nextgroup=gplot skipwhite
          syn match gplot /gplot/ contained

          -----Original Message-----
          From: Geoffrey Mann
          Sent: Saturday, February 01, 2003 7:50 PM
          To: Geoffrey Mann; Piet Delport; vim@...
          Subject: RE: Syntax Question


          OK, that should read "I am not knowledgeable of regexp". :(

          -----Original Message-----
          From: Geoffrey Mann
          Sent: Saturday, February 01, 2003 3:08 PM
          To: Piet Delport; vim@...
          Subject: RE: Syntax Question


          Piet,
          Thanks for your response. Unfortunately, all 4 of the below lines give me the same response for the below text.
          1) syn region sasProcGplot start=/proc/ skipwhite end=/gplot/
          2) syn region sasProcGplot start=/proc/ skip=/\_s\+/ end=/gplot/
          3) syn region sasProcGplot start=/proc/ skip=/\_s/ end=/gplot/
          4) syn region sasProcGplot start=/proc/ end=/test/ oneline

          %preprocess(data=rp,vars=&rvars1,bw=500,cut=2.5,shift=10)
          run;


          /*---plots using time-of-flight on the x-axis---*/
          symbol i=join r=20;
          proc gplot data=rp1prep;

          Sorry for the rich text but I needed the highlight to show that it is going to the first "proc" string it sees and goes to the gplot. Do I want to use a cluster? I have exhaustively read the doc (which I am knowledgeable in regexp so it is hurting me), and have been playing with a lot of different combinations. Any more suggestions would be greatly appreciated.

          Geoff


          -----Original Message-----
          From: Piet Delport [mailto:pjd@...]
          Sent: Saturday, February 01, 2003 10:00 AM
          To: vim@...
          Subject: Re: Syntax Question


          On Fri, 31 Jan 2003 at 23:19:41 -0500, Geoffrey Mann wrote:
          >
          > At the moment, in the sas.vim syntax file, a specific proc is
          > specified as such:
          >
          > syn region sasProcs start="PROC FORMAT" end="\W"
          >
          > This is quite limiting because there might be two spaces or 3, who
          > knows? One thing I am sure of is that FORMAT must follow PROC in
          > order to be highlighted (although it could be on the next line). I
          > have been trying to play with combinations of match, region and/or
          > cluster to get this to work. I have been trying to think of an
          > example syntax file which has this sort of highlighting characteristic
          > but am coming up with butkus.

          Try using \_s\+ instead of the space? This will match any amount of
          whitespace, including newlines. (See :h /\s and :h /\_ for more info.)

          --
          Piet Delport
          Today's subliminal thought is: << File: ATT00013.dat >>
        • Piet Delport
          ... Rich text? I only see plain text here... ... Hmm, the :syn region statements above should work. Did you do a :syn clear, or restart Vim, before trying
          Message 4 of 6 , Feb 3, 2003
          • 0 Attachment
            On Sat, 01 Feb 2003 at 15:08:06 -0500, Geoffrey Mann wrote:
            > Piet,
            > Thanks for your response. Unfortunately, all 4 of the below lines give me the same response for the below text.
            > 1) syn region sasProcGplot start=/proc/ skipwhite end=/gplot/
            > 2) syn region sasProcGplot start=/proc/ skip=/\_s\+/ end=/gplot/
            > 3) syn region sasProcGplot start=/proc/ skip=/\_s/ end=/gplot/
            > 4) syn region sasProcGplot start=/proc/ end=/test/ oneline
            >
            > %preprocess(data=rp,vars=&rvars1,bw=500,cut=2.5,shift=10)
            > run;
            >
            >
            > /*---plots using time-of-flight on the x-axis---*/
            > symbol i=join r=20;
            > proc gplot data=rp1prep;
            >
            > Sorry for the rich text but I needed the highlight to show that it is
            > going to the first "proc" string it sees and goes to the gplot.

            Rich text? I only see plain text here...

            > Do I want to use a cluster? I have exhaustively read the doc (which I
            > am knowledgeable in regexp so it is hurting me), and have been playing
            > with a lot of different combinations. Any more suggestions would be
            > greatly appreciated.

            Hmm, the :syn region statements above should work. Did you do a :syn
            clear, or restart Vim, before trying out each of the above :syn region
            statements? Not doing so could cause previously-defined regions to
            match the text, before the ones you just entered even have a chance.

            As an aside, it's probably better and more efficient to use a single
            match, instead of the regions above, as in:

            :syn match sasProcGplot /proc\_s\+gplot/

            HTH,

            --
            Piet Delport
            Today's subliminal thought is:
          Your message has been successfully submitted and would be delivered to recipients shortly.