Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#473 Text Highlighting Scheme

open
nobody
None
5
2005-04-18
2005-04-18
Anonymous
No

I have constructed a file that is about 48 MB that
generates a highlighting scheme for the NCAR
Command Language (NCL) for .ncl files. The highlighting
scheme was working fine as buidt in functions and
procedure keywords were added and periodically
checked to see if working.

Only recently, upon adding a few more words to the
buildt in procedures keywords list, I used

nedit -import filename

where filename is the text highlighting file. After saving
the preferences in nedit, I went to open a .ncl file and
got the following error message:

Error compiling syntax highlighting patterns:

regexp > 32767 bytes

This causes the highlighting scheme not to work on the
machine. Another collegue of mine gets a similar
message on his machine. I think this means that the file
may be too large for nedit. Can this be fixed? Can more
memory be allocated (can that be done locally on a
machine or in a script)?

Otherwise, I am very close to a successful, correct
highlighting scheme for NCL. Hope to hear back from
someone soon.

Best regards,

Paul Quelet

Colorado State University

Discussion

  • Nedit Highlighting File Scheme

     
    Attachments
  • Joerg Fischer
    Joerg Fischer
    2005-04-19

    Logged In: YES
    user_id=918104

    It isn't the patterns file that is too large. For effiency
    reasons
    the size of a regular expression is limited to the size shown
    in the error message.

    By trying to build a list of all built-in functions you've
    created
    a regexp that is too large. You could try to reduce the regexpr
    by combining keywords (e.g. instead of
    random_chi|random_gamma|random_... write
    random_(chi|gamma|... ,or so).

    However, I wouldn't recommend to write such a highlighting
    scheme in the first place. Just consider how useful it would
    be to have a C pattern, where you give a list of all library
    functions (and if you happen to write an X or Motif app you
    probably would like to add those library functions to the
    pattern,
    too).

     
  • Thorsten Haude
    Thorsten Haude
    2006-09-17

    Logged In: YES
    user_id=119143

    You could apply a simple patch to increase the limit, but
    that would also mean that nobody could use your highlighting
    patterns. I suggest trying Jörg's approach and modifiying
    the pattern set. NCL probably has different kind of
    functions, put them in different pattern.