Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scoped #define tag #490

Closed
oOBoomberOo opened this issue Jun 16, 2020 · 1 comment
Closed

Scoped #define tag #490

oOBoomberOo opened this issue Jun 16, 2020 · 1 comment

Comments

@oOBoomberOo
Copy link

oOBoomberOo commented Jun 16, 2020

When writing a datapack, I tend to use a lot of temporary score inside a function which would never be used outside of it ever again. Pilling up those scores into the global list doesn't seem ideal since the score shouldn't be used outside of this function.

#define score_holder pos.x
#define score_holder pos.y
#define score_holder pos.z

# Do some math with those scores...

So I would like a new #define syntax that will only suggest them within the function itself

#define_scope score_holder pos.x
#define_scope score_holder pos.y
#define_scope score_holder pos.z

Having a scoped suggestion also helps to remind you which score isn't supposed to be used outside of a function.

Note: You didn't enable issues labeling for a normal user so you have to label this one yourself.

@SPGoding
Copy link
Member

SPGoding commented Jun 16, 2020

Actually this is something I always want to do, so this is a duplicate of #319

You will use something like this when this feature is implemented:

#> @private
#define score_holder pos.x

#> @private
#define score_holder pos.y

#> @private
#define score_holder pos.z

Thanks for report anyways!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants