Example #1
0
 /// <summary>
 /// Gets the boundary production function as determined by a style
 /// </summary>
 /// <param name="style">The tuple representation style</param>
 /// <returns></returns>
 internal static Func<string, string> boundaryFn(TupleFormatStyle style)
     => style == TupleFormatStyle.List ? new Func<string, string>(bracket)
     : style == TupleFormatStyle.Record ? new Func<string, string>(embrace)
     : new Func<string, string>(paren);
Example #2
0
 static char rightBoundary(TupleFormatStyle style)
     => (style == TupleFormatStyle.Coordinate ? rparen()
     : style == TupleFormatStyle.List ? rbracket()
     : style == TupleFormatStyle.Record ? rbrace()
     : rparen())[0];
Example #3
0
 static char[] bounds(TupleFormatStyle style)
     => array(leftBoundary(style), rightBoundary(style));
Example #4
0
 static char leftBoundary(TupleFormatStyle style)
     => (style == TupleFormatStyle.Coordinate ? lparen()
     : style == TupleFormatStyle.List ? lbracket()
     : style == TupleFormatStyle.Record ? lbrace()
     : lparen())[0];