Skip to content

Support mixed-dimension arrays [][n]TYPE#100

Merged
associate-1 merged 1 commit intomainfrom
feat/mixed-dim-arrays-64
Mar 4, 2026
Merged

Support mixed-dimension arrays [][n]TYPE#100
associate-1 merged 1 commit intomainfrom
feat/mixed-dim-arrays-64

Conversation

@associate-1
Copy link
Member

Summary

  • Add support for mixed-dimension array types [][n]TYPE (open first, fixed second) in abbreviations and proc params, e.g. VAL [][2]BYTE coord IS [[41, 11], [20, 5]]:
  • Fix [][]TYPE abbreviations which previously only handled a single [] dimension
  • Replace IsOpenArray/IsFixedArray booleans on Abbreviation AST node with OpenArrayDims int to support arbitrary dimension counts
  • Add generateTypedArrayLiteral() for nested array literals using Go composite literal elision

Closes #64

Test plan

  • 3 new parser unit tests: TestMixedDimAbbreviation, TestMultiDimOpenAbbreviation, TestMixedDimProcParam
  • 3 new E2E tests: TestE2E_MixedDimAbbreviation, TestE2E_MixedDimProcParam, TestE2E_MultiDimOpenAbbreviation
  • All existing tests pass (go test ./...)
  • Course module transpiles and passes go vet

🤖 Generated with Claude Code

Add support for mixed-dimension array types like [][2]BYTE (open first,
fixed second) in abbreviations and proc params. Also fixes [][]TYPE
abbreviations which previously only handled single [].

All dimensions map to Go slices (e.g. [][2]BYTE → [][]byte), consistent
with existing approach. Nested array literals use Go composite literal
elision for inner elements.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@associate-1 associate-1 merged commit 4bb9215 into main Mar 4, 2026
1 check passed
@dboreham dboreham deleted the feat/mixed-dim-arrays-64 branch March 4, 2026 02:26
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.

Support multi-dimensional arrays ([][n]TYPE)

2 participants