Oh man, I am so stupid. I have figured out why overwriting has given me so much trouble. It's because of the smallest oversight possible in my script which is actually leading to an error that is silent.
My method for parsing names was as follows
(ex string)
lets say we wanted to get the name "child". First my script looks for : then it works backwards to the first { ( or , and grabs the text inbetween. Now on the surface this looks fine, until you consider that parent has already been parsed and what is then being sent through is
child:{}
ya see the problem? There is no {,( or , before child. In a case like this the name doesn't need to be parsed (heavily) cause it is the first instance of anything in the string. I need to write a condition that accommodates for this. BUT I am tempted to rethink the way I parse names altogether.
I will say, I have invented some nutty projects that were all very complex but I think this takes the cake. In all of my other projects the data being manipulated was simple data or (at worst) a math problem handles all the complexity. In the case of this project I have to parse all of this crap out in my head just to figure out how to tell the computer to do it and even the smallest thing left unconsidered can have me chasing my tail for days trying to figure out where the kink in the chain is.
I was convinced for 2 days that I hadn't found the proper combo to do overwrites, when in reality the overwrite instantiated the "one" possibility that I had overlooked. I'm chasing a good pattern while some innocuous bullshit is breaking the system quietly.
So, there is a little lesson for newb (aspiring) programmers. The output panel is your best friend and until you have completely finished you should be outputting every step of the process. I was convinced my stuff was elite and I had suppressed my "solid" output to the output panel. If I wouldn't have done that, I would have realized 2 days ago that there was a condition where names weren't being parsed.
Now to go fix this shit, get overwriting working and move on to loading images straight into the main Object. I get those 3 things out the way and I should be ready to start pounding out some example apps. Ones that are far more complex and useful than overlapping gradient images.
EDIT: Merry Christmas to everyone. I'm already enjoying the present that my output panel has given me. This project was dead in the water til I could rectify my issue and now that I know what the issue is, I can finally move forward.
EDIT2: NOPE, there is definitely a parse problem but what I described is not it. As it turns out, my method already compensated for the lack of a preceeding delimiter, pretty awesomely too. I didn't even realize what I had fully done til now.
I start by finding : and then getting the entire string up to that. Then I search the string for every occurrence of { ( and , - each "find" gets pushed to an array. I then set the begin position to the last occurrence in the string of the last delimiter stored in the array. If there is no occurrence, that number will be -1. BUT in order to increment past the delimiter I add 1 to the begin position at the last second, making it 0 which is the beginning of the string.
So you see, some kind of way I accidentally prepared for no delimiter. Awesome. Unfortunately, that means that my problem is happening elsewhere. I have some clues though. It only happens when an array is the first instance of an object and it's not that the name doesn't get parsed, it is leaving a delimiter in the first and last index.
overwrite = (0xAA9900
is not gonna work. Why is that being left there ONLY when it is the first child of an object? It is being trimmed from : to , instead of
to ,
That means for some reason my script is not adding : to the open delimiter (in the case of a name) but it is overwriting the delimiter with :
Hmmmmm - this is like juggling snakes
EDIT 3: This is absolutely gazonkers. I have output every step of everything and it is all perfect until that last compile of my overwrite object. It even perfectly parses the object and everything, no delimiter problems - until that last second and it is being replaced somehow. It doesn't make sense because it is adding delimiters that are already gone.
I was positive that this meant it's parent was pushing it into the .content instead of turning it into an Object. This would make sense for wrong delimiters to be there according to the last split, but I output the .content of every object upon the .content being added and my overwrite object is not there.
hmmm - ghost .content. Somewhere I am referring to 2 different .contents. Like an alternate dimension, that for whatever reason would normally be identical but in this case they do not match. That's bad. Time to break out the singleton pattern (that I thought I was already using).
fuck...lol.
My method for parsing names was as follows
(ex string)
Code:
parent: { child: { } }
child:{}
ya see the problem? There is no {,( or , before child. In a case like this the name doesn't need to be parsed (heavily) cause it is the first instance of anything in the string. I need to write a condition that accommodates for this. BUT I am tempted to rethink the way I parse names altogether.
I will say, I have invented some nutty projects that were all very complex but I think this takes the cake. In all of my other projects the data being manipulated was simple data or (at worst) a math problem handles all the complexity. In the case of this project I have to parse all of this crap out in my head just to figure out how to tell the computer to do it and even the smallest thing left unconsidered can have me chasing my tail for days trying to figure out where the kink in the chain is.
I was convinced for 2 days that I hadn't found the proper combo to do overwrites, when in reality the overwrite instantiated the "one" possibility that I had overlooked. I'm chasing a good pattern while some innocuous bullshit is breaking the system quietly.
So, there is a little lesson for newb (aspiring) programmers. The output panel is your best friend and until you have completely finished you should be outputting every step of the process. I was convinced my stuff was elite and I had suppressed my "solid" output to the output panel. If I wouldn't have done that, I would have realized 2 days ago that there was a condition where names weren't being parsed.
Now to go fix this shit, get overwriting working and move on to loading images straight into the main Object. I get those 3 things out the way and I should be ready to start pounding out some example apps. Ones that are far more complex and useful than overlapping gradient images.
EDIT: Merry Christmas to everyone. I'm already enjoying the present that my output panel has given me. This project was dead in the water til I could rectify my issue and now that I know what the issue is, I can finally move forward.
EDIT2: NOPE, there is definitely a parse problem but what I described is not it. As it turns out, my method already compensated for the lack of a preceeding delimiter, pretty awesomely too. I didn't even realize what I had fully done til now.
I start by finding : and then getting the entire string up to that. Then I search the string for every occurrence of { ( and , - each "find" gets pushed to an array. I then set the begin position to the last occurrence in the string of the last delimiter stored in the array. If there is no occurrence, that number will be -1. BUT in order to increment past the delimiter I add 1 to the begin position at the last second, making it 0 which is the beginning of the string.
So you see, some kind of way I accidentally prepared for no delimiter. Awesome. Unfortunately, that means that my problem is happening elsewhere. I have some clues though. It only happens when an array is the first instance of an object and it's not that the name doesn't get parsed, it is leaving a delimiter in the first and last index.
overwrite = (0xAA9900
is not gonna work. Why is that being left there ONLY when it is the first child of an object? It is being trimmed from : to , instead of

That means for some reason my script is not adding : to the open delimiter (in the case of a name) but it is overwriting the delimiter with :
Hmmmmm - this is like juggling snakes
EDIT 3: This is absolutely gazonkers. I have output every step of everything and it is all perfect until that last compile of my overwrite object. It even perfectly parses the object and everything, no delimiter problems - until that last second and it is being replaced somehow. It doesn't make sense because it is adding delimiters that are already gone.
I was positive that this meant it's parent was pushing it into the .content instead of turning it into an Object. This would make sense for wrong delimiters to be there according to the last split, but I output the .content of every object upon the .content being added and my overwrite object is not there.
hmmm - ghost .content. Somewhere I am referring to 2 different .contents. Like an alternate dimension, that for whatever reason would normally be identical but in this case they do not match. That's bad. Time to break out the singleton pattern (that I thought I was already using).
fuck...lol.
Comment