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

Fix grammar issues, add Comma production #1783

Merged
merged 1 commit into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/source-1.0/spec/core/idl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ string support defined in `RFC 5234 <https://www.rfc-editor.org/rfc/rfc7405>`_.
NodeValue :`NodeArray`
:/ `NodeObject`
:/ `Number`
:/ `NodeKeywords`
:/ `NodeKeyword`
:/ `NodeStringValue`
NodeArray :"[" [`WS`]
: [`NodeValue` [`WS`]
Expand All @@ -148,7 +148,7 @@ string support defined in `RFC 5234 <https://www.rfc-editor.org/rfc/rfc7405>`_.
Minus :%x2D ; -
Plus :%x2B ; +
Zero :%x30 ; 0
NodeKeywords :%s"true" / %s"false" / %s"null"
NodeKeyword :%s"true" / %s"false" / %s"null"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit, missing space to align the colon as the rest of the productions.

NodeStringValue :`ShapeId` / `TextBlock` / `QuotedText`
QuotedText :DQUOTE *`QuotedChar` DQUOTE
QuotedChar :%x20-21 ; space - "!"
Expand Down
25 changes: 13 additions & 12 deletions docs/source-2.0/spec/idl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ string support defined in :rfc:`7405`.
.. rubric:: Whitespace

.. productionlist:: smithy
WS :1*(`SP` / `NL` / `Comment` / ",") ; whitespace
WS :1*(`SP` / `NL` / `Comment` / `Comma`) ; whitespace
Comma:","
SP :1*(%x20 / %x09) ; one or more spaces or tabs
NL :%x0A / %x0D.0A ; Newline: \n and \r\n
NotNL:%x09 / %x20-10FFFF ; Any character except newline
Expand Down Expand Up @@ -129,7 +130,7 @@ string support defined in :rfc:`7405`.
NodeValue :`NodeArray`
:/ `NodeObject`
:/ `Number`
:/ `NodeKeywords`
:/ `NodeKeyword`
:/ `NodeStringValue`
NodeArray :"[" [`WS`] *(`NodeValue` [`WS`]) "]"
NodeObject :"{" [`WS`] [`NodeObjectKvp` *(`WS` `NodeObjectKvp`)] [`WS`] "}"
Expand All @@ -145,7 +146,7 @@ string support defined in :rfc:`7405`.
Minus :%x2D ; -
Plus :%x2B ; +
Zero :%x30 ; 0
NodeKeywords :%s"true" / %s"false" / %s"null"
NodeKeyword :%s"true" / %s"false" / %s"null"
NodeStringValue :`ShapeId` / `TextBlock` / `QuotedText`
QuotedText :DQUOTE *`QuotedChar` DQUOTE
QuotedChar :%x09 ; tab
Expand Down Expand Up @@ -175,7 +176,7 @@ string support defined in :rfc:`7405`.
ShapeOrApplyStatement :`ShapeStatement` / `ApplyStatement`
ShapeStatement :`TraitStatements` `ShapeBody`
ShapeBody :`SimpleShapeStatement`
:/ `EnumShapeStatement`
:/ `EnumStatement`
:/ `ListStatement`
:/ `MapStatement`
:/ `StructureStatement`
Expand All @@ -188,11 +189,11 @@ string support defined in :rfc:`7405`.
:/ %s"byte" / %s"short" / %s"integer" / %s"long"
:/ %s"float" / %s"double" / %s"bigInteger"
:/ %s"bigDecimal" / %s"timestamp"
Mixins :[`SP`] %s"with" [`WS`] "[" 1*([`WS`] `ShapeId`) [`WS`] "]"
EnumShapeStatement :`EnumTypeName` `SP` `Identifier` [`Mixins`] [`WS`] `EnumShapeMembers`
Mixins :[`SP`] %s"with" [`WS`] "[" [`WS`] 1*(`ShapeId` [`WS`]) "]"
EnumStatement :`EnumTypeName` `SP` `Identifier` [`Mixins`] [`WS`] `EnumShapeMembers`
EnumTypeName :%s"enum" / %s"intEnum"
EnumShapeMembers :"{" [`WS`] 1*(`TraitStatements` `Identifier` [`ValueAssignment`] [`WS`]) "}"
ValueAssignment :[`SP`] "=" [`SP`] `NodeValue` `BR`
ValueAssignment :[`SP`] "=" [`SP`] `NodeValue` [`SP`] [`Comma`] `BR`
ListStatement :%s"list" `SP` `Identifier` [`Mixins`] [`WS`] `ListMembers`
ListMembers :"{" [`WS`] [`ListMember`] [`WS`] "}"
ListMember :`TraitStatements` (`ElidedListMember` / `ExplicitListMember`)
Expand Down Expand Up @@ -223,9 +224,9 @@ string support defined in :rfc:`7405`.
: *(`OperationInput` / `OperationOutput` / `OperationErrors`)
: [`WS`] "}"
: ; only one of each property can be specified.
OperationInput :%s"input" [`WS`] (`InlineStructure` / (":" [`WS`] `ShapeId`)) `WS`
OperationOutput :%s"output" [`WS`] (`InlineStructure` / (":" [`WS`] `ShapeId`)) `WS`
OperationErrors :%s"errors" [`WS`] ":" [`WS`] "[" *([`WS`] `Identifier`) [`WS`] "]" `WS`
OperationInput :%s"input" [`WS`] (`InlineStructure` / (":" [`WS`] `ShapeId`))
OperationOutput :%s"output" [`WS`] (`InlineStructure` / (":" [`WS`] `ShapeId`))
OperationErrors :%s"errors" [`WS`] ":" [`WS`] "[" [`WS`] *(`ShapeId` [`WS`]) "]"
InlineStructure :":=" [`WS`] `TraitStatements` [`StructureResource`]
: [`Mixins`] [`WS`] `StructureMembers`

Expand Down Expand Up @@ -784,7 +785,7 @@ The following example defines an ``integer`` shape with a :ref:`range-trait`:
Enum shapes
-----------

The :ref:`enum` shape is defined using an :token:`smithy:EnumShapeStatement`.
The :ref:`enum` shape is defined using an :token:`smithy:EnumStatement`.

The following example defines an :ref:`enum` shape:

Expand Down Expand Up @@ -847,7 +848,7 @@ IntEnum shapes
--------------

The :ref:`intEnum` shape is defined using an
:token:`smithy:EnumShapeStatement`.
:token:`smithy:EnumStatement`.

.. note::
The :ref:`enumValue trait <enumValue-trait>` is required on all
Expand Down