Re: Tcl Syntax Highlighting
Tony Balinski <[email protected]> Tue, 22 Jun 2010 23:54:53 +0200
| Newsgroups | gmane.editors.nedit.user |
|---|---|
| Message-ID | <[email protected]> |
Quoting Offer Kaye <[email protected]>: > Hi, > Does anyone know how to modify the Tcl syntax highlighting patterns so > that code like: > > regexp {^\s*#} $line > > Will be highlighted correctly? Currently It is highlighted as a > comment starting from the "#" character, which is wrong. > > I've tried to understand the current patterns and how they work but > either I don't understand how NEdit is setup or the default Tcl > language mode is just wrong - it uses a single quote as the start/end > delimiter for single-quoted strings which as far as I know is wrong, > "{" and "}" are the correct characters for single quoted strings. If you want {...} to pick up a string, then set up a "braced string" recognition pattern, probably best with start and end REs. eg start: \{ end: \} matching error: \n say. A # between the braces then becomes a character in the string. Make sure you move the pattern to a position just after the Single Quote String pattern. But then you'll have two other problems: nested braces (are such things valid in TCL string?) or highlighting within a brace-string, and braces when used for other reasons (are there any?) where you'll have to give REs that provide a bit of context. It can get tricky! Tony -- NEdit Discuss mailing list - [email protected] http://www.nedit.org/mailman/listinfo/discuss