This commit is contained in:
nub31
2025-06-01 00:40:25 +02:00
parent 795b69df1b
commit 3b06f19468
12 changed files with 192 additions and 39 deletions

View File

@@ -245,10 +245,10 @@ public class Lexer
private SourceLocation CreateLocation(int index)
{
var line = 1;
var column = 0;
var column = 1;
for (var i = 0; i < index; i++)
{
if (_sourceText.Text[i] == '\n')
if (_sourceText.Content[i] == '\n')
{
column = 1;
line += 1;
@@ -269,9 +269,9 @@ public class Lexer
private Optional<char> Peek(int offset = 0)
{
if (_index + offset < _sourceText.Text.Length)
if (_index + offset < _sourceText.Content.Length)
{
return _sourceText.Text[_index + offset];
return _sourceText.Content[_index + offset];
}
return Optional<char>.Empty();