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

Re: [jasspa] Groups in a regular expression for indentation?

Expand Messages
  • Steven Phillips
    This is absolutely fine, ME constructs a structure which is very efficient, it has to be as the same code is used by the hilighter. If you consider the regex
    Message 1 of 5 , Jul 17, 2008
    View Source
    • 0 Attachment
      This is absolutely fine, ME constructs a structure which is very
      efficient, it has to be as the same code is used by the hilighter. If
      you consider the regex '\(one\|two\|three\)' you have effectively
      wrapped three words into one regex but this is also much more
      complicated to parse, the hilighter approach is to create 3 simple rules
      and make it go much faster.

      Once you realize indent uses the same code as hilight, 20 rules does not
      seem so excessive, for example C (hkc.emf) has ~280 hilight rules and
      php script has ~450!

      Steve

      Jeremy Cowgar wrote:
      >
      > Quoting Jon Green <jon@... <mailto:jon%40jasspa.com>>:
      > > Jeremy Cowgar wrote:
      > > > I have the following indent code:
      > > >
      > > > indent .hilight.euphoria c "[-+=*/<>,{][ \t]*$" t
      > > > indent .hilight.euphoria c "[-+=*/<>,{][ \t]*--.*$" t
      > > >
      > > > The second is obviously a duplicate but it is to hanle those types of
      > > > lines that also have a comment at the end. For instance:
      > > >
      > > > constant ABC=10,
      > > > ....DEF=20
      > > >
      > > > and
      > > >
      > > > constant ABC=10, -- Dummy constant for this explanation
      > > > ....DEF=20
      > > >
      > > > Can I combined those in any way? I tried (--.*)* w/no luck.
      > > >
      > >
      > > No not really, it is OK as you have defined it.
      >
      > The only problem is I have about 10 similar statements, thus, I will have
      > about 20 lines that say roughly the same thing :-/
      >
      > Jeremy
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.