Arguments

References
public sealed class Arguments : IEnumerable<Argument>
The arguments inside a bracketed list, each given either by position or by name.

Arguments are separated by top level commas, or, when there are none, by whitespace, so that "rgb(1, 0.5, 0)" and "rgb(1 0.5 0)" agree. An argument is named when a word is followed by a colon; a number before a colon is left alone, which is what keeps "13:45" a time rather than an argument called thirteen.

Properties

AllNamed

#
public bool AllNamed { get; }
Gets whether every argument was given by name.

AllPositional

#
public bool AllPositional { get; }
Gets whether every argument was given by position.

Count

#
public int Count { get; }
Gets the number of arguments.

Indexers

this[]

#
public Argument this[int index] { get; }
index (int)

Methods

Create

#
public static Arguments Create(Fragments interior)
Cut the interior of a bracketed list into its arguments.
interior (Fragments)Fragments between the brackets.

GetEnumerator

#
public IEnumerator<Argument> GetEnumerator()
Explicit

IEnumerable.GetEnumerator

#
IEnumerator IEnumerable.GetEnumerator()

ToString

#
public override string ToString()
Object.ToString

TryBind

#
public bool TryBind(ArgumentSyntax[] syntax, out Argument[] bound, out string failure, out Fragment at)
Match these arguments against a signature, yielding the value for each entry in it, or null where nothing was supplied.

Positional arguments fill the signature from the left, named ones fill by name wherever they appear, and a positional argument may not follow a named one; "point(x: 1, 2)" says nothing about which slot the two belongs to.

syntax (ArgumentSyntax[])Description of each argument the notation accepts.
bound (out Argument[])Argument for each entry, or null where absent.
failure (out string)Description of the mismatch, if there was one.
at (out Fragment)Fragment to blame for the mismatch.