berry-lang / berry

A ultra-lightweight embedded scripting language optimized for microcontrollers.
https://berry-lang.github.io
MIT License
782 stars 95 forks source link

Fix compilation issue of index access #384

Closed s-hadinger closed 6 months ago

s-hadinger commented 6 months ago

Fix compilation issue linked to wrong deallocation of register by the compiler.

def test()
  var line = '1234567890'
  line = line[3..7]
# print(line)
  for n : 1..2 end
end
test()

BRY: Exception> 'attribute_error' - the 'range' object has no method '()'
stack traceback:
    :5: in function `test`
    :7: in function `main`