Merge pull request #1659 from AleoHQ/remove/unsized-array-abnf

[ABNF] Adapt ABNF to removal of unsized arrays.
This commit is contained in:
Collin Chin 2022-03-07 12:21:56 -08:00 committed by GitHub
commit 181fc2dc6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 37 deletions

View File

@ -1013,34 +1013,24 @@ An array type consists of an element type
and an indication of dimensions.
There is either a single dimension,
or a tuple of one or more dimensions.
Each dimension is natural.
Each dimension is a natural.
<a name="array-type"></a>
```abnf
array-type = "[" type ";" array-type-dimensions "]"
array-type = "[" type ";" array-dimensions "]"
```
Go to: _[array-type-dimensions](#user-content-array-type-dimensions), [type](#user-content-type)_;
Go to: _[array-dimensions](#user-content-array-dimensions), [type](#user-content-type)_;
<a name="array-type-dimension"></a>
<a name="array-dimensions"></a>
```abnf
array-type-dimension = natural / "_"
array-dimensions = natural / "(" natural *( "," natural ) ")"
```
Go to: _[natural](#user-content-natural)_;
<a name="array-type-dimensions"></a>
```abnf
array-type-dimensions = array-type-dimension
/ "(" array-type-dimension
*( "," array-type-dimension ) [","] ")"
```
Go to: _[array-type-dimension](#user-content-array-type-dimension)_;
The keyword `Self` denotes the enclosing circuit type.
It is only allowed inside a circuit type declaration.
@ -1214,19 +1204,10 @@ Go to: _[expression](#user-content-expression)_;
<a name="array-repeat-construction"></a>
```abnf
array-repeat-construction = "[" expression ";" array-expression-dimensions "]"
array-repeat-construction = "[" expression ";" array-dimensions "]"
```
Go to: _[array-expression-dimensions](#user-content-array-expression-dimensions), [expression](#user-content-expression)_;
<a name="array-expression-dimensions"></a>
```abnf
array-expression-dimensions = natural
/ "(" natural *( "," natural ) ")"
```
Go to: _[natural](#user-content-natural)_;
Go to: _[array-dimensions](#user-content-array-dimensions), [expression](#user-content-expression)_;
<a name="array-construction"></a>

View File

@ -650,15 +650,11 @@ tuple-type = "(" [ type 1*( "," type ) ] ")"
; and an indication of dimensions.
; There is either a single dimension,
; or a tuple of one or more dimensions.
; Each dimension is natural.
; Each dimension is a natural.
array-type = "[" type ";" array-type-dimensions "]"
array-type = "[" type ";" array-dimensions "]"
array-type-dimension = natural / "_"
array-type-dimensions = array-type-dimension
/ "(" array-type-dimension
*( "," array-type-dimension ) [","] ")"
array-dimensions = natural / "(" natural *( "," natural ) ")"
; The keyword `Self` denotes the enclosing circuit type.
; It is only allowed inside a circuit type declaration.
@ -756,10 +752,7 @@ array-inline-construction = "["
array-inline-element = expression / "..." expression
array-repeat-construction = "[" expression ";" array-expression-dimensions "]"
array-expression-dimensions = natural
/ "(" natural *( "," natural ) ")"
array-repeat-construction = "[" expression ";" array-dimensions "]"
array-construction = array-inline-construction / array-repeat-construction