Author Topic: Changing the embedded colour coding to a different lexer  (Read 4273 times)

StephenW

  • Senior Community Member
  • Posts: 186
  • Hero Points: 21
Changing the embedded colour coding to a different lexer
« on: February 01, 2008, 02:03:35 am »
I am working with some C++ code using the Borland C/C++ for OS/2 compiler.  One file has some embedded assembler code, and I have just spent several hours trying to find a bug that was caused by a bad comment in the embedded code.  It was so difficult to find because the colour coding used in C++ files for embedded assembler uses the "asm" lexer, which is set up for the Microsoft MASM assembler.  Borland's TASM assembler is a bit different.  When TASM is used for embedded assembler code, all the comments have to be done C style (using /* */), instead of using a ; to start a comment.  And the asm lexer does not colour code these C style comments, leading to my problem finding a missing */.

I want to keep the current colour coding used for the asm lexer, as it is what is needed normally.  So I am trying to set up just that project to use a new "tasm" lexer that I have defined for embedded assembler.  I have a macro that I use to change the main lexer when required, but I can not find any way of changing the embedded lexer that is selected for a file.  The p_EmbeddedLexerName property returns the name of the embedded lexer, but it is read-only, and refers to a particular location in the file, rather than a property for the whole file.

Does anyone know how I can change the embedded lexer that is selected for embedded assembler code?  Or where in all the SlickEdit macros I can find the code that selects the embedded lexer?

hs2

  • Senior Community Member
  • Posts: 2733
  • Hero Points: 284
Re: Changing the embedded colour coding to a different lexer
« Reply #1 on: February 01, 2008, 03:24:53 am »
Hi Stephen, there was already a thread conc. the same problem: http://community.slickedit.com/index.php?topic=1553.msg7850#msg7850
and also a related poll here: http://community.slickedit.com/index.php?topic=2323.msg9644#msg9644

For the time being (I also hope that this gets improved) you need to fiddle around with your 'SE-config/user.vlx' or maintain a set of them where you keep your different embedded asm lexer ([asm] section) definitions.
HS2

hs2

  • Senior Community Member
  • Posts: 2733
  • Hero Points: 284
Re: Changing the embedded colour coding to a different lexer
« Reply #2 on: February 01, 2008, 03:31:28 am »
Maybe you can wrap it into a macro using cload() with the vlx file containing the desired asm lexer.
I've planned to give it a try, but until now there was not enough pressure to do it and not enough spare time - as usual...
HS2

StephenW

  • Senior Community Member
  • Posts: 186
  • Hero Points: 21
Re: Changing the embedded colour coding to a different lexer
« Reply #3 on: February 03, 2008, 09:49:43 pm »
@SlickTeam: From the looks of the poll hs2 pointed me to, there may well be improvements in handling embedded lexers in SlickEdit 2008.  If so, then I can live with changing my user.vlx file manually in the mean time.  Is it possible to know if and what is going to be happening in this area?

@hs2: Thanks - I had not even thought of having multiple user.vlx files.  If there is nothing happening in SE2008, then I will probably look at doing my own version of cload to handle this, but there is no point in doing that if a fix is already on the way.