Created a literal label for arrays. Like with objects, I didn't do the interpreter side.
I figure that arrays and objects will work very similarly for the interpreter. My assumption is that, with objects, you need to explicitly declare fields and give them names for them to be accessible. However in arrays, I assume that the declaration is implicit, so every child of the array node will be in the final array. i.e. this:
will become an ObjectV with three fields: 0 ::= "test1", 1 ::= "test2", and 2 ::= 10.
This is why I don't allow variable declarations to be children of the array literal. It doesn't make sense to allow them for the same reason that we can't declare a variable to be another variable declaration.
Created a literal label for arrays. Like with objects, I didn't do the interpreter side.
I figure that arrays and objects will work very similarly for the interpreter. My assumption is that, with objects, you need to explicitly declare fields and give them names for them to be accessible. However in arrays, I assume that the declaration is implicit, so every child of the array node will be in the final array. i.e. this:
will become an ObjectV with three fields: 0 ::= "test1", 1 ::= "test2", and 2 ::= 10.
This is why I don't allow variable declarations to be children of the array literal. It doesn't make sense to allow them for the same reason that we can't declare a variable to be another variable declaration.