Commit 7061b05
authored
Double parenthesis isn't allowed in Dana Grammar (#80)
In the Dana grammar, the rule for ⟨fpar-type⟩ is:
```
⟨fpar-type⟩ ::= ⟨type⟩
| "ref" ⟨data-type⟩
| ⟨data-type⟩ "[" "]" ("[" ⟨int-const⟩ "]")*
```
Thus, in function parameter types, the third choice only allows one empty dimension `[]`, followed by one or more explicitly sized dimensions.
Therefore, the following is invalid syntax:
```
def printBoard: board_param as byte[][], n_param as int
```
It should be:
```
def printBoard: board_param as byte[][20], n_param as int
```1 parent 2850672 commit 7061b05
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
0 commit comments