open-papyrus / papyrus-compiler

Open-source compiler for the Papyrus scripting language of Bethesda games.
https://open-papyrus.github.io/docs/papyrus-compiler/Introduction.html
MIT License
25 stars 3 forks source link

Do array initialization in declaration #53

Open Scrabx3 opened 1 year ago

Scrabx3 commented 1 year ago

Currently the only way to initialize an array at size n with compile time values is to do

int[] a = new int[2]
a[0] = 5
a[1] = 10

It'd save a lot of time if that could be shortened to

int[] a = [5, 10]