
Hi,
I want to override the lexing for a specific lexical state.
So I implemented this in my Dynamic lexer. Here is a simplified version:
public override ActiproSoftware.Text.Lexing.MergableLexerResult GetNextToken(ActiproSoftware.Text.ITextBufferReader reader, ActiproSoftware.Text.Lexing.ILexicalState lexicalState)
{
if (((ActiproSoftware.Text.Lexing.Implementation.LexicalStateBase)(lexicalState)).Key != "PrimaryString")
{
return base.GetNextToken(reader, lexicalState);
}
else
{
// Custom lexing logic:
reader.Read();
return new MergableLexerResult(MatchType.ExactMatch, new LexicalStateTokenData(lexicalState, MyScriptTokenId.PrimaryStringText));
}
}
The token is created, but there is no syntax highlighting
The problem is that the property ClassificationType in the LexicalStateTokenData is null.
I cannot find a way to set this property; it is readonly.
(When I call the base.GetNextToken, it is working OK)
Do you have any suggestions?
Thanks and regards,
Aernout