OK, so I rewrote the overwrite system and it works fine, it's also 143 lines less code. I noticed an oversight. It's kind of a big deal (to me).
You actually cannot do this:
And I thought "Why? Why does this refuse to cooperate when * works fine?"
*
Then it became very clear. "{" means object so when this is encountered an Object is created. "(" means Array and so an array is created when this delimiter is encountered. "]:" doesn't mean anything.
My current system splits at ":" so I end up with name:child[0] and value:{//stuff}. I then parse "[0]" out of the name and further parse the 0 (which is not always a 0) to gain the array index. That's all well and good, and as long as "]:" is followed by a "{" or "(" then everything works great. But in the case of child[0]:"something", my compiler is like "woah woah what the F is a " - I don't know what to do with any of this now, Imma just crash."
And in that my friends is a lesson on dependency. My compiler was dependent on this condition "]:" being followed by an "{" or "(". I did not intentionally build that dependency. It was inherent of adding features that weren't considered in the beginning. This becomes obvious, when I have to consider the catch 22 I am now in (this is where it gets real good)
I can break the dependency that is currently breaking everything and it will just move to a different function. I move it out of that function (as well) and it creates a whole new slew of problems that involve both functions. I have even been super crafty in how I wrote "the fix", by breaking 99% of the dependency these two functions have on each other and feeding them 2 different sets of data- everything works!!! EXCEPT the last little bit of { or ( not existing. I mean I have it working all the way to the very last line of the damn function and there is no way to change that line (or we start breaking more stuff).
So, what is my conclusion to this?
Well, we are talking about a functionality that I want in my script. So the importance factor is high, but the ability that I would lose by simply not worrying about this is very minimal.
In order to really fix this is going to take some complete Parser reconsideration, meaning rewriting huge chunks (?maybe all?) of it. That sounds like advancement. I like advancement. Let's do it! A rewrite it is. This is actually good. I have a lot of excellent code here that was never classed out and properly turned into packages. I also have 2 functions that have identical loop signatures with different directions in the loops. I could make that much more dynamic. The loops are to cycle through every single solitary child of every parent, no matter how many or what type of either.
So, that is basically the parser core right there. It's time to separate this stuff and build a machine vs the procedural monster I have built. I wouldn't go as far as to say I used spaghetti programming, but it is just one function followed by another til 1084 lines later. (just for the parser)
You actually cannot do this:
Code:
child[0]:"some text", child[1]:"more text", child[2]:50
*
Code:
child[0]: { //something }
My current system splits at ":" so I end up with name:child[0] and value:{//stuff}. I then parse "[0]" out of the name and further parse the 0 (which is not always a 0) to gain the array index. That's all well and good, and as long as "]:" is followed by a "{" or "(" then everything works great. But in the case of child[0]:"something", my compiler is like "woah woah what the F is a " - I don't know what to do with any of this now, Imma just crash."
And in that my friends is a lesson on dependency. My compiler was dependent on this condition "]:" being followed by an "{" or "(". I did not intentionally build that dependency. It was inherent of adding features that weren't considered in the beginning. This becomes obvious, when I have to consider the catch 22 I am now in (this is where it gets real good)
I can break the dependency that is currently breaking everything and it will just move to a different function. I move it out of that function (as well) and it creates a whole new slew of problems that involve both functions. I have even been super crafty in how I wrote "the fix", by breaking 99% of the dependency these two functions have on each other and feeding them 2 different sets of data- everything works!!! EXCEPT the last little bit of { or ( not existing. I mean I have it working all the way to the very last line of the damn function and there is no way to change that line (or we start breaking more stuff).
So, what is my conclusion to this?
Well, we are talking about a functionality that I want in my script. So the importance factor is high, but the ability that I would lose by simply not worrying about this is very minimal.
In order to really fix this is going to take some complete Parser reconsideration, meaning rewriting huge chunks (?maybe all?) of it. That sounds like advancement. I like advancement. Let's do it! A rewrite it is. This is actually good. I have a lot of excellent code here that was never classed out and properly turned into packages. I also have 2 functions that have identical loop signatures with different directions in the loops. I could make that much more dynamic. The loops are to cycle through every single solitary child of every parent, no matter how many or what type of either.
So, that is basically the parser core right there. It's time to separate this stuff and build a machine vs the procedural monster I have built. I wouldn't go as far as to say I used spaghetti programming, but it is just one function followed by another til 1084 lines later. (just for the parser)
Comment