public CommandSyntaxParsingResult( CommandSyntax commandSyntax, MatchingParameters matchingParameters, List <ParseError> parseErrors ) { CommandSyntax = commandSyntax; MatchingParameters = matchingParameters; ParseErrors = parseErrors; }
public (ParseError parseError, ParameterSyntax parameterSyntax) MatchSegment( StringComparison syntaxMatchingRule, MatchingParameters matchingParameters, StringSegment segment, int position, int index, StringSegment[] rightSegments, StringSegment[] segments) { var cs = CommandSpecification; var csp = CommandParameterSpecification; if (matchingParameters.Contains(csp.ParameterName)) { if (position > 0) { var leftSegments = segments[0..(position - 1)];
Match( CommandEvaluationContext context, StringComparison syntaxMatchingRule, //string[] segments, StringSegment[] segments, int firstIndex = 0) { var matchingParameters = new MatchingParameters(); if (segments.Length < MinAttemptedSegments) { return(matchingParameters, new List <ParseError> { new ParseError( $"missing parameter(s). minimum attempted is {MinAttemptedSegments}, founded {segments.Length}", 0, firstIndex, CommandSpecification, AttemptedParameters(0) ) });