Sarrus1 / sourcepawn-studio

VSCode extension for SourcePawn scripting
https://sarrus1.github.io/sourcepawn-studio/
MIT License
140 stars 22 forks source link

macro cannot be parsed #340

Closed ProjectSky closed 11 months ago

ProjectSky commented 11 months ago

Basic informations

Further Information

To Reproduce

include

include

define IS_VALID_CLIENT(%1) (%1 > 0 && %1 <= MaxClients)

define IS_SURVIVOR(%1) (GetClientTeam(%1) == L4D_TEAM_SURVIVOR)

define IS_VALID_INGAME(%1) (IS_VALID_CLIENT(%1) && IsClientInGame(%1))

define IS_VALID_SURVIVOR(%1) (IS_VALID_INGAME(%1) && IS_SURVIVOR(%1))

public void OnPluginStart() { for (int i = 1; i <= MaxClients; i++) { if (IS_VALID_SURVIVOR(i) && !IsFakeClient(i)) { PrintToChat(i, "Hello World"); } } }



# Code to reproduce the behaviour

<!-- A link to a paste of the SourcePawn code which causes the issue. -->

# Expected behaviour

<!-- What should the extension do instead of what is happening? -->

# Error messages

<!-- _For error messages, go to Help>Dev tools>Console_ -->
ProjectSky commented 11 months ago

latest version seems to have fixed this issue

Sarrus1 commented 11 months ago

Reopening the issue because even though the server does not crash anymore, the macro is still incorrectly expanded, see this commit for the failing test:

https://github.com/Sarrus1/sourcepawn-vscode/commit/8022f59e564160da84d3aefa5387409a274229aa