Class SourceLocation
Represents a technical point in a source text for lexer, parser, and runtime operations.
public sealed record SourceLocation : IEquatable<SourceLocation>
- Inheritance
-
SourceLocation
- Implements
- Inherited Members
- Extension Methods
Remarks
SourceLocation is a runtime/source-buffer coordinate contract. It is not equivalent to SourceCodeLocation, which intentionally carries no absolute source offset and requires a file path for diagnostic or tooling display.
Constructors
SourceLocation(string?, int, int, int)
Represents a technical point in a source text for lexer, parser, and runtime operations.
public SourceLocation(string? FilePath, int Line, int Column, int Position)
Parameters
FilePathstringOptional path of the source file containing the location, or null for anonymous or in-memory source text.
Lineint1-based human-readable line number associated with the same point, when display coordinates are available.
Columnint1-based human-readable column number associated with the same point, when display coordinates are available.
PositionintZero-based absolute offset from the start of the source text.
Remarks
SourceLocation is a runtime/source-buffer coordinate contract. It is not equivalent to SourceCodeLocation, which intentionally carries no absolute source offset and requires a file path for diagnostic or tooling display.
Properties
Column
1-based human-readable column number associated with the same point, when display coordinates are available.
public int Column { get; init; }
Property Value
FilePath
Optional path of the source file containing the location, or null for anonymous or in-memory source text.
public string? FilePath { get; init; }
Property Value
Line
1-based human-readable line number associated with the same point, when display coordinates are available.
public int Line { get; init; }
Property Value
Position
Zero-based absolute offset from the start of the source text.
public int Position { get; init; }