Skip to content

Commit

Permalink
fix #495
Browse files Browse the repository at this point in the history
  • Loading branch information
b3b00 committed Nov 3, 2024
1 parent 2670194 commit 60f7a75
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/sly/lexer/LexerBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,17 @@ private static BuildResult<ILexer<IN>> BuildGenericSubLexers<IN>(
var subLexers = GetSubLexers(attributes);
foreach (var subLexer in subLexers)
{
var x = BuildGenericLexer(subLexer.Value, extensionBuilder, result, lang, explicitTokens);
var currentGenericLexer = x.Result as GenericLexer<IN>;
BuildResult<ILexer<IN>> b = null;
if (subLexer.Key == ModeAttribute.DefaultLexerMode)
{
b = BuildGenericLexer(subLexer.Value, extensionBuilder, result, lang, explicitTokens);
}
else
{
b = BuildGenericLexer(subLexer.Value, extensionBuilder, result, lang, null);
}

var currentGenericLexer = b.Result as GenericLexer<IN>;
if (genLexer == null)
{
genLexer = currentGenericLexer;
Expand Down

0 comments on commit 60f7a75

Please sign in to comment.