Improve XML documentation coverage across src modules and sync generated analysis artifacts.
This commit is contained in:
@@ -36,6 +36,13 @@ public sealed class PedanticToken
|
||||
private readonly bool _usedVariable;
|
||||
private readonly string _sourceFile;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a parser token wrapper that preserves resolved value and source metadata.
|
||||
/// </summary>
|
||||
/// <param name="item">Raw lexer token captured from the configuration source.</param>
|
||||
/// <param name="value">Optional parsed value override when token text has been normalized.</param>
|
||||
/// <param name="usedVariable">Indicates whether this token originated from variable substitution.</param>
|
||||
/// <param name="sourceFile">Source file path associated with this token, when available.</param>
|
||||
public PedanticToken(Token item, object? value = null, bool usedVariable = false, string sourceFile = "")
|
||||
{
|
||||
_item = item;
|
||||
@@ -44,15 +51,33 @@ public sealed class PedanticToken
|
||||
_sourceFile = sourceFile ?? string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Serializes the token value into JSON, matching Go parser diagnostics formatting.
|
||||
/// </summary>
|
||||
public string MarshalJson() => JsonSerializer.Serialize(Value());
|
||||
|
||||
/// <summary>
|
||||
/// Returns the resolved token value, or raw token text when no typed value is stored.
|
||||
/// </summary>
|
||||
public object? Value() => _value ?? _item.Value;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the 1-based source line where the token was parsed.
|
||||
/// </summary>
|
||||
public int Line() => _item.Line;
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether variable interpolation contributed to this token.
|
||||
/// </summary>
|
||||
public bool IsUsedVariable() => _usedVariable;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the source file path associated with this token.
|
||||
/// </summary>
|
||||
public string SourceFile() => _sourceFile;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the 1-based character position of the token on its source line.
|
||||
/// </summary>
|
||||
public int Position() => _item.Position;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user