[code] [textadept] new TCL lexer

From: Joshua Krämer <joshua.kraemer.att.gmail.com>
Date: Mon, 3 Nov 2014 21:55:55 +0100

Hi all,

I have prepared a new TCL lexer for Textadept. I regret that the
current lexer has a few annoying problems and missing features. I
tried to solve that with my new lexer. For me, the result is more
useful than the current lexer -- check the attached comparison image
with some examples (current lexer on the left, mine on the right).
However, it is not perfect (see below). It would be great if people
using TCL could try it with their code and report problems they
encounter. Mitchell, feel free to add appropriate copyright
information, rename the file and distribute it with Textadept.

To try it out, copy the attached file tcl_jk.lua to
~/.textadept/lexers/ and chose the "tcl_jk" lexer in Textadept.

I see two main problems with my new lexer:

(1) Commands are not highlighted.
In TCL, there are no reserved keywords like in other languages. I
think it is impossible to highlight TCL commands properly without a
real TCL parser. The current lexer treats core TCL commands as
keywords. This however means that command names used in other
occasions, e.g. as variable names, are incorrectly highlighted as
commands, too (something like "set string string"). I prefer no command
highlighting to improper highlighting.

(2) Text enclosed in quotes is not highlighted.
In my opinion, it is more important to highlight annotated words
($variables and \escapes) inside the quoted text, because they are
subject to substitution -- and I think it is not possible to highlight
those and additionally highlight regular text inside quotes
(suggestions welcome). Anyway, quotes are just delimiters to group text
into a single word/argument, similar to braces. Thus, I think it is
logical to have no "quoted" text highlighting if there is also no
{braced} text highlighting.

Kind regards,
Joshua Krämer

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
lexer_comparison.png
Received on Mon 03 Nov 2014 - 15:55:55 EST

This archive was generated by hypermail 2.2.0 : Tue 04 Nov 2014 - 06:45:28 EST