Child pages
  • RuleExpression.ZeroOrManyWithHangingSeparator

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Code Block
| ZeroOrManyWithHangingSeparator = "(" RuleExpression ";" Separator ";" "?" ")" "*"

RuleExpression.ZeroOrManyWithHangingSeparator is the same as ZeroOrManyWithSeparator, except that it allows for a hanging separator – a separator located at the end of the list (not followed by an element).

For example:

Code Block
syntax EnumMemberDeclarations = (EnumMemberDeclaration; ","; ?)*;

This example parses code such as:

Code Block
UriEscaped = 1,
Unescaped,
SafeUnescaped,

or:

Code Block
UriEscaped = 1,
Unescaped,
SafeUnescaped

that is the code either with a comma at the end of the list or without it.

Using the ZeroOrManyWithSeparator rule would prohibit a comma at the end of the list.

See also

RuleExpression
RuleExpression.ZeroOrMany
RuleExpression.OneOrMany
RuleExpression.ZeroOrManyWithSeparator
RuleExpression.OneOrManyWithSeparator
RuleExpression.OneOrManyWithHangingSeparator