ENIGMA Forums

Outsourcing saves money => Issues Help Desk => Topic started by: TheExDeus on August 29, 2013, 02:23:14 pm

Title: Parenting and even inheritance
Post by: TheExDeus on August 29, 2013, 02:23:14 pm
This are two things the new parser should fix right? Josh, how is it going?
A user asked me to convert this example for him: http://gmc.yoyogames.com/index.php?showtopic=456948
And besides things like variable_exists(), it uses a lot of parenting and inheritance (even the event_inherited(); function). And as many use them I just wanted to know how is that going?
I will probably rewrite the example to not use parenting, but that just involves a lot of code duplication.

edit: The parser also seems to fail a lot like this case:
Code: [Select]
var near=instance_nearest(x,y,obj_Player_Camara_Parent);outputs as this:
Code: [Select]
var = instance_nearest(x, y, obj_Player_Camara_Parent);And
Code: [Select]
var near; near=instance_nearest(x,y,obj_Player_Camara_Parent);Error in the syntax checker with "Primary expression expected before operator". But it seems to be a variable issue, because when I rename "near" into "tid" or something else, then it works. Is "near" used specifically somewhere in the parser or the compiler? I see these problems with variable names a lot. I think other than type names (int, short, double etc.) all other should be available. Especially if it is not shown in the code editor (type names are bold for example, while "near" is just normal). So we should find all these variables and define them in a way that doesn't make the conflict.

edit2: Also, GM seems to allow break; outside a loop or a switch which makes it work like "exit": http://wiki.yoyogames.com/index.php/Break. ENIGMA doesn't allow that. Not sure we even should allow that... but you know.. compatibility.
Title: Re: Parenting and even inheritance
Post by: polygone on August 29, 2013, 02:47:01 pm
For some reason 'near' has stopped working recently, must have been added somewhere.
Title: Re: Parenting and even inheritance
Post by: Josh @ Dreamland on August 29, 2013, 04:35:11 pm
I told polygone to implement a new AST node for me, but he gave up in roughly the expected time. I'm taking a break from the compiler long enough to work with Ism on the EDC's new cloud server. It has been a bigger pain in the ass than anticipated. Both, actually. If you've been keeping an eye on JDI's progress, you'll notice the C parser in the branch throws roughly twice as many errors parsing <string> as the one in ENIGMA. That's the bad news. The good news is that it is parsing with 100% accuracy, which is both the source of the errors (if it can't parse accurately, it throws errors instead of assuming A-OK), and the reason that the new compiler is able to do the advanced type inference required for OOP.

I understand that in addition to the new features I want to see in ENIGMA, a lot of the longest-lived bugs are counting on the new parser. There's not much I can do about it unless I want to take another shortcut, which will only mean repeating this again in so many months.

On the plus side, the reason for my lack of free time is working against itself: I took courses over summer and am graduating in a few months. This will mean a brief transitional period wherein my output is even less than right now, followed by a time where the bulk of the stress in my life is between the hours of 9-5, and, if all goes according to plan, 20% of that stress will be this project.
Title: Re: Parenting and even inheritance
Post by: daz on August 29, 2013, 04:51:33 pm
if all goes according to plan, 20% of that stress will be this project.
Looking to go to Google?