JimmyCushnie / JECS

Jimmy's Epic Config System
Do What The F*ck You Want To Public License
154 stars 16 forks source link

support for multi-dimensional arrays #13

Open JimmyCushnie opened 5 years ago

JimmyCushnie commented 5 years ago

probably the best way to do this is by treating them as nested arrays. A 2d array is saved the same was as an array of arrays, a 3d array is saved the same way as an array of arrays of arrays, ect

starikcetin commented 4 years ago

You know it would be super exciting if you saved them as actual tables if they are 2D arrays. Something like this:

        Col0      Col1
Row0    val00     val01
Row1    val10     val11

But again, it is hard to implement and probably hard to use as well.

JimmyCushnie commented 4 years ago

An interesting idea! Yeah, the biggest drawback I see is that it will be hard to use. SUCC files should be easy to write from scratch, with confidence that what you write won't have parsing errors. Perhaps it would be good to have this as an option without it being the default.

starikcetin commented 4 years ago

To prevent (or more realistically speaking, reduce) parsing errors, we might search for a separator character instead of relying on whitespace. For example:

         Col0,      Col1
Row0,    val00,     val01
Row1,    val10,     val11

Notice the commas.

JimmyCushnie commented 4 years ago

Ah, that's clever