XML comments in ExplicitPatterns element

SyntaxEditor for Windows Forms Forum

Posted 20 years ago by Jeff Key
I have an ExplicitPatternGroup called "FunctionsGroup" that is defined in my syntax XML file, which I'm populating at runtime. I get an exception[1] if I leave its child ExplicitPatterns empty, so I've put a dummy word as the ExplicitPatterns innerText, which I'm removing programmatically before adding the real ExplicitPatterns. Here's the XML:

<ExplicitPatternGroup Key="FunctionsGroup" Token="FunctionToken" Style="FunctionStyle" LookAhead="{NonWordMacro}" CaseSensitivity="AutoCorrect">
            Function names go here.  Note that at least one pattern is required to load the file,
            so the following "dummy" is required. It is programmatically removed and replaced
            with the functions from the Syntax.xml file.
Here's the problem: When I try to load the syntax file, I'm still getting the same exception[1] that I get if the group is empty. The gotcha is that it works if I remove the XML comment in the ExplicitPatterns element.

Is this a bug? This isn't a vital issue, but I would like to be able to have that (and more, in the future) in the syntax file.


[1] "The pattern group 'FunctionToken' in lexical state 'DefaultState' in the language '<my project>.Syntax' did not contain any patterns."

Comments (1)

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

Try moving the commment to between the ExplicitPatternGroup and ExplicitPatterns tag (up one level). I believe it would work there. Anything within ExplicitPatterns is dangerous if it's not intended to be an actual explicit pattern because it tries to split out patterns out of the text within the ExplicitPatterns tag.

Actipro Software Support

The latest build of this product (v24.1.0) was released 4 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.