private string FormatExpression(IFilterTree tree) { if (TokenMappings.IsLogicalOperation(tree.Token)) { return(FormatLogicalExpression(tree)); } if (TokenMappings.IsComparisonOperation(tree.Token)) { return(FormatComparisonExpression(tree)); } throw new FormaterException($"Encountered unexpected node of type {tree.Token.Type}."); }