Skip to content

[FEATURE REPORT] Improvement of arrays: Differentiate array from variables to avoid bugs and check out for ranges when indexing #458

@Math-O5

Description

@Math-O5

Describe the feature
This would be extension of #346, #354 and #344. Arrays are treat as variables and therefore, can be freely used as one.

To Reproduce
We are not differentiating variables from array, so the code where we sum two variables, as example, can be in fact two arrays!

Sim-C:

   var b[10]
   b[0] = 1
   // All line following should throw an error, but it does not!
   c = b[b] 
   d = b * 2 + b 
   e[10]
   e[b + b] = 10
   f = e[b + b] 

Expected behavior
We should add another metadata type for array and one filed more in the Symbol Table, then add a case on expression function in simc_parser.py to know if we are indexing the array 'b[x]' or using it raw without indexing!

Desktop (please complete the following information):

  • OS: Fedora 30.0.x

Additional context
Start this issue only if you look at CONTRIBUTING.md file

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmoderateModerate problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions