Skip to content

Spec #38.2: Implement 1D array declaration (DIM) #57

Description

@treytomes

Description

Parse and allocate 1-dimensional numeric arrays using DIM statement.

DIM explicitly declares an array with specified upper bound. Lower bound determined by OPTION BASE (default 0).

ECMA-55 References

  • ECMA55-ARR-003: DIM statement syntax
  • ECMA55-ARR-004: Array bounds based on BASE
  • ECMA55-VAR-011: Array naming conventions

Acceptance Criteria

  • Parse DIM A(n) for single-letter arrays
  • Parse DIM A1(n) for letter+digit arrays
  • With BASE 0: DIM A(10) creates 11 elements (indices 0-10)
  • With BASE 1: DIM A(10) creates 10 elements (indices 1-10)
  • Reject negative upper bounds
  • Reject DIM A(0) when BASE is 1
  • Reject duplicate DIM statements for same array
  • Array names follow variable naming rules
  • All tests pass
  • Test coverage ≥ 80%

Parent Issue

Part of #38 - Implement DIM and OPTION BASE for array support

Estimated Effort

3-4 hours

Dependencies

Depends on Spec #38.1 (OPTION BASE)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ecma-55ECMA-55 Minimal BASIC specification complianceenhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions