Child pages
  • RuleExpression.Optional

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Code Block
| 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:

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

See also

RuleExpression