public static string[] Process(string text, Func<string, string> variables, bool preserveSurroundingQuotes) { var grammer = new CommandGrammar(variables, preserveSurroundingQuotes); var cursor = new Cursor(text, 0, text.Length); var result = grammer.Parse(cursor); if (!result.Remainder.IsEnd) { throw new Exception("TODO: malformed command text"); } return result.Value.ToArray(); }
public static string[] Process(string text, Func <string, string> variables, bool preserveSurroundingQuotes) { var grammer = new CommandGrammar(variables, preserveSurroundingQuotes); var cursor = new Cursor(text, 0, text.Length); var result = grammer.Parse(cursor); if (!result.Remainder.IsEnd) { throw new Exception("TODO: malformed command text"); } return(result.Value.ToArray()); }