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

Inconsistent enum highlighting (type name and members) #113

Closed
Geod24 opened this issue Sep 23, 2021 · 3 comments
Closed

Inconsistent enum highlighting (type name and members) #113

Geod24 opened this issue Sep 23, 2021 · 3 comments

Comments

@Geod24
Copy link

Geod24 commented Sep 23, 2021

GNU Emacs 27.2
D mode: 20210119.1853

enum AddressType
{
    string cname;
    uint ipv4;
    ulong[2] ipv6;
}

Screen Shot 2021-09-23 at 15 35 30

Issues:

  • First member's identifier is not properly highlighted;
  • enum's name is highlighted as an identifier, not a type;
-enum AddressType
+private enum AddressType

Screen Shot 2021-09-23 at 15 35 45

As can be seen, adding a visibility qualifier fixes the second issue.
Related: #104

@CyberShadow
Copy link
Member

What is this syntax? Is it like a struct?

@CyberShadow
Copy link
Member

DMD master says:

test.d(3): Error: `string` is not a valid attribute for enum members
test.d(3): Error: `cname` is not a valid attribute for enum members
test.d(3): Error: `;` is not a valid attribute for enum members
test.d(4): Error: `uint` is not a valid attribute for enum members
test.d(4): Error: `ipv4` is not a valid attribute for enum members
test.d(4): Error: `;` is not a valid attribute for enum members
test.d(5): Error: `ulong` is not a valid attribute for enum members
test.d(5): Error: `[` is not a valid attribute for enum members
test.d(5): Error: `2` is not a valid attribute for enum members
test.d(5): Error: `]` is not a valid attribute for enum members
test.d(5): Error: `ipv6` is not a valid attribute for enum members
test.d(5): Error: `;` is not a valid attribute for enum members

I don't know what language this is, but it doesn't seem to be D, so I think supporting this syntax is out-of-scope for this package. :)

@Geod24
Copy link
Author

Geod24 commented Sep 23, 2021

🤦

Yes, I just realized I mistakenly substituted union for enum. Sorry for the noise!

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