Packages
Packages copied to clipboard
[C] Syntax highlighting around C namespaces is broken
When return types are on a separate lines:
- return types become a different colour
- argument list in the first function is broken but not in the third
- there is a red mark on the closing brace

Without newline it looks OK:

Inside a struct it's busted again but only for pointers:

These are some of the examples but this is common and all over the place. u64 is coloured because I added it to custom_types in C.sublime-syntax:26 but otherwise the syntax file is standard. Sublime v3.2.2 build 3211
Could you also post minimal reproducible examples in text form (instead of screenshots) please?
Here you go:
struct game_object_pool
GameObjectPoolCreate(u64 Size);
void
GameObjectPoolDestroy(struct game_object_pool* Pool);
struct game_object_id
GameObjectPoolAlloc(struct game_object_pool* Pool);
union
{
struct game_object GameObject;
struct game_object_bucket* FreeList;
};
For reference:
union
{
struct x y; // missing struct scope
struct z* w; // missing pointer scope
};
// declaration of a function called b that takes nothing and returns an a.
struct a
b();
// declaration of a function called d that takes an e and returns a c.
struct c
d(struct e);
Note that there is no syntax error when adding * in the following case:
struct game_object_id *
GameObjectPoolAlloc(struct game_object_pool* Pool);