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:
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.
Thanks
-jk
[1] "The pattern group 'FunctionToken' in lexical state 'DefaultState' in the language '<my project>.Syntax' did not contain any patterns."
<ExplicitPatternGroup Key="FunctionsGroup" Token="FunctionToken" Style="FunctionStyle" LookAhead="{NonWordMacro}" CaseSensitivity="AutoCorrect">
<ExplicitPatterns>
<!--
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.
-->
dummy
</ExplicitPatterns>
</ExplicitPatternGroup>
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.
Thanks
-jk
[1] "The pattern group 'FunctionToken' in lexical state 'DefaultState' in the language '<my project>.Syntax' did not contain any patterns."