Skip to content

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

Merged
Y-Less merged 2 commits intopawn-lang:devfrom
Daniel-Cortez:unnamed-enum-tags-fix
Nov 7, 2019
Merged

Do not allow tags inside the braces of unnamed enums#454
Y-Less merged 2 commits intopawn-lang:devfrom
Daniel-Cortez:unnamed-enum-tags-fix

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