- Added derivation to `LineInfo`
This commit is contained in:
Tristan B. Velloza Kildaire 2024-04-02 19:27:58 +02:00
parent e74fdd3983
commit e87385c6f2
1 changed files with 9 additions and 0 deletions

View File

@ -7,6 +7,8 @@ import std.string : cmp, format;
import std.conv : to;
import tlang.compiler.reporting : Coords;
// TODO: Below could have linof?!?!?!
/**
* Defines a `Token` that a lexer
* would be able to produce
@ -117,4 +119,11 @@ public final class Token
{
return Coords(this.line, this.column);
}
// TODO: Switch to this
import tlang.compiler.reporting :LineInfo;
public LineInfo deriveLineInfo()
{
return LineInfo(getOrigin(), getCoords());
}
}