Class ParserRawNamedArgumentSplitter
Provides syntactic top-level splitting of raw rule-call argument text into named key–value pairs,
supporting forms such as value: 42 and value = 42.
Splitting is purely syntactic: no value is evaluated, no parameter is bound.
public static class ParserRawNamedArgumentSplitter
- Inheritance
-
ParserRawNamedArgumentSplitter
- Inherited Members
Methods
SplitNamedTopLevel(string, ParserRawNamedArgumentSeparatorMode)
Splits raw rule-call argument text into a name–value dictionary at top-level separators.
public static IReadOnlyDictionary<string, string> SplitNamedTopLevel(string rawArguments, ParserRawNamedArgumentSeparatorMode separatorMode = ParserRawNamedArgumentSeparatorMode.ColonOrEquals)
Parameters
rawArgumentsstringRaw argument text without outer delimiters, as stored in RawArguments.
separatorModeParserRawNamedArgumentSeparatorModeWhich separator characters to recognise. Defaults to ColonOrEquals.
Returns
- IReadOnlyDictionary<string, string>
A dictionary mapping trimmed argument names to trimmed raw value text. Returns an empty dictionary when
rawArgumentsis empty or whitespace-only. When the same name appears more than once, the last entry wins.
Remarks
Uses SplitTopLevel(string) to split on top-level commas first, so commas inside nested expressions or quoted strings are correctly ignored.
Separators (: or =) inside nested parentheses, brackets, braces, or quoted strings
are not treated as the key–value separator.
No value is evaluated and no type is inferred. "hello" stays as "hello" in the output.
Exceptions
- ArgumentNullException
Thrown when
rawArgumentsisnull.- FormatException
Thrown when any top-level slice has no separator, or when a separator is found but the key is empty.