Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear whether multiple trailing commas are allowed in arrays #568

Closed
ghost opened this issue Oct 6, 2018 · 2 comments
Closed

Unclear whether multiple trailing commas are allowed in arrays #568

ghost opened this issue Oct 6, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Oct 6, 2018

It is not clear from the specification whether multiple trailing commas are allowed in array values.
For example:

a = [ 1, 2, , , , ] # is this allowed ?
b = [ , ] # or this ?

The ABNF definition forbids both cases, but the ABNF is currently not authoritative.

The section Array only states that "Terminating commas (also called trailing commas) are ok after the last value of the array.". This suggests that any number of trailing commas is fine.

@pradyunsg
Copy link
Member

pradyunsg commented Oct 9, 2018

# is this allowed ?

No.

# or this ?

No.

This suggests that any number of trailing commas is fine.

I disagree but I wouldn't mind changing the language there to use the singular form instead of plural form:

A terminating comma (also called trailing comma) is ok after the last value of the array.

@bitwalker
Copy link

I also don't see the current phrasing as ambiguous, but using the singular form is clearer, so probably worth changing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants