Pages: 1
Author Topic: #RESOLVED# unable to parse (obj.variable) = value;  (35,979 Views)
Offline (Unknown gender) polygone

Contributor
Joined: Mar 2009
Posts: 794
View profile
Posted on: January 27, 2011, 07:37:41 PM
GM is able to parse:

(obj.variable) = value;
Whereas Enigma appears unable.


Tracker Reference:
http://enigma-dev.org/tracker/ticket.php?id=81
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #1 Posted on: January 28, 2011, 05:44:45 AM
I was under the impression the syntax was strictly as follows:

(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.
Offline (Unknown gender) polygone

Contributor
Joined: Mar 2009
Posts: 794
View profile
Reply #2 Posted on: January 28, 2011, 01:13:12 PM
Quote from: Josh @ Dreamland. on January 28, 2011, 05:44:45 AM
I was under the impression the syntax was strictly as follows:

(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:

(((((script())).meh.hello))) = (script().derp);
(variable) = value;


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

variable.(loc) = value
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #3 Posted on: January 28, 2011, 01:26:46 PM
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.
Pages: 1