Source/Parser/DiceExpressionParser.cs
/// <summary>
/// Parses an expression string, and returns a <see cref="DiceExpression"/> if it's valid
/// </summary>
/// <param name="expression">The expression string to parse</param>
/// <returns>The expression in parsed form</returns>
/// <exception cref="Exceptions.DiceExpressionParseException">When parsing fails</exception>
Parses an expression string, and returns a  if it's valid
Parses an expression string and returns a if it ' s valid
public DiceExpression Parse(string expression)
		{
			if (TryParse(expression, out DiceExpression? result, out string? error, out Position errorPosition))
			{
				return result;
			}
			throw new Exceptions.DiceExpressionParseException($"{errorPosition}: {error}");
		}
public DiceExpression Parse ( string expression ) { if ( TryParse ( expression , out DiceExpression ? result , out string ? error , out Position errorPosition ) ) { return result ; } throw new Exceptions . DiceExpressionParseException ( $" { errorPosition } :  { error } " ) ; }
Parses an expression string, and returns a  if it's valid
Parses an expression string and returns a if it ' s valid
The expression in parsed form
The expression in parsed form
When parsing fails
When parsing fails
expression
string
The expression string to parse
The expression string to parse