-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Difficulty: Medium — Parser, AST, and codegen must all support nested array dimensions.
Summary
Occam supports multi-dimensional arrays such as [][2]BYTE (open first dimension, fixed second) and [n][m]TYPE (both fixed). These are currently not parsed.
Occam syntax
VAL [][2]BYTE pairs IS [['A', 'a'], ['B', 'b']]:
[10][20]INT grid:
Proposed Go mapping
var pairs = [][2]byte{{'A', 'a'}, {'B', 'b'}}
var grid [10][20]intOr using slices for open dimensions:
var pairs [][]byte = [][]byte{{'A', 'a'}, {'B', 'b'}}Affected files
bar.occ(multi-dim array params/declarations)test_utils.occ(line 19:VAL [][2]BYTE)
Work required
- Parser: After parsing
[n], check for another[to handle nested array dimensions - AST: Extend array type representation to support multiple dimensions
- Codegen: Generate nested Go array/slice types
Part of #43.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels