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

String Constant Conflicts #60

Open
thelink2012 opened this issue Nov 6, 2016 · 5 comments
Open

String Constant Conflicts #60

thelink2012 opened this issue Nov 6, 2016 · 5 comments
Milestone

Comments

@thelink2012
Copy link
Owner

String constants may have collisions. For instance, the CAMMODE enumeration contains a SNIPER constant, same name of a CARPEDMODEL constant.

The implication of this is that the following may generate different output depending on how we evaluate the search for a constant:

VAR_INT x
x = SNIPER

In fact, this ends up using CARPEDMODEL in miss2, while it uses the CAMMODE enum here.

Specify the evaluation order of enumerations!

@thelink2012
Copy link
Owner Author

Commit 4b1684b is not a fix, just a quick workaround for working with the Vice City SCM.

@thelink2012
Copy link
Owner Author

Since #63, we should exclude the object models enum from the search.

@thelink2012
Copy link
Owner Author

thelink2012 commented Nov 7, 2016

CONSTANT arguments admit integer literals.

@thelink2012
Copy link
Owner Author

Remark:

III Source Code have variables which collides with level models, and level models have priority over variables when used in a MODEL argument. Meanwhile, the miss2 we know doesn't allow variable with the same name as string constants (!??).

Plus, we perform this check here which I don't feel is right.

@thelink2012
Copy link
Owner Author

thelink2012 commented Dec 12, 2016

After adding constant collision checks, the gta3 source code no longer compiles, which means they had no such check on the compiler of the first chapter: https://travis-ci.org/thelink2012/gta3sc/jobs/183137213

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

1 participant