is there a better way to determine a single-line comment for

SyntaxEditor for Windows Forms Forum

Posted 20 years ago by SamWare
Avatar
currently i'm trying to implement the "comment selection block" and "uncomment selection block". i have code to retrieve the single-line comment start pattern from the lexical parser, but it's very strict and the syntax file has to match exactly to my code.

"Single_Line_Comment_State" is, obviously, the state for the single-line comment. original was "CommentState".

string sComment = oToken.Language.LexicalStates["Single_Line_Comment_State"].LexicalScopes[0].StartLexicalPatternGroup[0].Pattern;
also, is there a way to "tag" a State or Token as a single-line comment like y'all do with "IsWhitespace" attribute for Patterns? do the lexical parser objects support custom attributes? (i haven't noticed anything for that)

Comments (3)

Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
It sounds like you're doing it correctly now. Would something like an IsComment flag help?


Actipro Software Support

Posted 20 years ago by SamWare
Avatar
just not sure if there's a better way..

in a future version of the syntax editor, will it be possible to flag a pattern as a single-line comment so the "CommentBlock" function can automatically know what to use? the information would be gathered whenever the language file is loaded and parsed.
Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Good idea... for now you could always add a string property to your languages and look at that for the comment delimiter text.


Actipro Software Support

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.