private bool TryHandler (string match, ExpressionHandler handler, ref string expression, out object result) { int len; if (!MatchExpression (match, expression, out len)) { result = null; return false; } expression = expression.Substring (len).TrimStart (); if (expression.Length == 0) throw new Exception ("Expression did not end in '}'"); result = handler (ref expression); return true; }