Skip to content

Do not allow tags inside the braces of unnamed enums #454

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

Merged
merged 2 commits into from
Nov 7, 2019

Conversation

Daniel-Cortez
Copy link
Contributor

@Daniel-Cortez Daniel-Cortez commented Sep 30, 2019

What this PR does / why we need it:

This PR fixes a problem with the compiler silently ignoring tags inside the braces of unnamed enums.
Before:

enum
{
    Float:DRAW_DISTANCE = 100.0 // This code compiles, but the 'Float' tag
                                // is silently ignored and the constant is defined
                                // as "DRAW_DISTANCE = _:100.0", so if someone uses it,
                                // then instead of "100.0" they'll get "float(_:100.0)"
};

After:

enum
{
    Float:DRAW_DISTANCE = 100.0 // error 001: expected token: "-identifier-", but found "-label-"
};

Which issue(s) this PR fixes:

Fixes #444

What kind of pull this is:

  • A Bug Fix
  • A New Feature
  • Some repository meta (documentation, etc)
  • Other

Additional Documentation:

@Daniel-Cortez Daniel-Cortez requested a review from a team as a code owner September 30, 2019 12:08
@Y-Less Y-Less merged commit df32344 into pawn-lang:dev Nov 7, 2019
@Daniel-Cortez Daniel-Cortez deleted the unnamed-enum-tags-fix branch December 1, 2019 14:32
@Y-Less Y-Less mentioned this pull request Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants