Skip to content

Double empty brackets ([][]) are not allowed in Dana grammar#80

Merged
kostis merged 1 commit intokostis:masterfrom
JohnnyPol:fix/parenthesis
Aug 3, 2025
Merged

Double empty brackets ([][]) are not allowed in Dana grammar#80
kostis merged 1 commit intokostis:masterfrom
JohnnyPol:fix/parenthesis

Conversation

@JohnnyPol
Copy link
Contributor

@JohnnyPol JohnnyPol commented Aug 2, 2025

Explanation

In the Dana grammar, the rule for ⟨fpar-type⟩ is:

⟨fpar-type⟩ ::= ⟨type⟩ 
              | "ref" ⟨data-type⟩ 
              | ⟨data-type⟩ "[" "]" ("[" ⟨int-const⟩ "]")*

This means that in function parameter types, the third choice only allows one empty dimension [], followed by one or more explicitly sized dimensions.

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

@kostis kostis merged commit 7061b05 into kostis:master Aug 3, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants