dimitriv / Ziria

A domain-specific-language and compiler for low-level bitstream processing.
92 stars 18 forks source link

Indexing multi-dimensional arrays #127

Open ghost opened 8 years ago

ghost commented 8 years ago

The following program seems to successfully compile and run, yielding 140725834319488 as the value at VIT_TEST[0][0].

fun comp test() {

  var VIT_TEST: arr arr int8 := {
    { 0, 14,  0, 14,  0},
    {14,  0, 14,  0, 14}
  };

  do {
    println VIT_TEST[0][0];
  }

  repeat {
    x <- take;
    emit x;
  }
}

let comp main = read[int8] >>> test() >>> write

I'm not sure if Ziria supports multi-dimensional arrays, but I do know that @mainland's implementation handles multi-dimensional arrays fine.