Syntax highlighting for Matlab

Ideas for new features

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
59977
Posts: 2
Joined: Tue Feb 24, 2004 8:48 pm
Location: Stockholm, Sweden

Syntax highlighting for Matlab

Post by 59977 »

Matlab uses the same character as string separator as for the transpose operator. This causes a problem with syntax highlighting. For example:

r = [sin(phi)' cos(phi)'];

will cause the characters between the apostrophes to be colored as strings. The only way around this seems to be turn off string coloration alltogether.

My proposal is to allow sequences of characters to trigger string coloration. For example (' and ,' would indicate the start of a string but )' would not. This way I think it would be possible to distinguish the two uses of the apostrophe.
flyingboz
Posts: 1
Joined: Tue Feb 24, 2004 10:30 pm

Perhaps the more generic case....

Post by flyingboz »

Extend the syntax highlighting definition to allow for
the use of regular expression matching in the identification
of keywords.

Textpad already has an excellent RE engine, it would just need
to be integrated and used w/ the syntax highlighting.

Also, as an aside - VIM allows for the use of such constructs as

def[ine] to match keyword abbreviations in languages where such is allowed. Very useful if you are following someone who is less or more
lazy than yourself.
User avatar
CyberSlug
Posts: 120
Joined: Sat Oct 04, 2003 3:41 am

Post by CyberSlug »

Try this:

Code: Select all

[Syntax]
CommentStartAlt = )'
Configure the Comments2 color to be the same as the Brackets color.
59977
Posts: 2
Joined: Tue Feb 24, 2004 8:48 pm
Location: Stockholm, Sweden

Post by 59977 »

Full regular expression matching for syntax highlighting would of course be the optimal solution, but integrating the RE engine would probably be rather complicated.

flyingboz:
Thanks for the tip, but it only partially solves the problem. For instance:

r=[x' y'];

is still affected.
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

Pls vote here http://textpad.com/forum/viewtopic.php?t=3846
59977 wrote:Full regular expression matching for syntax highlighting would of course be the optimal solution, but integrating the RE engine would probably be rather complicated.
Then I open up and see
the person fumbling here is me
a different way to be
Post Reply