[Zscript] Mod/File checking

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is ON
[img] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: [Zscript] Mod/File checking

Re: [Zscript] Mod/File checking

by Graf Zahl » Sun Apr 30, 2017 2:00 pm

Removed the 'closed' tag.

Re: [Zscript] Mod/File checking

by Rachael » Sun Apr 30, 2017 1:41 pm

Re: [Zscript] Mod/File checking

by Graf Zahl » Mon Jan 09, 2017 3:59 pm

This one's already in the tracker.

Re: [Zscript] Mod/File checking

by Major Cooke » Sat Dec 03, 2016 10:22 pm

I think now might be a good time to bring this up again.

Perhaps something similar to how C++ does (end)if's might work? By checking for a specific 'tag' or something inside the files and versioning like you mentioned, this could become extremely useful.

This would be better than just going on file names alone since those may be prone to change.

Re: [Zscript] Mod/File checking

by Graf Zahl » Tue Oct 18, 2016 3:58 pm

It makes no sense to think about control stuff when I'm still in the initial stages of making the compiler work.

Re: [Zscript] Mod/File checking

by Major Cooke » Tue Oct 18, 2016 12:49 pm

My mistake. When you stated there's options, I had assumed there was already some form.

Re: [Zscript] Mod/File checking

by Graf Zahl » Tue Oct 18, 2016 12:44 pm

Can we please get this stuff working first? Right now this thing is not even on my radar.

Re: [Zscript] Mod/File checking

by Major Cooke » Tue Oct 18, 2016 12:16 pm

Alright. I've documented all that down on the wiki.

Now back to the suggestion at hand, how will the zscript control work?

Re: [Zscript] Mod/File checking

by Graf Zahl » Mon Oct 17, 2016 3:26 pm

There's 4 types of constants:

ints, floats, strings and names.

Strings can be unambiguously recognized by double quotation marks.
Names can be unambiguously recognized by single quotation marks.
Floats get recognized by either being too large for integer storage or typical floating point signs in the literal, like a decimal point or an exponent

And in case you wonder what this part was inspired by, I'd say don't look further than the most popular scripting language right now: Lua. Of course Lua takes the 'the value determines the type' approach even further by applying it to everything.

Re: [Zscript] Mod/File checking

by Major Cooke » Mon Oct 17, 2016 12:18 pm

Well, again, I can't be certain. I'm just guessing there.

Also, made a separate thread for general discussion and questions considering how off the rails I took this thread. :P

Re: [Zscript] Mod/File checking

by Ryan Cordell » Mon Oct 17, 2016 10:05 am

Oh I'm sure they do.. right now, but that doesn't feel like a smart system to begin with.

Re: [Zscript] Mod/File checking

by Major Cooke » Mon Oct 17, 2016 10:03 am

Correct me if I'm wrong, Graf: they probably resolve based on detection of "" or not. If no "" is detected, it can detect if it's an int or float based on a period being present or not.

Re: [Zscript] Mod/File checking

by Ryan Cordell » Mon Oct 17, 2016 9:50 am

Graf Zahl wrote:Yes, you can. But it's just 'const Name1 = "...";'
Why make defining the type optional though? Wouldn't it be better to actually avoid any ambiguity on that front?

Re: [Zscript] Mod/File checking

by Major Cooke » Mon Oct 17, 2016 9:40 am

Graf Zahl wrote:Because many users tend to put multiple flags on one line and then the semicolons become a distraction. I can add that one is allowed after a flag name for consistency but I won't force it.
Allowing it to ignore the semicolon basically? That works!

So then, I know you probably haven't thought about it as you stated earlier, but what plans do you have for loading conditions in control lumps? Because all I see right now in zscript.txt is just loading of the filenames (though obviously that's because there's no need for anything in them yet.)

Re: [Zscript] Mod/File checking

by Graf Zahl » Mon Oct 17, 2016 5:29 am

Because many users tend to put multiple flags on one line and then the semicolons become a distraction. I can add that one is allowed after a flag name for consistency but I won't force it.

@Gez: Because that's what it had been named in ZDoom since forever. Randi just used the same name here. But since we are still in the initial stage, if there's consensus that it should be changed it can still be done.

Top