ENIGMA Forums
General fluff => Announcements => Topic started by: Josh @ Dreamland on June 16, 2009, 02:26:59 pm
-
I'm pleased to inform that the expression evaluator is working just as I'd hoped.
I'd like it to have a public test.
There are two versions. The C++ one, and the GML one. The C++ one is for macros, and so does not allow strings or floats. (Numbers that aren't integers.) Also as per preprocessors, it doesn't allow casts. (Though, there is a cast system implemented.)
This means that 5/2 = 2.
The GML one does allow strings and floats. It should work just like you're used to.
Note that functions and variables aren't in yet. It's an expression evaluator. It's designed for #if. Variables will be treated as zero. I just overkilled it a bit so I could more easily make a full fledged interpreter later on.
Other changes include that ternary exists, and there are more than two string comparison operators.
(("str"=="str")?"true":"false")+"zor" is my favorite string test.
Also, note that single quotes are treated as numbers in C++, and I think I left them that way in the GML one. So 'str' is a number, "str" is a string.
This means one less step on my todo list. One more item checked off.
Those who wish to try it out can download it here:
Both as 7z / as zip
C++ as 7z / as zip
GML as 7z / as zip
When the window pops up, you are immediately allowed to type. You can clear the screen by typing c or cls, and close it by typing x. (And pressing enter.)
Anyway, I'm going back to the CFile parser now, which I've been told by many is the impossible task for one person with no tools. But I don't care what they think. ^_^
Also, feel free to keep guessing at the secret from last topic.
I'll be working.
-
On the GML one:
1=1
Error at 2: can't assign to that
1==1
1
-
Stupid GM with its context-specific expression/statement crap...
-
On the GML one:
1=1
Error at 2: can't assign to that
1==1
1
Does that mean it works on the C++ one, or you just mentioned it because it's GML which allows that?
-
Yeah, I didn't really put much thought into converting it to GML. I just flipped a couple macro values.
Either way, nice catch. Noted for whenever this is applied to debug mode. And since this evaluates just the expression part, not the actual assignment operator, it'll be as simple as replacing that error with treating it as a comparison.
-
"Does that mean it works on the C++ one, or you just mentioned it because it's GML which allows that?"
The latter. I thought the GML one wouldn't recognise "=", but as Josh said it's just the standalone evaluator that doesn't.
-
And on that note, I think using a single = in ENIGMA when compiling doesn't work either. >_>
-
And on that note, I think using a single = in ENIGMA when compiling doesn't work either. >_>
Yeah, that's a bit more serious. The majority of existing GM projects use "=" rather than "==" I think.
-
Yeah, that's a bit more serious. The majority of existing GM projects use "=" rather than "==" I think.
People who do that instantly go down on my assimilate-as-soon-as-possible list.
-
I only replace them in if()'s and the like.
I find that a=b=c=0 is too damn useful to dispose of. I'll probably end up option-izing it.
-
Also, feel free to keep guessing at the secret from last topic.
I'll be working.
Are the games actually going to be posted on Steam?
-
Also, feel free to keep guessing at the secret from last topic.
I'll be working.
Are the games actually going to be posted on Steam?
That's not only impractical, but also Steam does not run on Linux and has restrictive DRM.
-
They're going to be making YoYo steam though
-
Yoyo's going to be making everything, just ask them.
-
Yeah, that's a bit more serious. The majority of existing GM projects use "=" rather than "==" I think.
People who do that instantly go down on my assimilate-as-soon-as-possible list.
Then there's the Pascal syntax.
if (a = b) then begin
b := 2;
end;
Valid GML syntax, valid Pascal syntax.
-
Also, feel free to keep guessing at the secret from last topic.
I'll be working.
Are the games actually going to be posted on Steam?
That's not only impractical, but also Steam does not run on Linux and has restrictive DRM.
Well, I thought of this because when you click "Creations" at the top of the page, it says:
Coming soon... in Valve Time.
-a2h
-
Well, I thought of this because when you click "Creations" at the top of the page, it says:
Coming soon... in Valve Time.
-a2h
This may help.
http://developer.valvesoftware.com/wiki/Valve_Time
It's a joke because Valve never release anything at the stated time. a2h borrowed the joke; I don't think he intended to suggest it'll be related to Steam at all. I'm guessing EDC will be done when i) they've coded it fully and ii) ENIGMA is ready for the world to see.
-
Speaking of which, everyone completely ignored the fact that I coded a useless function that nobody cares about. (http://enigma-dev.org/forums/index.php?topic=286.msg1945#new)
Yay.
-
This may help.
http://developer.valvesoftware.com/wiki/Valve_Time
It's a joke because Valve never release anything at the stated time. a2h borrowed the joke; I don't think he intended to suggest it'll be related to Steam at all. I'm guessing EDC will be done when i) they've coded it fully and ii) ENIGMA is ready for the world to see.
This.
-
EDC's coming back? :D