Language definition question

SyntaxEditor for Windows Forms Forum

Posted 19 years ago by meathook - Genesys Telecommunications
Avatar
I use the SyntaxEditor control in a development tool that uses an extended form of TCL. In a version 1.x language file, how do you support escaped newlines?

For example:

#set x 1 \
set y 2

would, according to my language file, treat the first line as a comment. This is due to the fact that TCL is a line delimited language. However, the parser treats the \ as an escape. Since the newline is next, it is escaped and the next line also is part of the comment.

I can provide my language file if necessary.

Comments (4)

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
If you do a regular expression it would probably be something like:
\\\n


Actipro Software Support

Posted 19 years ago by meathook - Genesys Telecommunications
Avatar
As it is right now, I use the LineTerminatorMacro for my end of comment token. How could I modify this to ignore the escaped newline?
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
You have to add a token that consumes that end of line character. That's why adding one for \\\n would probably work.


Actipro Software Support

Posted 19 years ago by meathook - Genesys Telecommunications
Avatar
Thanks for your help.
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.