From fd6a3b1a87cd13c28afbd43bc7b1c2d45e689bc5 Mon Sep 17 00:00:00 2001
From: Luthetus <45454132+huntercfreeman@users.noreply.github.com>
Date: Sat, 14 Dec 2024 12:16:06 -0500
Subject: [PATCH 1/7] Update IdeInfoDisplay.razor
---
.../Shareds/Displays/Internals/IdeInfoDisplay.razor | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Source/Lib/Ide/Ide.RazorLib/Shareds/Displays/Internals/IdeInfoDisplay.razor b/Source/Lib/Ide/Ide.RazorLib/Shareds/Displays/Internals/IdeInfoDisplay.razor
index ed3a4658f..1df68ec11 100644
--- a/Source/Lib/Ide/Ide.RazorLib/Shareds/Displays/Internals/IdeInfoDisplay.razor
+++ b/Source/Lib/Ide/Ide.RazorLib/Shareds/Displays/Internals/IdeInfoDisplay.razor
@@ -174,7 +174,7 @@
From b19a19498eeae9c4f60b002b65ed728c4679f613 Mon Sep 17 00:00:00 2001
From: Luthetus <45454132+huntercfreeman@users.noreply.github.com>
Date: Sat, 14 Dec 2024 16:33:56 -0500
Subject: [PATCH 2/7] Remove from 'CSharpParserModel' Binder and BinderSession
properties
---
.../BinderCase/CSharpBinder.Expressions.cs | 10 +-
.../CSharp/BinderCase/CSharpBinder.Main.cs | 112 +++++++++---------
.../CSharp/ParserCase/CSharpParser.cs | 2 -
.../CSharp/ParserCase/CSharpParserModel.cs | 6 -
.../Internals/ParseDefaultKeywords.cs | 10 +-
.../ParserCase/Internals/ParseFunctions.cs | 8 +-
.../ParserCase/Internals/ParseOthers.cs | 10 +-
.../ParserCase/Internals/ParseTokens.cs | 20 ++--
.../ParserCase/Internals/ParseVariables.cs | 2 +-
9 files changed, 86 insertions(+), 94 deletions(-)
diff --git a/Source/Lib/CompilerServices/CSharp/BinderCase/CSharpBinder.Expressions.cs b/Source/Lib/CompilerServices/CSharp/BinderCase/CSharpBinder.Expressions.cs
index 4726a3690..3463d55fd 100644
--- a/Source/Lib/CompilerServices/CSharp/BinderCase/CSharpBinder.Expressions.cs
+++ b/Source/Lib/CompilerServices/CSharp/BinderCase/CSharpBinder.Expressions.cs
@@ -340,8 +340,8 @@ public IExpressionNode ForceDecisionAmbiguousIdentifier(
{
if (TryGetVariableDeclarationHierarchically(
compilationUnit,
- compilationUnit.ParserModel.BinderSession.ResourceUri,
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey,
+ compilationUnit.BinderSession.ResourceUri,
+ compilationUnit.BinderSession.CurrentScopeIndexKey,
ambiguousIdentifierExpressionNode.Token.TextSpan.GetText(),
out var existingVariableDeclarationNode))
{
@@ -360,8 +360,8 @@ public IExpressionNode ForceDecisionAmbiguousIdentifier(
{
if (TryGetTypeDefinitionHierarchically(
compilationUnit,
- compilationUnit.ParserModel.BinderSession.ResourceUri,
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey,
+ compilationUnit.BinderSession.ResourceUri,
+ compilationUnit.BinderSession.CurrentScopeIndexKey,
ambiguousIdentifierExpressionNode.Token.TextSpan.GetText(),
out var typeDefinitionNode))
{
@@ -1028,7 +1028,7 @@ public IExpressionNode LambdaMergeToken(
token.TextSpan.ResourceUri,
token.TextSpan.SourceText);
- ((CSharpBinder)compilationUnit.ParserModel.Binder).AddSymbolDefinition(
+ ((CSharpBinder)compilationUnit.Binder).AddSymbolDefinition(
new LambdaSymbol(textSpan, lambdaExpressionNode), compilationUnit);
if (compilationUnit.ParserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.OpenBraceToken)
diff --git a/Source/Lib/CompilerServices/CSharp/BinderCase/CSharpBinder.Main.cs b/Source/Lib/CompilerServices/CSharp/BinderCase/CSharpBinder.Main.cs
index 320373ba8..c77fe43a4 100644
--- a/Source/Lib/CompilerServices/CSharp/BinderCase/CSharpBinder.Main.cs
+++ b/Source/Lib/CompilerServices/CSharp/BinderCase/CSharpBinder.Main.cs
@@ -259,12 +259,12 @@ public void BindFunctionDefinitionNode(
if (!TryAddFunctionDefinitionNodeByScope(
compilationUnit,
- compilationUnit.ParserModel.BinderSession.ResourceUri,
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey,
+ compilationUnit.BinderSession.ResourceUri,
+ compilationUnit.BinderSession.CurrentScopeIndexKey,
functionIdentifierText,
functionDefinitionNode))
{
- compilationUnit.ParserModel.BinderSession.DiagnosticBag.ReportAlreadyDefinedFunction(
+ compilationUnit.BinderSession.DiagnosticBag.ReportAlreadyDefinedFunction(
functionDefinitionNode.FunctionIdentifierToken.TextSpan,
functionIdentifierText);
}
@@ -286,8 +286,8 @@ public void BindFunctionOptionalArgument(
// TODO: Wouldn't this have a '!' at the start? And '... && typeDefinitionNode is not null' (2024-10-25)
if (TryGetTypeDefinitionHierarchically(
model,
- compilationUnit.ParserModel.BinderSession.ResourceUri,
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey,
+ compilationUnit.BinderSession.ResourceUri,
+ compilationUnit.BinderSession.CurrentScopeIndexKey,
argumentTypeClauseNode.TypeIdentifierToken.TextSpan.GetText(),
out var typeDefinitionNode)
|| typeDefinitionNode is null)
@@ -309,7 +309,7 @@ public void BindFunctionOptionalArgument(
EndingIndexExclusive = functionArgumentEntryNode.VariableDeclarationNode.IdentifierToken.TextSpan.EndingIndexExclusive
};
- compilationUnit.ParserModel.BinderSession.DiagnosticBag.ReportBadFunctionOptionalArgumentDueToMismatchInType(
+ compilationUnit.BinderSession.DiagnosticBag.ReportBadFunctionOptionalArgumentDueToMismatchInType(
optionalArgumentTextSpan,
functionArgumentEntryNode.VariableDeclarationNode.IdentifierToken.TextSpan.GetText(),
functionArgumentEntryNode.VariableDeclarationNode.TypeClauseNode.ValueType?.Name ?? "null",
@@ -344,7 +344,7 @@ public void SetCurrentNamespaceStatementNode(
NamespaceStatementNode namespaceStatementNode,
CSharpCompilationUnit compilationUnit)
{
- compilationUnit.ParserModel.BinderSession.CurrentNamespaceStatementNode = namespaceStatementNode;
+ compilationUnit.BinderSession.CurrentNamespaceStatementNode = namespaceStatementNode;
}
public void BindNamespaceStatementNode(
@@ -406,8 +406,8 @@ public void BindVariableDeclarationNode(
if (TryGetVariableDeclarationNodeByScope(
compilationUnit,
- compilationUnit.ParserModel.BinderSession.ResourceUri,
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey,
+ compilationUnit.BinderSession.ResourceUri,
+ compilationUnit.BinderSession.CurrentScopeIndexKey,
text,
out var existingVariableDeclarationNode))
{
@@ -419,13 +419,13 @@ public void BindVariableDeclarationNode(
// (if there is an error where something is defined twice for example)
SetVariableDeclarationNodeByScope(
compilationUnit,
- compilationUnit.ParserModel.BinderSession.ResourceUri,
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey,
+ compilationUnit.BinderSession.ResourceUri,
+ compilationUnit.BinderSession.CurrentScopeIndexKey,
text,
variableDeclarationNode);
}
- compilationUnit.ParserModel.BinderSession.DiagnosticBag.ReportAlreadyDefinedVariable(
+ compilationUnit.BinderSession.DiagnosticBag.ReportAlreadyDefinedVariable(
variableDeclarationNode.IdentifierToken.TextSpan,
text);
}
@@ -433,8 +433,8 @@ public void BindVariableDeclarationNode(
{
_ = TryAddVariableDeclarationNodeByScope(
compilationUnit,
- compilationUnit.ParserModel.BinderSession.ResourceUri,
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey,
+ compilationUnit.BinderSession.ResourceUri,
+ compilationUnit.BinderSession.CurrentScopeIndexKey,
text,
variableDeclarationNode);
}
@@ -449,8 +449,8 @@ public VariableReferenceNode ConstructAndBindVariableReferenceNode(
if (TryGetVariableDeclarationHierarchically(
compilationUnit,
- compilationUnit.ParserModel.BinderSession.ResourceUri,
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey,
+ compilationUnit.BinderSession.ResourceUri,
+ compilationUnit.BinderSession.CurrentScopeIndexKey,
text,
out var variableDeclarationNode)
&& variableDeclarationNode is not null)
@@ -474,7 +474,7 @@ public VariableReferenceNode ConstructAndBindVariableReferenceNode(
variableIdentifierToken,
variableDeclarationNode);
- compilationUnit.ParserModel.BinderSession.DiagnosticBag.ReportUndefinedVariable(
+ compilationUnit.BinderSession.DiagnosticBag.ReportUndefinedVariable(
variableIdentifierToken.TextSpan,
text);
}
@@ -492,8 +492,8 @@ public void BindVariableAssignmentExpressionNode(
if (TryGetVariableDeclarationHierarchically(
compilationUnit,
- compilationUnit.ParserModel.BinderSession.ResourceUri,
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey,
+ compilationUnit.BinderSession.ResourceUri,
+ compilationUnit.BinderSession.CurrentScopeIndexKey,
text,
out var variableDeclarationNode)
&& variableDeclarationNode is not null)
@@ -508,13 +508,13 @@ public void BindVariableAssignmentExpressionNode(
{
if (UtilityApi.IsContextualKeywordSyntaxKind(text))
{
- compilationUnit.ParserModel.BinderSession.DiagnosticBag.TheNameDoesNotExistInTheCurrentContext(
+ compilationUnit.BinderSession.DiagnosticBag.TheNameDoesNotExistInTheCurrentContext(
variableAssignmentExpressionNode.VariableIdentifierToken.TextSpan,
text);
}
else
{
- compilationUnit.ParserModel.BinderSession.DiagnosticBag.ReportUndefinedVariable(
+ compilationUnit.BinderSession.DiagnosticBag.ReportUndefinedVariable(
variableAssignmentExpressionNode.VariableIdentifierToken.TextSpan,
text);
}
@@ -551,8 +551,8 @@ public void BindFunctionInvocationNode(
if (TryGetFunctionHierarchically(
compilationUnit,
- compilationUnit.ParserModel.BinderSession.ResourceUri,
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey,
+ compilationUnit.BinderSession.ResourceUri,
+ compilationUnit.BinderSession.CurrentScopeIndexKey,
functionInvocationIdentifierText,
out var functionDefinitionNode) &&
functionDefinitionNode is not null)
@@ -561,7 +561,7 @@ public void BindFunctionInvocationNode(
}
else
{
- compilationUnit.ParserModel.BinderSession.DiagnosticBag.ReportUndefinedFunction(
+ compilationUnit.BinderSession.DiagnosticBag.ReportUndefinedFunction(
functionInvocationNode.FunctionInvocationIdentifierToken.TextSpan,
functionInvocationIdentifierText);
}
@@ -623,7 +623,7 @@ public void BindUsingStatementNode(
{
AddSymbolReference(new NamespaceSymbol(usingStatementNode.NamespaceIdentifier.TextSpan), compilationUnit);
- compilationUnit.ParserModel.BinderSession.CurrentUsingStatementNodeList.Add(usingStatementNode);
+ compilationUnit.BinderSession.CurrentUsingStatementNodeList.Add(usingStatementNode);
AddNamespaceToCurrentScope(usingStatementNode.NamespaceIdentifier.TextSpan.GetText(), compilationUnit);
}
@@ -654,13 +654,13 @@ public void OpenScope(
{
var scope = new Scope(
codeBlockOwner,
- indexKey: compilationUnit.ParserModel.BinderSession.GetNextIndexKey(),
- parentIndexKey: compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey,
+ indexKey: compilationUnit.BinderSession.GetNextIndexKey(),
+ parentIndexKey: compilationUnit.BinderSession.CurrentScopeIndexKey,
textSpan.StartingIndexInclusive,
endingIndexExclusive: null);
- compilationUnit.ParserModel.BinderSession.ScopeList.Insert(scope.IndexKey, scope);
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey = scope.IndexKey;
+ compilationUnit.BinderSession.ScopeList.Insert(scope.IndexKey, scope);
+ compilationUnit.BinderSession.CurrentScopeIndexKey = scope.IndexKey;
}
public void AddNamespaceToCurrentScope(string namespaceString, IParserModel parserModel) =>
@@ -682,8 +682,8 @@ public void AddNamespaceToCurrentScope(
{
_ = TryAddTypeDefinitionNodeByScope(
compilationUnit,
- compilationUnit.ParserModel.BinderSession.ResourceUri,
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey,
+ compilationUnit.BinderSession.ResourceUri,
+ compilationUnit.BinderSession.CurrentScopeIndexKey,
typeDefinitionNode.TypeIdentifierToken.TextSpan.GetText(),
typeDefinitionNode);
}
@@ -696,7 +696,7 @@ public void CloseScope(
{
// Check if it is the global scope, if so return early.
{
- if (compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey == 0)
+ if (compilationUnit.BinderSession.CurrentScopeIndexKey == 0)
return;
}
@@ -708,14 +708,14 @@ public void CloseScope(
// Update Scope
{
- var scope = compilationUnit.ParserModel.BinderSession.ScopeList[compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey];
+ var scope = compilationUnit.BinderSession.ScopeList[compilationUnit.BinderSession.CurrentScopeIndexKey];
scope.EndingIndexExclusive = textSpan.EndingIndexExclusive;
- compilationUnit.ParserModel.BinderSession.ScopeList[compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey] = scope;
+ compilationUnit.BinderSession.ScopeList[compilationUnit.BinderSession.CurrentScopeIndexKey] = scope;
// Restore Parent Scope
if (scope.ParentIndexKey is not null)
{
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey = scope.ParentIndexKey.Value;
+ compilationUnit.BinderSession.CurrentScopeIndexKey = scope.ParentIndexKey.Value;
}
}
@@ -725,9 +725,9 @@ public void CloseScope(
inOwner.SetCodeBlockNode(inBuilder.Build(), compilationUnit.ParserModel.DiagnosticBag, compilationUnit.ParserModel.TokenWalker);
if (inOwner.SyntaxKind == SyntaxKind.NamespaceStatementNode)
- compilationUnit.ParserModel.Binder.BindNamespaceStatementNode((NamespaceStatementNode)inOwner, compilationUnit);
+ compilationUnit.Binder.BindNamespaceStatementNode((NamespaceStatementNode)inOwner, compilationUnit);
else if (inOwner.SyntaxKind == SyntaxKind.TypeDefinitionNode)
- compilationUnit.ParserModel.Binder.BindTypeDefinitionNode((TypeDefinitionNode)inOwner, compilationUnit, true);
+ compilationUnit.Binder.BindTypeDefinitionNode((TypeDefinitionNode)inOwner, compilationUnit, true);
// Restore Parent CodeBlockBuilder
if (outBuilder is not null)
@@ -751,15 +751,15 @@ public void BindTypeDefinitionNode(
bool shouldOverwrite = false)
{
var typeIdentifierText = typeDefinitionNode.TypeIdentifierToken.TextSpan.GetText();
- var currentNamespaceStatementText = compilationUnit.ParserModel.BinderSession.CurrentNamespaceStatementNode.IdentifierToken.TextSpan.GetText();
+ var currentNamespaceStatementText = compilationUnit.BinderSession.CurrentNamespaceStatementNode.IdentifierToken.TextSpan.GetText();
var namespaceAndTypeIdentifiers = new NamespaceAndTypeIdentifiers(currentNamespaceStatementText, typeIdentifierText);
typeDefinitionNode.EncompassingNamespaceIdentifierString = currentNamespaceStatementText;
if (TryGetTypeDefinitionNodeByScope(
compilationUnit,
- compilationUnit.ParserModel.BinderSession.ResourceUri,
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey,
+ compilationUnit.BinderSession.ResourceUri,
+ compilationUnit.BinderSession.CurrentScopeIndexKey,
typeIdentifierText,
out var existingTypeDefinitionNode))
{
@@ -767,8 +767,8 @@ public void BindTypeDefinitionNode(
{
SetTypeDefinitionNodeByScope(
compilationUnit,
- compilationUnit.ParserModel.BinderSession.ResourceUri,
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey,
+ compilationUnit.BinderSession.ResourceUri,
+ compilationUnit.BinderSession.CurrentScopeIndexKey,
typeIdentifierText,
typeDefinitionNode);
}
@@ -777,8 +777,8 @@ public void BindTypeDefinitionNode(
{
_ = TryAddTypeDefinitionNodeByScope(
compilationUnit,
- compilationUnit.ParserModel.BinderSession.ResourceUri,
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey,
+ compilationUnit.BinderSession.ResourceUri,
+ compilationUnit.BinderSession.CurrentScopeIndexKey,
typeIdentifierText,
typeDefinitionNode);
}
@@ -800,10 +800,10 @@ private void AddSymbolDefinition(
{
var symbolDefinitionId = ISymbol.GetSymbolDefinitionId(
symbol.TextSpan.GetText(),
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey);
+ compilationUnit.BinderSession.CurrentScopeIndexKey);
var symbolDefinition = new SymbolDefinition(
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey,
+ compilationUnit.BinderSession.CurrentScopeIndexKey,
symbol);
if (!_symbolDefinitions.TryAdd(
@@ -829,14 +829,14 @@ private void AddSymbolReference(ISymbol symbol, CSharpCompilationUnit compilatio
{
var symbolDefinitionId = ISymbol.GetSymbolDefinitionId(
symbol.TextSpan.GetText(),
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey);
+ compilationUnit.BinderSession.CurrentScopeIndexKey);
if (!_symbolDefinitions.TryGetValue(
symbolDefinitionId,
out var symbolDefinition))
{
symbolDefinition = new SymbolDefinition(
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey,
+ compilationUnit.BinderSession.CurrentScopeIndexKey,
symbol)
{
IsFabricated = true
@@ -853,7 +853,7 @@ private void AddSymbolReference(ISymbol symbol, CSharpCompilationUnit compilatio
symbolDefinition.SymbolReferences.Add(new SymbolReference(
symbol,
- compilationUnit.ParserModel.BinderSession.CurrentScopeIndexKey));
+ compilationUnit.BinderSession.CurrentScopeIndexKey));
}
public void CreateVariableSymbol(
@@ -1104,9 +1104,9 @@ bool IBinder.TryGetBinderSession(ResourceUri resourceUri, out IBinderSession bin
public bool TryGetBinderSession(CSharpCompilationUnit? compilationUnit, ResourceUri resourceUri, out IBinderSession binderSession)
{
if (compilationUnit is not null &&
- resourceUri == compilationUnit.ParserModel.BinderSession.ResourceUri)
+ resourceUri == compilationUnit.BinderSession.ResourceUri)
{
- binderSession = compilationUnit.ParserModel.BinderSession;
+ binderSession = compilationUnit.BinderSession;
return true;
}
@@ -1733,7 +1733,7 @@ public void OnBoundScopeCreatedAndSetAsCurrent(ICodeBlockOwner codeBlockOwner, C
{
foreach (var argument in typeDefinitionNode.PrimaryConstructorFunctionArgumentsListingNode.FunctionArgumentEntryNodeList)
{
- compilationUnit.ParserModel.Binder.BindVariableDeclarationNode(argument.VariableDeclarationNode, compilationUnit);
+ compilationUnit.Binder.BindVariableDeclarationNode(argument.VariableDeclarationNode, compilationUnit);
}
}
}
@@ -1741,27 +1741,27 @@ public void OnBoundScopeCreatedAndSetAsCurrent(ICodeBlockOwner codeBlockOwner, C
{
var namespaceStatementNode = (NamespaceStatementNode)codeBlockOwner;
var namespaceString = namespaceStatementNode.IdentifierToken.TextSpan.GetText();
- compilationUnit.ParserModel.Binder.AddNamespaceToCurrentScope(namespaceString, compilationUnit);
+ compilationUnit.Binder.AddNamespaceToCurrentScope(namespaceString, compilationUnit);
}
else if (codeBlockOwner.SyntaxKind == SyntaxKind.FunctionDefinitionNode)
{
var functionDefinitionNode = (FunctionDefinitionNode)codeBlockOwner;
foreach (var argument in functionDefinitionNode.FunctionArgumentsListingNode.FunctionArgumentEntryNodeList)
{
- compilationUnit.ParserModel.Binder.BindVariableDeclarationNode(argument.VariableDeclarationNode, compilationUnit);
+ compilationUnit.Binder.BindVariableDeclarationNode(argument.VariableDeclarationNode, compilationUnit);
}
}
else if (codeBlockOwner.SyntaxKind == SyntaxKind.ForeachStatementNode)
{
var foreachStatementNode = (ForeachStatementNode)codeBlockOwner;
- compilationUnit.ParserModel.Binder.BindVariableDeclarationNode(foreachStatementNode.VariableDeclarationNode, compilationUnit);
+ compilationUnit.Binder.BindVariableDeclarationNode(foreachStatementNode.VariableDeclarationNode, compilationUnit);
}
else if (codeBlockOwner.SyntaxKind == SyntaxKind.ConstructorDefinitionNode)
{
var constructorDefinitionNode = (ConstructorDefinitionNode)codeBlockOwner;
foreach (var argument in constructorDefinitionNode.FunctionArgumentsListingNode.FunctionArgumentEntryNodeList)
{
- compilationUnit.ParserModel.Binder.BindVariableDeclarationNode(argument.VariableDeclarationNode, compilationUnit);
+ compilationUnit.Binder.BindVariableDeclarationNode(argument.VariableDeclarationNode, compilationUnit);
}
}
}
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpParser.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpParser.cs
index 2642a2826..25920e39d 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpParser.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpParser.cs
@@ -33,8 +33,6 @@ public void Parse(CSharpCompilationUnit compilationUnit)
var diagnosticBag = new DiagnosticBag();
compilationUnit.ParserModel = new CSharpParserModel(
- compilationUnit.Binder,
- compilationUnit.BinderSession,
new TokenWalker(compilationUnit.Lexer.SyntaxTokenList, diagnosticBag),
new Stack
(),
diagnosticBag,
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpParserModel.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpParserModel.cs
index 102242f5b..e2860900b 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpParserModel.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpParserModel.cs
@@ -14,8 +14,6 @@ namespace Luthetus.CompilerServices.CSharp.ParserCase;
public class CSharpParserModel
{
public CSharpParserModel(
- CSharpBinder binder,
- CSharpBinderSession binderSession,
TokenWalker tokenWalker,
Stack syntaxStack,
DiagnosticBag diagnosticBag,
@@ -26,8 +24,6 @@ public CSharpParserModel(
++LuthetusDebugSomething.ParserModel_ConstructorInvocationCount;
#endif
- Binder = binder;
- BinderSession = binderSession;
TokenWalker = tokenWalker;
SyntaxStack = syntaxStack;
DiagnosticBag = diagnosticBag;
@@ -40,8 +36,6 @@ public CSharpParserModel(
ForceParseExpressionInitialPrimaryExpression = EmptyExpressionNode.Empty;
}
- public CSharpBinder Binder { get; }
- public CSharpBinderSession BinderSession { get; }
public TokenWalker TokenWalker { get; }
public Stack SyntaxStack { get; set; }
public CSharpStatementBuilder StatementBuilder { get; set; } = new();
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseDefaultKeywords.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseDefaultKeywords.cs
index 56a135230..a5bb98b06 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseDefaultKeywords.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseDefaultKeywords.cs
@@ -721,7 +721,7 @@ public static void HandleIfTokenKeyword(CSharpCompilationUnit compilationUnit)
compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, null));
var expression = ParseOthers.ParseExpression(compilationUnit);
- var boundIfStatementNode = compilationUnit.ParserModel.Binder.BindIfStatementNode(ifTokenKeyword, expression);
+ var boundIfStatementNode = compilationUnit.Binder.BindIfStatementNode(ifTokenKeyword, expression);
compilationUnit.ParserModel.SyntaxStack.Push(boundIfStatementNode);
compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = boundIfStatementNode;
}
@@ -744,7 +744,7 @@ public static void HandleUsingTokenKeyword(CSharpCompilationUnit compilationUnit
usingKeywordToken,
namespaceIdentifier);
- compilationUnit.ParserModel.Binder.BindUsingStatementNode(usingStatementNode, compilationUnit);
+ compilationUnit.Binder.BindUsingStatementNode(usingStatementNode, compilationUnit);
compilationUnit.ParserModel.StatementBuilder.ChildList.Add(usingStatementNode);
}
@@ -869,8 +869,8 @@ public static void HandleStorageModifierTokenKeyword(CSharpCompilationUnit compi
openBraceToken: default,
codeBlockNode: null);
- compilationUnit.ParserModel.Binder.BindTypeDefinitionNode(typeDefinitionNode, compilationUnit);
- compilationUnit.ParserModel.Binder.BindTypeIdentifier(identifierToken, compilationUnit);
+ compilationUnit.Binder.BindTypeDefinitionNode(typeDefinitionNode, compilationUnit);
+ compilationUnit.Binder.BindTypeIdentifier(identifierToken, compilationUnit);
compilationUnit.ParserModel.SyntaxStack.Push(typeDefinitionNode);
compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = typeDefinitionNode;
}
@@ -899,7 +899,7 @@ public static void HandleNamespaceTokenKeyword(CSharpCompilationUnit compilation
namespaceIdentifier,
null);
- compilationUnit.ParserModel.Binder.SetCurrentNamespaceStatementNode(namespaceStatementNode, compilationUnit);
+ compilationUnit.Binder.SetCurrentNamespaceStatementNode(namespaceStatementNode, compilationUnit);
compilationUnit.ParserModel.SyntaxStack.Push(namespaceStatementNode);
compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = namespaceStatementNode;
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseFunctions.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseFunctions.cs
index aceecc343..92de6efb8 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseFunctions.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseFunctions.cs
@@ -41,7 +41,7 @@ public static void HandleFunctionDefinition(
null,
null);
- compilationUnit.ParserModel.Binder.BindFunctionDefinitionNode(functionDefinitionNode, compilationUnit);
+ compilationUnit.Binder.BindFunctionDefinitionNode(functionDefinitionNode, compilationUnit);
compilationUnit.ParserModel.SyntaxStack.Push(functionDefinitionNode);
compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = functionDefinitionNode;
@@ -54,9 +54,9 @@ public static void HandleFunctionDefinition(
foreach (var argument in functionDefinitionNode.FunctionArgumentsListingNode.FunctionArgumentEntryNodeList)
{
if (argument.IsOptional)
- compilationUnit.ParserModel.Binder.BindFunctionOptionalArgument(argument, compilationUnit);
+ compilationUnit.Binder.BindFunctionOptionalArgument(argument, compilationUnit);
else
- compilationUnit.ParserModel.Binder.BindVariableDeclarationNode(argument.VariableDeclarationNode, compilationUnit);
+ compilationUnit.Binder.BindVariableDeclarationNode(argument.VariableDeclarationNode, compilationUnit);
}
}
}
@@ -81,7 +81,7 @@ public static void HandleConstructorDefinition(
null,
null);
- compilationUnit.ParserModel.Binder.BindConstructorDefinitionIdentifierToken(consumedIdentifierToken, compilationUnit);
+ compilationUnit.Binder.BindConstructorDefinitionIdentifierToken(consumedIdentifierToken, compilationUnit);
compilationUnit.ParserModel.SyntaxStack.Push(constructorDefinitionNode);
compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = constructorDefinitionNode;
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseOthers.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseOthers.cs
index b2b606809..d7d94c74f 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseOthers.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseOthers.cs
@@ -175,7 +175,7 @@ public static IExpressionNode ParseExpression(CSharpCompilationUnit compilationU
break;
}
- expressionPrimary = compilationUnit.ParserModel.Binder.AnyMergeToken(expressionPrimary, tokenCurrent, compilationUnit);
+ expressionPrimary = compilationUnit.Binder.AnyMergeToken(expressionPrimary, tokenCurrent, compilationUnit);
#if DEBUG
Console.WriteLine($"\t=> {expressionPrimary.SyntaxKind}");
@@ -190,7 +190,7 @@ public static IExpressionNode ParseExpression(CSharpCompilationUnit compilationU
if (compilationUnit.ParserModel.NoLongerRelevantExpressionNode is not null) // try finally is not needed to guarantee setting 'compilationUnit.ParserModel.NoLongerRelevantExpressionNode = null;' because this is an object reference comparison 'Object.ReferenceEquals'. Versus something more general that would break future parses if not properly cleared, like a SyntaxKind.
{
- compilationUnit.ParserModel.Binder.ClearFromExpressionList(compilationUnit.ParserModel.NoLongerRelevantExpressionNode, compilationUnit);
+ compilationUnit.Binder.ClearFromExpressionList(compilationUnit.ParserModel.NoLongerRelevantExpressionNode, compilationUnit);
compilationUnit.ParserModel.NoLongerRelevantExpressionNode = null;
}
@@ -257,7 +257,7 @@ public static IExpressionNode ParseExpression(CSharpCompilationUnit compilationU
if (expressionPrimary.SyntaxKind == SyntaxKind.AmbiguousIdentifierExpressionNode)
{
- expressionPrimary = compilationUnit.ParserModel.Binder.ForceDecisionAmbiguousIdentifier(
+ expressionPrimary = compilationUnit.Binder.ForceDecisionAmbiguousIdentifier(
EmptyExpressionNode.Empty,
(AmbiguousIdentifierExpressionNode)expressionPrimary,
compilationUnit);
@@ -318,7 +318,7 @@ private static IExpressionNode BubbleUpParseExpression(int indexTriggered, IExpr
previousDelimiterExpressionNode = delimiterExpressionTuple.ExpressionNode;
- expressionPrimary = compilationUnit.ParserModel.Binder.AnyMergeExpression(
+ expressionPrimary = compilationUnit.Binder.AnyMergeExpression(
delimiterExpressionTuple.ExpressionNode,
expressionPrimary, // expressionSecondary
compilationUnit);
@@ -326,7 +326,7 @@ private static IExpressionNode BubbleUpParseExpression(int indexTriggered, IExpr
if (compilationUnit.ParserModel.NoLongerRelevantExpressionNode is not null) // try finally is not needed to guarantee setting 'compilationUnit.ParserModel.NoLongerRelevantExpressionNode = null;' because this is an object reference comparison 'Object.ReferenceEquals'. Versus something more general that would break future parses if not properly cleared, like a SyntaxKind.
{
- compilationUnit.ParserModel.Binder.ClearFromExpressionList(compilationUnit.ParserModel.NoLongerRelevantExpressionNode, compilationUnit);
+ compilationUnit.Binder.ClearFromExpressionList(compilationUnit.ParserModel.NoLongerRelevantExpressionNode, compilationUnit);
compilationUnit.ParserModel.NoLongerRelevantExpressionNode = null;
}
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseTokens.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseTokens.cs
index d44f3833e..123ccc697 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseTokens.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseTokens.cs
@@ -107,7 +107,7 @@ public static void MoveToHandleVariableDeclarationNode(IVariableDeclarationNode
((VariableDeclarationNode)variableDeclarationNode).VariableKind = variableKind;
- compilationUnit.ParserModel.Binder.BindVariableDeclarationNode(variableDeclarationNode, compilationUnit);
+ compilationUnit.Binder.BindVariableDeclarationNode(variableDeclarationNode, compilationUnit);
compilationUnit.ParserModel.CurrentCodeBlockBuilder.ChildList.Add(variableDeclarationNode);
compilationUnit.ParserModel.StatementBuilder.ChildList.Add(variableDeclarationNode);
@@ -215,7 +215,7 @@ public static void ParseColonToken(CSharpCompilationUnit compilationUnit)
var typeDefinitionNode = (TypeDefinitionNode)compilationUnit.ParserModel.SyntaxStack.Pop();
var inheritedTypeClauseNode = compilationUnit.ParserModel.TokenWalker.MatchTypeClauseNode(compilationUnit);
- compilationUnit.ParserModel.Binder.BindTypeClauseNode(inheritedTypeClauseNode, compilationUnit);
+ compilationUnit.Binder.BindTypeClauseNode(inheritedTypeClauseNode, compilationUnit);
typeDefinitionNode.SetInheritedTypeClauseNode(inheritedTypeClauseNode);
@@ -258,9 +258,9 @@ public static void ParseOpenBraceToken(OpenBraceToken openBraceToken, CSharpComp
var nextCodeBlockOwner = compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner;
var nextReturnTypeClauseNode = nextCodeBlockOwner.GetReturnTypeClauseNode();
- compilationUnit.ParserModel.Binder.OpenScope(nextCodeBlockOwner, nextReturnTypeClauseNode, openBraceToken.TextSpan, compilationUnit);
+ compilationUnit.Binder.OpenScope(nextCodeBlockOwner, nextReturnTypeClauseNode, openBraceToken.TextSpan, compilationUnit);
compilationUnit.ParserModel.CurrentCodeBlockBuilder = new(parent: compilationUnit.ParserModel.CurrentCodeBlockBuilder, codeBlockOwner: nextCodeBlockOwner);
- compilationUnit.ParserModel.Binder.OnBoundScopeCreatedAndSetAsCurrent(nextCodeBlockOwner, compilationUnit);
+ compilationUnit.Binder.OnBoundScopeCreatedAndSetAsCurrent(nextCodeBlockOwner, compilationUnit);
}
///
@@ -278,7 +278,7 @@ public static void ParseCloseBraceToken(CloseBraceToken closeBraceToken, CSharpC
if (compilationUnit.ParserModel.CurrentCodeBlockBuilder.CodeBlockOwner is not null)
compilationUnit.ParserModel.CurrentCodeBlockBuilder.CodeBlockOwner.SetCloseBraceToken(closeBraceToken, compilationUnit.ParserModel.DiagnosticBag, compilationUnit.ParserModel.TokenWalker);
- compilationUnit.ParserModel.Binder.CloseScope(closeBraceToken.TextSpan, compilationUnit);
+ compilationUnit.Binder.CloseScope(closeBraceToken.TextSpan, compilationUnit);
}
public static void ParseOpenParenthesisToken(CSharpCompilationUnit compilationUnit)
@@ -414,13 +414,13 @@ public static void ParseStatementDelimiterToken(StatementDelimiterToken statemen
namespaceStatementNode.SetStatementDelimiterToken(statementDelimiterToken, compilationUnit.ParserModel.DiagnosticBag, compilationUnit.ParserModel.TokenWalker);
- compilationUnit.ParserModel.Binder.OpenScope(
+ compilationUnit.Binder.OpenScope(
nextCodeBlockOwner,
scopeReturnTypeClauseNode,
statementDelimiterToken.TextSpan,
compilationUnit);
- compilationUnit.ParserModel.Binder.AddNamespaceToCurrentScope(
+ compilationUnit.Binder.AddNamespaceToCurrentScope(
namespaceStatementNode.IdentifierToken.TextSpan.GetText(),
compilationUnit);
@@ -431,11 +431,11 @@ public static void ParseStatementDelimiterToken(StatementDelimiterToken statemen
{
var pendingChild = compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner;
- compilationUnit.ParserModel.Binder.OpenScope(pendingChild, CSharpFacts.Types.Void.ToTypeClause(), statementDelimiterToken.TextSpan, compilationUnit);
+ compilationUnit.Binder.OpenScope(pendingChild, CSharpFacts.Types.Void.ToTypeClause(), statementDelimiterToken.TextSpan, compilationUnit);
compilationUnit.ParserModel.CurrentCodeBlockBuilder = new(compilationUnit.ParserModel.CurrentCodeBlockBuilder, pendingChild);
- compilationUnit.ParserModel.Binder.OnBoundScopeCreatedAndSetAsCurrent(pendingChild, compilationUnit);
+ compilationUnit.Binder.OnBoundScopeCreatedAndSetAsCurrent(pendingChild, compilationUnit);
- compilationUnit.ParserModel.Binder.CloseScope(statementDelimiterToken.TextSpan, compilationUnit);
+ compilationUnit.Binder.CloseScope(statementDelimiterToken.TextSpan, compilationUnit);
if (compilationUnit.ParserModel.CurrentCodeBlockBuilder.Parent is not null)
compilationUnit.ParserModel.CurrentCodeBlockBuilder = compilationUnit.ParserModel.CurrentCodeBlockBuilder.Parent;
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseVariables.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseVariables.cs
index fa7efc2bf..9caf6e509 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseVariables.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseVariables.cs
@@ -32,7 +32,7 @@ public static void HandleVariableReference(
variableKind,
false);
- compilationUnit.ParserModel.Binder.BindVariableDeclarationNode(variableDeclarationNode, compilationUnit);
+ compilationUnit.Binder.BindVariableDeclarationNode(variableDeclarationNode, compilationUnit);
compilationUnit.ParserModel.CurrentCodeBlockBuilder.ChildList.Add(variableDeclarationNode);
return variableDeclarationNode;
}
From 80a679da1764c5dc764cc5af7899ef80cbe66357 Mon Sep 17 00:00:00 2001
From: Luthetus <45454132+huntercfreeman@users.noreply.github.com>
Date: Sat, 14 Dec 2024 18:14:43 -0500
Subject: [PATCH 3/7] Only return 'CSharpLexerOutput' so computational state is
cleared from memory immediately upon returning
---
.../CSharpCompilationUnit.cs | 2 +-
.../CSharpCompilerService.cs | 8 +-
.../CSharp/LexerCase/CSharpLexer.cs | 235 ++++++++----------
.../CSharp/LexerCase/CSharpLexerOutput.cs | 23 ++
.../CSharp/ParserCase/CSharpParser.cs | 4 +-
.../CompilerServices/Razor/RazorSyntaxTree.cs | 14 +-
6 files changed, 135 insertions(+), 151 deletions(-)
create mode 100644 Source/Lib/CompilerServices/CSharp/LexerCase/CSharpLexerOutput.cs
diff --git a/Source/Lib/CompilerServices/CSharp/CompilerServiceCase/CSharpCompilationUnit.cs b/Source/Lib/CompilerServices/CSharp/CompilerServiceCase/CSharpCompilationUnit.cs
index 17947979c..4977b1557 100644
--- a/Source/Lib/CompilerServices/CSharp/CompilerServiceCase/CSharpCompilationUnit.cs
+++ b/Source/Lib/CompilerServices/CSharp/CompilerServiceCase/CSharpCompilationUnit.cs
@@ -21,7 +21,7 @@ public CSharpCompilationUnit(
}
public ResourceUri ResourceUri { get; set; }
- public CSharpLexer Lexer { get; set; }
+ public CSharpLexerOutput LexerOutput { get; set; }
public CSharpParser Parser { get; set; }
public CSharpParserModel ParserModel { get; set; }
public CSharpBinder Binder { get; set; }
diff --git a/Source/Lib/CompilerServices/CSharp/CompilerServiceCase/CSharpCompilerService.cs b/Source/Lib/CompilerServices/CSharp/CompilerServiceCase/CSharpCompilerService.cs
index 101130e64..a37147353 100644
--- a/Source/Lib/CompilerServices/CSharp/CompilerServiceCase/CSharpCompilerService.cs
+++ b/Source/Lib/CompilerServices/CSharp/CompilerServiceCase/CSharpCompilerService.cs
@@ -74,8 +74,8 @@ public override Task ParseAsync(ITextEditorEditContext editContext, TextEditorMo
x => x.TextEditorPresentationKey == CompilerServiceDiagnosticPresentationFacts.PresentationKey);
var cSharpCompilationUnit = new CSharpCompilationUnit(resourceUri, CSharpBinder);
- cSharpCompilationUnit.Lexer = new CSharpLexer(resourceUri, presentationModel.PendingCalculation.ContentAtRequest);
- cSharpCompilationUnit.Lexer.Lex();
+
+ cSharpCompilationUnit.LexerOutput = CSharpLexer.Lex(resourceUri, presentationModel.PendingCalculation.ContentAtRequest);
// Even if the parser throws an exception, be sure to
// make use of the Lexer to do whatever syntax highlighting is possible.
@@ -93,8 +93,8 @@ public override Task ParseAsync(ITextEditorEditContext editContext, TextEditorMo
{
var resource = (CSharpResource)_resourceMap[resourceUri];
- resource.EscapeCharacterList = cSharpCompilationUnit.Lexer.EscapeCharacterList;
- resource.SyntaxTokenList = cSharpCompilationUnit.Lexer.SyntaxTokenList;
+ resource.EscapeCharacterList = cSharpCompilationUnit.LexerOutput.EscapeCharacterList;
+ resource.SyntaxTokenList = cSharpCompilationUnit.LexerOutput.SyntaxTokenList;
if (cSharpCompilationUnit is not null)
resource.CompilationUnit = cSharpCompilationUnit;
diff --git a/Source/Lib/CompilerServices/CSharp/LexerCase/CSharpLexer.cs b/Source/Lib/CompilerServices/CSharp/LexerCase/CSharpLexer.cs
index d8203801f..ea3168f8c 100644
--- a/Source/Lib/CompilerServices/CSharp/LexerCase/CSharpLexer.cs
+++ b/Source/Lib/CompilerServices/CSharp/LexerCase/CSharpLexer.cs
@@ -10,36 +10,13 @@
namespace Luthetus.CompilerServices.CSharp.LexerCase;
-public struct CSharpLexer
+public static class CSharpLexer
{
- private readonly List _syntaxTokenList = new();
- private readonly DiagnosticBag _diagnosticBag = new();
-
- public CSharpLexer(ResourceUri resourceUri, string sourceText)
- {
- #if DEBUG
- ++LuthetusDebugSomething.Lexer_ConstructorInvocationCount;
- #endif
-
- ResourceUri = resourceUri;
- SourceText = sourceText;
- LexerKeywords = CSharpKeywords.LexerKeywords;
- }
-
- private byte _decorationByteLastEscapeCharacter = (byte)GenericDecorationKind.None;
-
- public List EscapeCharacterList { get; } = new();
-
- public ResourceUri ResourceUri { get; }
- public string SourceText { get; }
- public LexerKeywords LexerKeywords { get; }
-
- public List SyntaxTokenList => _syntaxTokenList;
- public List DiagnosticList => _diagnosticBag.ToList();
-
- public void Lex()
+ public static CSharpLexerOutput Lex(ResourceUri resourceUri, string sourceText)
{
- var stringWalker = new StringWalkerStruct(ResourceUri, SourceText);
+ var stringWalker = new StringWalkerStruct(resourceUri, sourceText);
+ var decorationByteLastEscapeCharacter = (byte)GenericDecorationKind.None;
+ var lexerOutput = new CSharpLexerOutput();
while (!stringWalker.IsEof)
{
@@ -101,7 +78,7 @@ public void Lex()
case 'Z':
/* Underscore */
case '_':
- LexIdentifierOrKeywordOrKeywordContextual(ref stringWalker);
+ LexIdentifierOrKeywordOrKeywordContextual(ref lexerOutput, ref stringWalker);
break;
case '0':
case '1':
@@ -113,81 +90,81 @@ public void Lex()
case '7':
case '8':
case '9':
- LexNumericLiteralToken(ref stringWalker);
+ LexNumericLiteralToken(ref lexerOutput, ref stringWalker);
break;
case '\'':
- LexCharLiteralToken(ref stringWalker);
+ LexCharLiteralToken(ref lexerOutput, ref stringWalker);
break;
case '"':
- LexString(ref stringWalker, countDollarSign: 0, useVerbatim: false);
+ LexString(ref lexerOutput, ref stringWalker, ref decorationByteLastEscapeCharacter, countDollarSign: 0, useVerbatim: false);
break;
case '/':
if (stringWalker.PeekCharacter(1) == '/')
{
- LexCommentSingleLineToken(ref stringWalker);
+ LexCommentSingleLineToken(ref lexerOutput, ref stringWalker);
}
else if (stringWalker.PeekCharacter(1) == '*')
{
- LexCommentMultiLineToken(ref stringWalker);
+ LexCommentMultiLineToken(ref lexerOutput, ref stringWalker);
}
else
{
var entryPositionIndex = stringWalker.PositionIndex;
stringWalker.ReadCharacter();
var textSpan = new TextEditorTextSpan(entryPositionIndex, stringWalker.PositionIndex, (byte)GenericDecorationKind.None, stringWalker.ResourceUri, stringWalker.SourceText);
- _syntaxTokenList.Add(new DivisionToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new DivisionToken(textSpan));
}
break;
case '+':
if (stringWalker.PeekCharacter(1) == '+')
{
- LexPlusPlusToken(ref stringWalker);
+ LexPlusPlusToken(ref lexerOutput, ref stringWalker);
}
else
{
var entryPositionIndex = stringWalker.PositionIndex;
stringWalker.ReadCharacter();
var textSpan = new TextEditorTextSpan(entryPositionIndex, stringWalker.PositionIndex, (byte)GenericDecorationKind.None, stringWalker.ResourceUri, stringWalker.SourceText);
- _syntaxTokenList.Add(new PlusToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new PlusToken(textSpan));
}
break;
case '-':
if (stringWalker.PeekCharacter(1) == '-')
{
- LexMinusMinusToken(ref stringWalker);
+ LexMinusMinusToken(ref lexerOutput, ref stringWalker);
}
else
{
var entryPositionIndex = stringWalker.PositionIndex;
stringWalker.ReadCharacter();
var textSpan = new TextEditorTextSpan(entryPositionIndex, stringWalker.PositionIndex, (byte)GenericDecorationKind.None, stringWalker.ResourceUri, stringWalker.SourceText);
- _syntaxTokenList.Add(new MinusToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new MinusToken(textSpan));
}
break;
case '=':
if (stringWalker.PeekCharacter(1) == '=')
{
- LexEqualsEqualsToken(ref stringWalker);
+ LexEqualsEqualsToken(ref lexerOutput, ref stringWalker);
}
else
{
var entryPositionIndex = stringWalker.PositionIndex;
stringWalker.ReadCharacter();
var textSpan = new TextEditorTextSpan(entryPositionIndex, stringWalker.PositionIndex, (byte)GenericDecorationKind.None, stringWalker.ResourceUri, stringWalker.SourceText);
- _syntaxTokenList.Add(new EqualsToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new EqualsToken(textSpan));
}
break;
case '?':
if (stringWalker.PeekCharacter(1) == '?')
{
- LexQuestionMarkQuestionMarkToken(ref stringWalker);
+ LexQuestionMarkQuestionMarkToken(ref lexerOutput, ref stringWalker);
}
else
{
var entryPositionIndex = stringWalker.PositionIndex;
stringWalker.ReadCharacter();
var textSpan = new TextEditorTextSpan(entryPositionIndex, stringWalker.PositionIndex, (byte)GenericDecorationKind.None, stringWalker.ResourceUri, stringWalker.SourceText);
- _syntaxTokenList.Add(new QuestionMarkToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new QuestionMarkToken(textSpan));
}
break;
case '*':
@@ -195,7 +172,7 @@ public void Lex()
var entryPositionIndex = stringWalker.PositionIndex;
stringWalker.ReadCharacter();
var textSpan = new TextEditorTextSpan(entryPositionIndex, stringWalker.PositionIndex, (byte)GenericDecorationKind.None, stringWalker.ResourceUri, stringWalker.SourceText);
- _syntaxTokenList.Add(new StarToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new StarToken(textSpan));
break;
}
case '!':
@@ -203,7 +180,7 @@ public void Lex()
var entryPositionIndex = stringWalker.PositionIndex;
stringWalker.ReadCharacter();
var textSpan = new TextEditorTextSpan(entryPositionIndex, stringWalker.PositionIndex, (byte)GenericDecorationKind.None, stringWalker.ResourceUri, stringWalker.SourceText);
- _syntaxTokenList.Add(new BangToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new BangToken(textSpan));
break;
}
case ';':
@@ -211,7 +188,7 @@ public void Lex()
var entryPositionIndex = stringWalker.PositionIndex;
stringWalker.ReadCharacter();
var textSpan = new TextEditorTextSpan(entryPositionIndex, stringWalker.PositionIndex, (byte)GenericDecorationKind.None, stringWalker.ResourceUri, stringWalker.SourceText);
- _syntaxTokenList.Add(new StatementDelimiterToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new StatementDelimiterToken(textSpan));
break;
}
case '(':
@@ -219,7 +196,7 @@ public void Lex()
var entryPositionIndex = stringWalker.PositionIndex;
stringWalker.ReadCharacter();
var textSpan = new TextEditorTextSpan(entryPositionIndex, stringWalker.PositionIndex, (byte)GenericDecorationKind.None, stringWalker.ResourceUri, stringWalker.SourceText);
- _syntaxTokenList.Add(new OpenParenthesisToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new OpenParenthesisToken(textSpan));
break;
}
case ')':
@@ -227,7 +204,7 @@ public void Lex()
var entryPositionIndex = stringWalker.PositionIndex;
stringWalker.ReadCharacter();
var textSpan = new TextEditorTextSpan(entryPositionIndex, stringWalker.PositionIndex, (byte)GenericDecorationKind.None, stringWalker.ResourceUri, stringWalker.SourceText);
- _syntaxTokenList.Add(new CloseParenthesisToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new CloseParenthesisToken(textSpan));
break;
}
case '{':
@@ -235,7 +212,7 @@ public void Lex()
var entryPositionIndex = stringWalker.PositionIndex;
stringWalker.ReadCharacter();
var textSpan = new TextEditorTextSpan(entryPositionIndex, stringWalker.PositionIndex, (byte)GenericDecorationKind.None, stringWalker.ResourceUri, stringWalker.SourceText);
- _syntaxTokenList.Add(new OpenBraceToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new OpenBraceToken(textSpan));
break;
}
case '}':
@@ -243,7 +220,7 @@ public void Lex()
var entryPositionIndex = stringWalker.PositionIndex;
stringWalker.ReadCharacter();
var textSpan = new TextEditorTextSpan(entryPositionIndex, stringWalker.PositionIndex, (byte)GenericDecorationKind.None, stringWalker.ResourceUri, stringWalker.SourceText);
- _syntaxTokenList.Add(new CloseBraceToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new CloseBraceToken(textSpan));
break;
}
case '<':
@@ -251,7 +228,7 @@ public void Lex()
var entryPositionIndex = stringWalker.PositionIndex;
stringWalker.ReadCharacter();
var textSpan = new TextEditorTextSpan(entryPositionIndex, stringWalker.PositionIndex, (byte)GenericDecorationKind.None, stringWalker.ResourceUri, stringWalker.SourceText);
- _syntaxTokenList.Add(new OpenAngleBracketToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new OpenAngleBracketToken(textSpan));
break;
}
case '>':
@@ -259,7 +236,7 @@ public void Lex()
var entryPositionIndex = stringWalker.PositionIndex;
stringWalker.ReadCharacter();
var textSpan = new TextEditorTextSpan(entryPositionIndex, stringWalker.PositionIndex, (byte)GenericDecorationKind.None, stringWalker.ResourceUri, stringWalker.SourceText);
- _syntaxTokenList.Add(new CloseAngleBracketToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new CloseAngleBracketToken(textSpan));
break;
}
case '[':
@@ -267,7 +244,7 @@ public void Lex()
var entryPositionIndex = stringWalker.PositionIndex;
stringWalker.ReadCharacter();
var textSpan = new TextEditorTextSpan(entryPositionIndex, stringWalker.PositionIndex, (byte)GenericDecorationKind.None, stringWalker.ResourceUri, stringWalker.SourceText);
- _syntaxTokenList.Add(new OpenSquareBracketToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new OpenSquareBracketToken(textSpan));
break;
}
case ']':
@@ -275,17 +252,17 @@ public void Lex()
var entryPositionIndex = stringWalker.PositionIndex;
stringWalker.ReadCharacter();
var textSpan = new TextEditorTextSpan(entryPositionIndex, stringWalker.PositionIndex, (byte)GenericDecorationKind.None, stringWalker.ResourceUri, stringWalker.SourceText);
- _syntaxTokenList.Add(new CloseSquareBracketToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new CloseSquareBracketToken(textSpan));
break;
}
case '$':
if (stringWalker.NextCharacter == '"')
{
- LexString(ref stringWalker, countDollarSign: 1, useVerbatim: false);
+ LexString(ref lexerOutput, ref stringWalker, ref decorationByteLastEscapeCharacter, countDollarSign: 1, useVerbatim: false);
}
else if (stringWalker.PeekCharacter(1) == '@' && stringWalker.PeekCharacter(2) == '"')
{
- LexString(ref stringWalker, countDollarSign: 1, useVerbatim: true);
+ LexString(ref lexerOutput, ref stringWalker, ref decorationByteLastEscapeCharacter, countDollarSign: 1, useVerbatim: true);
}
else if (stringWalker.NextCharacter == '$')
{
@@ -306,7 +283,7 @@ public void Lex()
// Only the last '$' (dollar sign character) will be syntax highlighted
// if this code is NOT included.
var textSpan = new TextEditorTextSpan(entryPositionIndex, stringWalker.PositionIndex, (byte)GenericDecorationKind.StringLiteral, stringWalker.ResourceUri, stringWalker.SourceText);
- _syntaxTokenList.Add(new StringLiteralToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new StringLiteralToken(textSpan));
// From the LexString(...) method:
// "awkwardly even if there are many of these it is expected
@@ -314,27 +291,27 @@ public void Lex()
_ = stringWalker.BacktrackCharacter();
if (stringWalker.NextCharacter == '"')
- LexString(ref stringWalker, countDollarSign: countDollarSign, useVerbatim: false);
+ LexString(ref lexerOutput, ref stringWalker, ref decorationByteLastEscapeCharacter, countDollarSign: countDollarSign, useVerbatim: false);
}
else
{
- LexDollarSignToken(ref stringWalker);
+ LexDollarSignToken(ref lexerOutput, ref stringWalker);
}
break;
case '@':
if (stringWalker.NextCharacter == '"')
- LexString(ref stringWalker, countDollarSign: 0, useVerbatim: true);
+ LexString(ref lexerOutput, ref stringWalker, ref decorationByteLastEscapeCharacter, countDollarSign: 0, useVerbatim: true);
else if (stringWalker.PeekCharacter(1) == '$' && stringWalker.PeekCharacter(2) == '"')
- LexString(ref stringWalker, countDollarSign: 1, useVerbatim: true);
+ LexString(ref lexerOutput, ref stringWalker, ref decorationByteLastEscapeCharacter, countDollarSign: 1, useVerbatim: true);
else
- LexAtToken(ref stringWalker);
+ LexAtToken(ref lexerOutput, ref stringWalker);
break;
case ':':
{
var entryPositionIndex = stringWalker.PositionIndex;
stringWalker.ReadCharacter();
var textSpan = new TextEditorTextSpan(entryPositionIndex, stringWalker.PositionIndex, (byte)GenericDecorationKind.None, stringWalker.ResourceUri, stringWalker.SourceText);
- _syntaxTokenList.Add(new ColonToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new ColonToken(textSpan));
break;
}
case '.':
@@ -342,7 +319,7 @@ public void Lex()
var entryPositionIndex = stringWalker.PositionIndex;
stringWalker.ReadCharacter();
var textSpan = new TextEditorTextSpan(entryPositionIndex, stringWalker.PositionIndex, (byte)GenericDecorationKind.None, stringWalker.ResourceUri, stringWalker.SourceText);
- _syntaxTokenList.Add(new MemberAccessToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new MemberAccessToken(textSpan));
break;
}
case ',':
@@ -350,11 +327,11 @@ public void Lex()
var entryPositionIndex = stringWalker.PositionIndex;
stringWalker.ReadCharacter();
var textSpan = new TextEditorTextSpan(entryPositionIndex, stringWalker.PositionIndex, (byte)GenericDecorationKind.None, stringWalker.ResourceUri, stringWalker.SourceText);
- _syntaxTokenList.Add(new CommaToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new CommaToken(textSpan));
break;
}
case '#':
- LexPreprocessorDirectiveToken(ref stringWalker);
+ LexPreprocessorDirectiveToken(ref lexerOutput, ref stringWalker);
break;
default:
_ = stringWalker.ReadCharacter();
@@ -369,7 +346,8 @@ public void Lex()
stringWalker.ResourceUri,
stringWalker.SourceText);
- _syntaxTokenList.Add(new EndOfFileToken(endOfFileTextSpan));
+ lexerOutput.SyntaxTokenList.Add(new EndOfFileToken(endOfFileTextSpan));
+ return lexerOutput;
}
///
@@ -379,7 +357,7 @@ public void Lex()
/// The reason being: you don't know if it is a string until you've read all of the '$' (dollar sign characters).
/// So in order to invoke this method the invoker had to have counted them.
///
- private void LexString(ref StringWalkerStruct stringWalker, int countDollarSign, bool useVerbatim)
+ private static void LexString(ref CSharpLexerOutput lexerOutput, ref StringWalkerStruct stringWalker, ref byte decorationByteLastEscapeCharacter, int countDollarSign, bool useVerbatim)
{
var entryPositionIndex = stringWalker.PositionIndex;
@@ -434,15 +412,12 @@ private void LexString(ref StringWalkerStruct stringWalker, int countDollarSign,
}
else if (useVerbatim && stringWalker.NextCharacter == '\"')
{
- if (EscapeCharacterList is not null)
- {
- EscapeCharacterListAdd(ref stringWalker, new TextEditorTextSpan(
- stringWalker.PositionIndex,
- stringWalker.PositionIndex + 2,
- (byte)GenericDecorationKind.EscapeCharacterPrimary,
- stringWalker.ResourceUri,
- stringWalker.SourceText));
- }
+ EscapeCharacterListAdd(ref lexerOutput, ref stringWalker, ref decorationByteLastEscapeCharacter, new TextEditorTextSpan(
+ stringWalker.PositionIndex,
+ stringWalker.PositionIndex + 2,
+ (byte)GenericDecorationKind.EscapeCharacterPrimary,
+ stringWalker.ResourceUri,
+ stringWalker.SourceText));
_ = stringWalker.ReadCharacter();
}
@@ -454,15 +429,12 @@ private void LexString(ref StringWalkerStruct stringWalker, int countDollarSign,
}
else if (!useVerbatim && stringWalker.CurrentCharacter == '\\')
{
- if (EscapeCharacterList is not null)
- {
- EscapeCharacterListAdd(ref stringWalker, new TextEditorTextSpan(
- stringWalker.PositionIndex,
- stringWalker.PositionIndex + 2,
- (byte)GenericDecorationKind.EscapeCharacterPrimary,
- stringWalker.ResourceUri,
- stringWalker.SourceText));
- }
+ EscapeCharacterListAdd(ref lexerOutput, ref stringWalker, ref decorationByteLastEscapeCharacter, new TextEditorTextSpan(
+ stringWalker.PositionIndex,
+ stringWalker.PositionIndex + 2,
+ (byte)GenericDecorationKind.EscapeCharacterPrimary,
+ stringWalker.ResourceUri,
+ stringWalker.SourceText));
// Presuming the escaped text is 2 characters, then read an extra character.
_ = stringWalker.ReadCharacter();
@@ -500,14 +472,14 @@ private void LexString(ref StringWalkerStruct stringWalker, int countDollarSign,
(byte)GenericDecorationKind.StringLiteral,
stringWalker.ResourceUri,
stringWalker.SourceText);
- _syntaxTokenList.Add(new StringLiteralToken(innerTextSpan));
+ lexerOutput.SyntaxTokenList.Add(new StringLiteralToken(innerTextSpan));
// 'LexInterpolatedExpression' is expected to consume one more after it is finished.
// Thus, if this while loop were to consume, it would skip the
// closing double quotes if the expression were the last thing in the string.
//
// So, a backtrack is done.
- LexInterpolatedExpression(ref stringWalker, countDollarSign);
+ LexInterpolatedExpression(ref lexerOutput, ref stringWalker, countDollarSign);
entryPositionIndex = stringWalker.PositionIndex;
stringWalker.BacktrackCharacter();
}
@@ -528,12 +500,12 @@ private void LexString(ref StringWalkerStruct stringWalker, int countDollarSign,
(byte)GenericDecorationKind.StringLiteral,
stringWalker.ResourceUri,
stringWalker.SourceText);
- _syntaxTokenList.Add(new StringLiteralToken(innerTextSpan));
+ lexerOutput.SyntaxTokenList.Add(new StringLiteralToken(innerTextSpan));
// 'LexInterpolatedExpression' is expected to consume one more after it is finished.
// Thus, if this while loop were to consume, it would skip the
// closing double quotes if the expression were the last thing in the string.
- LexInterpolatedExpression(ref stringWalker, countDollarSign);
+ LexInterpolatedExpression(ref lexerOutput, ref stringWalker, countDollarSign);
entryPositionIndex = stringWalker.PositionIndex;
continue;
}
@@ -552,10 +524,10 @@ private void LexString(ref StringWalkerStruct stringWalker, int countDollarSign,
stringWalker.ResourceUri,
stringWalker.SourceText);
- _syntaxTokenList.Add(new StringLiteralToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new StringLiteralToken(textSpan));
}
- private void LexInterpolatedExpression(ref StringWalkerStruct stringWalker, int countDollarSign)
+ private static void LexInterpolatedExpression(ref CSharpLexerOutput lexerOutput, ref StringWalkerStruct stringWalker, int countDollarSign)
{
var entryPositionIndex = stringWalker.PositionIndex;
@@ -588,14 +560,14 @@ private void LexInterpolatedExpression(ref StringWalkerStruct stringWalker, int
_ = stringWalker.ReadCharacter();
}
- private void EscapeCharacterListAdd(ref StringWalkerStruct stringWalker, TextEditorTextSpan textSpan)
+ private static void EscapeCharacterListAdd(ref CSharpLexerOutput lexerOutput, ref StringWalkerStruct stringWalker, ref byte decorationByteLastEscapeCharacter, TextEditorTextSpan textSpan)
{
- if (EscapeCharacterList.Count > 0)
+ if (lexerOutput.EscapeCharacterList.Count > 0)
{
- var lastEntry = EscapeCharacterList[^1];
+ var lastEntry = lexerOutput.EscapeCharacterList[^1];
if (lastEntry.EndingIndexExclusive == textSpan.StartingIndexInclusive &&
- _decorationByteLastEscapeCharacter == (byte)GenericDecorationKind.EscapeCharacterPrimary)
+ decorationByteLastEscapeCharacter == (byte)GenericDecorationKind.EscapeCharacterPrimary)
{
textSpan = textSpan with
{
@@ -604,11 +576,11 @@ private void EscapeCharacterListAdd(ref StringWalkerStruct stringWalker, TextEdi
}
}
- _decorationByteLastEscapeCharacter = textSpan.DecorationByte;
- EscapeCharacterList.Add(textSpan);
+ decorationByteLastEscapeCharacter = textSpan.DecorationByte;
+ lexerOutput.EscapeCharacterList.Add(textSpan);
}
- public void LexIdentifierOrKeywordOrKeywordContextual(ref StringWalkerStruct stringWalker)
+ public static void LexIdentifierOrKeywordOrKeywordContextual(ref CSharpLexerOutput lexerOutput, ref StringWalkerStruct stringWalker)
{
var entryPositionIndex = stringWalker.PositionIndex;
@@ -646,18 +618,18 @@ public void LexIdentifierOrKeywordOrKeywordContextual(ref StringWalkerStruct str
if (CSharpKeywords.LexerKeywords.ContextualKeywords.Contains(textValue))
{
- _syntaxTokenList.Add(new KeywordContextualToken(textSpan, LexerUtils.GetSyntaxKindForContextualKeyword(textSpan)));
+ lexerOutput.SyntaxTokenList.Add(new KeywordContextualToken(textSpan, LexerUtils.GetSyntaxKindForContextualKeyword(textSpan)));
return;
}
- _syntaxTokenList.Add(new KeywordToken(textSpan, LexerUtils.GetSyntaxKindForKeyword(textSpan)));
+ lexerOutput.SyntaxTokenList.Add(new KeywordToken(textSpan, LexerUtils.GetSyntaxKindForKeyword(textSpan)));
return;
}
- _syntaxTokenList.Add(new IdentifierToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new IdentifierToken(textSpan));
}
- public void LexNumericLiteralToken(ref StringWalkerStruct stringWalker)
+ public static void LexNumericLiteralToken(ref CSharpLexerOutput lexerOutput, ref StringWalkerStruct stringWalker)
{
var entryPositionIndex = stringWalker.PositionIndex;
@@ -697,10 +669,10 @@ public void LexNumericLiteralToken(ref StringWalkerStruct stringWalker)
stringWalker.ResourceUri,
stringWalker.SourceText);
- _syntaxTokenList.Add(new NumericLiteralToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new NumericLiteralToken(textSpan));
}
- public void LexCharLiteralToken(ref StringWalkerStruct stringWalker)
+ public static void LexCharLiteralToken(ref CSharpLexerOutput lexerOutput, ref StringWalkerStruct stringWalker)
{
var delimiter = '\'';
var escapeCharacter = '\\';
@@ -719,15 +691,12 @@ public void LexCharLiteralToken(ref StringWalkerStruct stringWalker)
}
else if (stringWalker.CurrentCharacter == escapeCharacter)
{
- if (EscapeCharacterList is not null)
- {
- EscapeCharacterList.Add(new TextEditorTextSpan(
- stringWalker.PositionIndex,
- stringWalker.PositionIndex + 2,
- (byte)GenericDecorationKind.EscapeCharacterPrimary,
- stringWalker.ResourceUri,
- stringWalker.SourceText));
- }
+ lexerOutput.EscapeCharacterList.Add(new TextEditorTextSpan(
+ stringWalker.PositionIndex,
+ stringWalker.PositionIndex + 2,
+ (byte)GenericDecorationKind.EscapeCharacterPrimary,
+ stringWalker.ResourceUri,
+ stringWalker.SourceText));
// Presuming the escaped text is 2 characters,
// then read an extra character.
@@ -744,10 +713,10 @@ public void LexCharLiteralToken(ref StringWalkerStruct stringWalker)
stringWalker.ResourceUri,
stringWalker.SourceText);
- _syntaxTokenList.Add(new CharLiteralToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new CharLiteralToken(textSpan));
}
- public void LexCommentSingleLineToken(ref StringWalkerStruct stringWalker)
+ public static void LexCommentSingleLineToken(ref CSharpLexerOutput lexerOutput, ref StringWalkerStruct stringWalker)
{
var entryPositionIndex = stringWalker.PositionIndex;
@@ -779,10 +748,10 @@ public void LexCommentSingleLineToken(ref StringWalkerStruct stringWalker)
stringWalker.ResourceUri,
stringWalker.SourceText);
- _syntaxTokenList.Add(new CommentSingleLineToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new CommentSingleLineToken(textSpan));
}
- public void LexCommentMultiLineToken(ref StringWalkerStruct stringWalker)
+ public static void LexCommentMultiLineToken(ref CSharpLexerOutput lexerOutput, ref StringWalkerStruct stringWalker)
{
var entryPositionIndex = stringWalker.PositionIndex;
@@ -821,10 +790,10 @@ public void LexCommentMultiLineToken(ref StringWalkerStruct stringWalker)
stringWalker.ResourceUri,
stringWalker.SourceText);
- _syntaxTokenList.Add(new CommentMultiLineToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new CommentMultiLineToken(textSpan));
}
- public void LexPlusPlusToken(ref StringWalkerStruct stringWalker)
+ public static void LexPlusPlusToken(ref CSharpLexerOutput lexerOutput, ref StringWalkerStruct stringWalker)
{
var entryPositionIndex = stringWalker.PositionIndex;
@@ -840,10 +809,10 @@ public void LexPlusPlusToken(ref StringWalkerStruct stringWalker)
stringWalker.ResourceUri,
stringWalker.SourceText);
- _syntaxTokenList.Add(new PlusPlusToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new PlusPlusToken(textSpan));
}
- public void LexMinusMinusToken(ref StringWalkerStruct stringWalker)
+ public static void LexMinusMinusToken(ref CSharpLexerOutput lexerOutput, ref StringWalkerStruct stringWalker)
{
var entryPositionIndex = stringWalker.PositionIndex;
@@ -859,10 +828,10 @@ public void LexMinusMinusToken(ref StringWalkerStruct stringWalker)
stringWalker.ResourceUri,
stringWalker.SourceText);
- _syntaxTokenList.Add(new MinusMinusToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new MinusMinusToken(textSpan));
}
- public void LexEqualsEqualsToken(ref StringWalkerStruct stringWalker)
+ public static void LexEqualsEqualsToken(ref CSharpLexerOutput lexerOutput, ref StringWalkerStruct stringWalker)
{
var entryPositionIndex = stringWalker.PositionIndex;
@@ -878,10 +847,10 @@ public void LexEqualsEqualsToken(ref StringWalkerStruct stringWalker)
stringWalker.ResourceUri,
stringWalker.SourceText);
- _syntaxTokenList.Add(new EqualsEqualsToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new EqualsEqualsToken(textSpan));
}
- public void LexQuestionMarkQuestionMarkToken(ref StringWalkerStruct stringWalker)
+ public static void LexQuestionMarkQuestionMarkToken(ref CSharpLexerOutput lexerOutput, ref StringWalkerStruct stringWalker)
{
var entryPositionIndex = stringWalker.PositionIndex;
@@ -897,10 +866,10 @@ public void LexQuestionMarkQuestionMarkToken(ref StringWalkerStruct stringWalker
stringWalker.ResourceUri,
stringWalker.SourceText);
- _syntaxTokenList.Add(new QuestionMarkQuestionMarkToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new QuestionMarkQuestionMarkToken(textSpan));
}
- public void LexDollarSignToken(ref StringWalkerStruct stringWalker)
+ public static void LexDollarSignToken(ref CSharpLexerOutput lexerOutput, ref StringWalkerStruct stringWalker)
{
var entryPositionIndex = stringWalker.PositionIndex;
@@ -913,10 +882,10 @@ public void LexDollarSignToken(ref StringWalkerStruct stringWalker)
stringWalker.ResourceUri,
stringWalker.SourceText);
- _syntaxTokenList.Add(new DollarSignToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new DollarSignToken(textSpan));
}
- public void LexAtToken(ref StringWalkerStruct stringWalker)
+ public static void LexAtToken(ref CSharpLexerOutput lexerOutput, ref StringWalkerStruct stringWalker)
{
var entryPositionIndex = stringWalker.PositionIndex;
@@ -929,10 +898,10 @@ public void LexAtToken(ref StringWalkerStruct stringWalker)
stringWalker.ResourceUri,
stringWalker.SourceText);
- _syntaxTokenList.Add(new AtToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new AtToken(textSpan));
}
- public void LexPreprocessorDirectiveToken(ref StringWalkerStruct stringWalker)
+ public static void LexPreprocessorDirectiveToken(ref CSharpLexerOutput lexerOutput, ref StringWalkerStruct stringWalker)
{
var entryPositionIndex = stringWalker.PositionIndex;
@@ -964,6 +933,6 @@ public void LexPreprocessorDirectiveToken(ref StringWalkerStruct stringWalker)
stringWalker.ResourceUri,
stringWalker.SourceText);
- _syntaxTokenList.Add(new PreprocessorDirectiveToken(textSpan));
+ lexerOutput.SyntaxTokenList.Add(new PreprocessorDirectiveToken(textSpan));
}
}
\ No newline at end of file
diff --git a/Source/Lib/CompilerServices/CSharp/LexerCase/CSharpLexerOutput.cs b/Source/Lib/CompilerServices/CSharp/LexerCase/CSharpLexerOutput.cs
new file mode 100644
index 000000000..dc4dd1f98
--- /dev/null
+++ b/Source/Lib/CompilerServices/CSharp/LexerCase/CSharpLexerOutput.cs
@@ -0,0 +1,23 @@
+using Luthetus.TextEditor.RazorLib.CompilerServices;
+using Luthetus.TextEditor.RazorLib.CompilerServices.Syntax;
+using Luthetus.TextEditor.RazorLib.Lexers.Models;
+
+namespace Luthetus.CompilerServices.CSharp.LexerCase;
+
+public struct CSharpLexerOutput
+{
+ public CSharpLexerOutput()
+ {
+ #if DEBUG
+ ++LuthetusDebugSomething.Lexer_ConstructorInvocationCount;
+ #endif
+
+ SyntaxTokenList = new();
+ EscapeCharacterList = new();
+ DiagnosticBag = new();
+ }
+
+ public List SyntaxTokenList { get; }
+ public List EscapeCharacterList { get; }
+ public DiagnosticBag DiagnosticBag { get; }
+}
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpParser.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpParser.cs
index 25920e39d..c1c28a5cc 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpParser.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpParser.cs
@@ -33,7 +33,7 @@ public void Parse(CSharpCompilationUnit compilationUnit)
var diagnosticBag = new DiagnosticBag();
compilationUnit.ParserModel = new CSharpParserModel(
- new TokenWalker(compilationUnit.Lexer.SyntaxTokenList, diagnosticBag),
+ new TokenWalker(compilationUnit.LexerOutput.SyntaxTokenList, diagnosticBag),
new Stack(),
diagnosticBag,
globalCodeBlockBuilder,
@@ -240,7 +240,7 @@ public void Parse(CSharpCompilationUnit compilationUnit)
var topLevelStatementsCodeBlock = compilationUnit.ParserModel.CurrentCodeBlockBuilder.Build(
DiagnosticsList
.Union(compilationUnit.Binder.DiagnosticsList)
- .Union(compilationUnit.Lexer.DiagnosticList)
+ .Union(compilationUnit.LexerOutput.DiagnosticBag.ToList())
.ToArray());
compilationUnit.Binder.FinalizeBinderSession(compilationUnit.BinderSession);
diff --git a/Source/Lib/CompilerServices/Razor/RazorSyntaxTree.cs b/Source/Lib/CompilerServices/Razor/RazorSyntaxTree.cs
index 0612ec5b5..f839c1bcf 100644
--- a/Source/Lib/CompilerServices/Razor/RazorSyntaxTree.cs
+++ b/Source/Lib/CompilerServices/Razor/RazorSyntaxTree.cs
@@ -103,17 +103,11 @@ public void ParseCodebehind()
var classContents = _codebehindClassBuilder.ToString();
- var lexer = new CSharpLexer(
- _codebehindResourceUri,
- classContents);
-
- lexer.Lex();
-
var compilationUnit = new CSharpCompilationUnit(
_codebehindResourceUri,
new CSharpBinder());
- compilationUnit.Lexer = lexer;
+ compilationUnit.LexerOutput = CSharpLexer.Lex(_codebehindResourceUri, classContents);
compilationUnit.BinderSession = (CSharpBinderSession)compilationUnit.Binder.StartBinderSession(_codebehindResourceUri);
@@ -1377,11 +1371,9 @@ private List ParseCSharp(
{
var injectedLanguageFragmentSyntaxes = new List();
- var lexer = new CSharpLexer(ResourceUri.Empty, cSharpText);
-
- lexer.Lex();
+ var lexerOutput = CSharpLexer.Lex(ResourceUri.Empty, cSharpText);
- foreach (var lexedTokenTextSpan in lexer.SyntaxTokenList.Select(x => x.TextSpan))
+ foreach (var lexedTokenTextSpan in lexerOutput.SyntaxTokenList.Select(x => x.TextSpan))
{
var startingIndexInclusive = lexedTokenTextSpan.StartingIndexInclusive +
offsetPositionIndex -
From 2a352d37d1662af8af108b92c2b252f97ac098e4 Mon Sep 17 00:00:00 2001
From: Luthetus <45454132+huntercfreeman@users.noreply.github.com>
Date: Sat, 14 Dec 2024 19:53:00 -0500
Subject: [PATCH 4/7] Parser computational state
---
.../BinderCase/CSharpBinder.Expressions.cs | 361 +++++-----
.../CSharp/BinderCase/CSharpBinder.Main.cs | 26 +-
.../CSharpCompilationUnit.cs | 8 +-
.../CSharpCompilerService.cs | 3 +-
.../ParserCase/CSharpDeferredChildScope.cs | 12 +-
.../CSharp/ParserCase/CSharpParser.cs | 459 ++-----------
.../CSharp/ParserCase/CSharpParserModel.cs | 6 +-
.../ParserCase/CSharpStatementBuilder.cs | 10 +-
.../Internals/ParseContextualKeywords.cs | 190 +++---
.../Internals/ParseDefaultKeywords.cs | 550 +++++++--------
.../ParserCase/Internals/ParseFunctions.cs | 85 +--
.../ParserCase/Internals/ParseOthers.cs | 126 ++--
.../ParserCase/Internals/ParseTokens.cs | 628 ++++++++----------
.../CSharp/ParserCase/Internals/ParseTypes.cs | 60 +-
.../ParserCase/Internals/ParseVariables.cs | 50 +-
.../Internals/TokenWalkerExtensionMethods.cs | 15 +-
.../CSharp/ParserCase/Internals/UtilityApi.cs | 16 +-
.../CompilerServices/Razor/RazorSyntaxTree.cs | 3 +-
18 files changed, 1122 insertions(+), 1486 deletions(-)
diff --git a/Source/Lib/CompilerServices/CSharp/BinderCase/CSharpBinder.Expressions.cs b/Source/Lib/CompilerServices/CSharp/BinderCase/CSharpBinder.Expressions.cs
index 3463d55fd..925489398 100644
--- a/Source/Lib/CompilerServices/CSharp/BinderCase/CSharpBinder.Expressions.cs
+++ b/Source/Lib/CompilerServices/CSharp/BinderCase/CSharpBinder.Expressions.cs
@@ -27,7 +27,7 @@ public partial class CSharpBinder
/// if the parameters were not mergeable.
///
public IExpressionNode AnyMergeToken(
- IExpressionNode expressionPrimary, ISyntaxToken token, CSharpCompilationUnit compilationUnit)
+ IExpressionNode expressionPrimary, ISyntaxToken token, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
#if DEBUG
Console.WriteLine($"{expressionPrimary.SyntaxKind} + {token.SyntaxKind}");
@@ -44,7 +44,8 @@ public IExpressionNode AnyMergeToken(
ForceDecisionAmbiguousIdentifier(
EmptyExpressionNode.Empty,
ambiguousIdentifierExpressionNode,
- compilationUnit);
+ compilationUnit,
+ ref parserModel);
}
}
@@ -54,37 +55,37 @@ public IExpressionNode AnyMergeToken(
switch (expressionPrimary.SyntaxKind)
{
case SyntaxKind.EmptyExpressionNode:
- return EmptyMergeToken((EmptyExpressionNode)expressionPrimary, token, compilationUnit);
+ return EmptyMergeToken((EmptyExpressionNode)expressionPrimary, token, compilationUnit, ref parserModel);
case SyntaxKind.LiteralExpressionNode:
- return LiteralMergeToken((LiteralExpressionNode)expressionPrimary, token, compilationUnit);
+ return LiteralMergeToken((LiteralExpressionNode)expressionPrimary, token, compilationUnit, ref parserModel);
case SyntaxKind.BinaryExpressionNode:
- return BinaryMergeToken((BinaryExpressionNode)expressionPrimary, token, compilationUnit);
+ return BinaryMergeToken((BinaryExpressionNode)expressionPrimary, token, compilationUnit, ref parserModel);
case SyntaxKind.ParenthesizedExpressionNode:
- return ParenthesizedMergeToken((ParenthesizedExpressionNode)expressionPrimary, token, compilationUnit);
+ return ParenthesizedMergeToken((ParenthesizedExpressionNode)expressionPrimary, token, compilationUnit, ref parserModel);
case SyntaxKind.CommaSeparatedExpressionNode:
- return CommaSeparatedMergeToken((CommaSeparatedExpressionNode)expressionPrimary, token, compilationUnit);
+ return CommaSeparatedMergeToken((CommaSeparatedExpressionNode)expressionPrimary, token, compilationUnit, ref parserModel);
case SyntaxKind.FunctionInvocationNode:
- return FunctionInvocationMergeToken((FunctionInvocationNode)expressionPrimary, token, compilationUnit);
+ return FunctionInvocationMergeToken((FunctionInvocationNode)expressionPrimary, token, compilationUnit, ref parserModel);
case SyntaxKind.LambdaExpressionNode:
- return LambdaMergeToken((LambdaExpressionNode)expressionPrimary, token, compilationUnit);
+ return LambdaMergeToken((LambdaExpressionNode)expressionPrimary, token, compilationUnit, ref parserModel);
case SyntaxKind.ConstructorInvocationExpressionNode:
- return ConstructorInvocationMergeToken((ConstructorInvocationExpressionNode)expressionPrimary, token, compilationUnit);
+ return ConstructorInvocationMergeToken((ConstructorInvocationExpressionNode)expressionPrimary, token, compilationUnit, ref parserModel);
case SyntaxKind.ExplicitCastNode:
- return ExplicitCastMergeToken((ExplicitCastNode)expressionPrimary, token, compilationUnit);
+ return ExplicitCastMergeToken((ExplicitCastNode)expressionPrimary, token, compilationUnit, ref parserModel);
case SyntaxKind.AmbiguousIdentifierExpressionNode:
- return AmbiguousIdentifierMergeToken((AmbiguousIdentifierExpressionNode)expressionPrimary, token, compilationUnit);
+ return AmbiguousIdentifierMergeToken((AmbiguousIdentifierExpressionNode)expressionPrimary, token, compilationUnit, ref parserModel);
case SyntaxKind.TypeClauseNode:
- return TypeClauseMergeToken((TypeClauseNode)expressionPrimary, token, compilationUnit);
+ return TypeClauseMergeToken((TypeClauseNode)expressionPrimary, token, compilationUnit, ref parserModel);
case SyntaxKind.VariableAssignmentExpressionNode:
- return VariableAssignmentMergeToken((VariableAssignmentExpressionNode)expressionPrimary, token, compilationUnit);
+ return VariableAssignmentMergeToken((VariableAssignmentExpressionNode)expressionPrimary, token, compilationUnit, ref parserModel);
case SyntaxKind.GenericParametersListingNode:
- return GenericParametersListingMergeToken((GenericParametersListingNode)expressionPrimary, token, compilationUnit);
+ return GenericParametersListingMergeToken((GenericParametersListingNode)expressionPrimary, token, compilationUnit, ref parserModel);
case SyntaxKind.FunctionParametersListingNode:
- return FunctionParametersListingMergeToken((FunctionParametersListingNode)expressionPrimary, token, compilationUnit);
+ return FunctionParametersListingMergeToken((FunctionParametersListingNode)expressionPrimary, token, compilationUnit, ref parserModel);
case SyntaxKind.FunctionArgumentsListingNode:
- return FunctionArgumentsListingMergeToken((FunctionArgumentsListingNode)expressionPrimary, token, compilationUnit);
+ return FunctionArgumentsListingMergeToken((FunctionArgumentsListingNode)expressionPrimary, token, compilationUnit, ref parserModel);
case SyntaxKind.BadExpressionNode:
- return BadMergeToken((BadExpressionNode)expressionPrimary, token, compilationUnit);
+ return BadMergeToken((BadExpressionNode)expressionPrimary, token, compilationUnit, ref parserModel);
default:
return new BadExpressionNode(CSharpFacts.Types.Void.ToTypeClause(), expressionPrimary, token);
};
@@ -95,7 +96,7 @@ public IExpressionNode AnyMergeToken(
/// if the parameters were not mergeable.
///
public IExpressionNode AnyMergeExpression(
- IExpressionNode expressionPrimary, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit)
+ IExpressionNode expressionPrimary, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
#if DEBUG
Console.WriteLine($"{expressionPrimary.SyntaxKind} + {expressionSecondary.SyntaxKind}");
@@ -104,36 +105,36 @@ public IExpressionNode AnyMergeExpression(
switch (expressionPrimary.SyntaxKind)
{
case SyntaxKind.ParenthesizedExpressionNode:
- return ParenthesizedMergeExpression((ParenthesizedExpressionNode)expressionPrimary, expressionSecondary, compilationUnit);
+ return ParenthesizedMergeExpression((ParenthesizedExpressionNode)expressionPrimary, expressionSecondary, compilationUnit, ref parserModel);
case SyntaxKind.CommaSeparatedExpressionNode:
- return CommaSeparatedMergeExpression((CommaSeparatedExpressionNode)expressionPrimary, expressionSecondary, compilationUnit);
+ return CommaSeparatedMergeExpression((CommaSeparatedExpressionNode)expressionPrimary, expressionSecondary, compilationUnit, ref parserModel);
case SyntaxKind.FunctionInvocationNode:
- return FunctionInvocationMergeExpression((FunctionInvocationNode)expressionPrimary, expressionSecondary, compilationUnit);
+ return FunctionInvocationMergeExpression((FunctionInvocationNode)expressionPrimary, expressionSecondary, compilationUnit, ref parserModel);
case SyntaxKind.LambdaExpressionNode:
- return LambdaMergeExpression((LambdaExpressionNode)expressionPrimary, expressionSecondary, compilationUnit);
+ return LambdaMergeExpression((LambdaExpressionNode)expressionPrimary, expressionSecondary, compilationUnit, ref parserModel);
case SyntaxKind.ConstructorInvocationExpressionNode:
- return ConstructorInvocationMergeExpression((ConstructorInvocationExpressionNode)expressionPrimary, expressionSecondary, compilationUnit);
+ return ConstructorInvocationMergeExpression((ConstructorInvocationExpressionNode)expressionPrimary, expressionSecondary, compilationUnit, ref parserModel);
case SyntaxKind.AmbiguousIdentifierExpressionNode:
- return AmbiguousIdentifierMergeExpression((AmbiguousIdentifierExpressionNode)expressionPrimary, expressionSecondary, compilationUnit);
+ return AmbiguousIdentifierMergeExpression((AmbiguousIdentifierExpressionNode)expressionPrimary, expressionSecondary, compilationUnit, ref parserModel);
case SyntaxKind.TypeClauseNode:
- return TypeClauseMergeExpression((TypeClauseNode)expressionPrimary, expressionSecondary, compilationUnit);
+ return TypeClauseMergeExpression((TypeClauseNode)expressionPrimary, expressionSecondary, compilationUnit, ref parserModel);
case SyntaxKind.VariableAssignmentExpressionNode:
- return VariableAssignmentMergeExpression((VariableAssignmentExpressionNode)expressionPrimary, expressionSecondary, compilationUnit);
+ return VariableAssignmentMergeExpression((VariableAssignmentExpressionNode)expressionPrimary, expressionSecondary, compilationUnit, ref parserModel);
case SyntaxKind.GenericParametersListingNode:
- return GenericParametersListingMergeExpression((GenericParametersListingNode)expressionPrimary, expressionSecondary, compilationUnit);
+ return GenericParametersListingMergeExpression((GenericParametersListingNode)expressionPrimary, expressionSecondary, compilationUnit, ref parserModel);
case SyntaxKind.FunctionParametersListingNode:
- return FunctionParametersListingMergeExpression((FunctionParametersListingNode)expressionPrimary, expressionSecondary, compilationUnit);
+ return FunctionParametersListingMergeExpression((FunctionParametersListingNode)expressionPrimary, expressionSecondary, compilationUnit, ref parserModel);
case SyntaxKind.FunctionArgumentsListingNode:
- return FunctionArgumentsListingMergeExpression((FunctionArgumentsListingNode)expressionPrimary, expressionSecondary, compilationUnit);
+ return FunctionArgumentsListingMergeExpression((FunctionArgumentsListingNode)expressionPrimary, expressionSecondary, compilationUnit, ref parserModel);
case SyntaxKind.BadExpressionNode:
- return BadMergeExpression((BadExpressionNode)expressionPrimary, expressionSecondary, compilationUnit);
+ return BadMergeExpression((BadExpressionNode)expressionPrimary, expressionSecondary, compilationUnit, ref parserModel);
default:
return new BadExpressionNode(CSharpFacts.Types.Void.ToTypeClause(), expressionPrimary, expressionSecondary);
};
}
public IExpressionNode AmbiguousIdentifierMergeToken(
- AmbiguousIdentifierExpressionNode ambiguousIdentifierExpressionNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit)
+ AmbiguousIdentifierExpressionNode ambiguousIdentifierExpressionNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
if (token.SyntaxKind == SyntaxKind.OpenParenthesisToken &&
ambiguousIdentifierExpressionNode.Token.SyntaxKind == SyntaxKind.IdentifierToken)
@@ -155,8 +156,8 @@ public IExpressionNode AmbiguousIdentifierMergeToken(
functionInvocationNode,
compilationUnit);
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, functionInvocationNode));
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CommaToken, functionInvocationNode.FunctionParametersListingNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, functionInvocationNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CommaToken, functionInvocationNode.FunctionParametersListingNode));
return EmptyExpressionNode.Empty;
}
else if (token.SyntaxKind == SyntaxKind.OpenAngleBracketToken)
@@ -170,8 +171,8 @@ public IExpressionNode AmbiguousIdentifierMergeToken(
closeAngleBracketToken: default));
}
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseAngleBracketToken, ambiguousIdentifierExpressionNode));
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CommaToken, ambiguousIdentifierExpressionNode.GenericParametersListingNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CloseAngleBracketToken, ambiguousIdentifierExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CommaToken, ambiguousIdentifierExpressionNode.GenericParametersListingNode));
return EmptyExpressionNode.Empty;
}
else if (token.SyntaxKind == SyntaxKind.CloseAngleBracketToken)
@@ -184,10 +185,10 @@ public IExpressionNode AmbiguousIdentifierMergeToken(
}
else if (token.SyntaxKind == SyntaxKind.EqualsToken)
{
- if (compilationUnit.ParserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.CloseAngleBracketToken)
+ if (parserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.CloseAngleBracketToken)
{
var lambdaExpressionNode = new LambdaExpressionNode(CSharpFacts.Types.Void.ToTypeClause());
- SetLambdaExpressionNodeVariableDeclarationNodeList(lambdaExpressionNode, ambiguousIdentifierExpressionNode, compilationUnit);
+ SetLambdaExpressionNodeVariableDeclarationNodeList(lambdaExpressionNode, ambiguousIdentifierExpressionNode, compilationUnit, ref parserModel);
return lambdaExpressionNode;
}
@@ -195,18 +196,18 @@ public IExpressionNode AmbiguousIdentifierMergeToken(
if (UtilityApi.IsConvertibleToIdentifierToken(ambiguousIdentifierExpressionNode.Token.SyntaxKind))
{
var variableAssignmentNode = new VariableAssignmentExpressionNode(
- UtilityApi.ConvertToIdentifierToken(ambiguousIdentifierExpressionNode.Token, compilationUnit),
+ UtilityApi.ConvertToIdentifierToken(ambiguousIdentifierExpressionNode.Token, compilationUnit, ref parserModel),
(EqualsToken)token,
EmptyExpressionNode.Empty);
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CommaToken, variableAssignmentNode));
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.EndOfFileToken, variableAssignmentNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CommaToken, variableAssignmentNode));
+ parserModel.ExpressionList.Add((SyntaxKind.EndOfFileToken, variableAssignmentNode));
return EmptyExpressionNode.Empty;
}
else
{
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CommaToken, ambiguousIdentifierExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CommaToken, ambiguousIdentifierExpressionNode));
return EmptyExpressionNode.Empty;
}
}
@@ -215,24 +216,25 @@ public IExpressionNode AmbiguousIdentifierMergeToken(
ForceDecisionAmbiguousIdentifier(
EmptyExpressionNode.Empty,
ambiguousIdentifierExpressionNode,
- compilationUnit);
+ compilationUnit,
+ ref parserModel);
- _ = compilationUnit.ParserModel.TokenWalker.Consume(); // Consume the IsTokenKeyword
+ _ = parserModel.TokenWalker.Consume(); // Consume the IsTokenKeyword
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.NotTokenContextualKeyword)
- _ = compilationUnit.ParserModel.TokenWalker.Consume(); // Consume the NotTokenKeyword
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.NotTokenContextualKeyword)
+ _ = parserModel.TokenWalker.Consume(); // Consume the NotTokenKeyword
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.NullTokenKeyword)
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.NullTokenKeyword)
{
- _ = compilationUnit.ParserModel.TokenWalker.Consume(); // Consume the NullTokenKeyword
+ _ = parserModel.TokenWalker.Consume(); // Consume the NullTokenKeyword
}
- else if (UtilityApi.IsConvertibleToIdentifierToken(compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind))
+ else if (UtilityApi.IsConvertibleToIdentifierToken(parserModel.TokenWalker.Current.SyntaxKind))
{
- ParseTokens.ParseIdentifierToken(compilationUnit); // Parse the type pattern matching / variable declaration
+ ParseTokens.ParseIdentifierToken(compilationUnit, ref parserModel); // Parse the type pattern matching / variable declaration
}
// Guaranteed to consume 1 further than the secondary loop so have to backtrack 1 time as well.
- _ = compilationUnit.ParserModel.TokenWalker.Backtrack();
+ _ = parserModel.TokenWalker.Backtrack();
return ambiguousIdentifierExpressionNode;
}
@@ -241,42 +243,43 @@ public IExpressionNode AmbiguousIdentifierMergeToken(
ForceDecisionAmbiguousIdentifier(
EmptyExpressionNode.Empty,
ambiguousIdentifierExpressionNode,
- compilationUnit);
+ compilationUnit,
+ ref parserModel);
- if (compilationUnit.ParserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.OpenBraceToken)
+ if (parserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.OpenBraceToken)
{
- var withKeywordContextualToken = compilationUnit.ParserModel.TokenWalker.Consume();
+ var withKeywordContextualToken = parserModel.TokenWalker.Consume();
#if DEBUG
- compilationUnit.ParserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = true;
+ parserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = true;
#endif
- var openBraceToken = (OpenBraceToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var openBraceToken = (OpenBraceToken)parserModel.TokenWalker.Consume();
var openBraceCounter = 1;
while (true)
{
- if (compilationUnit.ParserModel.TokenWalker.IsEof)
+ if (parserModel.TokenWalker.IsEof)
break;
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenBraceToken)
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenBraceToken)
{
++openBraceCounter;
}
- else if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CloseBraceToken)
+ else if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CloseBraceToken)
{
if (--openBraceCounter <= 0)
break;
}
- _ = compilationUnit.ParserModel.TokenWalker.Consume();
+ _ = parserModel.TokenWalker.Consume();
}
- var closeBraceToken = (CloseBraceToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.CloseBraceToken);
+ var closeBraceToken = (CloseBraceToken)parserModel.TokenWalker.Match(SyntaxKind.CloseBraceToken);
#if DEBUG
- compilationUnit.ParserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = false;
+ parserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = false;
#endif
}
@@ -291,23 +294,25 @@ public IExpressionNode AmbiguousIdentifierMergeToken(
var decidedExpression = ForceDecisionAmbiguousIdentifier(
EmptyExpressionNode.Empty,
ambiguousIdentifierExpressionNode,
- compilationUnit);
+ compilationUnit,
+ ref parserModel);
if (decidedExpression.SyntaxKind != SyntaxKind.TypeClauseNode)
{
- compilationUnit.ParserModel.DiagnosticBag.ReportTodoException(
- compilationUnit.ParserModel.TokenWalker.Current.TextSpan,
+ parserModel.DiagnosticBag.ReportTodoException(
+ parserModel.TokenWalker.Current.TextSpan,
"if (decidedExpression.SyntaxKind != SyntaxKind.TypeClauseNode)");
return decidedExpression;
}
- var identifierToken = (IdentifierToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.IdentifierToken);
+ var identifierToken = (IdentifierToken)parserModel.TokenWalker.Match(SyntaxKind.IdentifierToken);
var variableDeclarationNode = ParseVariables.HandleVariableDeclarationExpression(
(TypeClauseNode)decidedExpression,
identifierToken,
VariableKind.Local,
- compilationUnit);
+ compilationUnit,
+ ref parserModel);
return variableDeclarationNode;
}
@@ -316,7 +321,7 @@ public IExpressionNode AmbiguousIdentifierMergeToken(
}
public IExpressionNode AmbiguousIdentifierMergeExpression(
- AmbiguousIdentifierExpressionNode ambiguousIdentifierExpressionNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit)
+ AmbiguousIdentifierExpressionNode ambiguousIdentifierExpressionNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
if (ambiguousIdentifierExpressionNode.GenericParametersListingNode is not null &&
!ambiguousIdentifierExpressionNode.GenericParametersListingNode.CloseAngleBracketToken.ConstructorWasInvoked)
@@ -331,6 +336,7 @@ public IExpressionNode ForceDecisionAmbiguousIdentifier(
IExpressionNode expressionPrimary,
AmbiguousIdentifierExpressionNode ambiguousIdentifierExpressionNode,
CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel,
bool forceVariableReferenceNode = false)
{
if (ambiguousIdentifierExpressionNode.FollowsMemberAccessToken)
@@ -345,7 +351,7 @@ public IExpressionNode ForceDecisionAmbiguousIdentifier(
ambiguousIdentifierExpressionNode.Token.TextSpan.GetText(),
out var existingVariableDeclarationNode))
{
- var identifierToken = UtilityApi.ConvertToIdentifierToken(ambiguousIdentifierExpressionNode.Token, compilationUnit);
+ var identifierToken = UtilityApi.ConvertToIdentifierToken(ambiguousIdentifierExpressionNode.Token, compilationUnit, ref parserModel);
var variableReferenceNode = ConstructAndBindVariableReferenceNode(
identifierToken,
@@ -365,7 +371,7 @@ public IExpressionNode ForceDecisionAmbiguousIdentifier(
ambiguousIdentifierExpressionNode.Token.TextSpan.GetText(),
out var typeDefinitionNode))
{
- var typeClauseNode = UtilityApi.ConvertToTypeClauseNode(ambiguousIdentifierExpressionNode.Token, compilationUnit);
+ var typeClauseNode = UtilityApi.ConvertToTypeClauseNode(ambiguousIdentifierExpressionNode.Token, compilationUnit, ref parserModel);
BindTypeClauseNode(typeClauseNode, compilationUnit);
return typeClauseNode;
}
@@ -375,7 +381,7 @@ public IExpressionNode ForceDecisionAmbiguousIdentifier(
if (!forceVariableReferenceNode ||
UtilityApi.IsConvertibleToTypeClauseNode(ambiguousIdentifierExpressionNode.Token.SyntaxKind))
{
- var typeClauseNode = UtilityApi.ConvertToTypeClauseNode(ambiguousIdentifierExpressionNode.Token, compilationUnit);
+ var typeClauseNode = UtilityApi.ConvertToTypeClauseNode(ambiguousIdentifierExpressionNode.Token, compilationUnit, ref parserModel);
BindTypeClauseNode(typeClauseNode, compilationUnit);
return typeClauseNode;
}
@@ -383,7 +389,7 @@ public IExpressionNode ForceDecisionAmbiguousIdentifier(
// Bind an undefined-variable
if (UtilityApi.IsConvertibleToIdentifierToken(ambiguousIdentifierExpressionNode.Token.SyntaxKind))
{
- var identifierToken = UtilityApi.ConvertToIdentifierToken(ambiguousIdentifierExpressionNode.Token, compilationUnit);
+ var identifierToken = UtilityApi.ConvertToIdentifierToken(ambiguousIdentifierExpressionNode.Token, compilationUnit, ref parserModel);
var variableReferenceNode = ConstructAndBindVariableReferenceNode(
identifierToken,
@@ -396,21 +402,21 @@ public IExpressionNode ForceDecisionAmbiguousIdentifier(
}
public IExpressionNode BadMergeToken(
- BadExpressionNode badExpressionNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit)
+ BadExpressionNode badExpressionNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
badExpressionNode.SyntaxList.Add(token);
return badExpressionNode;
}
public IExpressionNode BadMergeExpression(
- BadExpressionNode badExpressionNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit)
+ BadExpressionNode badExpressionNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
badExpressionNode.SyntaxList.Add(expressionSecondary);
return badExpressionNode;
}
public IExpressionNode BinaryMergeToken(
- BinaryExpressionNode binaryExpressionNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit)
+ BinaryExpressionNode binaryExpressionNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
switch (token.SyntaxKind)
{
@@ -463,13 +469,13 @@ public IExpressionNode BinaryMergeToken(
}
public IExpressionNode CommaSeparatedMergeToken(
- CommaSeparatedExpressionNode commaSeparatedExpressionNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit)
+ CommaSeparatedExpressionNode commaSeparatedExpressionNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
if (token.SyntaxKind == SyntaxKind.CommaToken)
{
if (!commaSeparatedExpressionNode.CloseParenthesisToken.ConstructorWasInvoked)
{
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CommaToken, commaSeparatedExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CommaToken, commaSeparatedExpressionNode));
return EmptyExpressionNode.Empty;
}
}
@@ -482,9 +488,9 @@ public IExpressionNode CommaSeparatedMergeToken(
}
public IExpressionNode CommaSeparatedMergeExpression(
- CommaSeparatedExpressionNode commaSeparatedExpressionNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit)
+ CommaSeparatedExpressionNode commaSeparatedExpressionNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CommaToken || compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CloseParenthesisToken)
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CommaToken || parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CloseParenthesisToken)
{
commaSeparatedExpressionNode.AddInnerExpressionNode(expressionSecondary);
return commaSeparatedExpressionNode;
@@ -494,7 +500,7 @@ public IExpressionNode CommaSeparatedMergeExpression(
}
public IExpressionNode ConstructorInvocationMergeToken(
- ConstructorInvocationExpressionNode constructorInvocationExpressionNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit)
+ ConstructorInvocationExpressionNode constructorInvocationExpressionNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
switch (token.SyntaxKind)
{
@@ -503,7 +509,7 @@ public IExpressionNode ConstructorInvocationMergeToken(
{
if (UtilityApi.IsConvertibleToTypeClauseNode(token.SyntaxKind))
{
- var typeClauseNode = UtilityApi.ConvertToTypeClauseNode(token, compilationUnit);
+ var typeClauseNode = UtilityApi.ConvertToTypeClauseNode(token, compilationUnit, ref parserModel);
BindTypeClauseNode(
typeClauseNode,
@@ -523,8 +529,8 @@ public IExpressionNode ConstructorInvocationMergeToken(
constructorInvocationExpressionNode.SetFunctionParametersListingNode(functionParametersListingNode);
constructorInvocationExpressionNode.ConstructorInvocationStageKind = ConstructorInvocationStageKind.FunctionParameters;
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, constructorInvocationExpressionNode));
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CommaToken, constructorInvocationExpressionNode.FunctionParametersListingNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, constructorInvocationExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CommaToken, constructorInvocationExpressionNode.FunctionParametersListingNode));
return EmptyExpressionNode.Empty;
case SyntaxKind.CloseParenthesisToken:
if (constructorInvocationExpressionNode.FunctionParametersListingNode is not null)
@@ -547,8 +553,8 @@ public IExpressionNode ConstructorInvocationMergeToken(
}
constructorInvocationExpressionNode.ConstructorInvocationStageKind = ConstructorInvocationStageKind.GenericParameters;
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseAngleBracketToken, constructorInvocationExpressionNode));
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CommaToken, constructorInvocationExpressionNode.ResultTypeClauseNode.GenericParametersListingNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CloseAngleBracketToken, constructorInvocationExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CommaToken, constructorInvocationExpressionNode.ResultTypeClauseNode.GenericParametersListingNode));
return EmptyExpressionNode.Empty;
case SyntaxKind.CloseAngleBracketToken:
constructorInvocationExpressionNode.ConstructorInvocationStageKind = ConstructorInvocationStageKind.Unset;
@@ -563,9 +569,9 @@ public IExpressionNode ConstructorInvocationMergeToken(
constructorInvocationExpressionNode.SetObjectInitializationParametersListingNode(objectInitializationParametersListingNode);
constructorInvocationExpressionNode.ConstructorInvocationStageKind = ConstructorInvocationStageKind.ObjectInitializationParameters;
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseBraceToken, constructorInvocationExpressionNode));
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.EqualsToken, constructorInvocationExpressionNode));
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CommaToken, constructorInvocationExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CloseBraceToken, constructorInvocationExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.EqualsToken, constructorInvocationExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CommaToken, constructorInvocationExpressionNode));
return EmptyExpressionNode.Empty;
case SyntaxKind.CloseBraceToken:
constructorInvocationExpressionNode.ConstructorInvocationStageKind = ConstructorInvocationStageKind.Unset;
@@ -580,8 +586,8 @@ public IExpressionNode ConstructorInvocationMergeToken(
goto default;
}
case SyntaxKind.EqualsToken:
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.EqualsToken, constructorInvocationExpressionNode));
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CommaToken, constructorInvocationExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.EqualsToken, constructorInvocationExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CommaToken, constructorInvocationExpressionNode));
if (constructorInvocationExpressionNode.ConstructorInvocationStageKind == ConstructorInvocationStageKind.ObjectInitializationParameters &&
constructorInvocationExpressionNode.ObjectInitializationParametersListingNode is not null)
@@ -600,7 +606,7 @@ public IExpressionNode ConstructorInvocationMergeToken(
goto default;
case SyntaxKind.CommaToken:
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CommaToken, constructorInvocationExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CommaToken, constructorInvocationExpressionNode));
return EmptyExpressionNode.Empty;
default:
return new BadExpressionNode(CSharpFacts.Types.Void.ToTypeClause(), constructorInvocationExpressionNode, token);
@@ -608,7 +614,7 @@ public IExpressionNode ConstructorInvocationMergeToken(
}
public IExpressionNode ConstructorInvocationMergeExpression(
- ConstructorInvocationExpressionNode constructorInvocationExpressionNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit)
+ ConstructorInvocationExpressionNode constructorInvocationExpressionNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
if (constructorInvocationExpressionNode.ConstructorInvocationStageKind != ConstructorInvocationStageKind.ObjectInitializationParameters &&
expressionSecondary.SyntaxKind == SyntaxKind.AmbiguousIdentifierExpressionNode)
@@ -616,7 +622,8 @@ public IExpressionNode ConstructorInvocationMergeExpression(
expressionSecondary = ForceDecisionAmbiguousIdentifier(
constructorInvocationExpressionNode,
(AmbiguousIdentifierExpressionNode)expressionSecondary,
- compilationUnit);
+ compilationUnit,
+ ref parserModel);
}
if (expressionSecondary.SyntaxKind == SyntaxKind.EmptyExpressionNode)
@@ -666,8 +673,8 @@ public IExpressionNode ConstructorInvocationMergeExpression(
// This feels like hacky nonsense.
// It allows for ObjectInitialization and CollectionInitialization
// to use the same node but why not just use separate nodes?
- var currentTokenIsComma = compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CommaToken;
- var currentTokenIsBrace = compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CloseBraceToken;
+ var currentTokenIsComma = parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CommaToken;
+ var currentTokenIsBrace = parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CloseBraceToken;
if (!objectInitializationParameterEntryNode.PropertyIdentifierToken.ConstructorWasInvoked &&
(!currentTokenIsComma && !currentTokenIsBrace))
@@ -710,7 +717,8 @@ public IExpressionNode ConstructorInvocationMergeExpression(
expressionSecondary = ForceDecisionAmbiguousIdentifier(
constructorInvocationExpressionNode,
(AmbiguousIdentifierExpressionNode)expressionSecondary,
- compilationUnit);
+ compilationUnit,
+ ref parserModel);
}
objectInitializationParameterEntryNode.ExpressionNode = expressionSecondary;
@@ -744,7 +752,7 @@ public IExpressionNode ConstructorInvocationMergeExpression(
}
public IExpressionNode EmptyMergeToken(
- EmptyExpressionNode emptyExpressionNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit)
+ EmptyExpressionNode emptyExpressionNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
if (UtilityApi.IsConvertibleToTypeClauseNode(token.SyntaxKind))
{
@@ -756,13 +764,14 @@ public IExpressionNode EmptyMergeToken(
FollowsMemberAccessToken = emptyExpressionNode.FollowsMemberAccessToken
};
- if (compilationUnit.ParserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.StatementDelimiterToken && !ambiguousExpressionNode.FollowsMemberAccessToken ||
- compilationUnit.ParserModel.TryParseExpressionSyntaxKindList.Contains(SyntaxKind.TypeClauseNode) && compilationUnit.ParserModel.TokenWalker.Next.SyntaxKind != SyntaxKind.WithTokenContextualKeyword)
+ if (parserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.StatementDelimiterToken && !ambiguousExpressionNode.FollowsMemberAccessToken ||
+ parserModel.TryParseExpressionSyntaxKindList.Contains(SyntaxKind.TypeClauseNode) && parserModel.TokenWalker.Next.SyntaxKind != SyntaxKind.WithTokenContextualKeyword)
{
return ForceDecisionAmbiguousIdentifier(
emptyExpressionNode,
ambiguousExpressionNode,
- compilationUnit);
+ compilationUnit,
+ ref parserModel);
}
return ambiguousExpressionNode;
@@ -791,8 +800,8 @@ public IExpressionNode EmptyMergeToken(
return new LiteralExpressionNode(token, tokenTypeClauseNode);
case SyntaxKind.OpenParenthesisToken:
var parenthesizedExpressionNode = new ParenthesizedExpressionNode((OpenParenthesisToken)token, CSharpFacts.Types.Void.ToTypeClause());
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, parenthesizedExpressionNode));
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CommaToken, parenthesizedExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, parenthesizedExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CommaToken, parenthesizedExpressionNode));
return EmptyExpressionNode.Empty;
case SyntaxKind.NewTokenKeyword:
return new ConstructorInvocationExpressionNode(
@@ -810,10 +819,10 @@ public IExpressionNode EmptyMergeToken(
return emptyExpressionNode;
case SyntaxKind.OutTokenKeyword:
- if (UtilityApi.IsConvertibleToIdentifierToken(compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind))
+ if (UtilityApi.IsConvertibleToIdentifierToken(parserModel.TokenWalker.Current.SyntaxKind))
{
// Parse the variable reference / variable declaration
- ParseTokens.ParseIdentifierToken(compilationUnit);
+ ParseTokens.ParseIdentifierToken(compilationUnit, ref parserModel);
}
return emptyExpressionNode;
@@ -826,8 +835,8 @@ public IExpressionNode EmptyMergeToken(
new List(),
closeAngleBracketToken: default);
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseAngleBracketToken, genericParametersListingNode));
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CommaToken, genericParametersListingNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CloseAngleBracketToken, genericParametersListingNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CommaToken, genericParametersListingNode));
return EmptyExpressionNode.Empty;
default:
return new BadExpressionNode(CSharpFacts.Types.Void.ToTypeClause(), emptyExpressionNode, token);
@@ -835,7 +844,7 @@ public IExpressionNode EmptyMergeToken(
}
public IExpressionNode ExplicitCastMergeToken(
- ExplicitCastNode explicitCastNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit)
+ ExplicitCastNode explicitCastNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
switch (token.SyntaxKind)
{
@@ -853,12 +862,12 @@ public IExpressionNode ExplicitCastMergeToken(
}
public IExpressionNode GenericParametersListingMergeToken(
- GenericParametersListingNode genericParametersListingNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit)
+ GenericParametersListingNode genericParametersListingNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
switch (token.SyntaxKind)
{
case SyntaxKind.CommaToken:
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CommaToken, genericParametersListingNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CommaToken, genericParametersListingNode));
return EmptyExpressionNode.Empty;
case SyntaxKind.CloseAngleBracketToken:
// This case only occurs when the text won't compile.
@@ -866,7 +875,7 @@ public IExpressionNode GenericParametersListingMergeToken(
// The case is for when the user types just the generic parameter listing text without an identifier before it.
//
// In the case of "SomeMethod()", the FunctionInvocationNode
- // is expected to have ran 'compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseAngleBracketToken, functionInvocationNode));'
+ // is expected to have ran 'parserModel.ExpressionList.Add((SyntaxKind.CloseAngleBracketToken, functionInvocationNode));'
// to receive the genericParametersListingNode.
return genericParametersListingNode;
default:
@@ -875,7 +884,7 @@ public IExpressionNode GenericParametersListingMergeToken(
}
public IExpressionNode GenericParametersListingMergeExpression(
- GenericParametersListingNode genericParametersListingNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit)
+ GenericParametersListingNode genericParametersListingNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
if (expressionSecondary.SyntaxKind == SyntaxKind.EmptyExpressionNode)
return genericParametersListingNode;
@@ -884,7 +893,7 @@ public IExpressionNode GenericParametersListingMergeExpression(
{
var expressionSecondaryTyped = (AmbiguousIdentifierExpressionNode)expressionSecondary;
- var typeClauseNode = UtilityApi.ConvertToTypeClauseNode(expressionSecondaryTyped.Token, compilationUnit);
+ var typeClauseNode = UtilityApi.ConvertToTypeClauseNode(expressionSecondaryTyped.Token, compilationUnit, ref parserModel);
BindTypeClauseNode(
typeClauseNode,
@@ -929,12 +938,12 @@ public IExpressionNode GenericParametersListingMergeExpression(
}
public IExpressionNode FunctionParametersListingMergeToken(
- FunctionParametersListingNode functionParametersListingNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit)
+ FunctionParametersListingNode functionParametersListingNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
switch (token.SyntaxKind)
{
case SyntaxKind.CommaToken:
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CommaToken, functionParametersListingNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CommaToken, functionParametersListingNode));
return EmptyExpressionNode.Empty;
default:
return new BadExpressionNode(CSharpFacts.Types.Void.ToTypeClause(), functionParametersListingNode, token);
@@ -942,7 +951,7 @@ public IExpressionNode FunctionParametersListingMergeToken(
}
public IExpressionNode FunctionParametersListingMergeExpression(
- FunctionParametersListingNode functionParametersListingNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit)
+ FunctionParametersListingNode functionParametersListingNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
if (expressionSecondary.SyntaxKind == SyntaxKind.EmptyExpressionNode)
return functionParametersListingNode;
@@ -952,7 +961,8 @@ public IExpressionNode FunctionParametersListingMergeExpression(
expressionSecondary = ForceDecisionAmbiguousIdentifier(
functionParametersListingNode,
(AmbiguousIdentifierExpressionNode)expressionSecondary,
- compilationUnit);
+ compilationUnit,
+ ref parserModel);
}
var functionParameterEntryNode = new FunctionParameterEntryNode(
@@ -967,12 +977,12 @@ public IExpressionNode FunctionParametersListingMergeExpression(
}
public IExpressionNode FunctionArgumentsListingMergeToken(
- FunctionArgumentsListingNode functionArgumentsListingNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit)
+ FunctionArgumentsListingNode functionArgumentsListingNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
switch (token.SyntaxKind)
{
case SyntaxKind.CommaToken:
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CommaToken, functionArgumentsListingNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CommaToken, functionArgumentsListingNode));
return EmptyExpressionNode.Empty;
default:
return new BadExpressionNode(CSharpFacts.Types.Void.ToTypeClause(), functionArgumentsListingNode, token);
@@ -980,7 +990,7 @@ public IExpressionNode FunctionArgumentsListingMergeToken(
}
public IExpressionNode FunctionArgumentsListingMergeExpression(
- FunctionArgumentsListingNode functionArgumentsListingNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit)
+ FunctionArgumentsListingNode functionArgumentsListingNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
if (expressionSecondary.SyntaxKind == SyntaxKind.EmptyExpressionNode)
return functionArgumentsListingNode;
@@ -990,7 +1000,8 @@ public IExpressionNode FunctionArgumentsListingMergeExpression(
expressionSecondary = ForceDecisionAmbiguousIdentifier(
functionArgumentsListingNode,
(AmbiguousIdentifierExpressionNode)expressionSecondary,
- compilationUnit);
+ compilationUnit,
+ ref parserModel);
}
var functionArgumentEntryNode = new FunctionArgumentEntryNode(
@@ -1008,14 +1019,14 @@ public IExpressionNode FunctionArgumentsListingMergeExpression(
}
public IExpressionNode LambdaMergeToken(
- LambdaExpressionNode lambdaExpressionNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit)
+ LambdaExpressionNode lambdaExpressionNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
if (token.SyntaxKind == SyntaxKind.CloseAngleBracketToken)
{
int startInclusiveIndex;
- if (compilationUnit.ParserModel.TokenWalker.Previous.SyntaxKind == SyntaxKind.EqualsToken)
- startInclusiveIndex = compilationUnit.ParserModel.TokenWalker.Previous.TextSpan.StartingIndexInclusive;
+ if (parserModel.TokenWalker.Previous.SyntaxKind == SyntaxKind.EqualsToken)
+ startInclusiveIndex = parserModel.TokenWalker.Previous.TextSpan.StartingIndexInclusive;
else
startInclusiveIndex = token.TextSpan.StartingIndexInclusive;
@@ -1031,16 +1042,16 @@ public IExpressionNode LambdaMergeToken(
((CSharpBinder)compilationUnit.Binder).AddSymbolDefinition(
new LambdaSymbol(textSpan, lambdaExpressionNode), compilationUnit);
- if (compilationUnit.ParserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.OpenBraceToken)
+ if (parserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.OpenBraceToken)
{
lambdaExpressionNode.CodeBlockNodeIsExpression = false;
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseBraceToken, lambdaExpressionNode));
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.StatementDelimiterToken, lambdaExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CloseBraceToken, lambdaExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.StatementDelimiterToken, lambdaExpressionNode));
return EmptyExpressionNode.Empty;
}
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.StatementDelimiterToken, lambdaExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.StatementDelimiterToken, lambdaExpressionNode));
return EmptyExpressionNode.Empty;
}
else if (token.SyntaxKind == SyntaxKind.StatementDelimiterToken)
@@ -1051,7 +1062,7 @@ public IExpressionNode LambdaMergeToken(
}
else
{
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.StatementDelimiterToken, lambdaExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.StatementDelimiterToken, lambdaExpressionNode));
return EmptyExpressionNode.Empty;
}
}
@@ -1075,8 +1086,8 @@ public IExpressionNode LambdaMergeToken(
else
{
lambdaExpressionNode.HasReadParameters = true;
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, lambdaExpressionNode));
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CommaToken, lambdaExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, lambdaExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CommaToken, lambdaExpressionNode));
return EmptyExpressionNode.Empty;
}
}
@@ -1086,14 +1097,14 @@ public IExpressionNode LambdaMergeToken(
}
else if (token.SyntaxKind == SyntaxKind.EqualsToken)
{
- if (compilationUnit.ParserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.CloseAngleBracketToken)
+ if (parserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.CloseAngleBracketToken)
return lambdaExpressionNode;
return new BadExpressionNode(CSharpFacts.Types.Void.ToTypeClause(), lambdaExpressionNode, token);
}
else if (token.SyntaxKind == SyntaxKind.CommaToken)
{
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CommaToken, lambdaExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CommaToken, lambdaExpressionNode));
return EmptyExpressionNode.Empty;
}
else if (token.SyntaxKind == SyntaxKind.IdentifierToken)
@@ -1115,7 +1126,7 @@ public IExpressionNode LambdaMergeToken(
}
public IExpressionNode LambdaMergeExpression(
- LambdaExpressionNode lambdaExpressionNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit)
+ LambdaExpressionNode lambdaExpressionNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
switch (expressionSecondary.SyntaxKind)
{
@@ -1133,7 +1144,7 @@ public IExpressionNode LambdaMergeExpression(
/// they are much higher priority.
///
public IExpressionNode LiteralMergeToken(
- LiteralExpressionNode literalExpressionNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit)
+ LiteralExpressionNode literalExpressionNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
switch (token.SyntaxKind)
{
@@ -1151,7 +1162,7 @@ public IExpressionNode LiteralMergeToken(
}
public IExpressionNode ParenthesizedMergeToken(
- ParenthesizedExpressionNode parenthesizedExpressionNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit)
+ ParenthesizedExpressionNode parenthesizedExpressionNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
switch (token.SyntaxKind)
{
@@ -1160,15 +1171,15 @@ public IExpressionNode ParenthesizedMergeToken(
{
var typeClauseNode = (TypeClauseNode)parenthesizedExpressionNode.InnerExpression;
var explicitCastNode = new ExplicitCastNode(parenthesizedExpressionNode.OpenParenthesisToken, typeClauseNode);
- return ExplicitCastMergeToken(explicitCastNode, token, compilationUnit);
+ return ExplicitCastMergeToken(explicitCastNode, token, compilationUnit, ref parserModel);
}
return parenthesizedExpressionNode.SetCloseParenthesisToken((CloseParenthesisToken)token);
case SyntaxKind.EqualsToken:
- if (compilationUnit.ParserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.CloseAngleBracketToken)
+ if (parserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.CloseAngleBracketToken)
{
var lambdaExpressionNode = new LambdaExpressionNode(CSharpFacts.Types.Void.ToTypeClause());
- SetLambdaExpressionNodeVariableDeclarationNodeList(lambdaExpressionNode, parenthesizedExpressionNode.InnerExpression, compilationUnit);
+ SetLambdaExpressionNodeVariableDeclarationNodeList(lambdaExpressionNode, parenthesizedExpressionNode.InnerExpression, compilationUnit, ref parserModel);
return lambdaExpressionNode;
}
@@ -1179,26 +1190,26 @@ public IExpressionNode ParenthesizedMergeToken(
}
public IExpressionNode ParenthesizedMergeExpression(
- ParenthesizedExpressionNode parenthesizedExpressionNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit)
+ ParenthesizedExpressionNode parenthesizedExpressionNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- if (compilationUnit.ParserModel.TokenWalker.Peek(1).SyntaxKind == SyntaxKind.EqualsToken &&
- compilationUnit.ParserModel.TokenWalker.Peek(2).SyntaxKind == SyntaxKind.CloseAngleBracketToken)
+ if (parserModel.TokenWalker.Peek(1).SyntaxKind == SyntaxKind.EqualsToken &&
+ parserModel.TokenWalker.Peek(2).SyntaxKind == SyntaxKind.CloseAngleBracketToken)
{
var lambdaExpressionNode = new LambdaExpressionNode(CSharpFacts.Types.Void.ToTypeClause());
- return SetLambdaExpressionNodeVariableDeclarationNodeList(lambdaExpressionNode, expressionSecondary, compilationUnit);
+ return SetLambdaExpressionNodeVariableDeclarationNodeList(lambdaExpressionNode, expressionSecondary, compilationUnit, ref parserModel);
}
if (expressionSecondary.SyntaxKind == SyntaxKind.AmbiguousIdentifierExpressionNode)
- expressionSecondary = ForceDecisionAmbiguousIdentifier(parenthesizedExpressionNode, (AmbiguousIdentifierExpressionNode)expressionSecondary, compilationUnit);
+ expressionSecondary = ForceDecisionAmbiguousIdentifier(parenthesizedExpressionNode, (AmbiguousIdentifierExpressionNode)expressionSecondary, compilationUnit, ref parserModel);
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CommaToken)
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CommaToken)
{
- compilationUnit.ParserModel.NoLongerRelevantExpressionNode = parenthesizedExpressionNode;
+ parserModel.NoLongerRelevantExpressionNode = parenthesizedExpressionNode;
var commaSeparatedExpressionNode = new CommaSeparatedExpressionNode();
commaSeparatedExpressionNode.AddInnerExpressionNode(expressionSecondary);
// commaSeparatedExpressionNode never saw the 'OpenParenthesisToken' so the 'ParenthesizedExpressionNode
// has to create the ExpressionList entry on behalf of the 'CommaSeparatedExpressionNode'.
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, commaSeparatedExpressionNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, commaSeparatedExpressionNode));
return commaSeparatedExpressionNode;
}
@@ -1226,7 +1237,7 @@ public IExpressionNode ParenthesizedMergeExpression(
}
public IExpressionNode TypeClauseMergeToken(
- TypeClauseNode typeClauseNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit)
+ TypeClauseNode typeClauseNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
switch (token.SyntaxKind)
{
@@ -1240,8 +1251,8 @@ public IExpressionNode TypeClauseMergeToken(
closeAngleBracketToken: default));
}
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseAngleBracketToken, typeClauseNode));
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CommaToken, typeClauseNode.GenericParametersListingNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CloseAngleBracketToken, typeClauseNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CommaToken, typeClauseNode.GenericParametersListingNode));
return EmptyExpressionNode.Empty;
case SyntaxKind.CloseAngleBracketToken:
if (typeClauseNode.GenericParametersListingNode is not null)
@@ -1269,7 +1280,7 @@ public IExpressionNode TypeClauseMergeToken(
closeParenthesisToken: default);
var functionInvocationNode = new FunctionInvocationNode(
- UtilityApi.ConvertToIdentifierToken(typeClauseNode.TypeIdentifierToken, compilationUnit),
+ UtilityApi.ConvertToIdentifierToken(typeClauseNode.TypeIdentifierToken, compilationUnit, ref parserModel),
functionDefinitionNode: null,
typeClauseNode.GenericParametersListingNode,
functionParametersListingNode,
@@ -1279,8 +1290,8 @@ public IExpressionNode TypeClauseMergeToken(
functionInvocationNode,
compilationUnit);
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, functionInvocationNode));
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CommaToken, functionInvocationNode.FunctionParametersListingNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, functionInvocationNode));
+ parserModel.ExpressionList.Add((SyntaxKind.CommaToken, functionInvocationNode.FunctionParametersListingNode));
return EmptyExpressionNode.Empty;
}
@@ -1291,10 +1302,10 @@ public IExpressionNode TypeClauseMergeToken(
default:
if (UtilityApi.IsConvertibleToIdentifierToken(token.SyntaxKind))
{
- var identifierToken = UtilityApi.ConvertToIdentifierToken(token, compilationUnit);
+ var identifierToken = UtilityApi.ConvertToIdentifierToken(token, compilationUnit, ref parserModel);
var isRootExpression = true;
- foreach (var tuple in compilationUnit.ParserModel.ExpressionList)
+ foreach (var tuple in parserModel.ExpressionList)
{
if (tuple.ExpressionNode is null)
continue;
@@ -1328,7 +1339,8 @@ public IExpressionNode TypeClauseMergeToken(
typeClauseNode,
identifierToken,
VariableKind.Local,
- compilationUnit);
+ compilationUnit,
+ ref parserModel);
}
return variableDeclarationNode;
@@ -1339,7 +1351,7 @@ public IExpressionNode TypeClauseMergeToken(
}
public IExpressionNode TypeClauseMergeExpression(
- TypeClauseNode typeClauseNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit)
+ TypeClauseNode typeClauseNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
switch (expressionSecondary.SyntaxKind)
{
@@ -1357,13 +1369,13 @@ public IExpressionNode TypeClauseMergeExpression(
}
public IExpressionNode VariableAssignmentMergeToken(
- VariableAssignmentExpressionNode variableAssignmentNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit)
+ VariableAssignmentExpressionNode variableAssignmentNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
return variableAssignmentNode;
}
public IExpressionNode VariableAssignmentMergeExpression(
- VariableAssignmentExpressionNode variableAssignmentNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit)
+ VariableAssignmentExpressionNode variableAssignmentNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
if (variableAssignmentNode.ExpressionNode == EmptyExpressionNode.Empty)
{
@@ -1377,7 +1389,7 @@ public IExpressionNode VariableAssignmentMergeExpression(
}
public IExpressionNode FunctionInvocationMergeToken(
- FunctionInvocationNode functionInvocationNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit)
+ FunctionInvocationNode functionInvocationNode, ISyntaxToken token, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
switch (token.SyntaxKind)
{
@@ -1390,11 +1402,11 @@ public IExpressionNode FunctionInvocationMergeToken(
}
public IExpressionNode FunctionInvocationMergeExpression(
- FunctionInvocationNode functionInvocationNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit)
+ FunctionInvocationNode functionInvocationNode, IExpressionNode expressionSecondary, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
if (expressionSecondary.SyntaxKind == SyntaxKind.AmbiguousIdentifierExpressionNode)
{
- expressionSecondary = ForceDecisionAmbiguousIdentifier(functionInvocationNode, (AmbiguousIdentifierExpressionNode)expressionSecondary, compilationUnit);
+ expressionSecondary = ForceDecisionAmbiguousIdentifier(functionInvocationNode, (AmbiguousIdentifierExpressionNode)expressionSecondary, compilationUnit, ref parserModel);
}
switch (expressionSecondary.SyntaxKind)
@@ -1409,7 +1421,7 @@ public IExpressionNode FunctionInvocationMergeExpression(
}
public IExpressionNode SetLambdaExpressionNodeVariableDeclarationNodeList(
- LambdaExpressionNode lambdaExpressionNode, IExpressionNode expressionNode, CSharpCompilationUnit compilationUnit)
+ LambdaExpressionNode lambdaExpressionNode, IExpressionNode expressionNode, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
if (expressionNode.SyntaxKind == SyntaxKind.BadExpressionNode)
{
@@ -1421,7 +1433,7 @@ public IExpressionNode SetLambdaExpressionNodeVariableDeclarationNodeList(
{
var ambiguousIdentifierExpressionNode = (AmbiguousIdentifierExpressionNode)badExpressionNode.SyntaxList[0];
- var typeClauseNode = UtilityApi.ConvertToTypeClauseNode(ambiguousIdentifierExpressionNode.Token, compilationUnit);
+ var typeClauseNode = UtilityApi.ConvertToTypeClauseNode(ambiguousIdentifierExpressionNode.Token, compilationUnit, ref parserModel);
BindTypeClauseNode(
typeClauseNode,
@@ -1433,7 +1445,8 @@ public IExpressionNode SetLambdaExpressionNodeVariableDeclarationNodeList(
typeClauseNode,
identifierToken,
VariableKind.Local,
- compilationUnit);
+ compilationUnit,
+ ref parserModel);
lambdaExpressionNode.AddVariableDeclarationNode(variableDeclarationNode);
}
@@ -1463,7 +1476,7 @@ public IExpressionNode SetLambdaExpressionNodeVariableDeclarationNodeList(
if (firstSyntax.SyntaxKind == SyntaxKind.AmbiguousIdentifierExpressionNode)
{
var ambiguousIdentifierExpressionNode = (AmbiguousIdentifierExpressionNode)firstSyntax;
- typeClauseNode = UtilityApi.ConvertToTypeClauseNode(ambiguousIdentifierExpressionNode.Token, compilationUnit);
+ typeClauseNode = UtilityApi.ConvertToTypeClauseNode(ambiguousIdentifierExpressionNode.Token, compilationUnit, ref parserModel);
BindTypeClauseNode(
typeClauseNode,
@@ -1518,7 +1531,8 @@ public IExpressionNode SetLambdaExpressionNodeVariableDeclarationNodeList(
typeClauseNode,
(IdentifierToken)variableIdentifier,
VariableKind.Local,
- compilationUnit);
+ compilationUnit,
+ ref parserModel);
lambdaExpressionNode.AddVariableDeclarationNode(variableDeclarationNode);
}
@@ -1535,7 +1549,8 @@ public IExpressionNode SetLambdaExpressionNodeVariableDeclarationNodeList(
TypeFacts.Empty.ToTypeClause(),
(IdentifierToken)token,
VariableKind.Local,
- compilationUnit);
+ compilationUnit,
+ ref parserModel);
lambdaExpressionNode.AddVariableDeclarationNode(variableDeclarationNode);
}
@@ -1547,24 +1562,24 @@ public IExpressionNode SetLambdaExpressionNodeVariableDeclarationNodeList(
/// A ParenthesizedExpressionNode expression will "become" a CommaSeparatedExpressionNode
/// upon encounter a CommaToken within its parentheses.
///
- /// An issue arises however, because the compilationUnit.ParserModel.ExpressionList still says to
+ /// An issue arises however, because the parserModel.ExpressionList still says to
/// "short circuit" when the CloseParenthesisToken is encountered,
/// and to at this point make the ParenthesizedExpressionNode the primary expression.
///
/// Well, the ParenthesizedExpressionNode should no longer exist, it was deemed
/// to be more accurately described by a CommaSeparatedExpressionNode.
///
- /// So, this method will remove any entries in the compilationUnit.ParserModel.ExpressionList
+ /// So, this method will remove any entries in the parserModel.ExpressionList
/// that have the 'ParenthesizedExpressionNode' as the to-be primary expression.
///
- public void ClearFromExpressionList(IExpressionNode expressionNode, CSharpCompilationUnit compilationUnit)
+ public void ClearFromExpressionList(IExpressionNode expressionNode, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- for (int i = compilationUnit.ParserModel.ExpressionList.Count - 1; i > -1; i--)
+ for (int i = parserModel.ExpressionList.Count - 1; i > -1; i--)
{
- var delimiterExpressionTuple = compilationUnit.ParserModel.ExpressionList[i];
+ var delimiterExpressionTuple = parserModel.ExpressionList[i];
if (Object.ReferenceEquals(expressionNode, delimiterExpressionTuple.ExpressionNode))
- compilationUnit.ParserModel.ExpressionList.RemoveAt(i);
+ parserModel.ExpressionList.RemoveAt(i);
}
}
}
diff --git a/Source/Lib/CompilerServices/CSharp/BinderCase/CSharpBinder.Main.cs b/Source/Lib/CompilerServices/CSharp/BinderCase/CSharpBinder.Main.cs
index c77fe43a4..06042e1f5 100644
--- a/Source/Lib/CompilerServices/CSharp/BinderCase/CSharpBinder.Main.cs
+++ b/Source/Lib/CompilerServices/CSharp/BinderCase/CSharpBinder.Main.cs
@@ -127,7 +127,8 @@ public void FinalizeBinderSession(CSharpBinderSession binderSession)
public LiteralExpressionNode BindLiteralExpressionNode(
LiteralExpressionNode literalExpressionNode,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
TypeClauseNode typeClauseNode;
@@ -144,7 +145,7 @@ public LiteralExpressionNode BindLiteralExpressionNode(
break;
default:
typeClauseNode = CSharpFacts.Types.Void.ToTypeClause();
- compilationUnit.ParserModel.DiagnosticBag.ReportTodoException(literalExpressionNode.LiteralSyntaxToken.TextSpan, $"{nameof(BindLiteralExpressionNode)}(...) failed to map SyntaxKind: '{literalExpressionNode.LiteralSyntaxToken.SyntaxKind}'");
+ parserModel.DiagnosticBag.ReportTodoException(literalExpressionNode.LiteralSyntaxToken.TextSpan, $"{nameof(BindLiteralExpressionNode)}(...) failed to map SyntaxKind: '{literalExpressionNode.LiteralSyntaxToken.SyntaxKind}'");
break;
}
@@ -157,7 +158,8 @@ public BinaryOperatorNode BindBinaryOperatorNode(
IExpressionNode leftExpressionNode,
ISyntaxToken operatorToken,
IExpressionNode rightExpressionNode,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
var problematicTextSpan = (TextEditorTextSpan?)null;
@@ -213,7 +215,7 @@ public BinaryOperatorNode BindBinaryOperatorNode(
$" for types: {leftExpressionNode.ConstructTextSpanRecursively().GetText()}" +
$" and {rightExpressionNode.ConstructTextSpanRecursively().GetText()}";
- compilationUnit.ParserModel.DiagnosticBag.ReportTodoException(problematicTextSpan.Value, errorMessage);
+ parserModel.DiagnosticBag.ReportTodoException(problematicTextSpan.Value, errorMessage);
}
return new BinaryOperatorNode(
@@ -380,14 +382,15 @@ public void BindConstructorInvocationNode()
public InheritanceStatementNode BindInheritanceStatementNode(
TypeClauseNode typeClauseNode,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
AddSymbolReference(new TypeSymbol(typeClauseNode.TypeIdentifierToken.TextSpan with
{
DecorationByte = (byte)GenericDecorationKind.Type
}), compilationUnit);
- compilationUnit.ParserModel.DiagnosticBag.ReportTodoException(
+ parserModel.DiagnosticBag.ReportTodoException(
typeClauseNode.TypeIdentifierToken.TextSpan,
$"Implement {nameof(BindInheritanceStatementNode)}");
@@ -692,7 +695,8 @@ public void AddNamespaceToCurrentScope(
public void CloseScope(
TextEditorTextSpan textSpan,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
// Check if it is the global scope, if so return early.
{
@@ -700,10 +704,10 @@ public void CloseScope(
return;
}
- var inBuilder = compilationUnit.ParserModel.CurrentCodeBlockBuilder;
+ var inBuilder = parserModel.CurrentCodeBlockBuilder;
var inOwner = inBuilder.CodeBlockOwner;
- var outBuilder = compilationUnit.ParserModel.CurrentCodeBlockBuilder.Parent;
+ var outBuilder = parserModel.CurrentCodeBlockBuilder.Parent;
var outOwner = outBuilder?.CodeBlockOwner;
// Update Scope
@@ -722,7 +726,7 @@ public void CloseScope(
// Update CodeBlockOwner
if (inOwner is not null)
{
- inOwner.SetCodeBlockNode(inBuilder.Build(), compilationUnit.ParserModel.DiagnosticBag, compilationUnit.ParserModel.TokenWalker);
+ inOwner.SetCodeBlockNode(inBuilder.Build(), parserModel.DiagnosticBag, parserModel.TokenWalker);
if (inOwner.SyntaxKind == SyntaxKind.NamespaceStatementNode)
compilationUnit.Binder.BindNamespaceStatementNode((NamespaceStatementNode)inOwner, compilationUnit);
@@ -732,7 +736,7 @@ public void CloseScope(
// Restore Parent CodeBlockBuilder
if (outBuilder is not null)
{
- compilationUnit.ParserModel.CurrentCodeBlockBuilder = outBuilder;
+ parserModel.CurrentCodeBlockBuilder = outBuilder;
outBuilder.InnerPendingCodeBlockOwner = null;
if (inOwner.SyntaxKind != SyntaxKind.TryStatementTryNode &&
diff --git a/Source/Lib/CompilerServices/CSharp/CompilerServiceCase/CSharpCompilationUnit.cs b/Source/Lib/CompilerServices/CSharp/CompilerServiceCase/CSharpCompilationUnit.cs
index 4977b1557..edb1d0240 100644
--- a/Source/Lib/CompilerServices/CSharp/CompilerServiceCase/CSharpCompilationUnit.cs
+++ b/Source/Lib/CompilerServices/CSharp/CompilerServiceCase/CSharpCompilationUnit.cs
@@ -22,10 +22,12 @@ public CSharpCompilationUnit(
public ResourceUri ResourceUri { get; set; }
public CSharpLexerOutput LexerOutput { get; set; }
- public CSharpParser Parser { get; set; }
- public CSharpParserModel ParserModel { get; set; }
public CSharpBinder Binder { get; set; }
public CSharpBinderSession BinderSession { get; set; }
public CodeBlockNode RootCodeBlockNode { get; set; }
+
+ ///
+ /// This seems to no longer get set (noticed this on 2024-12-14).
+ ///
public ImmutableArray DiagnosticsList { get; init; }
-}
\ No newline at end of file
+}
diff --git a/Source/Lib/CompilerServices/CSharp/CompilerServiceCase/CSharpCompilerService.cs b/Source/Lib/CompilerServices/CSharp/CompilerServiceCase/CSharpCompilerService.cs
index a37147353..4972674e1 100644
--- a/Source/Lib/CompilerServices/CSharp/CompilerServiceCase/CSharpCompilerService.cs
+++ b/Source/Lib/CompilerServices/CSharp/CompilerServiceCase/CSharpCompilerService.cs
@@ -82,8 +82,7 @@ public override Task ParseAsync(ITextEditorEditContext editContext, TextEditorMo
try
{
cSharpCompilationUnit.BinderSession = (CSharpBinderSession)CSharpBinder.StartBinderSession(resourceUri);
- var parser = new CSharpParser();
- parser.Parse(cSharpCompilationUnit);
+ CSharpParser.Parse(cSharpCompilationUnit);
}
finally
{
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpDeferredChildScope.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpDeferredChildScope.cs
index 9fd99b18e..f56ec6140 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpDeferredChildScope.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpDeferredChildScope.cs
@@ -23,19 +23,19 @@ public CSharpDeferredChildScope(
public int TokenIndexToRestore { get; private set; }
- public void PrepareMainParserLoop(int tokenIndexToRestore, CSharpCompilationUnit compilationUnit)
+ public void PrepareMainParserLoop(int tokenIndexToRestore, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
TokenIndexToRestore = tokenIndexToRestore;
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.PermitInnerPendingCodeBlockOwnerToBeParsed = true;
+ parserModel.CurrentCodeBlockBuilder.PermitInnerPendingCodeBlockOwnerToBeParsed = true;
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.DequeuedIndexForChildList = null;
+ parserModel.CurrentCodeBlockBuilder.DequeuedIndexForChildList = null;
- compilationUnit.ParserModel.TokenWalker.DeferredParsing(
+ parserModel.TokenWalker.DeferredParsing(
OpenTokenIndex,
CloseTokenIndex,
TokenIndexToRestore);
- compilationUnit.ParserModel.SyntaxStack.Push(PendingCodeBlockOwner);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = PendingCodeBlockOwner;
+ parserModel.SyntaxStack.Push(PendingCodeBlockOwner);
+ parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = PendingCodeBlockOwner;
}
}
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpParser.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpParser.cs
index c1c28a5cc..8f50be52e 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpParser.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpParser.cs
@@ -15,24 +15,15 @@
namespace Luthetus.CompilerServices.CSharp.ParserCase;
-public struct CSharpParser
+public static class CSharpParser
{
- public CSharpParser()
- {
- #if DEBUG
- ++LuthetusDebugSomething.Parser_ConstructorInvocationCount;
- #endif
- }
-
- public TextEditorDiagnostic[] DiagnosticsList { get; private set; } = Array.Empty();
-
- public void Parse(CSharpCompilationUnit compilationUnit)
+ public static void Parse(CSharpCompilationUnit compilationUnit)
{
var globalCodeBlockBuilder = new CSharpCodeBlockBuilder(null, null);
var currentCodeBlockBuilder = globalCodeBlockBuilder;
var diagnosticBag = new DiagnosticBag();
- compilationUnit.ParserModel = new CSharpParserModel(
+ var parserModel = new CSharpParserModel(
new TokenWalker(compilationUnit.LexerOutput.SyntaxTokenList, diagnosticBag),
new Stack(),
diagnosticBag,
@@ -40,17 +31,17 @@ public void Parse(CSharpCompilationUnit compilationUnit)
currentCodeBlockBuilder);
#if DEBUG
- compilationUnit.ParserModel.TokenWalker.ProtectedTokenSyntaxKindList = new() { SyntaxKind.StatementDelimiterToken, SyntaxKind.OpenBraceToken, SyntaxKind.CloseBraceToken, };
+ parserModel.TokenWalker.ProtectedTokenSyntaxKindList = new() { SyntaxKind.StatementDelimiterToken, SyntaxKind.OpenBraceToken, SyntaxKind.CloseBraceToken, };
#endif
while (true)
{
- // The last statement in this while loop is conditionally: '_ = compilationUnit.ParserModel.TokenWalker.Consume();'.
+ // The last statement in this while loop is conditionally: '_ = parserModel.TokenWalker.Consume();'.
// Knowing this to be the case is extremely important.
- var token = compilationUnit.ParserModel.TokenWalker.Current;
+ var token = parserModel.TokenWalker.Current;
#if DEBUG
- Console.WriteLine(token.SyntaxKind + "___" + token.TextSpan.GetText() + "___" + compilationUnit.ParserModel.TokenWalker.Index);
+ Console.WriteLine(token.SyntaxKind + "___" + token.TextSpan.GetText() + "___" + parserModel.TokenWalker.Index);
#endif
switch (token.SyntaxKind)
@@ -64,150 +55,150 @@ public void Parse(CSharpCompilationUnit compilationUnit)
case SyntaxKind.StarToken:
case SyntaxKind.DollarSignToken:
case SyntaxKind.AtToken:
- if (compilationUnit.ParserModel.StatementBuilder.ChildList.Count == 0)
+ if (parserModel.StatementBuilder.ChildList.Count == 0)
{
- ParseOthers.StartStatement_Expression(compilationUnit);
+ ParseOthers.StartStatement_Expression(compilationUnit, ref parserModel);
}
else
{
- var expressionNode = ParseOthers.ParseExpression(compilationUnit);
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add(expressionNode);
+ var expressionNode = ParseOthers.ParseExpression(compilationUnit, ref parserModel);
+ parserModel.StatementBuilder.ChildList.Add(expressionNode);
}
break;
case SyntaxKind.PreprocessorDirectiveToken:
- ParseTokens.ParsePreprocessorDirectiveToken((PreprocessorDirectiveToken)token, compilationUnit);
+ ParseTokens.ParsePreprocessorDirectiveToken((PreprocessorDirectiveToken)token, compilationUnit, ref parserModel);
break;
case SyntaxKind.IdentifierToken:
- ParseTokens.ParseIdentifierToken(compilationUnit);
+ ParseTokens.ParseIdentifierToken(compilationUnit, ref parserModel);
break;
case SyntaxKind.OpenBraceToken:
- compilationUnit.ParserModel.StatementBuilder.FinishStatement(compilationUnit);
+ parserModel.StatementBuilder.FinishStatement(compilationUnit, ref parserModel);
#if DEBUG
- compilationUnit.ParserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = true;
+ parserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = true;
#endif
- var openBraceToken = (OpenBraceToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var openBraceToken = (OpenBraceToken)parserModel.TokenWalker.Consume();
#if DEBUG
- compilationUnit.ParserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = false;
+ parserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = false;
#endif
- ParseTokens.ParseOpenBraceToken(openBraceToken, compilationUnit);
+ ParseTokens.ParseOpenBraceToken(openBraceToken, compilationUnit, ref parserModel);
break;
case SyntaxKind.CloseBraceToken:
- compilationUnit.ParserModel.StatementBuilder.FinishStatement(compilationUnit);
+ parserModel.StatementBuilder.FinishStatement(compilationUnit, ref parserModel);
#if DEBUG
- compilationUnit.ParserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = true;
+ parserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = true;
#endif
- var closeBraceToken = (CloseBraceToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var closeBraceToken = (CloseBraceToken)parserModel.TokenWalker.Consume();
#if DEBUG
- compilationUnit.ParserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = false;
+ parserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = false;
#endif
- ParseTokens.ParseCloseBraceToken(closeBraceToken, compilationUnit);
+ ParseTokens.ParseCloseBraceToken(closeBraceToken, compilationUnit, ref parserModel);
break;
case SyntaxKind.OpenParenthesisToken:
- if (compilationUnit.ParserModel.StatementBuilder.ChildList.Count == 0)
- ParseOthers.StartStatement_Expression(compilationUnit);
+ if (parserModel.StatementBuilder.ChildList.Count == 0)
+ ParseOthers.StartStatement_Expression(compilationUnit, ref parserModel);
else
- ParseTokens.ParseOpenParenthesisToken(compilationUnit);
+ ParseTokens.ParseOpenParenthesisToken(compilationUnit, ref parserModel);
break;
case SyntaxKind.CloseParenthesisToken:
- ParseTokens.ParseCloseParenthesisToken((CloseParenthesisToken)token, compilationUnit);
+ ParseTokens.ParseCloseParenthesisToken((CloseParenthesisToken)token, compilationUnit, ref parserModel);
break;
case SyntaxKind.OpenAngleBracketToken:
- if (compilationUnit.ParserModel.StatementBuilder.ChildList.Count == 0)
- ParseOthers.StartStatement_Expression(compilationUnit);
+ if (parserModel.StatementBuilder.ChildList.Count == 0)
+ ParseOthers.StartStatement_Expression(compilationUnit, ref parserModel);
else
- ParseTokens.ParseOpenAngleBracketToken((OpenAngleBracketToken)token, compilationUnit);
+ ParseTokens.ParseOpenAngleBracketToken((OpenAngleBracketToken)token, compilationUnit, ref parserModel);
break;
case SyntaxKind.CloseAngleBracketToken:
- ParseTokens.ParseCloseAngleBracketToken((CloseAngleBracketToken)token, compilationUnit);
+ ParseTokens.ParseCloseAngleBracketToken((CloseAngleBracketToken)token, compilationUnit, ref parserModel);
break;
case SyntaxKind.OpenSquareBracketToken:
- ParseTokens.ParseOpenSquareBracketToken(compilationUnit);
+ ParseTokens.ParseOpenSquareBracketToken(compilationUnit, ref parserModel);
break;
case SyntaxKind.CloseSquareBracketToken:
- ParseTokens.ParseCloseSquareBracketToken((CloseSquareBracketToken)token, compilationUnit);
+ ParseTokens.ParseCloseSquareBracketToken((CloseSquareBracketToken)token, compilationUnit, ref parserModel);
break;
case SyntaxKind.ColonToken:
- ParseTokens.ParseColonToken(compilationUnit);
+ ParseTokens.ParseColonToken(compilationUnit, ref parserModel);
break;
case SyntaxKind.MemberAccessToken:
- ParseTokens.ParseMemberAccessToken((MemberAccessToken)token, compilationUnit);
+ ParseTokens.ParseMemberAccessToken((MemberAccessToken)token, compilationUnit, ref parserModel);
break;
case SyntaxKind.EqualsToken:
- ParseTokens.ParseEqualsToken(compilationUnit);
+ ParseTokens.ParseEqualsToken(compilationUnit, ref parserModel);
break;
case SyntaxKind.StatementDelimiterToken:
- compilationUnit.ParserModel.StatementBuilder.FinishStatement(compilationUnit);
+ parserModel.StatementBuilder.FinishStatement(compilationUnit, ref parserModel);
#if DEBUG
- compilationUnit.ParserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = true;
+ parserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = true;
#endif
- var statementDelimiterToken = (StatementDelimiterToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var statementDelimiterToken = (StatementDelimiterToken)parserModel.TokenWalker.Consume();
#if DEBUG
- compilationUnit.ParserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = false;
+ parserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = false;
#endif
- ParseTokens.ParseStatementDelimiterToken(statementDelimiterToken, compilationUnit);
+ ParseTokens.ParseStatementDelimiterToken(statementDelimiterToken, compilationUnit, ref parserModel);
break;
case SyntaxKind.EndOfFileToken:
- if (compilationUnit.ParserModel.SyntaxStack.TryPeek(out var syntax) &&
+ if (parserModel.SyntaxStack.TryPeek(out var syntax) &&
syntax is EndOfFileToken)
{
- _ = compilationUnit.ParserModel.SyntaxStack.Pop();
+ _ = parserModel.SyntaxStack.Pop();
}
- if (compilationUnit.ParserModel.SyntaxStack.TryPop(out var notUsedSyntax))
+ if (parserModel.SyntaxStack.TryPop(out var notUsedSyntax))
{
if (notUsedSyntax is null)
{
}
else if (notUsedSyntax is IExpressionNode)
{
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.ChildList.Add(notUsedSyntax);
+ parserModel.CurrentCodeBlockBuilder.ChildList.Add(notUsedSyntax);
}
else if (notUsedSyntax.SyntaxKind == SyntaxKind.AmbiguousIdentifierNode)
{
var ambiguousIdentifierNode = (AmbiguousIdentifierNode)notUsedSyntax;
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.ChildList.Add(notUsedSyntax);
- compilationUnit.ParserModel.DiagnosticBag.ReportUndefinedTypeOrNamespace(
+ parserModel.CurrentCodeBlockBuilder.ChildList.Add(notUsedSyntax);
+ parserModel.DiagnosticBag.ReportUndefinedTypeOrNamespace(
ambiguousIdentifierNode.IdentifierToken.TextSpan,
ambiguousIdentifierNode.IdentifierToken.TextSpan.GetText());
}
}
- else if (compilationUnit.ParserModel.StatementBuilder.ChildList.Any())
+ else if (parserModel.StatementBuilder.ChildList.Any())
{
- foreach (var item in compilationUnit.ParserModel.StatementBuilder.ChildList)
+ foreach (var item in parserModel.StatementBuilder.ChildList)
{
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.ChildList.Add(item);
+ parserModel.CurrentCodeBlockBuilder.ChildList.Add(item);
}
}
break;
default:
if (UtilityApi.IsContextualKeywordSyntaxKind(token.SyntaxKind))
- ParseTokens.ParseKeywordContextualToken(compilationUnit);
+ ParseTokens.ParseKeywordContextualToken(compilationUnit, ref parserModel);
else if (UtilityApi.IsKeywordSyntaxKind(token.SyntaxKind))
- ParseTokens.ParseKeywordToken(compilationUnit);
+ ParseTokens.ParseKeywordToken(compilationUnit, ref parserModel);
break;
}
if (token.SyntaxKind == SyntaxKind.EndOfFileToken)
{
- if (compilationUnit.ParserModel.CurrentCodeBlockBuilder.ParseChildScopeQueue.TryDequeue(out var deferredChildScope))
- deferredChildScope.PrepareMainParserLoop(compilationUnit.ParserModel.TokenWalker.Index, compilationUnit);
+ if (parserModel.CurrentCodeBlockBuilder.ParseChildScopeQueue.TryDequeue(out var deferredChildScope))
+ deferredChildScope.PrepareMainParserLoop(parserModel.TokenWalker.Index, compilationUnit, ref parserModel);
else
break;
}
- if (compilationUnit.ParserModel.TokenWalker.ConsumeCounter == 0)
+ if (parserModel.TokenWalker.ConsumeCounter == 0)
{
// This means either:
// - None of the methods for syntax could make sense of the token, so they didn't consume it.
@@ -217,347 +208,31 @@ public void Parse(CSharpCompilationUnit compilationUnit)
// To avoid an infinite loop, this will ensure at least 1 token is consumed each iteration of the while loop.
//
// (and that the token index increased by at least 1 from the previous loop; this is implicitly what is implied).
- _ = compilationUnit.ParserModel.TokenWalker.Consume();
+ _ = parserModel.TokenWalker.Consume();
}
- else if (compilationUnit.ParserModel.TokenWalker.ConsumeCounter < 0)
+ else if (parserModel.TokenWalker.ConsumeCounter < 0)
{
- // This means that a syntax invoked 'compilationUnit.ParserModel.TokenWalker.Backtrack()'.
- // Without invoking an equal amount of 'compilationUnit.ParserModel.TokenWalker.Consume()' to avoid an infinite loop.
- throw new LuthetusTextEditorException($"compilationUnit.ParserModel.TokenWalker.ConsumeCounter:{compilationUnit.ParserModel.TokenWalker.ConsumeCounter} < 0");
+ // This means that a syntax invoked 'parserModel.TokenWalker.Backtrack()'.
+ // Without invoking an equal amount of 'parserModel.TokenWalker.Consume()' to avoid an infinite loop.
+ throw new LuthetusTextEditorException($"parserModel.TokenWalker.ConsumeCounter:{parserModel.TokenWalker.ConsumeCounter} < 0");
}
- compilationUnit.ParserModel.TokenWalker.ConsumeCounterReset();
+ parserModel.TokenWalker.ConsumeCounterReset();
}
- if (compilationUnit.ParserModel.CurrentCodeBlockBuilder.Parent is not null)
+ if (parserModel.CurrentCodeBlockBuilder.Parent is not null)
{
// The current token here would be the EOF token.
- compilationUnit.Binder.CloseScope(compilationUnit.ParserModel.TokenWalker.Current.TextSpan, compilationUnit);
+ compilationUnit.Binder.CloseScope(parserModel.TokenWalker.Current.TextSpan, compilationUnit, ref parserModel);
}
- DiagnosticsList = compilationUnit.ParserModel.DiagnosticBag.ToArray();
-
- var topLevelStatementsCodeBlock = compilationUnit.ParserModel.CurrentCodeBlockBuilder.Build(
- DiagnosticsList
+ var topLevelStatementsCodeBlock = parserModel.CurrentCodeBlockBuilder.Build(
+ parserModel.DiagnosticBag.ToArray()
.Union(compilationUnit.Binder.DiagnosticsList)
.Union(compilationUnit.LexerOutput.DiagnosticBag.ToList())
.ToArray());
-
- compilationUnit.Binder.FinalizeBinderSession(compilationUnit.BinderSession);
-
+
compilationUnit.RootCodeBlockNode = topLevelStatementsCodeBlock;
+ compilationUnit.Binder.FinalizeBinderSession(compilationUnit.BinderSession);
}
}
-
-// TODO: Are the comments below still of value? If they are not of value anymore then delete them.
-
-//{
- // In regards to whether to '_ = compilationUnit.ParserModel.TokenWalker.Consume();'
- // at the start of the while loop, or at the end:
- //
- // The end is better because:
- //
- // - Anytime one wants to check the previous token,
- // with the 'Consume()' at the end of the loop then one can use 'compilationUnit.ParserModel.TokenWalker.Previous'.
- // But, if 'Consume()' is at the start of the loop then one has to use 'compilationUnit.ParserModel.TokenWalker.Peek(-2)' and that feels very janky.
- //
- // - As well, helps ensure a "handle-syntax" does not 'Consume()' someone elses syntax.
- // If an individual "syntax" cannot make sense of the current token,
- // then it can just return to the main loop and the main loop will deal with it.
- //
- // On a different note:
- //
- // 'should return to the main loop'
- // - The end of every statement
- // - The start of a code block
- // - The end of a code block
- //
- // The goal with every iteration of the main loop,
- // is to narrow down the possible syntax that is occuring.
- // Then to invoke some other method that will handle that syntax
- // entirely, and then return to the main loop for the next syntax to start being parsed.
- //
- // For example, multiple consecutive keywords might be an ambiguous syntax.
- // Therefore, the main loop should push these keywords onto the 'StatementStack'.
- // Then, eventually a disambiguating token will be encountered.
- // At this point, the corresponding method to handle the syntax can be invoked,
- // and the method can pop off the 'StatementStack' to see the "related" tokens.
- //
- // There are two loops:
- // - Statement Loop
- // - Expression Loop
- //
- // Statement loop exists in CSharpParser.cs (this file).
- // Expression loop exists in ParseOthers.cs (a relative path from this file: './Internals/ParseOthers.cs').
- //
- // The parser should gracefully handle syntax that does not compile.
- // i.e.: if a syntactical error can be recovered from, then
- // the parser is expected to recover.
- //
- // For example, "(;"
- // For the sake of the example, this is presumed to start a ParenthesizedExpressionNode.
- // It goes on to see a StatementDelimiterToken before it sees a CloseParenthesisToken.
- // Instead of cascading syntactical errors to the text that comes after this (imagine this is part of a source code file)
- // the ParenthesizedExpressionNode should report a diagnostic error,
- // but then return back to the main loop.
- // The main loop will see a StatementDelimiterToken, and then a new statement will begin
- // as if nothing went wrong. This allows the rest of the text file to parse with the "same result".
- //
- // The parsing is at times done 'breadth first'.
- // Because, a class definition might be:
- //
- // ````public class MyClass
- // ````{
- // ```` public MyClass(string firstName)
- // ```` {
- // ```` FirstName = firstName;
- // ```` }
- // ````
- // ```` public string FirstName { get; set; }
- // ````}
- //
- // In this scenario the 'FirstName' property is being referenced from within the class's constructor.
- // Yet, the constructor is defined above the property it references.
- //
- // Instead of parsing 'depth first', in this scenario the index of the token that
- // starts the code block body of the constructor definition is remembered,
- // then the parser skips until it finds the matching close brace
- // (by counting the open brace and close braces until it evens out).
- //
- // Once the class definition is finished being parsed, then the deferred parsing will start.
- // This will modify the 'TokenWalker' such that it now is pointing at the previously "remembered"
- // token that starts the code block of the constructor definition.
- //
- // As well, the 'TokenWalker' is told what index to return to once finished parsing the child scope.
- // In this case the 'TokenWalker' would return to the index that represents the 'CloseBraceToken'
- // of the class definition.
- //
- // If there were many child scopes that needed to be 'defer parsed' then the same
- // code will be hit as was initially, and each time a child scope is 'defer parsed'
- // it is removed from the list of child scopes that need to be 'defer parsed'.
- //
- // Regarding StatementDelimiterToken, OpenBraceToken, and CloseBraceToken:
- // - These syntax hold a greater meaning than the "individual syntax".
- // For example: "1;".
- // In the example '1' is a NumericLiteralToken.
- // Furthermore, a NumericLiteralToken can be parsed as a 'LiteralExpressionNode'.
- // But, the ending StatementDelimiterToken does not belong to the 'LiteralExpressionNode'.
- // It is to be "provided" to the main statement loop, to be processed there.
- //
- // In short, syntax shouldn't consume tokens that don't belong to them.
- // And it is being stated that 'StatementDelimiterToken, OpenBraceToken, and CloseBraceToken'
- // in general do not belong to a syntax.
- //
- // Some exceptions to this would be a property definition "public string FirstName { get; set; }".
- // Here, the OpenBraceToken and CloseBraceToken are not being used in the same sense
- // as they are when defining scope.
- //
- // So, the property definition should consume those OpenBraceToken and CloseBraceToken.
- //
- // However, consider this example:
- //
- // ````public string FirstName
- // ````{
- // ```` get
- // ```` {
- // ```` return _firstName;
- // ```` }
- // ```` set => _firstName = value;
- // ````}
- //
- // Here, the property's "getter" is defining a code block.
- // So, the brace tokens that deliminate the "getter", ought to
- // "visit" the main loop for a moment. Then it can continue on with the property syntax.
-//}
-
-//{
- // Goal: re-write the parser a bit (2024-11-07)
- // ============================================
- // It took 8 seconds for the Luthetus.Ide.sln to parse after turning off much of the syntax.
- // (i.e.: the lexer ran entirely, but the parser was just iterating the while loop without doing much of anything).
- // (upon further inspection the parser's while loop still is doing a bit more than I thought,
- // but still the baseline time of 8 seconds can be compared with the time after I make a change.)
- //
- // With the syntax on it was taking 1 minute 13 seconds.
- //
- // Task Manager after the solution was parsed on Windows using a published version of the code.
- // --------------------------------------------------------------------------------------------
- // Apps:
- // '.NET Host' 278 MB
- // Background processes
- // '.NET Host' 492 MB
- // '.NET Host' 265 MB
- //
- // After about 5 minutes the Task Manager looks like this (5 minutes is not at all an accurate timespan, but it "felt" like 5 minutes had passed)
- // -----------------------------------------------------------------------------------------------------------------------------------------------
- // Apps:
- // '.NET Host' 370 MB
- // Background processes
- // (these are gone now)
- //
- // So, now I can move back from git history each syntax one by one and see the impact of adding that specific syntax back.
- //
- // Most pressing is:
- // - Determining whether syntax is an 'expression' or 'statement'.
- // - As well the handling of 'ambiguous syntax'.
- //
- // Suspicions:
- // - Anytime a 'statement' and a 'expression' are ambiguous,
- // then there will be a keyword to disambiguate.
- // - If I add back the 'expression' code first,
- // then the statements will be far clearer
- // because I hadn't implemented the 'expression' code
- // with any "complexity" of whether it actually is a statement.
- // I'll have a very "simple" version of the parser to look at,
- // and it is thought that the statement disambiguation will be obvious.
- // - I don't think I can rely on the surrounding code block's "kind"
- // and whether that code block allows a certain syntax.
- // - The programmer can type any syntax they want, and do so anywhere,
- // it just might not compile.
- // But, the parser still has to "survive" the ordeal.
- //
- // I added that if an IdentifierToken is found by the main loop,
- // and the 'StatementBuilderStack.Count == 0',
- // that ParseExpression(...) would be invoked.
- //
- // It went from 8 seconds for entire .sln to 26 seconds.
- // As well a lot of syntax highlighting began to appear,
- // albeit seemingly incorrect because definitions aren't being parsed
- // so it cannot tell whether an identifier is a reference to a type or a local, or etc...
- //
- // A confusion I remember having was with (I think it was) function definitions.
- // And their return type. Something to do with it being an ambiguous identifier
- // while you are stepping through the nodes, and you have to wait to decide what it was.
- //
- // I sort of rambled when I said that but I am fairly certain that two ideas can be relied on:
- // - If you are in an expression, you can look at syntax through the lens of an expression
- // until you are given syntax that brings you back to the possibiity of statements.
- // A lambda statement is confusing. Because it is an expression that wants to
- // return to the statement loop, yet its part of a larger expression
- // and being handled by the expression loop.
- // - There have got to be some keywords that when you come across them,
- // it is immediately apparent that you aren't looking at an expression.
- // Or at the least it could be a path to go down that leads to disambiguation.
- //
- // Function definition
- // ===================
- // ````int Aaa() => 3;
- // ````
- // ````int Bbb()
- // ````{
- // ```` return 3;
- // ````}
- //
- // Variable declaration
- // ====================
- // ````var x = 2;
- // ````int y = 3;
- //
- // Lambda expression
- // =================
- // ````// Is this syntax even legal?
- // ````int x => 3;
- // ````
- // ````(int x) => 3;
- //
- // Comma Separated Expression
- // ==========================
- // ````// lambda expression
- // ````(x, y) => 2;
- // ````(int x, Person y) => 2;
- // ````// tuple expression
- // ````(int X, Person Y) tuple = (3, new Person());
- //
- // Explicit Cast Expression
- // ==========================
- // ````(Person)someVariable;
- //
- // Parenthesized Expression
- // ==========================
- // ````(Person)someVariable;
- //
- // Constructor Definition
- // ======================
- // ````public class Person
- // ````{
- // ```` public Person()
- // ```` {
- // ```` }
- // ````}
- //
- // Constructor Invocation
- // ======================
- // ````new Person();
- // ````// object initialization
- // ````new Person();
- // ````new Person { };
- // ````new Person { FirstName = "John", ... };
- // ````new Person(id: Guid.NewGuid) { FirstName = "John", ... };
- // ````// collection initialization
- // ````new List { 1, 2, 3, };
- // ````new List(capacity: 5) { 1, 2, 3, };
- //
- // Class definition
- // ================
- // ````class Aaa { }
- // ````class Bbb(/*primary constructor*/) { }
- //
- // I want to write out in order the definitions/expressions, ordered by how similar the syntax is to one another.
- //
- // Types are a "simple" case due to the storage modifier keyword 'class, interface, ...'.
- //
- // It went from 26 seconds to 28 seconds
- // after adding TypeDefinitionNode parsing.
- //
- //
-//}
-
-//{
- // I think the key to parsing this properly is having the input "Person" parse properly.
- //
- // An expression can contain a 'TypeClauseNode', so it ought to be an IExpressionNode.
- // An expression can contain a 'TypeClauseNode IdentifierOrContextualToken', so it ought to be an IExpressionNode.
- //
- // If I open Visual Studio and I type "Person" into a C# file that is completely empty other than that text.
- // will it be treated as a type or a variable or something else?
- //
- // Because it seems that there is a pattern of either 'TypeClause' or 'TypeClauseNode IdentifierOrContextualToken'.
- //
- // And, the 'TypeClauseNode' could be made up of one or more ISyntaxToken.
- //
- // It almost feels like you'd want to parse for 'TypeClause'
- // and 'TypeClauseNode IdentifierOrContextualToken'.
- // But in the sense of they both get the same starting point in the TokenWalker.
- // All the state is separate.
- //
- // Probably a 'bool TryParse_TypeClause_IdentifierOrContextualToken(out var aaa)'
- // and 'bool TryParse_TypeClause(out var aaa)'.
- //
- // You'd maybe invoke 'TryParse_TypeClause_IdentifierOrContextualToken' first,
- // then reset the TokenWalker state back to what it was and invoke
- // TryParse_TypeClause' to see that returns true/successful.
- //
- // Visual Studio treats the text "Person" when it is the only text in a C# file to be:
- // "The type or namespace name 'Person' could not be found (are you missing a using directive or an assembly reference?)
- //
- // If I open the demo website and put the same text into an empty C# file what is it treated as?
- // With the 'v 0.9.7.1 :: Release :: Luthetus.Ide.RazorLib' demo it is a Type for the syntax highlighting
- // and has a similar error diagnostic with "type or namespace could not be found" wording.
- //
- // Visual Studio was different in that it for syntax highlighting "did not give the text a color - it was just colored as default text".
- // Whereas the demo website colored the text as a Type.
- //
- // I put the Visual Studio part about default text color in quotes because I believe that is also the color they use for namespaces (default text and namespaces are the same color).
- //
- // I changed the color in Visual Studio that is assigned to namespaces to be different from the default text.
- // The color of the text did not change, therefore it was being colored as default text it seems.
-
- // I am writing the C# Parser statement first but it might be better to do things expression first.
-
- // Idea: "Everything is an expression unless it is a statement"?
- //
- // This might just be equivalent to saying "do things expression first".
- // But for some reason this wording is sticking out in my mind.
-
- // But, some expressions can be a statement, so being a statement does not stop something from being an expression.
-//}
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpParserModel.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpParserModel.cs
index e2860900b..86e4381a1 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpParserModel.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpParserModel.cs
@@ -11,7 +11,11 @@
namespace Luthetus.CompilerServices.CSharp.ParserCase;
-public class CSharpParserModel
+///
+/// The computational state for the CSharpParser is contained within this type.
+/// The output of the CSharpParser is the .
+///
+public struct CSharpParserModel
{
public CSharpParserModel(
TokenWalker tokenWalker,
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpStatementBuilder.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpStatementBuilder.cs
index 553a38463..19556021a 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpStatementBuilder.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/CSharpStatementBuilder.cs
@@ -40,13 +40,13 @@ public ISyntax Pop()
/// are parsed by the main loop,
///
/// Then check that the last item in the StatementBuilder.ChildList
- /// has been added to the compilationUnit.ParserModel.CurrentCodeBlockBuilder.ChildList.
+ /// has been added to the parserModel.CurrentCodeBlockBuilder.ChildList.
///
/// If it was not yet added, then add it.
///
/// Lastly, clear the StatementBuilder.ChildList.
///
- public void FinishStatement(CSharpCompilationUnit compilationUnit)
+ public void FinishStatement(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
if (ChildList.Count == 0)
return;
@@ -55,13 +55,13 @@ public void FinishStatement(CSharpCompilationUnit compilationUnit)
ISyntax codeBlockBuilderSyntax;
- if (compilationUnit.ParserModel.CurrentCodeBlockBuilder.ChildList.Count == 0)
+ if (parserModel.CurrentCodeBlockBuilder.ChildList.Count == 0)
codeBlockBuilderSyntax = EmptyExpressionNode.Empty;
else
- codeBlockBuilderSyntax = compilationUnit.ParserModel.CurrentCodeBlockBuilder.ChildList[^1];
+ codeBlockBuilderSyntax = parserModel.CurrentCodeBlockBuilder.ChildList[^1];
if (!Object.ReferenceEquals(statementSyntax, codeBlockBuilderSyntax))
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.ChildList.Add(statementSyntax);
+ parserModel.CurrentCodeBlockBuilder.ChildList.Add(statementSyntax);
ChildList.Clear();
}
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseContextualKeywords.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseContextualKeywords.cs
index fe1cd5017..a67dbef1c 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseContextualKeywords.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseContextualKeywords.cs
@@ -9,240 +9,240 @@ namespace Luthetus.CompilerServices.CSharp.ParserCase.Internals;
public class ParseContextualKeywords
{
- public static void HandleVarTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleVarTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- if (compilationUnit.ParserModel.StatementBuilder.ChildList.Count == 0)
- ParseTokens.ParseIdentifierToken(compilationUnit);
+ if (parserModel.StatementBuilder.ChildList.Count == 0)
+ ParseTokens.ParseIdentifierToken(compilationUnit, ref parserModel);
else
- ParseOthers.StartStatement_Expression(compilationUnit);
+ ParseOthers.StartStatement_Expression(compilationUnit, ref parserModel);
}
- public static void HandlePartialTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandlePartialTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleAddTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleAddTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleAndTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleAndTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleAliasTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleAliasTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleAscendingTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleAscendingTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleArgsTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleArgsTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleAsyncTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleAsyncTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleAwaitTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleAwaitTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleByTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleByTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleDescendingTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleDescendingTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleDynamicTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleDynamicTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleEqualsTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleEqualsTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleFileTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleFileTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleFromTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleFromTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleGetTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleGetTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleGlobalTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleGlobalTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleGroupTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleGroupTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleInitTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleInitTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleIntoTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleIntoTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleJoinTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleJoinTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleLetTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleLetTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleManagedTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleManagedTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleNameofTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleNameofTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleNintTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleNintTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleNotTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleNotTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleNotnullTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleNotnullTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleNuintTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleNuintTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleOnTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleOnTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleOrTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleOrTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleOrderbyTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleOrderbyTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleRecordTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleRecordTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- ParseDefaultKeywords.HandleStorageModifierTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleStorageModifierTokenKeyword(compilationUnit, ref parserModel);
}
- public static void HandleRemoveTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleRemoveTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleRequiredTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleRequiredTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleScopedTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleScopedTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleSelectTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleSelectTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleSetTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleSetTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleUnmanagedTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleUnmanagedTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleValueTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleValueTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleWhenTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleWhenTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleWhereTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleWhereTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var whereTokenContextualKeyword = (KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var whereTokenContextualKeyword = (KeywordContextualToken)parserModel.TokenWalker.Consume();
- if (compilationUnit.ParserModel.SyntaxStack.TryPeek(out var syntax) && syntax.SyntaxKind != SyntaxKind.TypeDefinitionNode)
+ if (parserModel.SyntaxStack.TryPeek(out var syntax) && syntax.SyntaxKind != SyntaxKind.TypeDefinitionNode)
return;
- while (!compilationUnit.ParserModel.TokenWalker.IsEof)
+ while (!parserModel.TokenWalker.IsEof)
{
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenBraceToken ||
- compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.StatementDelimiterToken)
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenBraceToken ||
+ parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.StatementDelimiterToken)
{
break;
}
- _ = compilationUnit.ParserModel.TokenWalker.Consume();
+ _ = parserModel.TokenWalker.Consume();
}
}
- public static void HandleWithTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleWithTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleYieldTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleYieldTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
- public static void HandleUnrecognizedTokenContextualKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleUnrecognizedTokenContextualKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordContextualToken)parserModel.TokenWalker.Consume());
}
}
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseDefaultKeywords.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseDefaultKeywords.cs
index a5bb98b06..d14685375 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseDefaultKeywords.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseDefaultKeywords.cs
@@ -11,59 +11,59 @@ namespace Luthetus.CompilerServices.CSharp.ParserCase.Internals;
public class ParseDefaultKeywords
{
- public static void HandleAsTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleAsTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleBaseTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleBaseTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleBoolTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleBoolTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleTypeIdentifierKeyword(compilationUnit);
+ HandleTypeIdentifierKeyword(compilationUnit, ref parserModel);
}
- public static void HandleBreakTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleBreakTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleByteTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleByteTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleTypeIdentifierKeyword(compilationUnit);
+ HandleTypeIdentifierKeyword(compilationUnit, ref parserModel);
}
- public static void HandleCaseTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleCaseTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.ColonToken, null));
- var expressionNode = ParseOthers.ParseExpression(compilationUnit);
- var colonToken = (ColonToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.ColonToken);
+ parserModel.ExpressionList.Add((SyntaxKind.ColonToken, null));
+ var expressionNode = ParseOthers.ParseExpression(compilationUnit, ref parserModel);
+ var colonToken = (ColonToken)parserModel.TokenWalker.Match(SyntaxKind.ColonToken);
}
- public static void HandleCatchTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleCatchTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var catchKeywordToken = (KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var catchKeywordToken = (KeywordToken)parserModel.TokenWalker.Consume();
- var openParenthesisToken = (OpenParenthesisToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.OpenParenthesisToken);
+ var openParenthesisToken = (OpenParenthesisToken)parserModel.TokenWalker.Match(SyntaxKind.OpenParenthesisToken);
- var typeClause = compilationUnit.ParserModel.TokenWalker.MatchTypeClauseNode(compilationUnit);
+ var typeClause = parserModel.TokenWalker.MatchTypeClauseNode(compilationUnit, ref parserModel);
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind != SyntaxKind.CloseParenthesisToken)
- _ = (IdentifierToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.IdentifierToken);
+ if (parserModel.TokenWalker.Current.SyntaxKind != SyntaxKind.CloseParenthesisToken)
+ _ = (IdentifierToken)parserModel.TokenWalker.Match(SyntaxKind.IdentifierToken);
- var closeParenthesisToken = (CloseParenthesisToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.CloseParenthesisToken);
+ var closeParenthesisToken = (CloseParenthesisToken)parserModel.TokenWalker.Match(SyntaxKind.CloseParenthesisToken);
TryStatementNode? tryStatementNode = null;
- if (compilationUnit.ParserModel.SyntaxStack.TryPeek(out var syntax) &&
+ if (parserModel.SyntaxStack.TryPeek(out var syntax) &&
syntax is TryStatementNode temporaryTryStatementNodeOne)
{
tryStatementNode = temporaryTryStatementNodeOne;
}
- else if (compilationUnit.ParserModel.SyntaxStack.TryPeek(out syntax) &&
+ else if (parserModel.SyntaxStack.TryPeek(out syntax) &&
syntax is TryStatementTryNode tryNode)
{
if (tryNode.Parent is TryStatementNode temporaryTryStatementNodeTwo)
@@ -82,53 +82,53 @@ public static void HandleCatchTokenKeyword(CSharpCompilationUnit compilationUnit
codeBlockNode: null);
tryStatementNode.SetTryStatementCatchNode(catchNode);
- compilationUnit.ParserModel.SyntaxStack.Push(catchNode);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = catchNode;
+ parserModel.SyntaxStack.Push(catchNode);
+ parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = catchNode;
}
}
- public static void HandleCharTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleCharTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleTypeIdentifierKeyword(compilationUnit);
+ HandleTypeIdentifierKeyword(compilationUnit, ref parserModel);
}
- public static void HandleCheckedTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleCheckedTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleConstTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleConstTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleContinueTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleContinueTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleDecimalTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleDecimalTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleTypeIdentifierKeyword(compilationUnit);
+ HandleTypeIdentifierKeyword(compilationUnit, ref parserModel);
}
- public static void HandleDefaultTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleDefaultTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
// Switch statement default case.
- if (compilationUnit.ParserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.ColonToken)
- _ = compilationUnit.ParserModel.TokenWalker.Consume();
+ if (parserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.ColonToken)
+ _ = parserModel.TokenWalker.Consume();
else
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleDelegateTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleDelegateTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleTypeIdentifierKeyword(compilationUnit);
+ HandleTypeIdentifierKeyword(compilationUnit, ref parserModel);
}
- public static void HandleDoTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleDoTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var doKeywordToken = (KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var doKeywordToken = (KeywordToken)parserModel.TokenWalker.Consume();
var doWhileStatementNode = new DoWhileStatementNode(
doKeywordToken,
@@ -140,63 +140,63 @@ public static void HandleDoTokenKeyword(CSharpCompilationUnit compilationUnit)
closeParenthesisToken: default);
// Have to push twice so it is on the stack when the 'while' keyword is parsed.
- compilationUnit.ParserModel.SyntaxStack.Push(doWhileStatementNode);
- compilationUnit.ParserModel.SyntaxStack.Push(doWhileStatementNode);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = doWhileStatementNode;
+ parserModel.SyntaxStack.Push(doWhileStatementNode);
+ parserModel.SyntaxStack.Push(doWhileStatementNode);
+ parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = doWhileStatementNode;
}
- public static void HandleDoubleTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleDoubleTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleTypeIdentifierKeyword(compilationUnit);
+ HandleTypeIdentifierKeyword(compilationUnit, ref parserModel);
}
- public static void HandleElseTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleElseTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleEnumTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleEnumTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleStorageModifierTokenKeyword(compilationUnit);
+ HandleStorageModifierTokenKeyword(compilationUnit, ref parserModel);
// Why was this method invocation here? (2024-01-23)
//
- // HandleTypeIdentifierKeyword(compilationUnit);
+ // HandleTypeIdentifierKeyword(compilationUnit, ref parserModel);
}
- public static void HandleEventTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleEventTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleExplicitTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleExplicitTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleExternTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleExternTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleFalseTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleFalseTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var expressionNode = ParseOthers.ParseExpression(compilationUnit);
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add(expressionNode);
+ var expressionNode = ParseOthers.ParseExpression(compilationUnit, ref parserModel);
+ parserModel.StatementBuilder.ChildList.Add(expressionNode);
}
- public static void HandleFinallyTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleFinallyTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var finallyKeywordToken = (KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var finallyKeywordToken = (KeywordToken)parserModel.TokenWalker.Consume();
TryStatementNode? tryStatementNode = null;
- if (compilationUnit.ParserModel.SyntaxStack.TryPeek(out var syntax) &&
+ if (parserModel.SyntaxStack.TryPeek(out var syntax) &&
syntax is TryStatementNode temporaryTryStatementNodeOne)
{
tryStatementNode = temporaryTryStatementNodeOne;
}
- else if (compilationUnit.ParserModel.SyntaxStack.TryPeek(out syntax) &&
+ else if (parserModel.SyntaxStack.TryPeek(out syntax) &&
syntax is TryStatementTryNode tryNode)
{
if (tryNode.Parent is TryStatementNode temporaryTryStatementNodeTwo)
@@ -204,7 +204,7 @@ public static void HandleFinallyTokenKeyword(CSharpCompilationUnit compilationUn
tryStatementNode = temporaryTryStatementNodeTwo;
}
}
- else if (compilationUnit.ParserModel.SyntaxStack.TryPeek(out syntax) &&
+ else if (parserModel.SyntaxStack.TryPeek(out syntax) &&
syntax is TryStatementCatchNode catchNode)
{
if (catchNode.Parent is TryStatementNode temporaryTryStatementNodeThree)
@@ -221,49 +221,49 @@ public static void HandleFinallyTokenKeyword(CSharpCompilationUnit compilationUn
codeBlockNode: null);
tryStatementNode.SetTryStatementFinallyNode(finallyNode);
- compilationUnit.ParserModel.SyntaxStack.Push(finallyNode);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = finallyNode;
+ parserModel.SyntaxStack.Push(finallyNode);
+ parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = finallyNode;
}
}
- public static void HandleFixedTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleFixedTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleFloatTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleFloatTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleTypeIdentifierKeyword(compilationUnit);
+ HandleTypeIdentifierKeyword(compilationUnit, ref parserModel);
}
- public static void HandleForTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleForTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var forKeywordToken = (KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var forKeywordToken = (KeywordToken)parserModel.TokenWalker.Consume();
- var openParenthesisToken = (OpenParenthesisToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.OpenParenthesisToken);
+ var openParenthesisToken = (OpenParenthesisToken)parserModel.TokenWalker.Match(SyntaxKind.OpenParenthesisToken);
// Initialization Case One
// ;
var initializationExpressionNode = (IExpressionNode)new EmptyExpressionNode(CSharpFacts.Types.Void.ToTypeClause());
- var initializationStatementDelimiterToken = (StatementDelimiterToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.StatementDelimiterToken);
+ var initializationStatementDelimiterToken = (StatementDelimiterToken)parserModel.TokenWalker.Match(SyntaxKind.StatementDelimiterToken);
var badStateInitialization = false;
if (initializationStatementDelimiterToken.IsFabricated)
{
// Initialization Case Two
// i = 0;
- var identifierToken = (IdentifierToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.IdentifierToken);
+ var identifierToken = (IdentifierToken)parserModel.TokenWalker.Match(SyntaxKind.IdentifierToken);
if (identifierToken.IsFabricated)
{
// Initialization Case Three
// int i = 0;
- var typeClauseNode = compilationUnit.ParserModel.TokenWalker.MatchTypeClauseNode(compilationUnit);
+ var typeClauseNode = parserModel.TokenWalker.MatchTypeClauseNode(compilationUnit, ref parserModel);
var isCaseThree = !typeClauseNode.IsFabricated;
if (isCaseThree)
{
- identifierToken = (IdentifierToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.IdentifierToken);
+ identifierToken = (IdentifierToken)parserModel.TokenWalker.Match(SyntaxKind.IdentifierToken);
}
else
{
@@ -277,51 +277,51 @@ public static void HandleForTokenKeyword(CSharpCompilationUnit compilationUnit)
{
// Read the remainder
// = 0;
- var equalsToken = (EqualsToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.EqualsToken);
+ var equalsToken = (EqualsToken)parserModel.TokenWalker.Match(SyntaxKind.EqualsToken);
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, null));
- initializationExpressionNode = ParseOthers.ParseExpression(compilationUnit);
+ parserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, null));
+ initializationExpressionNode = ParseOthers.ParseExpression(compilationUnit, ref parserModel);
- initializationStatementDelimiterToken = (StatementDelimiterToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.StatementDelimiterToken);
+ initializationStatementDelimiterToken = (StatementDelimiterToken)parserModel.TokenWalker.Match(SyntaxKind.StatementDelimiterToken);
}
}
// Condition Case One
// ;
var conditionExpressionNode = (IExpressionNode)new EmptyExpressionNode(CSharpFacts.Types.Void.ToTypeClause());
- var conditionStatementDelimiterToken = (StatementDelimiterToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.StatementDelimiterToken);
+ var conditionStatementDelimiterToken = (StatementDelimiterToken)parserModel.TokenWalker.Match(SyntaxKind.StatementDelimiterToken);
if (conditionStatementDelimiterToken.IsFabricated)
{
// Condition Case Two
// i < 10;
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, null));
- conditionExpressionNode = ParseOthers.ParseExpression(compilationUnit);
+ parserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, null));
+ conditionExpressionNode = ParseOthers.ParseExpression(compilationUnit, ref parserModel);
- conditionStatementDelimiterToken = (StatementDelimiterToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.StatementDelimiterToken);
+ conditionStatementDelimiterToken = (StatementDelimiterToken)parserModel.TokenWalker.Match(SyntaxKind.StatementDelimiterToken);
}
// Updation Case One
// )
var updationExpressionNode = (IExpressionNode)new EmptyExpressionNode(CSharpFacts.Types.Void.ToTypeClause());
- var closeParenthesisToken = (CloseParenthesisToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.CloseParenthesisToken);
+ var closeParenthesisToken = (CloseParenthesisToken)parserModel.TokenWalker.Match(SyntaxKind.CloseParenthesisToken);
if (closeParenthesisToken.IsFabricated)
{
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, null));
- updationExpressionNode = ParseOthers.ParseExpression(compilationUnit);
+ parserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, null));
+ updationExpressionNode = ParseOthers.ParseExpression(compilationUnit, ref parserModel);
- closeParenthesisToken = (CloseParenthesisToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.CloseParenthesisToken);
+ closeParenthesisToken = (CloseParenthesisToken)parserModel.TokenWalker.Match(SyntaxKind.CloseParenthesisToken);
if (closeParenthesisToken.IsFabricated)
{
- while (!compilationUnit.ParserModel.TokenWalker.IsEof)
+ while (!parserModel.TokenWalker.IsEof)
{
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CloseParenthesisToken)
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CloseParenthesisToken)
break;
- _ = compilationUnit.ParserModel.TokenWalker.Consume();
+ _ = parserModel.TokenWalker.Consume();
}
}
}
@@ -337,18 +337,18 @@ public static void HandleForTokenKeyword(CSharpCompilationUnit compilationUnit)
closeParenthesisToken,
codeBlockNode: null);
- compilationUnit.ParserModel.SyntaxStack.Push(forStatementNode);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = forStatementNode;
+ parserModel.SyntaxStack.Push(forStatementNode);
+ parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = forStatementNode;
}
- public static void HandleForeachTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleForeachTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var foreachKeywordToken = (KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var foreachKeywordToken = (KeywordToken)parserModel.TokenWalker.Consume();
- var openParenthesisToken = (OpenParenthesisToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.OpenParenthesisToken);
+ var openParenthesisToken = (OpenParenthesisToken)parserModel.TokenWalker.Match(SyntaxKind.OpenParenthesisToken);
- var typeClauseNode = compilationUnit.ParserModel.TokenWalker.MatchTypeClauseNode(compilationUnit);
- var variableIdentifierToken = (IdentifierToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.IdentifierToken);
+ var typeClauseNode = parserModel.TokenWalker.MatchTypeClauseNode(compilationUnit, ref parserModel);
+ var variableIdentifierToken = (IdentifierToken)parserModel.TokenWalker.Match(SyntaxKind.IdentifierToken);
var variableDeclarationStatementNode = new VariableDeclarationNode(
typeClauseNode,
@@ -356,11 +356,11 @@ public static void HandleForeachTokenKeyword(CSharpCompilationUnit compilationUn
VariableKind.Local,
false);
- var inKeywordToken = (KeywordToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.InTokenKeyword);
+ var inKeywordToken = (KeywordToken)parserModel.TokenWalker.Match(SyntaxKind.InTokenKeyword);
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, null));
- var expressionNode = ParseOthers.ParseExpression(compilationUnit);
- var closeParenthesisToken = (CloseParenthesisToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.CloseParenthesisToken);
+ parserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, null));
+ var expressionNode = ParseOthers.ParseExpression(compilationUnit, ref parserModel);
+ var closeParenthesisToken = (CloseParenthesisToken)parserModel.TokenWalker.Match(SyntaxKind.CloseParenthesisToken);
var foreachStatementNode = new ForeachStatementNode(
foreachKeywordToken,
@@ -371,45 +371,45 @@ public static void HandleForeachTokenKeyword(CSharpCompilationUnit compilationUn
closeParenthesisToken,
codeBlockNode: null);
- compilationUnit.ParserModel.SyntaxStack.Push(foreachStatementNode);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = foreachStatementNode;
+ parserModel.SyntaxStack.Push(foreachStatementNode);
+ parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = foreachStatementNode;
}
- public static void HandleGotoTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleGotoTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleImplicitTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleImplicitTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleInTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleInTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleIntTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleIntTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleTypeIdentifierKeyword(compilationUnit);
+ HandleTypeIdentifierKeyword(compilationUnit, ref parserModel);
}
- public static void HandleIsTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleIsTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleLockTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleLockTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var lockKeywordToken = (KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var lockKeywordToken = (KeywordToken)parserModel.TokenWalker.Consume();
- var openParenthesisToken = (OpenParenthesisToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.OpenParenthesisToken);
+ var openParenthesisToken = (OpenParenthesisToken)parserModel.TokenWalker.Match(SyntaxKind.OpenParenthesisToken);
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, null));
- var expressionNode = ParseOthers.ParseExpression(compilationUnit);
+ parserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, null));
+ var expressionNode = ParseOthers.ParseExpression(compilationUnit, ref parserModel);
- var closeParenthesisToken = (CloseParenthesisToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.CloseParenthesisToken);
+ var closeParenthesisToken = (CloseParenthesisToken)parserModel.TokenWalker.Match(SyntaxKind.CloseParenthesisToken);
var lockStatementNode = new LockStatementNode(
lockKeywordToken,
@@ -418,96 +418,96 @@ public static void HandleLockTokenKeyword(CSharpCompilationUnit compilationUnit)
closeParenthesisToken,
codeBlockNode: null);
- compilationUnit.ParserModel.SyntaxStack.Push(lockStatementNode);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = lockStatementNode;
+ parserModel.SyntaxStack.Push(lockStatementNode);
+ parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = lockStatementNode;
}
- public static void HandleLongTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleLongTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleTypeIdentifierKeyword(compilationUnit);
+ HandleTypeIdentifierKeyword(compilationUnit, ref parserModel);
}
- public static void HandleNullTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleNullTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleTypeIdentifierKeyword(compilationUnit);
+ HandleTypeIdentifierKeyword(compilationUnit, ref parserModel);
}
- public static void HandleObjectTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleObjectTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleTypeIdentifierKeyword(compilationUnit);
+ HandleTypeIdentifierKeyword(compilationUnit, ref parserModel);
}
- public static void HandleOperatorTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleOperatorTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleOutTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleOutTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleParamsTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleParamsTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleProtectedTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleProtectedTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var protectedTokenKeyword = (KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume();
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add(protectedTokenKeyword);
+ var protectedTokenKeyword = (KeywordToken)parserModel.TokenWalker.Consume();
+ parserModel.StatementBuilder.ChildList.Add(protectedTokenKeyword);
}
- public static void HandleReadonlyTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleReadonlyTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleRefTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleRefTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleSbyteTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleSbyteTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleTypeIdentifierKeyword(compilationUnit);
+ HandleTypeIdentifierKeyword(compilationUnit, ref parserModel);
}
- public static void HandleShortTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleShortTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleTypeIdentifierKeyword(compilationUnit);
+ HandleTypeIdentifierKeyword(compilationUnit, ref parserModel);
}
- public static void HandleSizeofTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleSizeofTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleStackallocTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleStackallocTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleStringTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleStringTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleTypeIdentifierKeyword(compilationUnit);
+ HandleTypeIdentifierKeyword(compilationUnit, ref parserModel);
}
- public static void HandleStructTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleStructTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleStorageModifierTokenKeyword(compilationUnit);
+ HandleStorageModifierTokenKeyword(compilationUnit, ref parserModel);
}
- public static void HandleSwitchTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleSwitchTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var switchKeywordToken = (KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var switchKeywordToken = (KeywordToken)parserModel.TokenWalker.Consume();
- var openParenthesisToken = (OpenParenthesisToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.OpenParenthesisToken);
+ var openParenthesisToken = (OpenParenthesisToken)parserModel.TokenWalker.Match(SyntaxKind.OpenParenthesisToken);
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, null));
- var expressionNode = ParseOthers.ParseExpression(compilationUnit);
+ parserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, null));
+ var expressionNode = ParseOthers.ParseExpression(compilationUnit, ref parserModel);
- var closeParenthesisToken = (CloseParenthesisToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.CloseParenthesisToken);
+ var closeParenthesisToken = (CloseParenthesisToken)parserModel.TokenWalker.Match(SyntaxKind.CloseParenthesisToken);
var switchStatementNode = new SwitchStatementNode(
switchKeywordToken,
@@ -516,29 +516,29 @@ public static void HandleSwitchTokenKeyword(CSharpCompilationUnit compilationUni
closeParenthesisToken,
codeBlockNode: null);
- compilationUnit.ParserModel.SyntaxStack.Push(switchStatementNode);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = switchStatementNode;
+ parserModel.SyntaxStack.Push(switchStatementNode);
+ parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = switchStatementNode;
}
- public static void HandleThisTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleThisTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleThrowTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleThrowTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleTrueTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleTrueTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var expressionNode = ParseOthers.ParseExpression(compilationUnit);
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add(expressionNode);
+ var expressionNode = ParseOthers.ParseExpression(compilationUnit, ref parserModel);
+ parserModel.StatementBuilder.ChildList.Add(expressionNode);
}
- public static void HandleTryTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleTryTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var tryKeywordToken = (KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var tryKeywordToken = (KeywordToken)parserModel.TokenWalker.Consume();
var tryStatementNode = new TryStatementNode(
tryNode: null,
@@ -552,66 +552,66 @@ public static void HandleTryTokenKeyword(CSharpCompilationUnit compilationUnit)
tryStatementNode.SetTryStatementTryNode(tryStatementTryNode);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.ChildList.Add(tryStatementNode);
+ parserModel.CurrentCodeBlockBuilder.ChildList.Add(tryStatementNode);
- compilationUnit.ParserModel.SyntaxStack.Push(tryStatementNode);
+ parserModel.SyntaxStack.Push(tryStatementNode);
- compilationUnit.ParserModel.SyntaxStack.Push(tryStatementTryNode);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = tryStatementTryNode;
+ parserModel.SyntaxStack.Push(tryStatementTryNode);
+ parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = tryStatementTryNode;
}
- public static void HandleTypeofTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleTypeofTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleUintTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleUintTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleTypeIdentifierKeyword(compilationUnit);
+ HandleTypeIdentifierKeyword(compilationUnit, ref parserModel);
}
- public static void HandleUlongTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleUlongTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleTypeIdentifierKeyword(compilationUnit);
+ HandleTypeIdentifierKeyword(compilationUnit, ref parserModel);
}
- public static void HandleUncheckedTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleUncheckedTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleUnsafeTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleUnsafeTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleUshortTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleUshortTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleTypeIdentifierKeyword(compilationUnit);
+ HandleTypeIdentifierKeyword(compilationUnit, ref parserModel);
}
- public static void HandleVoidTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleVoidTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleTypeIdentifierKeyword(compilationUnit);
+ HandleTypeIdentifierKeyword(compilationUnit, ref parserModel);
}
- public static void HandleVolatileTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleVolatileTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleWhileTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleWhileTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var whileKeywordToken = (KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var whileKeywordToken = (KeywordToken)parserModel.TokenWalker.Consume();
- var openParenthesisToken = (OpenParenthesisToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.OpenParenthesisToken);
+ var openParenthesisToken = (OpenParenthesisToken)parserModel.TokenWalker.Match(SyntaxKind.OpenParenthesisToken);
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, null));
- var expressionNode = ParseOthers.ParseExpression(compilationUnit);
+ parserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, null));
+ var expressionNode = ParseOthers.ParseExpression(compilationUnit, ref parserModel);
- var closeParenthesisToken = (CloseParenthesisToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.CloseParenthesisToken);
+ var closeParenthesisToken = (CloseParenthesisToken)parserModel.TokenWalker.Match(SyntaxKind.CloseParenthesisToken);
- if (compilationUnit.ParserModel.SyntaxStack.TryPeek(out var syntax) &&
+ if (parserModel.SyntaxStack.TryPeek(out var syntax) &&
syntax is DoWhileStatementNode doWhileStatementNode)
{
doWhileStatementNode.SetWhileProperties(
@@ -629,112 +629,112 @@ public static void HandleWhileTokenKeyword(CSharpCompilationUnit compilationUnit
closeParenthesisToken,
codeBlockNode: null);
- compilationUnit.ParserModel.SyntaxStack.Push(whileStatementNode);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = whileStatementNode;
+ parserModel.SyntaxStack.Push(whileStatementNode);
+ parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = whileStatementNode;
}
}
- public static void HandleUnrecognizedTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleUnrecognizedTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
/// The 'Default' of this method name is confusing.
/// It seems to refer to the 'default' of switch statement rather than the 'default' keyword itself?
///
- public static void HandleDefault(CSharpCompilationUnit compilationUnit)
+ public static void HandleDefault(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleTypeIdentifierKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleTypeIdentifierKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- ParseTokens.ParseIdentifierToken(compilationUnit);
+ ParseTokens.ParseIdentifierToken(compilationUnit, ref parserModel);
}
- public static void HandleNewTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleNewTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- if (compilationUnit.ParserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.OpenParenthesisToken ||
- UtilityApi.IsConvertibleToIdentifierToken(compilationUnit.ParserModel.TokenWalker.Next.SyntaxKind))
+ if (parserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.OpenParenthesisToken ||
+ UtilityApi.IsConvertibleToIdentifierToken(parserModel.TokenWalker.Next.SyntaxKind))
{
- var expressionNode = ParseOthers.ParseExpression(compilationUnit);
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add(expressionNode);
+ var expressionNode = ParseOthers.ParseExpression(compilationUnit, ref parserModel);
+ parserModel.StatementBuilder.ChildList.Add(expressionNode);
}
else
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
}
- public static void HandlePublicTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandlePublicTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var publicKeywordToken = (KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume();
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add(publicKeywordToken);
+ var publicKeywordToken = (KeywordToken)parserModel.TokenWalker.Consume();
+ parserModel.StatementBuilder.ChildList.Add(publicKeywordToken);
}
- public static void HandleInternalTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleInternalTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var internalTokenKeyword = (KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume();
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add(internalTokenKeyword);
+ var internalTokenKeyword = (KeywordToken)parserModel.TokenWalker.Consume();
+ parserModel.StatementBuilder.ChildList.Add(internalTokenKeyword);
}
- public static void HandlePrivateTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandlePrivateTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var privateTokenKeyword = (KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume();
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add(privateTokenKeyword);
+ var privateTokenKeyword = (KeywordToken)parserModel.TokenWalker.Consume();
+ parserModel.StatementBuilder.ChildList.Add(privateTokenKeyword);
}
- public static void HandleStaticTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleStaticTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleOverrideTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleOverrideTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleVirtualTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleVirtualTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleAbstractTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleAbstractTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleSealedTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleSealedTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
- public static void HandleIfTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleIfTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var ifTokenKeyword = (KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var ifTokenKeyword = (KeywordToken)parserModel.TokenWalker.Consume();
- var openParenthesisToken = compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.OpenParenthesisToken);
+ var openParenthesisToken = parserModel.TokenWalker.Match(SyntaxKind.OpenParenthesisToken);
if (openParenthesisToken.IsFabricated)
return;
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, null));
- var expression = ParseOthers.ParseExpression(compilationUnit);
+ parserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, null));
+ var expression = ParseOthers.ParseExpression(compilationUnit, ref parserModel);
var boundIfStatementNode = compilationUnit.Binder.BindIfStatementNode(ifTokenKeyword, expression);
- compilationUnit.ParserModel.SyntaxStack.Push(boundIfStatementNode);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = boundIfStatementNode;
+ parserModel.SyntaxStack.Push(boundIfStatementNode);
+ parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = boundIfStatementNode;
}
- public static void HandleUsingTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleUsingTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var usingKeywordToken = (KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var usingKeywordToken = (KeywordToken)parserModel.TokenWalker.Consume();
- var handleNamespaceIdentifierResult = ParseOthers.HandleNamespaceIdentifier(compilationUnit);
+ var handleNamespaceIdentifierResult = ParseOthers.HandleNamespaceIdentifier(compilationUnit, ref parserModel);
if (handleNamespaceIdentifierResult.SyntaxKind == SyntaxKind.EmptyNode)
{
- compilationUnit.ParserModel.DiagnosticBag.ReportTodoException(usingKeywordToken.TextSpan, "Expected a namespace identifier.");
+ parserModel.DiagnosticBag.ReportTodoException(usingKeywordToken.TextSpan, "Expected a namespace identifier.");
return;
}
@@ -745,12 +745,12 @@ public static void HandleUsingTokenKeyword(CSharpCompilationUnit compilationUnit
namespaceIdentifier);
compilationUnit.Binder.BindUsingStatementNode(usingStatementNode, compilationUnit);
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add(usingStatementNode);
+ parserModel.StatementBuilder.ChildList.Add(usingStatementNode);
}
- public static void HandleInterfaceTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleInterfaceTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleStorageModifierTokenKeyword(compilationUnit);
+ HandleStorageModifierTokenKeyword(compilationUnit, ref parserModel);
}
///
@@ -764,18 +764,18 @@ public static void HandleInterfaceTokenKeyword(CSharpCompilationUnit compilation
/// Invocation of this method implies the current token was
/// class, interface, struct, etc...
///
- public static void HandleStorageModifierTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleStorageModifierTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var storageModifierToken = compilationUnit.ParserModel.TokenWalker.Consume();
+ var storageModifierToken = parserModel.TokenWalker.Consume();
// Given: public partial class MyClass { }
// Then: partial
var hasPartialModifier = false;
- if (compilationUnit.ParserModel.StatementBuilder.TryPeek(out var syntax) && syntax is ISyntaxToken syntaxToken)
+ if (parserModel.StatementBuilder.TryPeek(out var syntax) && syntax is ISyntaxToken syntaxToken)
{
if (syntaxToken.SyntaxKind == SyntaxKind.PartialTokenContextualKeyword)
{
- _ = compilationUnit.ParserModel.StatementBuilder.Pop();
+ _ = parserModel.StatementBuilder.Pop();
hasPartialModifier = true;
}
}
@@ -785,24 +785,24 @@ public static void HandleStorageModifierTokenKeyword(CSharpCompilationUnit compi
// Given: public class MyClass { }
// Then: public
var accessModifierKind = AccessModifierKind.Public;
- if (compilationUnit.ParserModel.StatementBuilder.TryPeek(out syntax) && syntax is ISyntaxToken firstSyntaxToken)
+ if (parserModel.StatementBuilder.TryPeek(out syntax) && syntax is ISyntaxToken firstSyntaxToken)
{
var firstOutput = UtilityApi.GetAccessModifierKindFromToken(firstSyntaxToken);
if (firstOutput is not null)
{
- _ = compilationUnit.ParserModel.StatementBuilder.Pop();
+ _ = parserModel.StatementBuilder.Pop();
accessModifierKind = firstOutput.Value;
// Given: protected internal class MyClass { }
// Then: protected internal
- if (compilationUnit.ParserModel.StatementBuilder.TryPeek(out syntax) && syntax is ISyntaxToken secondSyntaxToken)
+ if (parserModel.StatementBuilder.TryPeek(out syntax) && syntax is ISyntaxToken secondSyntaxToken)
{
var secondOutput = UtilityApi.GetAccessModifierKindFromToken(secondSyntaxToken);
if (secondOutput is not null)
{
- _ = compilationUnit.ParserModel.StatementBuilder.Pop();
+ _ = parserModel.StatementBuilder.Pop();
if ((firstOutput.Value.ToString().ToLower() == "protected" &&
secondOutput.Value.ToString().ToLower() == "internal") ||
@@ -829,9 +829,9 @@ public static void HandleStorageModifierTokenKeyword(CSharpCompilationUnit compi
if (storageModifierKind is null)
return;
if (storageModifierKind == StorageModifierKind.Record &&
- compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.StructTokenKeyword)
+ parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.StructTokenKeyword)
{
- var structKeywordToken = (KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var structKeywordToken = (KeywordToken)parserModel.TokenWalker.Consume();
storageModifierKind = StorageModifierKind.RecordStruct;
}
@@ -840,22 +840,22 @@ public static void HandleStorageModifierTokenKeyword(CSharpCompilationUnit compi
IdentifierToken identifierToken;
// Retrospective: What is the purpose of this 'if (contextualKeyword) logic'?
// Response: maybe it is because 'var' contextual keyword is allowed to be a class name?
- if (UtilityApi.IsContextualKeywordSyntaxKind(compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind))
+ if (UtilityApi.IsContextualKeywordSyntaxKind(parserModel.TokenWalker.Current.SyntaxKind))
{
- var contextualKeywordToken = (KeywordContextualToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var contextualKeywordToken = (KeywordContextualToken)parserModel.TokenWalker.Consume();
// Take the contextual keyword as an identifier
identifierToken = new IdentifierToken(contextualKeywordToken.TextSpan);
}
else
{
- identifierToken = (IdentifierToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.IdentifierToken);
+ identifierToken = (IdentifierToken)parserModel.TokenWalker.Match(SyntaxKind.IdentifierToken);
}
// Given: public class MyClass { }
// Then:
GenericArgumentsListingNode? genericArgumentsListingNode = null;
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenAngleBracketToken)
- genericArgumentsListingNode = ParseTypes.HandleGenericArguments(compilationUnit);
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenAngleBracketToken)
+ genericArgumentsListingNode = ParseTypes.HandleGenericArguments(compilationUnit, ref parserModel);
var typeDefinitionNode = new TypeDefinitionNode(
accessModifierKind,
@@ -871,24 +871,24 @@ public static void HandleStorageModifierTokenKeyword(CSharpCompilationUnit compi
compilationUnit.Binder.BindTypeDefinitionNode(typeDefinitionNode, compilationUnit);
compilationUnit.Binder.BindTypeIdentifier(identifierToken, compilationUnit);
- compilationUnit.ParserModel.SyntaxStack.Push(typeDefinitionNode);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = typeDefinitionNode;
+ parserModel.SyntaxStack.Push(typeDefinitionNode);
+ parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = typeDefinitionNode;
}
- public static void HandleClassTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleClassTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- HandleStorageModifierTokenKeyword(compilationUnit);
+ HandleStorageModifierTokenKeyword(compilationUnit, ref parserModel);
}
- public static void HandleNamespaceTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleNamespaceTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var namespaceKeywordToken = (KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var namespaceKeywordToken = (KeywordToken)parserModel.TokenWalker.Consume();
- var handleNamespaceIdentifierResult = ParseOthers.HandleNamespaceIdentifier(compilationUnit);
+ var handleNamespaceIdentifierResult = ParseOthers.HandleNamespaceIdentifier(compilationUnit, ref parserModel);
if (handleNamespaceIdentifierResult.SyntaxKind == SyntaxKind.EmptyNode)
{
- compilationUnit.ParserModel.DiagnosticBag.ReportTodoException(namespaceKeywordToken.TextSpan, "Expected a namespace identifier.");
+ parserModel.DiagnosticBag.ReportTodoException(namespaceKeywordToken.TextSpan, "Expected a namespace identifier.");
return;
}
@@ -901,12 +901,12 @@ public static void HandleNamespaceTokenKeyword(CSharpCompilationUnit compilation
compilationUnit.Binder.SetCurrentNamespaceStatementNode(namespaceStatementNode, compilationUnit);
- compilationUnit.ParserModel.SyntaxStack.Push(namespaceStatementNode);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = namespaceStatementNode;
+ parserModel.SyntaxStack.Push(namespaceStatementNode);
+ parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = namespaceStatementNode;
}
- public static void HandleReturnTokenKeyword(CSharpCompilationUnit compilationUnit)
+ public static void HandleReturnTokenKeyword(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add((KeywordToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ parserModel.StatementBuilder.ChildList.Add((KeywordToken)parserModel.TokenWalker.Consume());
}
}
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseFunctions.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseFunctions.cs
index 92de6efb8..b93a5baac 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseFunctions.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseFunctions.cs
@@ -14,23 +14,25 @@ public static void HandleFunctionDefinition(
IdentifierToken consumedIdentifierToken,
TypeClauseNode consumedTypeClauseNode,
GenericParametersListingNode? consumedGenericArgumentsListingNode,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenAngleBracketToken)
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenAngleBracketToken)
{
var successGenericParametersListingNode = ParseOthers.TryParseExpression(
SyntaxKind.GenericParametersListingNode,
compilationUnit,
+ ref parserModel,
out var genericParametersListingNode);
if (successGenericParametersListingNode)
consumedGenericArgumentsListingNode = (GenericParametersListingNode)genericParametersListingNode;
}
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind != SyntaxKind.OpenParenthesisToken)
+ if (parserModel.TokenWalker.Current.SyntaxKind != SyntaxKind.OpenParenthesisToken)
return;
- var functionArgumentsListingNode = HandleFunctionArguments(compilationUnit);
+ var functionArgumentsListingNode = HandleFunctionArguments(compilationUnit, ref parserModel);
var functionDefinitionNode = new FunctionDefinitionNode(
AccessModifierKind.Public,
@@ -42,14 +44,14 @@ public static void HandleFunctionDefinition(
null);
compilationUnit.Binder.BindFunctionDefinitionNode(functionDefinitionNode, compilationUnit);
- compilationUnit.ParserModel.SyntaxStack.Push(functionDefinitionNode);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = functionDefinitionNode;
+ parserModel.SyntaxStack.Push(functionDefinitionNode);
+ parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = functionDefinitionNode;
- if (compilationUnit.ParserModel.CurrentCodeBlockBuilder.CodeBlockOwner is TypeDefinitionNode typeDefinitionNode &&
+ if (parserModel.CurrentCodeBlockBuilder.CodeBlockOwner is TypeDefinitionNode typeDefinitionNode &&
typeDefinitionNode.IsInterface)
{
// TODO: Would method constraints break this code? "public T Aaa() where T : OtherClass"
- var statementDelimiterToken = compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.StatementDelimiterToken);
+ var statementDelimiterToken = parserModel.TokenWalker.Match(SyntaxKind.StatementDelimiterToken);
foreach (var argument in functionDefinitionNode.FunctionArgumentsListingNode.FunctionArgumentEntryNodeList)
{
@@ -64,9 +66,10 @@ public static void HandleFunctionDefinition(
public static void HandleConstructorDefinition(
TypeDefinitionNode typeDefinitionNodeCodeBlockOwner,
IdentifierToken consumedIdentifierToken,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
- var functionArgumentsListingNode = HandleFunctionArguments(compilationUnit);
+ var functionArgumentsListingNode = HandleFunctionArguments(compilationUnit, ref parserModel);
var typeClauseNode = new TypeClauseNode(
typeDefinitionNodeCodeBlockOwner.TypeIdentifierToken,
@@ -82,55 +85,55 @@ public static void HandleConstructorDefinition(
null);
compilationUnit.Binder.BindConstructorDefinitionIdentifierToken(consumedIdentifierToken, compilationUnit);
- compilationUnit.ParserModel.SyntaxStack.Push(constructorDefinitionNode);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = constructorDefinitionNode;
+ parserModel.SyntaxStack.Push(constructorDefinitionNode);
+ parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = constructorDefinitionNode;
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.ColonToken)
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.ColonToken)
{
- _ = compilationUnit.ParserModel.TokenWalker.Consume();
+ _ = parserModel.TokenWalker.Consume();
// Constructor invokes some other constructor as well
// 'this(...)' or 'base(...)'
KeywordToken keywordToken;
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.ThisTokenKeyword)
- keywordToken = (KeywordToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.ThisTokenKeyword);
- else if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.BaseTokenKeyword)
- keywordToken = (KeywordToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.BaseTokenKeyword);
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.ThisTokenKeyword)
+ keywordToken = (KeywordToken)parserModel.TokenWalker.Match(SyntaxKind.ThisTokenKeyword);
+ else if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.BaseTokenKeyword)
+ keywordToken = (KeywordToken)parserModel.TokenWalker.Match(SyntaxKind.BaseTokenKeyword);
else
keywordToken = default;
- while (!compilationUnit.ParserModel.TokenWalker.IsEof)
+ while (!parserModel.TokenWalker.IsEof)
{
// TODO: This won't work because an OpenBraceToken can appear inside the "other constructor invocation"...
// ...If one were to skip over this syntax for the time being, it should be done by counting the
// matched OpenParenthesisToken and CloseParenthesisToken until it evens out.
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenBraceToken ||
- compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.EqualsToken)
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenBraceToken ||
+ parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.EqualsToken)
{
break;
}
- _ = compilationUnit.ParserModel.TokenWalker.Consume();
+ _ = parserModel.TokenWalker.Consume();
}
}
}
/// Use this method for function definition, whereas should be used for function invocation.
- public static FunctionArgumentsListingNode HandleFunctionArguments(CSharpCompilationUnit compilationUnit)
+ public static FunctionArgumentsListingNode HandleFunctionArguments(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var openParenthesisToken = (OpenParenthesisToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var openParenthesisToken = (OpenParenthesisToken)parserModel.TokenWalker.Consume();
var functionArgumentEntryNodeList = new List();
var openParenthesisCount = 1;
var corruptState = false;
- while (!compilationUnit.ParserModel.TokenWalker.IsEof)
+ while (!parserModel.TokenWalker.IsEof)
{
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenParenthesisToken)
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenParenthesisToken)
{
openParenthesisCount++;
}
- else if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CloseParenthesisToken)
+ else if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CloseParenthesisToken)
{
openParenthesisCount--;
@@ -139,19 +142,19 @@ public static FunctionArgumentsListingNode HandleFunctionArguments(CSharpCompila
break;
}
}
- else if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenBraceToken)
+ else if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenBraceToken)
{
break;
}
- else if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.EqualsToken &&
- compilationUnit.ParserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.CloseAngleBracketToken)
+ else if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.EqualsToken &&
+ parserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.CloseAngleBracketToken)
{
break;
}
else if (!corruptState)
{
- var tokenIndexOriginal = compilationUnit.ParserModel.TokenWalker.Index;
- var successTypeClauseNode = ParseOthers.TryParseExpression(SyntaxKind.TypeClauseNode, compilationUnit, out var typeClauseNode);
+ var tokenIndexOriginal = parserModel.TokenWalker.Index;
+ var successTypeClauseNode = ParseOthers.TryParseExpression(SyntaxKind.TypeClauseNode, compilationUnit, ref parserModel, out var typeClauseNode);
var successName = false;
if (successTypeClauseNode)
@@ -159,12 +162,12 @@ public static FunctionArgumentsListingNode HandleFunctionArguments(CSharpCompila
// 'TypeClauseNode' or 'VariableDeclarationNode'
var successNameableToken = false;
- if (UtilityApi.IsConvertibleToIdentifierToken(compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind))
+ if (UtilityApi.IsConvertibleToIdentifierToken(parserModel.TokenWalker.Current.SyntaxKind))
{
- var identifierToken = UtilityApi.ConvertToIdentifierToken(compilationUnit.ParserModel.TokenWalker.Consume(), compilationUnit);
+ var identifierToken = UtilityApi.ConvertToIdentifierToken(parserModel.TokenWalker.Consume(), compilationUnit, ref parserModel);
successNameableToken = true;
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.EqualsToken)
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.EqualsToken)
{
// Optional
}
@@ -186,10 +189,10 @@ public static FunctionArgumentsListingNode HandleFunctionArguments(CSharpCompila
functionArgumentEntryNodeList.Add(functionArgumentEntryNode);
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CommaToken)
- _ = compilationUnit.ParserModel.TokenWalker.Consume();
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CommaToken)
+ _ = parserModel.TokenWalker.Consume();
- if (tokenIndexOriginal < compilationUnit.ParserModel.TokenWalker.Index)
+ if (tokenIndexOriginal < parserModel.TokenWalker.Index)
continue; // Already consumed so avoid the one at the end of the while loop
}
@@ -202,13 +205,13 @@ public static FunctionArgumentsListingNode HandleFunctionArguments(CSharpCompila
}
}
- _ = compilationUnit.ParserModel.TokenWalker.Consume();
+ _ = parserModel.TokenWalker.Consume();
}
var closeParenthesisToken = default(CloseParenthesisToken);
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CloseParenthesisToken)
- closeParenthesisToken = (CloseParenthesisToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CloseParenthesisToken)
+ closeParenthesisToken = (CloseParenthesisToken)parserModel.TokenWalker.Consume();
return new FunctionArgumentsListingNode(
openParenthesisToken,
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseOthers.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseOthers.cs
index d7d94c74f..7df7707c1 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseOthers.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseOthers.cs
@@ -16,15 +16,15 @@ public static class ParseOthers
///
/// TODO: Delete this method, to parse a namespace identifier one should be able to just invoke 'ParseExpression(...)'
///
- public static ISyntax HandleNamespaceIdentifier(CSharpCompilationUnit compilationUnit)
+ public static ISyntax HandleNamespaceIdentifier(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
var combineNamespaceIdentifierIntoOne = new List();
- while (!compilationUnit.ParserModel.TokenWalker.IsEof)
+ while (!parserModel.TokenWalker.IsEof)
{
if (combineNamespaceIdentifierIntoOne.Count % 2 == 0)
{
- var matchedToken = compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.IdentifierToken);
+ var matchedToken = parserModel.TokenWalker.Match(SyntaxKind.IdentifierToken);
combineNamespaceIdentifierIntoOne.Add(matchedToken);
if (matchedToken.IsFabricated)
@@ -32,8 +32,8 @@ public static ISyntax HandleNamespaceIdentifier(CSharpCompilationUnit compilatio
}
else
{
- if (SyntaxKind.MemberAccessToken == compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind)
- combineNamespaceIdentifierIntoOne.Add(compilationUnit.ParserModel.TokenWalker.Consume());
+ if (SyntaxKind.MemberAccessToken == parserModel.TokenWalker.Current.SyntaxKind)
+ combineNamespaceIdentifierIntoOne.Add(parserModel.TokenWalker.Consume());
else
break;
}
@@ -54,20 +54,20 @@ public static ISyntax HandleNamespaceIdentifier(CSharpCompilationUnit compilatio
return new IdentifierToken(identifierTextSpan);
}
- public static void StartStatement_Expression(CSharpCompilationUnit compilationUnit)
+ public static void StartStatement_Expression(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var expressionNode = ParseOthers.ParseExpression(compilationUnit);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.ChildList.Add(expressionNode);
+ var expressionNode = ParseOthers.ParseExpression(compilationUnit, ref parserModel);
+ parserModel.CurrentCodeBlockBuilder.ChildList.Add(expressionNode);
}
///
/// ParseExpression while expressionPrimary.SyntaxKind == syntaxKind
///
/// if (expressionPrimary.SyntaxKind != syntaxKind)
- /// compilationUnit.ParserModel.TokenWalker.Backtrack() to either the previous loops tokenIndex where
+ /// parserModel.TokenWalker.Backtrack() to either the previous loops tokenIndex where
/// the syntax kinds did match.
///
- /// Or, if they never matched then compilationUnit.ParserModel.TokenWalker.Backtrack()
+ /// Or, if they never matched then parserModel.TokenWalker.Backtrack()
/// to the tokenIndex that was had when this function was invoked.
///
/// Return true if a match was found, return false if NO match was found.
@@ -76,30 +76,30 @@ public static void StartStatement_Expression(CSharpCompilationUnit compilationUn
/// As a result, some statements need to read a TypeClauseNode by invoking 'ParseExpression(...)'.
///
/// In order to "short circut" or "force exit" from the expression code back to the statement code,
- /// if the root primary expression is not equal to the compilationUnit.ParserModel.ForceParseExpressionSyntaxKind
+ /// if the root primary expression is not equal to the parserModel.ForceParseExpressionSyntaxKind
/// then stop.
///
- public static bool TryParseExpression(SyntaxKind? syntaxKind, CSharpCompilationUnit compilationUnit, out IExpressionNode expressionNode)
+ public static bool TryParseExpression(SyntaxKind? syntaxKind, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel, out IExpressionNode expressionNode)
{
- var originalTokenIndex = compilationUnit.ParserModel.TokenWalker.Index;
+ var originalTokenIndex = parserModel.TokenWalker.Index;
if (syntaxKind is not null)
- compilationUnit.ParserModel.TryParseExpressionSyntaxKindList.Add(syntaxKind.Value);
+ parserModel.TryParseExpressionSyntaxKindList.Add(syntaxKind.Value);
try
{
- expressionNode = ParseExpression(compilationUnit);
+ expressionNode = ParseExpression(compilationUnit, ref parserModel);
#if DEBUG
Console.WriteLine($"try => {expressionNode.SyntaxKind}\n");
#endif
- return compilationUnit.ParserModel.TryParseExpressionSyntaxKindList.Contains(expressionNode.SyntaxKind);
+ return parserModel.TryParseExpressionSyntaxKindList.Contains(expressionNode.SyntaxKind);
}
finally
{
- compilationUnit.ParserModel.TryParseExpressionSyntaxKindList.Clear();
- compilationUnit.ParserModel.ForceParseExpressionInitialPrimaryExpression = EmptyExpressionNode.Empty;
+ parserModel.TryParseExpressionSyntaxKindList.Clear();
+ parserModel.ForceParseExpressionInitialPrimaryExpression = EmptyExpressionNode.Empty;
}
}
@@ -123,37 +123,37 @@ public static bool SyntaxIsEndDelimiter(SyntaxKind syntaxKind)
}
///
- /// Invoke this method when 'compilationUnit.ParserModel.TokenWalker.Current' is the first token of the expression to be parsed.
+ /// Invoke this method when 'parserModel.TokenWalker.Current' is the first token of the expression to be parsed.
///
- /// In the case where the first token of the expression had already been 'Consume()'-ed then 'compilationUnit.ParserModel.TokenWalker.Backtrack();'
- /// might be of use in order to move the compilationUnit.ParserModel.TokenWalker backwards prior to invoking this method.
+ /// In the case where the first token of the expression had already been 'Consume()'-ed then 'parserModel.TokenWalker.Backtrack();'
+ /// might be of use in order to move the parserModel.TokenWalker backwards prior to invoking this method.
///
- public static IExpressionNode ParseExpression(CSharpCompilationUnit compilationUnit)
+ public static IExpressionNode ParseExpression(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
#if DEBUG
Console.WriteLine("\nParseExpression(...)");
#endif
- var expressionPrimary = compilationUnit.ParserModel.ForceParseExpressionInitialPrimaryExpression;
- var indexToken = compilationUnit.ParserModel.TokenWalker.Index;
+ var expressionPrimary = parserModel.ForceParseExpressionInitialPrimaryExpression;
+ var indexToken = parserModel.TokenWalker.Index;
var forceExit = false;
- var indexTokenRoot = compilationUnit.ParserModel.TokenWalker.Index;
+ var indexTokenRoot = parserModel.TokenWalker.Index;
var expressionPrimaryPreviousRoot = expressionPrimary;
- while (!compilationUnit.ParserModel.TokenWalker.IsEof)
+ while (!parserModel.TokenWalker.IsEof)
{
#if DEBUG
- WriteExpressionList(compilationUnit.ParserModel.ExpressionList);
+ WriteExpressionList(parserModel.ExpressionList);
#endif
- var tokenCurrent = compilationUnit.ParserModel.TokenWalker.Current;
+ var tokenCurrent = parserModel.TokenWalker.Current;
if (SyntaxIsEndDelimiter(tokenCurrent.SyntaxKind)) // Check if the tokenCurrent is a token that is used as a end-delimiter before iterating the list?
{
- for (int i = compilationUnit.ParserModel.ExpressionList.Count - 1; i > -1; i--)
+ for (int i = parserModel.ExpressionList.Count - 1; i > -1; i--)
{
- var delimiterExpressionTuple = compilationUnit.ParserModel.ExpressionList[i];
+ var delimiterExpressionTuple = parserModel.ExpressionList[i];
if (delimiterExpressionTuple.DelimiterSyntaxKind == tokenCurrent.SyntaxKind)
{
@@ -163,7 +163,7 @@ public static IExpressionNode ParseExpression(CSharpCompilationUnit compilationU
break;
}
- expressionPrimary = BubbleUpParseExpression(i, expressionPrimary, compilationUnit);
+ expressionPrimary = BubbleUpParseExpression(i, expressionPrimary, compilationUnit, ref parserModel);
break;
}
}
@@ -171,35 +171,35 @@ public static IExpressionNode ParseExpression(CSharpCompilationUnit compilationU
if (forceExit) // delimiterExpressionTuple.ExpressionNode is null
{
- expressionPrimary = BubbleUpParseExpression(0, expressionPrimary, compilationUnit);
+ expressionPrimary = BubbleUpParseExpression(0, expressionPrimary, compilationUnit, ref parserModel);
break;
}
- expressionPrimary = compilationUnit.Binder.AnyMergeToken(expressionPrimary, tokenCurrent, compilationUnit);
+ expressionPrimary = compilationUnit.Binder.AnyMergeToken(expressionPrimary, tokenCurrent, compilationUnit, ref parserModel);
#if DEBUG
Console.WriteLine($"\t=> {expressionPrimary.SyntaxKind}");
#endif
- if (compilationUnit.ParserModel.TokenWalker.Index == indexToken)
- _ = compilationUnit.ParserModel.TokenWalker.Consume();
- if (compilationUnit.ParserModel.TokenWalker.Index < indexToken)
+ if (parserModel.TokenWalker.Index == indexToken)
+ _ = parserModel.TokenWalker.Consume();
+ if (parserModel.TokenWalker.Index < indexToken)
throw new LuthetusTextEditorException($"Infinite loop in {nameof(ParseExpression)}");
- indexToken = compilationUnit.ParserModel.TokenWalker.Index;
+ indexToken = parserModel.TokenWalker.Index;
- if (compilationUnit.ParserModel.NoLongerRelevantExpressionNode is not null) // try finally is not needed to guarantee setting 'compilationUnit.ParserModel.NoLongerRelevantExpressionNode = null;' because this is an object reference comparison 'Object.ReferenceEquals'. Versus something more general that would break future parses if not properly cleared, like a SyntaxKind.
+ if (parserModel.NoLongerRelevantExpressionNode is not null) // try finally is not needed to guarantee setting 'parserModel.NoLongerRelevantExpressionNode = null;' because this is an object reference comparison 'Object.ReferenceEquals'. Versus something more general that would break future parses if not properly cleared, like a SyntaxKind.
{
- compilationUnit.Binder.ClearFromExpressionList(compilationUnit.ParserModel.NoLongerRelevantExpressionNode, compilationUnit);
- compilationUnit.ParserModel.NoLongerRelevantExpressionNode = null;
+ compilationUnit.Binder.ClearFromExpressionList(parserModel.NoLongerRelevantExpressionNode, compilationUnit, ref parserModel);
+ parserModel.NoLongerRelevantExpressionNode = null;
}
- if (compilationUnit.ParserModel.TryParseExpressionSyntaxKindList.Count != 0)
+ if (parserModel.TryParseExpressionSyntaxKindList.Count != 0)
{
var isExpressionRoot = true;
var rootSyntaxKind = SyntaxKind.EmptyExpressionNode;
- foreach (var tuple in compilationUnit.ParserModel.ExpressionList)
+ foreach (var tuple in parserModel.ExpressionList)
{
if (tuple.ExpressionNode is null)
continue;
@@ -213,26 +213,26 @@ public static IExpressionNode ParseExpression(CSharpCompilationUnit compilationU
if (isExpressionRoot)
{
- success = compilationUnit.ParserModel.TryParseExpressionSyntaxKindList.Contains(expressionPrimary.SyntaxKind);
+ success = parserModel.TryParseExpressionSyntaxKindList.Contains(expressionPrimary.SyntaxKind);
if (success)
{
expressionPrimaryPreviousRoot = expressionPrimary;
- indexTokenRoot = compilationUnit.ParserModel.TokenWalker.Index;
+ indexTokenRoot = parserModel.TokenWalker.Index;
}
}
else
{
- success = compilationUnit.ParserModel.TryParseExpressionSyntaxKindList.Contains(rootSyntaxKind);
+ success = parserModel.TryParseExpressionSyntaxKindList.Contains(rootSyntaxKind);
}
if (!success)
{
- var distance = compilationUnit.ParserModel.TokenWalker.Index - indexTokenRoot;
+ var distance = parserModel.TokenWalker.Index - indexTokenRoot;
for (int i = 0; i < distance; i++)
{
- _ = compilationUnit.ParserModel.TokenWalker.Backtrack();
+ _ = parserModel.TokenWalker.Backtrack();
}
expressionPrimary = expressionPrimaryPreviousRoot;
@@ -240,27 +240,28 @@ public static IExpressionNode ParseExpression(CSharpCompilationUnit compilationU
forceExit = true;
#if DEBUG
- WriteExpressionList(compilationUnit.ParserModel.ExpressionList);
+ WriteExpressionList(parserModel.ExpressionList);
Console.WriteLine("----TryParseExpressionSyntaxKindList");
#endif
}
}
- if (forceExit) // compilationUnit.ParserModel.ForceParseExpressionSyntaxKind
+ if (forceExit) // parserModel.ForceParseExpressionSyntaxKind
break;
}
// It is vital that this 'clear' and 'add' are done in a way that permits an invoker of the 'ParseExpression' method to 'add' a similar 'forceExit' delimiter
- // Example: 'compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, null));'
- compilationUnit.ParserModel.ExpressionList.Clear();
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.StatementDelimiterToken, null));
+ // Example: 'parserModel.ExpressionList.Add((SyntaxKind.CloseParenthesisToken, null));'
+ parserModel.ExpressionList.Clear();
+ parserModel.ExpressionList.Add((SyntaxKind.StatementDelimiterToken, null));
if (expressionPrimary.SyntaxKind == SyntaxKind.AmbiguousIdentifierExpressionNode)
{
expressionPrimary = compilationUnit.Binder.ForceDecisionAmbiguousIdentifier(
EmptyExpressionNode.Empty,
(AmbiguousIdentifierExpressionNode)expressionPrimary,
- compilationUnit);
+ compilationUnit,
+ ref parserModel);
}
#if DEBUG
@@ -289,12 +290,12 @@ public static IExpressionNode ParseExpression(CSharpCompilationUnit compilationU
///
/// LambdaExpressionNode for example, needs to override 'SyntaxKind.StatementDelimiterToken'.
///
- private static IExpressionNode BubbleUpParseExpression(int indexTriggered, IExpressionNode expressionPrimary, CSharpCompilationUnit compilationUnit)
+ private static IExpressionNode BubbleUpParseExpression(int indexTriggered, IExpressionNode expressionPrimary, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var triggeredDelimiterTuple = compilationUnit.ParserModel.ExpressionList[indexTriggered];
+ var triggeredDelimiterTuple = parserModel.ExpressionList[indexTriggered];
IExpressionNode? previousDelimiterExpressionNode = null;
- var initialExpressionListCount = compilationUnit.ParserModel.ExpressionList.Count;
+ var initialExpressionListCount = parserModel.ExpressionList.Count;
#if DEBUG
var nullNodeSyntaxKindText = "null";
@@ -303,8 +304,8 @@ private static IExpressionNode BubbleUpParseExpression(int indexTriggered, IExpr
for (int i = initialExpressionListCount - 1; i > indexTriggered - 1; i--)
{
- var delimiterExpressionTuple = compilationUnit.ParserModel.ExpressionList[i];
- compilationUnit.ParserModel.ExpressionList.RemoveAt(i);
+ var delimiterExpressionTuple = parserModel.ExpressionList[i];
+ parserModel.ExpressionList.RemoveAt(i);
if (delimiterExpressionTuple.ExpressionNode is null)
break; // This implies to forcibly return back to the statement while loop.
@@ -321,13 +322,14 @@ private static IExpressionNode BubbleUpParseExpression(int indexTriggered, IExpr
expressionPrimary = compilationUnit.Binder.AnyMergeExpression(
delimiterExpressionTuple.ExpressionNode,
expressionPrimary, // expressionSecondary
- compilationUnit);
+ compilationUnit,
+ ref parserModel);
}
- if (compilationUnit.ParserModel.NoLongerRelevantExpressionNode is not null) // try finally is not needed to guarantee setting 'compilationUnit.ParserModel.NoLongerRelevantExpressionNode = null;' because this is an object reference comparison 'Object.ReferenceEquals'. Versus something more general that would break future parses if not properly cleared, like a SyntaxKind.
+ if (parserModel.NoLongerRelevantExpressionNode is not null) // try finally is not needed to guarantee setting 'parserModel.NoLongerRelevantExpressionNode = null;' because this is an object reference comparison 'Object.ReferenceEquals'. Versus something more general that would break future parses if not properly cleared, like a SyntaxKind.
{
- compilationUnit.Binder.ClearFromExpressionList(compilationUnit.ParserModel.NoLongerRelevantExpressionNode, compilationUnit);
- compilationUnit.ParserModel.NoLongerRelevantExpressionNode = null;
+ compilationUnit.Binder.ClearFromExpressionList(parserModel.NoLongerRelevantExpressionNode, compilationUnit, ref parserModel);
+ parserModel.NoLongerRelevantExpressionNode = null;
}
return expressionPrimary;
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseTokens.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseTokens.cs
index 123ccc697..7247c52b7 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseTokens.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseTokens.cs
@@ -15,22 +15,23 @@ public static class ParseTokens
{
public static void ParsePreprocessorDirectiveToken(
PreprocessorDirectiveToken consumedPreprocessorDirectiveToken,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
- var consumedToken = compilationUnit.ParserModel.TokenWalker.Consume();
+ var consumedToken = parserModel.TokenWalker.Consume();
}
- public static void ParseIdentifierToken(CSharpCompilationUnit compilationUnit)
+ public static void ParseIdentifierToken(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var originalTokenIndex = compilationUnit.ParserModel.TokenWalker.Index;
+ var originalTokenIndex = parserModel.TokenWalker.Index;
- compilationUnit.ParserModel.TryParseExpressionSyntaxKindList.Add(SyntaxKind.TypeClauseNode);
- compilationUnit.ParserModel.TryParseExpressionSyntaxKindList.Add(SyntaxKind.VariableDeclarationNode);
- compilationUnit.ParserModel.TryParseExpressionSyntaxKindList.Add(SyntaxKind.VariableReferenceNode);
- compilationUnit.ParserModel.TryParseExpressionSyntaxKindList.Add(SyntaxKind.ConstructorInvocationExpressionNode);
+ parserModel.TryParseExpressionSyntaxKindList.Add(SyntaxKind.TypeClauseNode);
+ parserModel.TryParseExpressionSyntaxKindList.Add(SyntaxKind.VariableDeclarationNode);
+ parserModel.TryParseExpressionSyntaxKindList.Add(SyntaxKind.VariableReferenceNode);
+ parserModel.TryParseExpressionSyntaxKindList.Add(SyntaxKind.ConstructorInvocationExpressionNode);
- if (compilationUnit.ParserModel.CurrentCodeBlockBuilder.CodeBlockOwner is not null &&
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.CodeBlockOwner.SyntaxKind != SyntaxKind.TypeDefinitionNode)
+ if (parserModel.CurrentCodeBlockBuilder.CodeBlockOwner is not null &&
+ parserModel.CurrentCodeBlockBuilder.CodeBlockOwner.SyntaxKind != SyntaxKind.TypeDefinitionNode)
{
// There is a syntax conflict between a ConstructorDefinitionNode and a FunctionInvocationNode.
//
@@ -42,65 +43,66 @@ public static void ParseIdentifierToken(CSharpCompilationUnit compilationUnit)
// Then, it perhaps should be treated as a function invocation (or function definition).
// The main case for this being someone typing out pseudo code within a CodeBlockOwner
// that is a TypeDefinitionNode.
- compilationUnit.ParserModel.TryParseExpressionSyntaxKindList.Add(SyntaxKind.FunctionInvocationNode);
+ parserModel.TryParseExpressionSyntaxKindList.Add(SyntaxKind.FunctionInvocationNode);
}
- var successParse = ParseOthers.TryParseExpression(null, compilationUnit, out var expressionNode);
+ var successParse = ParseOthers.TryParseExpression(null, compilationUnit, ref parserModel, out var expressionNode);
if (!successParse)
{
- expressionNode = ParseOthers.ParseExpression(compilationUnit);
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add(expressionNode);
+ expressionNode = ParseOthers.ParseExpression(compilationUnit, ref parserModel);
+ parserModel.StatementBuilder.ChildList.Add(expressionNode);
return;
}
switch (expressionNode.SyntaxKind)
{
case SyntaxKind.TypeClauseNode:
- MoveToHandleTypeClauseNode(originalTokenIndex, (TypeClauseNode)expressionNode, compilationUnit);
+ MoveToHandleTypeClauseNode(originalTokenIndex, (TypeClauseNode)expressionNode, compilationUnit, ref parserModel);
return;
case SyntaxKind.VariableDeclarationNode:
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenParenthesisToken ||
- compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenAngleBracketToken)
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenParenthesisToken ||
+ parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenAngleBracketToken)
{
- MoveToHandleFunctionDefinition((VariableDeclarationNode)expressionNode, compilationUnit);
+ MoveToHandleFunctionDefinition((VariableDeclarationNode)expressionNode, compilationUnit, ref parserModel);
return;
}
- MoveToHandleVariableDeclarationNode((VariableDeclarationNode)expressionNode, compilationUnit);
+ MoveToHandleVariableDeclarationNode((VariableDeclarationNode)expressionNode, compilationUnit, ref parserModel);
return;
case SyntaxKind.VariableReferenceNode:
case SyntaxKind.FunctionInvocationNode:
case SyntaxKind.ConstructorInvocationExpressionNode:
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add(expressionNode);
+ parserModel.StatementBuilder.ChildList.Add(expressionNode);
return;
default:
- compilationUnit.ParserModel.DiagnosticBag.ReportTodoException(compilationUnit.ParserModel.TokenWalker.Current.TextSpan, $"nameof(ParseIdentifierToken) default case");
+ parserModel.DiagnosticBag.ReportTodoException(parserModel.TokenWalker.Current.TextSpan, $"nameof(ParseIdentifierToken) default case");
return;
}
}
- public static void MoveToHandleFunctionDefinition(VariableDeclarationNode variableDeclarationNode, CSharpCompilationUnit compilationUnit)
+ public static void MoveToHandleFunctionDefinition(VariableDeclarationNode variableDeclarationNode, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
ParseFunctions.HandleFunctionDefinition(
variableDeclarationNode.IdentifierToken,
variableDeclarationNode.TypeClauseNode,
consumedGenericArgumentsListingNode: null,
- compilationUnit);
+ compilationUnit,
+ ref parserModel);
}
- public static void MoveToHandleVariableDeclarationNode(IVariableDeclarationNode variableDeclarationNode, CSharpCompilationUnit compilationUnit)
+ public static void MoveToHandleVariableDeclarationNode(IVariableDeclarationNode variableDeclarationNode, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
var variableKind = VariableKind.Local;
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenBraceToken ||
- (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.EqualsToken &&
- compilationUnit.ParserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.CloseAngleBracketToken))
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenBraceToken ||
+ (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.EqualsToken &&
+ parserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.CloseAngleBracketToken))
{
variableKind = VariableKind.Property;
}
- else if (compilationUnit.ParserModel.CurrentCodeBlockBuilder.CodeBlockOwner is not null &&
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.CodeBlockOwner.SyntaxKind == SyntaxKind.TypeDefinitionNode)
+ else if (parserModel.CurrentCodeBlockBuilder.CodeBlockOwner is not null &&
+ parserModel.CurrentCodeBlockBuilder.CodeBlockOwner.SyntaxKind == SyntaxKind.TypeDefinitionNode)
{
variableKind = VariableKind.Field;
}
@@ -108,123 +110,124 @@ public static void MoveToHandleVariableDeclarationNode(IVariableDeclarationNode
((VariableDeclarationNode)variableDeclarationNode).VariableKind = variableKind;
compilationUnit.Binder.BindVariableDeclarationNode(variableDeclarationNode, compilationUnit);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.ChildList.Add(variableDeclarationNode);
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add(variableDeclarationNode);
+ parserModel.CurrentCodeBlockBuilder.ChildList.Add(variableDeclarationNode);
+ parserModel.StatementBuilder.ChildList.Add(variableDeclarationNode);
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenBraceToken)
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenBraceToken)
{
- ParsePropertyDefinition(compilationUnit, variableDeclarationNode);
+ ParsePropertyDefinition(compilationUnit, variableDeclarationNode, ref parserModel);
}
- else if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.EqualsToken &&
- compilationUnit.ParserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.CloseAngleBracketToken)
+ else if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.EqualsToken &&
+ parserModel.TokenWalker.Next.SyntaxKind == SyntaxKind.CloseAngleBracketToken)
{
- ParsePropertyDefinition_ExpressionBound(compilationUnit);
+ ParsePropertyDefinition_ExpressionBound(compilationUnit, ref parserModel);
}
}
- public static void MoveToHandleTypeClauseNode(int originalTokenIndex, TypeClauseNode typeClauseNode, CSharpCompilationUnit compilationUnit)
+ public static void MoveToHandleTypeClauseNode(int originalTokenIndex, TypeClauseNode typeClauseNode, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.StatementDelimiterToken ||
- compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.EndOfFileToken ||
- compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenBraceToken ||
- compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CloseBraceToken)
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.StatementDelimiterToken ||
+ parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.EndOfFileToken ||
+ parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenBraceToken ||
+ parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CloseBraceToken)
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add(typeClauseNode);
+ parserModel.StatementBuilder.ChildList.Add(typeClauseNode);
}
- else if (compilationUnit.ParserModel.CurrentCodeBlockBuilder.CodeBlockOwner is TypeDefinitionNode typeDefinitionNode &&
+ else if (parserModel.CurrentCodeBlockBuilder.CodeBlockOwner is TypeDefinitionNode typeDefinitionNode &&
UtilityApi.IsConvertibleToIdentifierToken(typeClauseNode.TypeIdentifierToken.SyntaxKind) &&
- compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenParenthesisToken &&
+ parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenParenthesisToken &&
typeDefinitionNode.TypeIdentifierToken.TextSpan.GetText() == typeClauseNode.TypeIdentifierToken.TextSpan.GetText())
{
// ConstructorDefinitionNode
- var identifierToken = UtilityApi.ConvertToIdentifierToken(typeClauseNode.TypeIdentifierToken, compilationUnit);
+ var identifierToken = UtilityApi.ConvertToIdentifierToken(typeClauseNode.TypeIdentifierToken, compilationUnit, ref parserModel);
ParseFunctions.HandleConstructorDefinition(
typeDefinitionNode,
identifierToken,
- compilationUnit);
+ compilationUnit,
+ ref parserModel);
}
else
{
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add(typeClauseNode);
+ parserModel.StatementBuilder.ChildList.Add(typeClauseNode);
}
return;
}
- public static void ParsePropertyDefinition(CSharpCompilationUnit compilationUnit, IVariableDeclarationNode variableDeclarationNode)
+ public static void ParsePropertyDefinition(CSharpCompilationUnit compilationUnit, IVariableDeclarationNode variableDeclarationNode, ref CSharpParserModel parserModel)
{
#if DEBUG
- compilationUnit.ParserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = true;
+ parserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = true;
#endif
- var openBraceToken = (OpenBraceToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var openBraceToken = (OpenBraceToken)parserModel.TokenWalker.Consume();
var openBraceCounter = 1;
while (true)
{
- if (compilationUnit.ParserModel.TokenWalker.IsEof)
+ if (parserModel.TokenWalker.IsEof)
break;
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenBraceToken)
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenBraceToken)
{
++openBraceCounter;
}
- else if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CloseBraceToken)
+ else if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CloseBraceToken)
{
if (--openBraceCounter <= 0)
break;
}
- else if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.GetTokenContextualKeyword)
+ else if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.GetTokenContextualKeyword)
{
variableDeclarationNode.HasGetter = true;
}
- else if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.SetTokenContextualKeyword)
+ else if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.SetTokenContextualKeyword)
{
variableDeclarationNode.HasSetter = true;
}
- _ = compilationUnit.ParserModel.TokenWalker.Consume();
+ _ = parserModel.TokenWalker.Consume();
}
- var closeTokenIndex = compilationUnit.ParserModel.TokenWalker.Index;
- var closeBraceToken = (CloseBraceToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.CloseBraceToken);
+ var closeTokenIndex = parserModel.TokenWalker.Index;
+ var closeBraceToken = (CloseBraceToken)parserModel.TokenWalker.Match(SyntaxKind.CloseBraceToken);
#if DEBUG
- compilationUnit.ParserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = false;
+ parserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = false;
#endif
}
- public static void ParsePropertyDefinition_ExpressionBound(CSharpCompilationUnit compilationUnit)
+ public static void ParsePropertyDefinition_ExpressionBound(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var equalsToken = (EqualsToken)compilationUnit.ParserModel.TokenWalker.Consume();
- var closeAngleBracketToken = (CloseAngleBracketToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var equalsToken = (EqualsToken)parserModel.TokenWalker.Consume();
+ var closeAngleBracketToken = (CloseAngleBracketToken)parserModel.TokenWalker.Consume();
- var expressionNode = ParseOthers.ParseExpression(compilationUnit);
- var statementDelimiterToken = (StatementDelimiterToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.StatementDelimiterToken);
+ var expressionNode = ParseOthers.ParseExpression(compilationUnit, ref parserModel);
+ var statementDelimiterToken = (StatementDelimiterToken)parserModel.TokenWalker.Match(SyntaxKind.StatementDelimiterToken);
}
- public static void ParseColonToken(CSharpCompilationUnit compilationUnit)
+ public static void ParseColonToken(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var colonToken = (ColonToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var colonToken = (ColonToken)parserModel.TokenWalker.Consume();
- if (compilationUnit.ParserModel.SyntaxStack.TryPeek(out var syntax) && syntax.SyntaxKind == SyntaxKind.TypeDefinitionNode)
+ if (parserModel.SyntaxStack.TryPeek(out var syntax) && syntax.SyntaxKind == SyntaxKind.TypeDefinitionNode)
{
- var typeDefinitionNode = (TypeDefinitionNode)compilationUnit.ParserModel.SyntaxStack.Pop();
- var inheritedTypeClauseNode = compilationUnit.ParserModel.TokenWalker.MatchTypeClauseNode(compilationUnit);
+ var typeDefinitionNode = (TypeDefinitionNode)parserModel.SyntaxStack.Pop();
+ var inheritedTypeClauseNode = parserModel.TokenWalker.MatchTypeClauseNode(compilationUnit, ref parserModel);
compilationUnit.Binder.BindTypeClauseNode(inheritedTypeClauseNode, compilationUnit);
typeDefinitionNode.SetInheritedTypeClauseNode(inheritedTypeClauseNode);
- compilationUnit.ParserModel.SyntaxStack.Push(typeDefinitionNode);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = typeDefinitionNode;
+ parserModel.SyntaxStack.Push(typeDefinitionNode);
+ parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = typeDefinitionNode;
}
else
{
- compilationUnit.ParserModel.DiagnosticBag.ReportTodoException(colonToken.TextSpan, "Colon is in unexpected place.");
+ parserModel.DiagnosticBag.ReportTodoException(colonToken.TextSpan, "Colon is in unexpected place.");
}
}
@@ -232,34 +235,34 @@ public static void ParseColonToken(CSharpCompilationUnit compilationUnit)
/// OpenBraceToken is passed in to the method because it is a protected token,
/// and is preferably consumed from the main loop so it can be more easily tracked.
///
- public static void ParseOpenBraceToken(OpenBraceToken openBraceToken, CSharpCompilationUnit compilationUnit)
+ public static void ParseOpenBraceToken(OpenBraceToken openBraceToken, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- if (compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner is null)
+ if (parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner is null)
{
- var arbitraryCodeBlockNode = new ArbitraryCodeBlockNode(compilationUnit.ParserModel.CurrentCodeBlockBuilder.CodeBlockOwner);
- compilationUnit.ParserModel.SyntaxStack.Push(arbitraryCodeBlockNode);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = arbitraryCodeBlockNode;
+ var arbitraryCodeBlockNode = new ArbitraryCodeBlockNode(parserModel.CurrentCodeBlockBuilder.CodeBlockOwner);
+ parserModel.SyntaxStack.Push(arbitraryCodeBlockNode);
+ parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = arbitraryCodeBlockNode;
}
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner.SetOpenBraceToken(openBraceToken, compilationUnit.ParserModel.DiagnosticBag, compilationUnit.ParserModel.TokenWalker);
+ parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner.SetOpenBraceToken(openBraceToken, parserModel.DiagnosticBag, parserModel.TokenWalker);
- var parentScopeDirection = compilationUnit.ParserModel.CurrentCodeBlockBuilder?.CodeBlockOwner?.ScopeDirectionKind ?? ScopeDirectionKind.Both;
+ var parentScopeDirection = parserModel.CurrentCodeBlockBuilder?.CodeBlockOwner?.ScopeDirectionKind ?? ScopeDirectionKind.Both;
if (parentScopeDirection == ScopeDirectionKind.Both)
{
- if (!compilationUnit.ParserModel.CurrentCodeBlockBuilder.PermitInnerPendingCodeBlockOwnerToBeParsed)
+ if (!parserModel.CurrentCodeBlockBuilder.PermitInnerPendingCodeBlockOwnerToBeParsed)
{
- compilationUnit.ParserModel.TokenWalker.DeferParsingOfChildScope(openBraceToken, compilationUnit);
+ parserModel.TokenWalker.DeferParsingOfChildScope(openBraceToken, compilationUnit, ref parserModel);
return;
}
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.PermitInnerPendingCodeBlockOwnerToBeParsed = false;
+ parserModel.CurrentCodeBlockBuilder.PermitInnerPendingCodeBlockOwnerToBeParsed = false;
}
- var nextCodeBlockOwner = compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner;
+ var nextCodeBlockOwner = parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner;
var nextReturnTypeClauseNode = nextCodeBlockOwner.GetReturnTypeClauseNode();
compilationUnit.Binder.OpenScope(nextCodeBlockOwner, nextReturnTypeClauseNode, openBraceToken.TextSpan, compilationUnit);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder = new(parent: compilationUnit.ParserModel.CurrentCodeBlockBuilder, codeBlockOwner: nextCodeBlockOwner);
+ parserModel.CurrentCodeBlockBuilder = new(parent: parserModel.CurrentCodeBlockBuilder, codeBlockOwner: nextCodeBlockOwner);
compilationUnit.Binder.OnBoundScopeCreatedAndSetAsCurrent(nextCodeBlockOwner, compilationUnit);
}
@@ -267,50 +270,53 @@ public static void ParseOpenBraceToken(OpenBraceToken openBraceToken, CSharpComp
/// CloseBraceToken is passed in to the method because it is a protected token,
/// and is preferably consumed from the main loop so it can be more easily tracked.
///
- public static void ParseCloseBraceToken(CloseBraceToken closeBraceToken, CSharpCompilationUnit compilationUnit)
+ public static void ParseCloseBraceToken(CloseBraceToken closeBraceToken, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- if (compilationUnit.ParserModel.CurrentCodeBlockBuilder.ParseChildScopeQueue.TryDequeue(out var deferredChildScope))
+ if (parserModel.CurrentCodeBlockBuilder.ParseChildScopeQueue.TryDequeue(out var deferredChildScope))
{
- deferredChildScope.PrepareMainParserLoop(compilationUnit.ParserModel.TokenWalker.Index - 1, compilationUnit);
+ deferredChildScope.PrepareMainParserLoop(parserModel.TokenWalker.Index - 1, compilationUnit, ref parserModel);
return;
}
- if (compilationUnit.ParserModel.CurrentCodeBlockBuilder.CodeBlockOwner is not null)
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.CodeBlockOwner.SetCloseBraceToken(closeBraceToken, compilationUnit.ParserModel.DiagnosticBag, compilationUnit.ParserModel.TokenWalker);
+ if (parserModel.CurrentCodeBlockBuilder.CodeBlockOwner is not null)
+ parserModel.CurrentCodeBlockBuilder.CodeBlockOwner.SetCloseBraceToken(closeBraceToken, parserModel.DiagnosticBag, parserModel.TokenWalker);
- compilationUnit.Binder.CloseScope(closeBraceToken.TextSpan, compilationUnit);
+ compilationUnit.Binder.CloseScope(closeBraceToken.TextSpan, compilationUnit, ref parserModel);
}
- public static void ParseOpenParenthesisToken(CSharpCompilationUnit compilationUnit)
+ public static void ParseOpenParenthesisToken(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
}
public static void ParseCloseParenthesisToken(
CloseParenthesisToken consumedCloseParenthesisToken,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
- var closesParenthesisToken = (CloseParenthesisToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var closesParenthesisToken = (CloseParenthesisToken)parserModel.TokenWalker.Consume();
}
public static void ParseOpenAngleBracketToken(
OpenAngleBracketToken consumedOpenAngleBracketToken,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
}
public static void ParseCloseAngleBracketToken(
CloseAngleBracketToken consumedCloseAngleBracketToken,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
}
- public static void ParseOpenSquareBracketToken(CSharpCompilationUnit compilationUnit)
+ public static void ParseOpenSquareBracketToken(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var openSquareBracketToken = (OpenSquareBracketToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var openSquareBracketToken = (OpenSquareBracketToken)parserModel.TokenWalker.Consume();
- if (compilationUnit.ParserModel.StatementBuilder.ChildList.Count != 0)
+ if (parserModel.StatementBuilder.ChildList.Count != 0)
{
- compilationUnit.ParserModel.DiagnosticBag.ReportTodoException(
+ parserModel.DiagnosticBag.ReportTodoException(
openSquareBracketToken.TextSpan,
$"Unexpected '{nameof(OpenSquareBracketToken)}'");
return;
@@ -319,67 +325,68 @@ public static void ParseOpenSquareBracketToken(CSharpCompilationUnit compilation
var corruptState = false;
#if DEBUG
- compilationUnit.ParserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = true;
+ parserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = true;
#endif
- while (!compilationUnit.ParserModel.TokenWalker.IsEof)
+ while (!parserModel.TokenWalker.IsEof)
{
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenSquareBracketToken)
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenSquareBracketToken)
{
++openSquareBracketCounter;
}
- else if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CloseSquareBracketToken)
+ else if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CloseSquareBracketToken)
{
if (--openSquareBracketCounter <= 0)
break;
}
else if (!corruptState)
{
- var tokenIndexOriginal = compilationUnit.ParserModel.TokenWalker.Index;
+ var tokenIndexOriginal = parserModel.TokenWalker.Index;
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CloseSquareBracketToken, null));
- compilationUnit.ParserModel.ExpressionList.Add((SyntaxKind.CommaToken, null));
- var expression = ParseOthers.ParseExpression(compilationUnit);
+ parserModel.ExpressionList.Add((SyntaxKind.CloseSquareBracketToken, null));
+ parserModel.ExpressionList.Add((SyntaxKind.CommaToken, null));
+ var expression = ParseOthers.ParseExpression(compilationUnit, ref parserModel);
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CommaToken)
- _ = compilationUnit.ParserModel.TokenWalker.Consume();
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.CommaToken)
+ _ = parserModel.TokenWalker.Consume();
- if (tokenIndexOriginal < compilationUnit.ParserModel.TokenWalker.Index)
+ if (tokenIndexOriginal < parserModel.TokenWalker.Index)
continue; // Already consumed so avoid the one at the end of the while loop
}
- _ = compilationUnit.ParserModel.TokenWalker.Consume();
+ _ = parserModel.TokenWalker.Consume();
}
- var closeTokenIndex = compilationUnit.ParserModel.TokenWalker.Index;
- var closeSquareBracketToken = (CloseSquareBracketToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.CloseSquareBracketToken);
+ var closeTokenIndex = parserModel.TokenWalker.Index;
+ var closeSquareBracketToken = (CloseSquareBracketToken)parserModel.TokenWalker.Match(SyntaxKind.CloseSquareBracketToken);
#if DEBUG
- compilationUnit.ParserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = false;
+ parserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = false;
#endif
}
public static void ParseCloseSquareBracketToken(
CloseSquareBracketToken consumedCloseSquareBracketToken,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
}
- public static void ParseEqualsToken(CSharpCompilationUnit compilationUnit)
+ public static void ParseEqualsToken(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- if (compilationUnit.ParserModel.StatementBuilder.ChildList.Count == 0)
+ if (parserModel.StatementBuilder.ChildList.Count == 0)
{
- ParseOthers.StartStatement_Expression(compilationUnit);
+ ParseOthers.StartStatement_Expression(compilationUnit, ref parserModel);
return;
}
- if (compilationUnit.ParserModel.StatementBuilder.TryPeek(out var syntax) &&
+ if (parserModel.StatementBuilder.TryPeek(out var syntax) &&
syntax.SyntaxKind == SyntaxKind.VariableDeclarationNode)
{
var variableDeclarationNode = (VariableDeclarationNode)syntax;
- compilationUnit.ParserModel.TokenWalker.Backtrack();
- var expression = ParseOthers.ParseExpression(compilationUnit);
+ parserModel.TokenWalker.Backtrack();
+ var expression = ParseOthers.ParseExpression(compilationUnit, ref parserModel);
if (expression.SyntaxKind != SyntaxKind.VariableAssignmentExpressionNode)
{
@@ -387,13 +394,14 @@ public static void ParseEqualsToken(CSharpCompilationUnit compilationUnit)
return;
}
- compilationUnit.ParserModel.StatementBuilder.ChildList.Add(expression);
+ parserModel.StatementBuilder.ChildList.Add(expression);
}
}
public static void ParseMemberAccessToken(
MemberAccessToken consumedMemberAccessToken,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
}
@@ -401,18 +409,18 @@ public static void ParseMemberAccessToken(
/// StatementDelimiterToken is passed in to the method because it is a protected token,
/// and is preferably consumed from the main loop so it can be more easily tracked.
///
- public static void ParseStatementDelimiterToken(StatementDelimiterToken statementDelimiterToken, CSharpCompilationUnit compilationUnit)
+ public static void ParseStatementDelimiterToken(StatementDelimiterToken statementDelimiterToken, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- if (compilationUnit.ParserModel.SyntaxStack.TryPeek(out var syntax) && syntax.SyntaxKind == SyntaxKind.NamespaceStatementNode)
+ if (parserModel.SyntaxStack.TryPeek(out var syntax) && syntax.SyntaxKind == SyntaxKind.NamespaceStatementNode)
{
- var closureCurrentCompilationUnitBuilder = compilationUnit.ParserModel.CurrentCodeBlockBuilder;
+ var closureCurrentCompilationUnitBuilder = parserModel.CurrentCodeBlockBuilder;
ICodeBlockOwner? nextCodeBlockOwner = null;
TypeClauseNode? scopeReturnTypeClauseNode = null;
- var namespaceStatementNode = (NamespaceStatementNode)compilationUnit.ParserModel.SyntaxStack.Pop();
+ var namespaceStatementNode = (NamespaceStatementNode)parserModel.SyntaxStack.Pop();
nextCodeBlockOwner = namespaceStatementNode;
- namespaceStatementNode.SetStatementDelimiterToken(statementDelimiterToken, compilationUnit.ParserModel.DiagnosticBag, compilationUnit.ParserModel.TokenWalker);
+ namespaceStatementNode.SetStatementDelimiterToken(statementDelimiterToken, parserModel.DiagnosticBag, parserModel.TokenWalker);
compilationUnit.Binder.OpenScope(
nextCodeBlockOwner,
@@ -424,500 +432,410 @@ public static void ParseStatementDelimiterToken(StatementDelimiterToken statemen
namespaceStatementNode.IdentifierToken.TextSpan.GetText(),
compilationUnit);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder = new(compilationUnit.ParserModel.CurrentCodeBlockBuilder, nextCodeBlockOwner);
+ parserModel.CurrentCodeBlockBuilder = new(parserModel.CurrentCodeBlockBuilder, nextCodeBlockOwner);
}
- else if (compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner is not null &&
- !compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner.OpenBraceToken.ConstructorWasInvoked)
+ else if (parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner is not null &&
+ !parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner.OpenBraceToken.ConstructorWasInvoked)
{
- var pendingChild = compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner;
+ var pendingChild = parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner;
compilationUnit.Binder.OpenScope(pendingChild, CSharpFacts.Types.Void.ToTypeClause(), statementDelimiterToken.TextSpan, compilationUnit);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder = new(compilationUnit.ParserModel.CurrentCodeBlockBuilder, pendingChild);
+ parserModel.CurrentCodeBlockBuilder = new(parserModel.CurrentCodeBlockBuilder, pendingChild);
compilationUnit.Binder.OnBoundScopeCreatedAndSetAsCurrent(pendingChild, compilationUnit);
- compilationUnit.Binder.CloseScope(statementDelimiterToken.TextSpan, compilationUnit);
+ compilationUnit.Binder.CloseScope(statementDelimiterToken.TextSpan, compilationUnit, ref parserModel);
- if (compilationUnit.ParserModel.CurrentCodeBlockBuilder.Parent is not null)
- compilationUnit.ParserModel.CurrentCodeBlockBuilder = compilationUnit.ParserModel.CurrentCodeBlockBuilder.Parent;
+ if (parserModel.CurrentCodeBlockBuilder.Parent is not null)
+ parserModel.CurrentCodeBlockBuilder = parserModel.CurrentCodeBlockBuilder.Parent;
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = null;
+ parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner = null;
}
}
- public static void ParseKeywordToken(CSharpCompilationUnit compilationUnit)
+ public static void ParseKeywordToken(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
// 'return', 'if', 'get', etc...
- switch (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind)
+ switch (parserModel.TokenWalker.Current.SyntaxKind)
{
case SyntaxKind.AsTokenKeyword:
- ParseDefaultKeywords.HandleAsTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleAsTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.BaseTokenKeyword:
- ParseDefaultKeywords.HandleBaseTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleBaseTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.BoolTokenKeyword:
- ParseDefaultKeywords.HandleBoolTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleBoolTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.BreakTokenKeyword:
- ParseDefaultKeywords.HandleBreakTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleBreakTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ByteTokenKeyword:
- ParseDefaultKeywords.HandleByteTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleByteTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.CaseTokenKeyword:
- ParseDefaultKeywords.HandleCaseTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleCaseTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.CatchTokenKeyword:
- ParseDefaultKeywords.HandleCatchTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleCatchTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.CharTokenKeyword:
- ParseDefaultKeywords.HandleCharTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleCharTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.CheckedTokenKeyword:
- ParseDefaultKeywords.HandleCheckedTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleCheckedTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ConstTokenKeyword:
- ParseDefaultKeywords.HandleConstTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleConstTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ContinueTokenKeyword:
- ParseDefaultKeywords.HandleContinueTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleContinueTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.DecimalTokenKeyword:
- ParseDefaultKeywords.HandleDecimalTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleDecimalTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.DefaultTokenKeyword:
- ParseDefaultKeywords.HandleDefaultTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleDefaultTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.DelegateTokenKeyword:
- ParseDefaultKeywords.HandleDelegateTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleDelegateTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.DoTokenKeyword:
- ParseDefaultKeywords.HandleDoTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleDoTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.DoubleTokenKeyword:
- ParseDefaultKeywords.HandleDoubleTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleDoubleTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ElseTokenKeyword:
- ParseDefaultKeywords.HandleElseTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleElseTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.EnumTokenKeyword:
- ParseDefaultKeywords.HandleEnumTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleEnumTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.EventTokenKeyword:
- ParseDefaultKeywords.HandleEventTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleEventTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ExplicitTokenKeyword:
- ParseDefaultKeywords.HandleExplicitTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleExplicitTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ExternTokenKeyword:
- ParseDefaultKeywords.HandleExternTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleExternTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.FalseTokenKeyword:
- ParseDefaultKeywords.HandleFalseTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleFalseTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.FinallyTokenKeyword:
- ParseDefaultKeywords.HandleFinallyTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleFinallyTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.FixedTokenKeyword:
- ParseDefaultKeywords.HandleFixedTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleFixedTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.FloatTokenKeyword:
- ParseDefaultKeywords.HandleFloatTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleFloatTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ForTokenKeyword:
- ParseDefaultKeywords.HandleForTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleForTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ForeachTokenKeyword:
- ParseDefaultKeywords.HandleForeachTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleForeachTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.GotoTokenKeyword:
- ParseDefaultKeywords.HandleGotoTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleGotoTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ImplicitTokenKeyword:
- ParseDefaultKeywords.HandleImplicitTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleImplicitTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.InTokenKeyword:
- ParseDefaultKeywords.HandleInTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleInTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.IntTokenKeyword:
- ParseDefaultKeywords.HandleIntTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleIntTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.IsTokenKeyword:
- ParseDefaultKeywords.HandleIsTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleIsTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.LockTokenKeyword:
- ParseDefaultKeywords.HandleLockTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleLockTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.LongTokenKeyword:
- ParseDefaultKeywords.HandleLongTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleLongTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.NullTokenKeyword:
- ParseDefaultKeywords.HandleNullTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleNullTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ObjectTokenKeyword:
- ParseDefaultKeywords.HandleObjectTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleObjectTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.OperatorTokenKeyword:
- ParseDefaultKeywords.HandleOperatorTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleOperatorTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.OutTokenKeyword:
- ParseDefaultKeywords.HandleOutTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleOutTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ParamsTokenKeyword:
- ParseDefaultKeywords.HandleParamsTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleParamsTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ProtectedTokenKeyword:
- ParseDefaultKeywords.HandleProtectedTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleProtectedTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ReadonlyTokenKeyword:
- ParseDefaultKeywords.HandleReadonlyTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleReadonlyTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.RefTokenKeyword:
- ParseDefaultKeywords.HandleRefTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleRefTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.SbyteTokenKeyword:
- ParseDefaultKeywords.HandleSbyteTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleSbyteTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ShortTokenKeyword:
- ParseDefaultKeywords.HandleShortTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleShortTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.SizeofTokenKeyword:
- ParseDefaultKeywords.HandleSizeofTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleSizeofTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.StackallocTokenKeyword:
- ParseDefaultKeywords.HandleStackallocTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleStackallocTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.StringTokenKeyword:
- ParseDefaultKeywords.HandleStringTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleStringTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.StructTokenKeyword:
- ParseDefaultKeywords.HandleStructTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleStructTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.SwitchTokenKeyword:
- ParseDefaultKeywords.HandleSwitchTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleSwitchTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ThisTokenKeyword:
- ParseDefaultKeywords.HandleThisTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleThisTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ThrowTokenKeyword:
- ParseDefaultKeywords.HandleThrowTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleThrowTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.TrueTokenKeyword:
- ParseDefaultKeywords.HandleTrueTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleTrueTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.TryTokenKeyword:
- ParseDefaultKeywords.HandleTryTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleTryTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.TypeofTokenKeyword:
- ParseDefaultKeywords.HandleTypeofTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleTypeofTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.UintTokenKeyword:
- ParseDefaultKeywords.HandleUintTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleUintTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.UlongTokenKeyword:
- ParseDefaultKeywords.HandleUlongTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleUlongTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.UncheckedTokenKeyword:
- ParseDefaultKeywords.HandleUncheckedTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleUncheckedTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.UnsafeTokenKeyword:
- ParseDefaultKeywords.HandleUnsafeTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleUnsafeTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.UshortTokenKeyword:
- ParseDefaultKeywords.HandleUshortTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleUshortTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.VoidTokenKeyword:
- ParseDefaultKeywords.HandleVoidTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleVoidTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.VolatileTokenKeyword:
- ParseDefaultKeywords.HandleVolatileTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleVolatileTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.WhileTokenKeyword:
- ParseDefaultKeywords.HandleWhileTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleWhileTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.UnrecognizedTokenKeyword:
- ParseDefaultKeywords.HandleUnrecognizedTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleUnrecognizedTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ReturnTokenKeyword:
- ParseDefaultKeywords.HandleReturnTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleReturnTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.NamespaceTokenKeyword:
- ParseDefaultKeywords.HandleNamespaceTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleNamespaceTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ClassTokenKeyword:
- ParseDefaultKeywords.HandleClassTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleClassTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.InterfaceTokenKeyword:
- ParseDefaultKeywords.HandleInterfaceTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleInterfaceTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.UsingTokenKeyword:
- ParseDefaultKeywords.HandleUsingTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleUsingTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.PublicTokenKeyword:
- ParseDefaultKeywords.HandlePublicTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandlePublicTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.InternalTokenKeyword:
- ParseDefaultKeywords.HandleInternalTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleInternalTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.PrivateTokenKeyword:
- ParseDefaultKeywords.HandlePrivateTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandlePrivateTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.StaticTokenKeyword:
- ParseDefaultKeywords.HandleStaticTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleStaticTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.OverrideTokenKeyword:
- ParseDefaultKeywords.HandleOverrideTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleOverrideTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.VirtualTokenKeyword:
- ParseDefaultKeywords.HandleVirtualTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleVirtualTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.AbstractTokenKeyword:
- ParseDefaultKeywords.HandleAbstractTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleAbstractTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.SealedTokenKeyword:
- ParseDefaultKeywords.HandleSealedTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleSealedTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.IfTokenKeyword:
- ParseDefaultKeywords.HandleIfTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleIfTokenKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.NewTokenKeyword:
- ParseDefaultKeywords.HandleNewTokenKeyword(compilationUnit);
+ ParseDefaultKeywords.HandleNewTokenKeyword(compilationUnit, ref parserModel);
break;
default:
- ParseDefaultKeywords.HandleDefault(compilationUnit);
+ ParseDefaultKeywords.HandleDefault(compilationUnit, ref parserModel);
break;
}
}
- public static void ParseKeywordContextualToken(CSharpCompilationUnit compilationUnit)
+ public static void ParseKeywordContextualToken(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- switch (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind)
+ switch (parserModel.TokenWalker.Current.SyntaxKind)
{
case SyntaxKind.VarTokenContextualKeyword:
- ParseContextualKeywords.HandleVarTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleVarTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.PartialTokenContextualKeyword:
- ParseContextualKeywords.HandlePartialTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandlePartialTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.AddTokenContextualKeyword:
- ParseContextualKeywords.HandleAddTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleAddTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.AndTokenContextualKeyword:
- ParseContextualKeywords.HandleAndTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleAndTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.AliasTokenContextualKeyword:
- ParseContextualKeywords.HandleAliasTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleAliasTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.AscendingTokenContextualKeyword:
- ParseContextualKeywords.HandleAscendingTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleAscendingTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ArgsTokenContextualKeyword:
- ParseContextualKeywords.HandleArgsTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleArgsTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.AsyncTokenContextualKeyword:
- ParseContextualKeywords.HandleAsyncTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleAsyncTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.AwaitTokenContextualKeyword:
- ParseContextualKeywords.HandleAwaitTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleAwaitTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ByTokenContextualKeyword:
- ParseContextualKeywords.HandleByTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleByTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.DescendingTokenContextualKeyword:
- ParseContextualKeywords.HandleDescendingTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleDescendingTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.DynamicTokenContextualKeyword:
- ParseContextualKeywords.HandleDynamicTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleDynamicTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.EqualsTokenContextualKeyword:
- ParseContextualKeywords.HandleEqualsTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleEqualsTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.FileTokenContextualKeyword:
- ParseContextualKeywords.HandleFileTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleFileTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.FromTokenContextualKeyword:
- ParseContextualKeywords.HandleFromTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleFromTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.GetTokenContextualKeyword:
- ParseContextualKeywords.HandleGetTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleGetTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.GlobalTokenContextualKeyword:
- ParseContextualKeywords.HandleGlobalTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleGlobalTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.GroupTokenContextualKeyword:
- ParseContextualKeywords.HandleGroupTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleGroupTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.InitTokenContextualKeyword:
- ParseContextualKeywords.HandleInitTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleInitTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.IntoTokenContextualKeyword:
- ParseContextualKeywords.HandleIntoTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleIntoTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.JoinTokenContextualKeyword:
- ParseContextualKeywords.HandleJoinTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleJoinTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.LetTokenContextualKeyword:
- ParseContextualKeywords.HandleLetTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleLetTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ManagedTokenContextualKeyword:
- ParseContextualKeywords.HandleManagedTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleManagedTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.NameofTokenContextualKeyword:
- ParseContextualKeywords.HandleNameofTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleNameofTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.NintTokenContextualKeyword:
- ParseContextualKeywords.HandleNintTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleNintTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.NotTokenContextualKeyword:
- ParseContextualKeywords.HandleNotTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleNotTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.NotnullTokenContextualKeyword:
- ParseContextualKeywords.HandleNotnullTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleNotnullTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.NuintTokenContextualKeyword:
- ParseContextualKeywords.HandleNuintTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleNuintTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.OnTokenContextualKeyword:
- ParseContextualKeywords.HandleOnTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleOnTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.OrTokenContextualKeyword:
- ParseContextualKeywords.HandleOrTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleOrTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.OrderbyTokenContextualKeyword:
- ParseContextualKeywords.HandleOrderbyTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleOrderbyTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.RecordTokenContextualKeyword:
- ParseContextualKeywords.HandleRecordTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleRecordTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.RemoveTokenContextualKeyword:
- ParseContextualKeywords.HandleRemoveTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleRemoveTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.RequiredTokenContextualKeyword:
- ParseContextualKeywords.HandleRequiredTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleRequiredTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ScopedTokenContextualKeyword:
- ParseContextualKeywords.HandleScopedTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleScopedTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.SelectTokenContextualKeyword:
- ParseContextualKeywords.HandleSelectTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleSelectTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.SetTokenContextualKeyword:
- ParseContextualKeywords.HandleSetTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleSetTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.UnmanagedTokenContextualKeyword:
- ParseContextualKeywords.HandleUnmanagedTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleUnmanagedTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.ValueTokenContextualKeyword:
- ParseContextualKeywords.HandleValueTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleValueTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.WhenTokenContextualKeyword:
- ParseContextualKeywords.HandleWhenTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleWhenTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.WhereTokenContextualKeyword:
- ParseContextualKeywords.HandleWhereTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleWhereTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.WithTokenContextualKeyword:
- ParseContextualKeywords.HandleWithTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleWithTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.YieldTokenContextualKeyword:
- ParseContextualKeywords.HandleYieldTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleYieldTokenContextualKeyword(compilationUnit, ref parserModel);
break;
case SyntaxKind.UnrecognizedTokenContextualKeyword:
- ParseContextualKeywords.HandleUnrecognizedTokenContextualKeyword(compilationUnit);
+ ParseContextualKeywords.HandleUnrecognizedTokenContextualKeyword(compilationUnit, ref parserModel);
break;
default:
- compilationUnit.ParserModel.DiagnosticBag.ReportTodoException(compilationUnit.ParserModel.TokenWalker.Current.TextSpan, $"Implement the {compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind.ToString()} contextual keyword.");
+ parserModel.DiagnosticBag.ReportTodoException(parserModel.TokenWalker.Current.TextSpan, $"Implement the {parserModel.TokenWalker.Current.SyntaxKind.ToString()} contextual keyword.");
break;
}
}
}
-
-/*
- (2024-11-08) The issue is:
- ==========================
- 'int[] x = new { 1, 2, 3, };'
- 'int[] MyMethod() { }'
-
- In my mind this was an issue, but it wouldn't be an issue because in order
- to get to this code I have to see an OpenParenthesisToken.
-
- The variable assignment doesn't conflict at all.
-
- But:
- 'int[] x = new { 1, 2, 3, };'
- 'int[2] = 7;'
-
- At the start of a statement, there can be a conflict here,
- but given the situation, one can see the second line has a '2' in the array's square brackets
- so therefore you know the second line is a variable assignment expression.
- (the first line is a variable declaration statement / variable assignment expression).
-
- https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/arrays
- =======================================================================================
- // Declare a single-dimensional array of 5 integers.
- int[] array1 = new int[5];
-
- // Declare and set array element values.
- int[] array2 = [1, 2, 3, 4, 5, 6];
-
- // Declare a two dimensional array.
- int[,] multiDimensionalArray1 = new int[2, 3];
-
- // Declare and set array element values.
- int[,] multiDimensionalArray2 = { { 1, 2, 3 }, { 4, 5, 6 } };
-
- // Declare a jagged array.
- int[][] jaggedArray = new int[6][];
-
- // Set the values of the first array in the jagged array structure.
- jaggedArray[0] = [1, 2, 3, 4];
- ---------------------------------------------------------------------------------------
-
- None of the array declaration examples contain a number inside the
- array square brackets at the start of the statement.
-
- When dealing with a function definition,
- the TypeClauseNode for its return type might be an array.
-
- So I have to properly make sense of the 'int[]'
- if I have 'int[] MyMethod() { }'.
-
- But, I just saw that it seems I can check inside the array brackets
- whether there is a number or not.
-
- And there being a number means that it is an expression of some sort,
- whereas the lack or one means it is a statement of some sort.
-
- In the case of:
- 'Person MyMethod() { }'
-
- When I read 'Person', is there any ambiguity as to whether it is
- - TypeClauseNode
- - IdentifierToken
-
- I think the question is:
- "At what points do I convert a token that can be a 'TypeClauseNode' to a 'TypeClauseNode'?"
-
- If the 'TypeClauseNode' is an array, then the array square brackets will not
- contain a number, and this is the sign that it is a 'TypeClauseNode'.
-
- If the 'TypeClauseNode' is just an IdentifierToken, where could things go from there?
-
- ConstructorDefinitionNode can occur from the following:
- - IdentifierToken, OpenParenthesisToken
-
- FunctionDefinitionNode can occur from the following:
- - TypeClauseNode, IdentifierToken, OpenParenthesisToken
- - This occurs when the first token initially was a 'IdentifierToken' but was not ambiguous and therefore
- immediately interpreted as a 'TypeClauseNode' rather than as an 'IdentifierToken'.
- - IdentifierToken, IdentifierToken, OpenParenthesisToken
-
- VariableDeclarationNode can occur from the following:
- - TypeClauseNode, IdentifierToken, EqualsToken
-
- TypeDefinitionNode can occur from the following:
- - SyntaxKind.ClassTokenKeyword, IdentifierToken
-
- TypeDefinitionNode can occur from the following:
- - SyntaxKind.ClassTokenKeyword, IdentifierToken
-*/
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseTypes.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseTypes.cs
index d7f24a8ba..1ac0e7988 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseTypes.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseTypes.cs
@@ -11,29 +11,31 @@ public static class ParseTypes
{
public static void HandleStaticClassIdentifier(
IdentifierToken consumedIdentifierToken,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
}
public static void HandleUndefinedTypeOrNamespaceReference(
IdentifierToken consumedIdentifierToken,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
}
///
/// This method is used for generic type definition such as, 'class List<T> { ... }'
///
- public static GenericArgumentsListingNode HandleGenericArguments(CSharpCompilationUnit compilationUnit)
+ public static GenericArgumentsListingNode HandleGenericArguments(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- var openAngleBracketToken = (OpenAngleBracketToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var openAngleBracketToken = (OpenAngleBracketToken)parserModel.TokenWalker.Consume();
- if (SyntaxKind.CloseAngleBracketToken == compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind)
+ if (SyntaxKind.CloseAngleBracketToken == parserModel.TokenWalker.Current.SyntaxKind)
{
return new GenericArgumentsListingNode(
openAngleBracketToken,
ImmutableArray.Empty,
- (CloseAngleBracketToken)compilationUnit.ParserModel.TokenWalker.Consume());
+ (CloseAngleBracketToken)parserModel.TokenWalker.Consume());
}
var mutableGenericArgumentsListing = new List();
@@ -41,7 +43,7 @@ public static GenericArgumentsListingNode HandleGenericArguments(CSharpCompilati
while (true)
{
// TypeClause
- var typeClauseNode = MatchTypeClause(compilationUnit);
+ var typeClauseNode = MatchTypeClause(compilationUnit, ref parserModel);
if (typeClauseNode.IsFabricated)
break;
@@ -49,9 +51,9 @@ public static GenericArgumentsListingNode HandleGenericArguments(CSharpCompilati
var genericArgumentEntryNode = new GenericArgumentEntryNode(typeClauseNode);
mutableGenericArgumentsListing.Add(genericArgumentEntryNode);
- if (SyntaxKind.CommaToken == compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind)
+ if (SyntaxKind.CommaToken == parserModel.TokenWalker.Current.SyntaxKind)
{
- var commaToken = (CommaToken)compilationUnit.ParserModel.TokenWalker.Consume();
+ var commaToken = (CommaToken)parserModel.TokenWalker.Consume();
// TODO: Track comma tokens?
//
@@ -63,7 +65,7 @@ public static GenericArgumentsListingNode HandleGenericArguments(CSharpCompilati
}
}
- var closeAngleBracketToken = (CloseAngleBracketToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.CloseAngleBracketToken);
+ var closeAngleBracketToken = (CloseAngleBracketToken)parserModel.TokenWalker.Match(SyntaxKind.CloseAngleBracketToken);
return new GenericArgumentsListingNode(
openAngleBracketToken,
@@ -73,7 +75,8 @@ public static GenericArgumentsListingNode HandleGenericArguments(CSharpCompilati
public static void HandleAttribute(
OpenSquareBracketToken consumedOpenSquareBracketToken,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
}
@@ -89,20 +92,20 @@ public static void HandleAttribute(
/// Furthermore, because there is a need to disambiguate, more checks are performed in this method
/// than in .
///
- public static bool IsPossibleTypeClause(ISyntaxToken syntaxToken, CSharpCompilationUnit compilationUnit)
+ public static bool IsPossibleTypeClause(ISyntaxToken syntaxToken, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
return false;
}
- public static TypeClauseNode MatchTypeClause(CSharpCompilationUnit compilationUnit)
+ public static TypeClauseNode MatchTypeClause(CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- if (ParseOthers.TryParseExpression(SyntaxKind.TypeClauseNode, compilationUnit, out var expressionNode))
+ if (ParseOthers.TryParseExpression(SyntaxKind.TypeClauseNode, compilationUnit, ref parserModel, out var expressionNode))
{
return (TypeClauseNode)expressionNode;
}
else
{
- var syntaxToken = (IdentifierToken)compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.IdentifierToken);
+ var syntaxToken = (IdentifierToken)parserModel.TokenWalker.Match(SyntaxKind.IdentifierToken);
return new TypeClauseNode(
syntaxToken,
@@ -112,15 +115,15 @@ public static TypeClauseNode MatchTypeClause(CSharpCompilationUnit compilationUn
/*ISyntaxToken syntaxToken;
- if (UtilityApi.IsKeywordSyntaxKind(compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind) &&
- (UtilityApi.IsTypeIdentifierKeywordSyntaxKind(compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind) ||
- UtilityApi.IsVarContextualKeyword(compilationUnit, compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind)))
+ if (UtilityApi.IsKeywordSyntaxKind(parserModel.TokenWalker.Current.SyntaxKind) &&
+ (UtilityApi.IsTypeIdentifierKeywordSyntaxKind(parserModel.TokenWalker.Current.SyntaxKind) ||
+ UtilityApi.IsVarContextualKeyword(compilationUnit, parserModel.TokenWalker.Current.SyntaxKind)))
{
- syntaxToken = compilationUnit.ParserModel.TokenWalker.Consume();
+ syntaxToken = parserModel.TokenWalker.Consume();
}
else
{
- syntaxToken = compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.IdentifierToken);
+ syntaxToken = parserModel.TokenWalker.Match(SyntaxKind.IdentifierToken);
}
var typeClauseNode = new TypeClauseNode(
@@ -128,9 +131,9 @@ public static TypeClauseNode MatchTypeClause(CSharpCompilationUnit compilationUn
null,
null);
- compilationUnit.ParserModel.Binder.BindTypeClauseNode(typeClauseNode, compilationUnit);
+ parserModel.Binder.BindTypeClauseNode(typeClauseNode, compilationUnit);
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenAngleBracketToken)
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenAngleBracketToken)
{
var genericParametersListingNode = (GenericParametersListingNode)ParseOthers.Force_ParseExpression(
SyntaxKind.GenericParametersListingNode,
@@ -139,16 +142,16 @@ public static TypeClauseNode MatchTypeClause(CSharpCompilationUnit compilationUn
typeClauseNode.SetGenericParametersListingNode(genericParametersListingNode);
}
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.QuestionMarkToken)
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.QuestionMarkToken)
{
typeClauseNode.HasQuestionMark = true;
- _ = compilationUnit.ParserModel.TokenWalker.Consume();
+ _ = parserModel.TokenWalker.Consume();
}
- while (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenSquareBracketToken)
+ while (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenSquareBracketToken)
{
- var openSquareBracketToken = compilationUnit.ParserModel.TokenWalker.Consume();
- var closeSquareBracketToken = compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.CloseSquareBracketToken);
+ var openSquareBracketToken = parserModel.TokenWalker.Consume();
+ var closeSquareBracketToken = parserModel.TokenWalker.Match(SyntaxKind.CloseSquareBracketToken);
var arraySyntaxTokenTextSpan = syntaxToken.TextSpan with
{
@@ -184,7 +187,8 @@ public static TypeClauseNode MatchTypeClause(CSharpCompilationUnit compilationUn
public static void HandlePrimaryConstructorDefinition(
TypeDefinitionNode typeDefinitionNode,
OpenParenthesisToken consumedOpenParenthesisToken,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
}
}
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseVariables.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseVariables.cs
index 9caf6e509..ddea2d038 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseVariables.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/ParseVariables.cs
@@ -13,7 +13,8 @@ public static class ParseVariables
{
public static void HandleVariableReference(
IdentifierToken consumedIdentifierToken,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
}
@@ -22,7 +23,8 @@ public static void HandleVariableReference(
TypeClauseNode consumedTypeClauseNode,
IdentifierToken consumedIdentifierToken,
VariableKind variableKind,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
IVariableDeclarationNode variableDeclarationNode;
@@ -33,7 +35,7 @@ public static void HandleVariableReference(
false);
compilationUnit.Binder.BindVariableDeclarationNode(variableDeclarationNode, compilationUnit);
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.ChildList.Add(variableDeclarationNode);
+ parserModel.CurrentCodeBlockBuilder.ChildList.Add(variableDeclarationNode);
return variableDeclarationNode;
}
@@ -44,36 +46,40 @@ public static void HandleVariableDeclarationStatement(
TypeClauseNode consumedTypeClauseNode,
IdentifierToken consumedIdentifierToken,
VariableKind variableKind,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
var variableDeclarationNode = HandleVariableDeclarationExpression(
consumedTypeClauseNode,
consumedIdentifierToken,
variableKind,
- compilationUnit);
+ compilationUnit,
+ ref parserModel);
if (variableDeclarationNode is null)
return;
// if (variableKind == VariableKind.Local || variableKind == VariableKind.Closure)
- if (compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.EqualsToken)
+ if (parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.EqualsToken)
{
- if (compilationUnit.ParserModel.TokenWalker.Peek(1).SyntaxKind == SyntaxKind.CloseAngleBracketToken)
+ if (parserModel.TokenWalker.Peek(1).SyntaxKind == SyntaxKind.CloseAngleBracketToken)
{
HandlePropertyExpression(
variableDeclarationNode,
- (EqualsToken)compilationUnit.ParserModel.TokenWalker.Consume(),
- (CloseAngleBracketToken)compilationUnit.ParserModel.TokenWalker.Consume(),
- compilationUnit);
+ (EqualsToken)parserModel.TokenWalker.Consume(),
+ (CloseAngleBracketToken)parserModel.TokenWalker.Consume(),
+ compilationUnit,
+ ref parserModel);
}
else
{
// Variable initialization occurs here.
HandleVariableAssignment(
consumedIdentifierToken,
- (EqualsToken)compilationUnit.ParserModel.TokenWalker.Consume(),
- compilationUnit);
+ (EqualsToken)parserModel.TokenWalker.Consume(),
+ compilationUnit,
+ ref parserModel);
}
}
else
@@ -81,29 +87,31 @@ public static void HandleVariableDeclarationStatement(
if (variableDeclarationNode.TypeClauseNode.TypeIdentifierToken.SyntaxKind ==
SyntaxKind.VarTokenContextualKeyword)
{
- compilationUnit.ParserModel.DiagnosticBag.ReportImplicitlyTypedVariablesMustBeInitialized(
+ parserModel.DiagnosticBag.ReportImplicitlyTypedVariablesMustBeInitialized(
consumedIdentifierToken.TextSpan);
}
}
if (variableKind == VariableKind.Property &&
- compilationUnit.ParserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenBraceToken)
+ parserModel.TokenWalker.Current.SyntaxKind == SyntaxKind.OpenBraceToken)
{
HandlePropertyDeclaration(
variableDeclarationNode,
- (OpenBraceToken)compilationUnit.ParserModel.TokenWalker.Consume(),
- compilationUnit);
+ (OpenBraceToken)parserModel.TokenWalker.Consume(),
+ compilationUnit,
+ ref parserModel);
}
else
{
- _ = compilationUnit.ParserModel.TokenWalker.Match(SyntaxKind.StatementDelimiterToken);
+ _ = parserModel.TokenWalker.Match(SyntaxKind.StatementDelimiterToken);
}
}
public static void HandlePropertyDeclaration(
IVariableDeclarationNode consumedVariableDeclarationNode,
OpenBraceToken consumedOpenBraceToken,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
}
@@ -111,14 +119,16 @@ public static void HandlePropertyExpression(
IVariableDeclarationNode consumedVariableDeclarationNode,
EqualsToken consumedEqualsToken,
CloseAngleBracketToken consumedCloseAngleBracketToken,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
}
public static void HandleVariableAssignment(
IdentifierToken consumedIdentifierToken,
EqualsToken consumedEqualsToken,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
}
}
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/TokenWalkerExtensionMethods.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/TokenWalkerExtensionMethods.cs
index 9bd8196d5..4d7a5d072 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/TokenWalkerExtensionMethods.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/TokenWalkerExtensionMethods.cs
@@ -8,25 +8,26 @@ namespace Luthetus.CompilerServices.CSharp.ParserCase.Internals;
internal static class TokenWalkerExtensionMethods
{
- public static TypeClauseNode MatchTypeClauseNode(this TokenWalker tokenWalker, CSharpCompilationUnit compilationUnit)
+ public static TypeClauseNode MatchTypeClauseNode(this TokenWalker tokenWalker, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
- return ParseTypes.MatchTypeClause(compilationUnit);
+ return ParseTypes.MatchTypeClause(compilationUnit, ref parserModel);
}
public static void DeferParsingOfChildScope(
this TokenWalker tokenWalker,
OpenBraceToken consumedOpenBraceToken,
- CSharpCompilationUnit compilationUnit)
+ CSharpCompilationUnit compilationUnit,
+ ref CSharpParserModel parserModel)
{
// Pop off the 'TypeDefinitionNode', then push it back on when later dequeued.
- var pendingCodeBlockOwner = compilationUnit.ParserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner;
+ var pendingCodeBlockOwner = parserModel.CurrentCodeBlockBuilder.InnerPendingCodeBlockOwner;
var openTokenIndex = tokenWalker.Index - 1;
var openBraceCounter = 1;
#if DEBUG
- compilationUnit.ParserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = true;
+ parserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = true;
#endif
while (true)
@@ -51,10 +52,10 @@ public static void DeferParsingOfChildScope(
var closeBraceToken = (CloseBraceToken)tokenWalker.Match(SyntaxKind.CloseBraceToken);
#if DEBUG
- compilationUnit.ParserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = false;
+ parserModel.TokenWalker.SuppressProtectedSyntaxKindConsumption = false;
#endif
- compilationUnit.ParserModel.CurrentCodeBlockBuilder.ParseChildScopeQueue.Enqueue(new CSharpDeferredChildScope(
+ parserModel.CurrentCodeBlockBuilder.ParseChildScopeQueue.Enqueue(new CSharpDeferredChildScope(
openTokenIndex,
closeTokenIndex,
pendingCodeBlockOwner));
diff --git a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/UtilityApi.cs b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/UtilityApi.cs
index 632249675..a06d47b62 100644
--- a/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/UtilityApi.cs
+++ b/Source/Lib/CompilerServices/CSharp/ParserCase/Internals/UtilityApi.cs
@@ -188,7 +188,7 @@ public static bool IsConvertibleToTypeClauseNode(SyntaxKind syntaxKind)
IsContextualKeywordSyntaxKind(syntaxKind);
}
- public static TypeClauseNode ConvertToTypeClauseNode(ISyntax syntax, CSharpCompilationUnit compilationUnit)
+ public static TypeClauseNode ConvertToTypeClauseNode(ISyntax syntax, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
if (syntax.SyntaxKind == SyntaxKind.TypeClauseNode)
{
@@ -217,11 +217,11 @@ public static TypeClauseNode ConvertToTypeClauseNode(ISyntax syntax, CSharpCompi
}
else
{
- // 'compilationUnit.ParserModel.TokenWalker.Current.TextSpan' isn't necessarily the syntax passed to this method.
+ // 'parserModel.TokenWalker.Current.TextSpan' isn't necessarily the syntax passed to this method.
// TODO: But getting a TextSpan from a general type such as 'ISyntax' is a pain.
//
- compilationUnit.ParserModel.DiagnosticBag.ReportTodoException(
- compilationUnit.ParserModel.TokenWalker.Current.TextSpan,
+ parserModel.DiagnosticBag.ReportTodoException(
+ parserModel.TokenWalker.Current.TextSpan,
$"The {nameof(SyntaxKind)}: {syntax.SyntaxKind}, is not convertible to a {nameof(TypeClauseNode)}. Invoke {nameof(IsConvertibleToTypeClauseNode)} and check the result, before invoking {nameof(ConvertToTypeClauseNode)}.");
// TODO: Returning null when it can't be converted is a bad idea (the method return isn't documented as nullable).
@@ -235,7 +235,7 @@ public static bool IsConvertibleToIdentifierToken(SyntaxKind syntaxKind)
IsContextualKeywordSyntaxKind(syntaxKind);
}
- public static IdentifierToken ConvertToIdentifierToken(ISyntax syntax, CSharpCompilationUnit compilationUnit)
+ public static IdentifierToken ConvertToIdentifierToken(ISyntax syntax, CSharpCompilationUnit compilationUnit, ref CSharpParserModel parserModel)
{
if (syntax.SyntaxKind == SyntaxKind.IdentifierToken)
{
@@ -248,11 +248,11 @@ public static IdentifierToken ConvertToIdentifierToken(ISyntax syntax, CSharpCom
}
else
{
- // 'compilationUnit.ParserModel.TokenWalker.Current.TextSpan' isn't necessarily the syntax passed to this method.
+ // 'parserModel.TokenWalker.Current.TextSpan' isn't necessarily the syntax passed to this method.
// TODO: But getting a TextSpan from a general type such as 'ISyntax' is a pain.
//
- compilationUnit.ParserModel.DiagnosticBag.ReportTodoException(
- compilationUnit.ParserModel.TokenWalker.Current.TextSpan,
+ parserModel.DiagnosticBag.ReportTodoException(
+ parserModel.TokenWalker.Current.TextSpan,
$"The {nameof(SyntaxKind)}: {syntax.SyntaxKind}, is not convertible to a {nameof(IdentifierToken)}. Invoke {nameof(IsConvertibleToIdentifierToken)} and check the result, before invoking {nameof(ConvertToIdentifierToken)}.");
// TODO: Returning default when it can't be converted might be a fine idea? It isn't as bad as returning null.
diff --git a/Source/Lib/CompilerServices/Razor/RazorSyntaxTree.cs b/Source/Lib/CompilerServices/Razor/RazorSyntaxTree.cs
index f839c1bcf..f85586e44 100644
--- a/Source/Lib/CompilerServices/Razor/RazorSyntaxTree.cs
+++ b/Source/Lib/CompilerServices/Razor/RazorSyntaxTree.cs
@@ -111,8 +111,7 @@ public void ParseCodebehind()
compilationUnit.BinderSession = (CSharpBinderSession)compilationUnit.Binder.StartBinderSession(_codebehindResourceUri);
- var parser = new CSharpParser();
- parser.Parse(compilationUnit);
+ CSharpParser.Parse(compilationUnit);
SemanticResultRazor = new SemanticResultRazor(
compilationUnit,
From 08c3b2fed6fb9d3748d71049b417e39151961878 Mon Sep 17 00:00:00 2001
From: Luthetus <45454132+huntercfreeman@users.noreply.github.com>
Date: Sat, 14 Dec 2024 21:27:12 -0500
Subject: [PATCH 5/7] Update: README.md
---
Images/Ide/Gifs/parseSolutionWideUpdated.gif | Bin 0 -> 500743 bytes
README.md | 7 +++++--
2 files changed, 5 insertions(+), 2 deletions(-)
create mode 100644 Images/Ide/Gifs/parseSolutionWideUpdated.gif
diff --git a/Images/Ide/Gifs/parseSolutionWideUpdated.gif b/Images/Ide/Gifs/parseSolutionWideUpdated.gif
new file mode 100644
index 0000000000000000000000000000000000000000..43a818a3ed32d8abff10ded33a5818ef0fbddee2
GIT binary patch
literal 500743
zcmeF&Wl)r4%UcZpGc*o#5_n2?@b11PJa@tT^G#
z|GuARXLp`=_uYB->mGCD%z0gNO+I8MnanSVto&zTk?%~HMCk5lXzw2JR6c2He0;C^
ziIsT*{3EYv+a>W22uWu;XAzrw=C#>&qAzgad8j{nVmQB#|mnwtB+nVW+x
zz!#TSmRHwT);3qxxBhSc{S2&bY^`o=|DSYiV|#6LXJc!3YiECV{}3CAwuVC~SDV)t
zi2aJyaJV*qAe4wsAxo~VU?`G|&vI$Ft`HPU^D%-_zP<>Y$gELr2(B+4N#*_l$&zm<
z8O@}7wYvmvC>_t04#a({&$g5$W~}7pRLesuv~^TRm|5I4@A6G
zY_42ru$V6YI?`NaP#3xmkq9cNUhZ%|-(QZrs#@vse}+e;)LOeX5cZ1A2-;e=0g9tj
z%%OCyHtbI0GcSR*HSCP%eT<}1Zg1S1253|m`M?|vM{9q~|5Wa1K3Z&bIzWtewES7=
z_30>K>kwX99ZqEXHrCm8zB5s%m>c8LdV1hdX0L=#!)|4U4>tXaM7VF_~kL!Fh=H}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