namespace Core.Parsers.EventOccurrence;
///
/// Classifies lines to determine if they should be skipped during parsing.
///
public static class LineClassifier
{
///
/// Checks if a line is empty or contains only whitespace.
///
public static bool IsEmptyLine(string line)
{
return string.IsNullOrWhiteSpace(line);
}
///
/// Checks if a line is a comment (starts with "#").
///
public static bool IsCommentLine(string line)
{
return EventOccurrenceGrammar.IsCommentLine(line);
}
///
/// Determines if a line is a continuation/wrapped line that should be skipped.
/// These are typically lines that:
/// - Start with "*" (marks the start of a continuation block)
/// - Are parenthetical notes like "(Semifinalists only)"
///
public static bool IsContinuationLine(string line)
{
var trimmed = line.Trim();
// Check if line starts with "*" (marks continuation block start)
if (trimmed.StartsWith("*", StringComparison.Ordinal))
return true;
// Skip parenthetical notes
if (trimmed.StartsWith("(", StringComparison.Ordinal) && trimmed.EndsWith(")", StringComparison.Ordinal))
return true;
return false;
}
}