This commit is contained in:
nub31
2025-10-31 15:18:18 +01:00
parent 7c7624b1bc
commit 40d500fddd
8 changed files with 231 additions and 188 deletions

View File

@@ -11,14 +11,15 @@ public sealed class Parser
private Token? CurrentToken => _tokenIndex < _tokens.Count ? _tokens[_tokenIndex] : null;
private bool HasToken => CurrentToken != null;
public List<Diagnostic> Diagnostics { get; } = [];
public List<Diagnostic> Diagnostics { get; set; } = [];
public SyntaxTree Parse(List<Token> tokens)
{
Diagnostics.Clear();
_tokens = tokens;
_tokenIndex = 0;
Diagnostics = [];
var topLevelSyntaxNodes = new List<TopLevelSyntaxNode>();
while (HasToken)