type name = value;
type name = { ... }
; Semicolon terminates each instruction or logical line.
{...} Winged brackets enclose structs or instruction lists.
Is there any way to force compiler to accept ';' at the end of the instruction lists?
So it would be:
instead of:
This would fix a lot of issues that LiteC has with all C/C++ IDE's. Because all C parsers in this case expect the end of the line (;).
Code examples:
ENTITY *ent =
{
layer = 1;
};
PANEL *pan =
{
layer = 1;
};
VECTOR *vSpeed =
{
x = 10;
y = 20;
z = 30;
};
ANGLE *aSpeed =
{
pan = 10;
tilt = 20;
roll = 30;
};
Instead of weird
ENTITY *ent =
{
layer = 1;
}
PANEL *pan =
{
layer = 1;
}
VECTOR *vSpeed =
{
x = 10;
y = 20;
z = 30;
}
ANGLE *aSpeed =
{
pan = 10;
tilt = 20;
roll = 30;
}
EDIT: I've faced this syntax problem with VSCode in the past, now I'm facing it while getting Geany to work with LiteC.
C parser can't parse this... it goes all the way down till ';' is found at the end of ENTITY* ent_ptr !
But it works correctly when everything is closed with ';'
Best regards