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

Simplify inline-table ABNF definition #557

Merged
merged 1 commit into from Sep 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions toml.abnf
Expand Up @@ -212,14 +212,13 @@ std-table-close = ws %x5D ; ] Right square bracket

;; Inline Table

inline-table = inline-table-open inline-table-keyvals inline-table-close
inline-table = inline-table-open [ inline-table-keyvals ] inline-table-close

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change means that at least one key/value pair is required - the old way of expressing it allowed for "empty" tables.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bitwalker New way allows tables that do not have inline-table-keyvals at all. Is it not the same as "empty tables"?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yep, you're right, I was looking at the old definitions of inline-table-* and forgot about the [] around inline-table-keyvals up here.


inline-table-open = %x7B ws ; {
inline-table-close = ws %x7D ; }
inline-table-sep = ws %x2C ws ; , Comma

inline-table-keyvals = [ inline-table-keyvals-non-empty ]
inline-table-keyvals-non-empty = key keyval-sep val [ inline-table-sep inline-table-keyvals-non-empty ]
inline-table-keyvals = key keyval-sep val [ inline-table-sep inline-table-keyvals ]

;; Array Table

Expand Down