public static TimespanToken Parse(TimeSpan timespan, string rawToken, SourcePosition position, IConfiguration configuration) => new TimespanToken(timespan, rawToken, position);
private TimespanToken(TimeSpan typedValue, string rawToken, SourcePosition position) : base(LiteralTokenType.Timespan, typedValue, rawToken, position) { }
private FunctionToken(string name, string rawToken, SourcePosition position) : base(rawToken, position) { Name = name; }
public static FunctionToken Parse(string name, List <IToken> parameters, SourcePosition position) { var rawToken = $"{name}({(string.Join(", ", parameters.Select(p => p.RawToken)))})"; return(new FunctionToken(name, rawToken, position).Tap(ft => ft.Parameters.AddRange(parameters))); }
public static TimeToken Parse(string value, SourcePosition position, IConfiguration configuration) => TimeSpan.TryParse(value, out TimeSpan time) ? new TimeToken(time, value, position, configuration) : throw new ParseException($"Invalid time format '{value}'");