Closed diamante0018 closed 3 months ago
Another example
main()
{
thread onPlayerConnect();
}
#define PLAYER_NOTIFY_CMD(ent, str, action) ent notifyOnPlayerCommand( str, action )
onPlayerConnect()
{
while ( true )
{
level waittill( "connected", player );
if ( player isHost() )
{
continue;
}
PLAYER_NOTIFY_CMD( player, "load_saved_pos", "+activate" );
}
}
.\gsc-tool.exe -m comp -g iw5 -s pc .\a.gsc
GSC Tool 1.4.3.297-prod created by xensik
[ERROR]:compiler:./a.gsc:6:49: missing ';' ? at ./a.gsc
Smaller example:
#define TEST_FUNC(num) myfunc( num )
#define TEST_METHOD( ent, num ) ent mymeth( num )
myfunc( num )
{
print( num );
}
mymeth( num )
{
print( num );
}
main()
{
TEST_FUNC( 5 );
TEST_METHOD( level, 6 );
}
.\gsc-tool.exe -m comp -g iw5 -s pc .\a.gsc
GSC Tool 1.4.3.297-prod created by xensik
[ERROR]:compiler:./a.gsc:2:37: missing ';' ? at ./a.gsc
need to add preprocess command to dump pre-parse token to file output
Expected behaviour: Compilation succeeds because
ent isHost()
is a GSC method and should be replaced correctly when the macro expandsUnexpected behaviour:
Manually fixed version which proves something is wrong with the preprocessor