Single-Line Value Lists
Single-line values can always be combined into a list using a comma (,
) as a separator.
sl_value_or_list ::= sl_value (sl_list_separator sl_value)+
sl_list_separator ::= spacing COMMA spacing
value
value , value
value , value , value , value , ...
In the EBNF syntax above, the symbol
sl_value
is described in Named Values.The symbol
spacing
is described in Spacing.
Single-Line Value List Rules
Commas Form a List: Values separated by commas (
,
) form a value list.[main] value list: 1, 2, 3, 4, 5
Spacing Around Separator: Optional spacing is allowed before and after the comma.
[main] value list 1: 7 , 1 , 9 value list 2: 105 , 722 , 817
No Prefixing/Trailing Comma: A value list must not start or end with a comma.
[main] value list 1: ,1 , 2 # ERROR! Value list must not start with comma value list 2: 1, 2, # ERROR! Value list must not end with comma.
No Consecutive Commas: Consecutive commas, with no value between them, are not allowed.
[main] value list: 1, , 2 # ERROR! Consecutive commas are not allowed.
No Multi-line Values: Multi-line values are not allowed in single-line value lists.
[main] value list: """ text """, """ # ERROR! Multi-line values are not allowed in lists. text """
Example
[main]
first list: 1, 2, 3, 4 # Value lists are created by separating values with commas.
second list: 1 , 2 , 3 # Spacing is allowed around the comma.
Features
Feature |
Coverage |
---|---|
value-list |
The syntax outlined in this chapter is part of the standard feature value lists. |
Errors
Error Code |
Causes |
---|---|
Syntax |
Raised if a single line value list contains a multi-line value, such as multi-line text.
Raised if a value list contains prefixed, trailing, or consecutive commas.
|