ENIGMA Forums

Contributing to ENIGMA => Proposals => Topic started by: polygone on January 27, 2011, 02:37:41 PM

Title: #RESOLVED# unable to parse (obj.variable) = value;
Post by: polygone on January 27, 2011, 02:37:41 PM
GM is able to parse:

Code: [Select]
(obj.variable) = value;Whereas Enigma appears unable.


Tracker Reference:
http://enigma-dev.org/tracker/ticket.php?id=81
Title: Re: unable to parse (obj.variable) = value;
Post by: Josh @ Dreamland on January 28, 2011, 12:44:45 AM
I was under the impression the syntax was strictly as follows:
Code: [Select]
(obj).variable = value;

If GM is suddenly allowing that sort of thing, I will remove all checks related to assignment operators. That will add compatibility with stream structures like cout, anyway.
Title: Re: unable to parse (obj.variable) = value;
Post by: polygone on January 28, 2011, 08:13:12 AM
I was under the impression the syntax was strictly as follows:
Code: [Select]
(obj).variable = value;

If GM is suddenly allowing that sort of thing, I will remove all checks related to assignment operators. That will add compatibility with stream structures like cout, anyway.
It's always allowed that sort of thing. It doesn't care about the brackets:

Code: [Select]
(((((script())).meh.hello))) = (script().derp);
(variable) = value;

It's all perfectly valid. Only thing that isn't valid is:

Code: [Select]
variable.(loc) = value
Title: Re: unable to parse (obj.variable) = value;
Post by: Josh @ Dreamland on January 28, 2011, 08:26:46 AM
Neither does C++. But C++ lets you do this:

Code: (C) [Select]
function() = script(); //GM doesn't have references
(double&)varname = 10; //GM doesnt have types
++varname = 12; //GM doesn't have ++
(expression1,expression2,varname) = 10; // GM doesn't allow coma separation in expressions
var + 1; // Error: Assignment operator expected
cout << 1; //Error: Assignment operator expected

So it became a question of how messed up I wanted to allow the syntax to be.