public override CsvNode VisitRow(CsvParser.RowContext context) { var textRange = context.CreateTextRange(_textDocument); var fields = context.field().AcceptAll(this).OfType <FieldDeclarationSyntax>(); var commas = context.COMMA() .Select(comma => comma.CreateTextRange(_textDocument)) .Select(CsvTokens.Comma) .ToArray(); return(TreeFactory.Row(textRange, commas, fields)); }
public override CsvSyntaxTreeBuilder VisitRow(CsvParser.RowContext context) { var textRange = context.CreateTextRange(_textDocument); _treeFactory.CreateRow(textRange); foreach (var field in context.field()) { field.Accept(this); } foreach (var comma in context.COMMA()) { var range = comma.CreateTextRange(_textDocument); _treeFactory.CreateComma(range); } return(this); }