remove read only stuff

This commit is contained in:
nub31
2025-09-12 17:08:10 +02:00
parent fcccf0d51e
commit 51ca1b9211
15 changed files with 41 additions and 42 deletions

View File

@@ -8,19 +8,19 @@ namespace NubLang.Parsing;
public sealed class Parser
{
private readonly List<Diagnostic> _diagnostics = [];
private IReadOnlyList<Token> _tokens = [];
private List<Token> _tokens = [];
private int _tokenIndex;
private string _moduleName = string.Empty;
private Token? CurrentToken => _tokenIndex < _tokens.Count ? _tokens[_tokenIndex] : null;
private bool HasToken => CurrentToken != null;
public IReadOnlyList<Diagnostic> GetDiagnostics()
public List<Diagnostic> GetDiagnostics()
{
return _diagnostics;
}
public SyntaxTree Parse(IReadOnlyList<Token> tokens)
public SyntaxTree Parse(List<Token> tokens)
{
_diagnostics.Clear();
_tokens = tokens;