| Optional = RuleExpression "?" precedence 30

RuleExpression.Optional parses an optional rule. When AST is formed, the result of this rule is placed in the option T wrapping type. If the RuleExpression subrule is successfully parsed, the resulting value will be placed in optionT. If the parsing fails, option.None will be returned, and T will be replaced with the type that matches the result of the RuleExpression subrule.

For example:

| If = "if" "(" BooleanExpression ")" IndentedEmbeddedStatement ("else" IndentedEmbeddedStatement)?;

See also