ProgrammaticLexicalScope in a dynamic language

SyntaxEditor for Windows Forms Forum

Posted 6 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 6 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 6 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 6 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 6 years ago by Erel Uziel
Avatar

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

The latest build of this product (v2018.1 build 0341) was released 10 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.