Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposed easier way to add DateTime to SyntaxList #4

Merged
merged 3 commits into from
Mar 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/Tomlyn/Syntax/SyntaxNodeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,19 @@ public static void Add(this SyntaxList<KeyValueSyntax> list, string name, int[]
if (list == null) throw new ArgumentNullException(nameof(list));
list.Add(new KeyValueSyntax(name, new ArraySyntax(values)));
}

public static void Add(this SyntaxList<KeyValueSyntax> list, string name, string[] values)
{
if (list == null) throw new ArgumentNullException(nameof(list));
list.Add(new KeyValueSyntax(name, new ArraySyntax(values)));
}

public static void Add(this SyntaxList<KeyValueSyntax> list, string name, DateTimeValueSyntax value)
Sparkrai marked this conversation as resolved.
Show resolved Hide resolved
{
if (list == null) throw new ArgumentNullException(nameof(list));
list.Add(new KeyValueSyntax(name, value));
}

public static KeyValueSyntax AddComment(this KeyValueSyntax keyValue, string comment)
{
if (keyValue == null) throw new ArgumentNullException(nameof(keyValue));
Expand Down Expand Up @@ -96,4 +102,4 @@ public static T AddComment<T>(this T node, string comment) where T : SyntaxNode
return node;
}
}
}
}