Basically the problem is that an uppercase constructor is treated like an enum definition because definitions of type class, enum, and interface are all treated the same inside the body of the definition.
Example 13 here gives an example of what the syntax highlighter is looking for when it looks for an enum definition.
To fix this issue, I separated out class and enum definitions. The code is almost the same, class is just missing the 1 cases that looks for that uppercase definition.
Here is a side by side:
Before:
After:
There would still be an issue if you had an enum whose name was uppercase like so:
enum TEST {
TEST1, TEST2;
TEST(int value) {}
}
But I believe this to be a very rare case not worth worrying about
Addresses #99
Basically the problem is that an uppercase constructor is treated like an
enum
definition because definitions of typeclass
,enum
, andinterface
are all treated the same inside the body of the definition.Example 13 here gives an example of what the syntax highlighter is looking for when it looks for an enum definition.
To fix this issue, I separated out
class
andenum
definitions. The code is almost the same,class
is just missing the 1 cases that looks for that uppercase definition.Here is a side by side:
Before: After:
There would still be an issue if you had an enum whose name was uppercase like so:
But I believe this to be a very rare case not worth worrying about