Skip to content

[request] support for fixed length arrays #32

Description

@antis81

Defining static arrays is an issue using the !rept. meta when the array label is local. Example:

a_scope:  <-- Trying to define local "a_scope.arr[idx]" labels (actually this is a "__macro_<id>" label in my case)
  .arr:  ; <-- should have indexed .arr[<i>] labels
  !rept 5 { 
    ; note: scope is now "__rept_<id>"
    .arr[i]: !byte 0  ; results in "__rept_<id>.my_arr[<i>]" label -> practically invisible
  }

A solution to this could be a new !array meta command:

a_scope:
  !array .arr, 5  ; defines "a_scope.arr"
  {
    .arr[i]: !byte 0  ; defines "a_scope.arr[<i>]
  }

… or (probably better) we could allow explicit definition of sub labels:

a_scope:
  !rept 5 {
    a_scope.arr[i]: !byte 0  ; currently a syntax error
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions