syntax highlighting and code folding for the KDE Kate editor



Many thanks for the detailed feedback!

> I don't understand where it specifies the structure of lexical items,
> e.g. that a_b and <= are single symbols, but a.b and =- are multiple
> symbols.
The character "." is a deliminator, where "_" isn't. The combination "<=" is 
in fact treated as two special symbols "<" and "=". It could be treated as a 
single symbol with StringDetect rules. Is there any advantage in doing so?

> In your list of "Program Flow", you group together reserved words
> (for, do, ...), special forms with function-like syntax (block,
> errcatch, ...), global variables (lispdebugmode, errormsg, ...), and
> normal functions which happen to take functional arguments (map,
> Why is it useful to group those?
Kate's highlighter usually emphasize keywords (e.g. class, new, if, for, 
return and so on in Java). I wanted the same thing for maxima, so I just took 
the keywords from the section "Definitions for Program Flow" in maxima's info 
files. This is also the reason, why ELSEIF is missing, it's just not 
documented there, and why EQUAL is included.

> Your list of constants is incomplete (missing inf, %gamma, etc.), but
> more seriously it is a static list -- what happens when the user
> defines new constants with declare(xxx,constant)?
Again, the constants are the one from the "Definitions for Constants" info 
file. I only added %I to it. By the way, I wonder why (according to the info 
files) MINF is an constant and INF is a variable.

If the user defines a new constant, function, whatever, it will be printed as 
normal text. Therefrom he knows it is not part of maximas standard 
vocabulary.

> Some things are listed as functions when they're actually variables
> (evfun, linenum, ibase).
That's true, there is no distinction between functions and variables. Of 
course, this should be added.

> The syntax of [...] is missing.
I don't see your point. Can you explain more? At the moment, "[" and "]" are 
just symbols. Should they provide code folding for lists?

> What about identifiers which refer to both functions and variables,
> e.g. float, gcd, ....?
This can probably be treated with child rules. This should be added.

> There doesn't seem to be a syntax specification which would allow the
> editor to do indentation properly (or perhaps Kate doesn't handle
> indentation?).
Kate handles indentation by default. Maybe you disabled it somewhere?

Again, many thanks for your comments!
Michael