ProgrammaticLexicalScope in a dynamic language

SyntaxEditor for Windows Forms Forum

Posted 10 years ago by Erel Uziel
Version: 14.1.0320
Avatar

Is it possible to use ProgrammaticLexicalScope inside a dynamic language?

I want to use it for an implementation of conditional compilation blocks.

Another possible solution will be to use the sematic parsing for that if it possible.

Comments (4)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Erel,

I think that dynamic languages will run into problems if non-DynamicLexicalScopes are used.  What sort of features are you trying to achieve in relation to conditional compilation blocks?


Actipro Software Support

Posted 10 years ago by Erel Uziel
Avatar

I want to to change the color of inactive code.

For example:

#if DEBUG

 ...

#else

 //code should be gray

#endif

I can update the language when the active conditions change however I don't know how (or whether it is possible) to implement #else and #elseif.

The language is a dynamic language.

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Erel,

You might have better luck using span indicators.  With those you can alter the foreground and background of text and it would occur separately from the main lexing, so you don't need to worry about modifying the lexer that way.  You could have your span indicator ranges change the text foreground to be dimmer.


Actipro Software Support

Posted 10 years ago by Erel Uziel
Avatar

Thank you. It is a great idea. We will try it.

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.