Hi,
I was wrong - PerformSemanticParse for child language is called! - I've found a error in my code.
But I got another issues:
1. If the first token in document text is ASPDirectiveStartToken (i.e. <% - direct lexical state transition to child language) PerformSemanticParse for child language isn't called. When I change GetNextTokenCore() in LexicalParser for root language to:
protected override IToken GetNextTokenCore()
{
int startOffset = this.TextBufferReader.Offset;
while (!this.IsAtEnd)
{
// Get the next token
IToken token = this.Manager.GetNextToken();
if (token.HasFlag(LexicalParseFlags.LanguageStart))
{
return this.Manager.ProcessChildLanguage(token);
}
return token;
}
// Return an end of document token
if (this.Token != null)
return this.Language.CreateDocumentEndToken(startOffset, this.Token.LexicalState);
else
return this.Language.CreateDocumentEndToken(startOffset, this.Language.DefaultLexicalState);
}
PerformSemanticParse for child language is called! Am I right to do a such trick or it's a bug?
2. When I parse a text like this:
<html>
<body>
<%
if(someCondition)
{
%>
<%
}
%>
</body>
</html>
PerformSemanticParse for child language is called 2 times. In first C# block I got a syntax error, since *If* block has no close brace. Does any workaround exist to parse all child language blocks one time as one block?
Thanks,
Nik