alliedmodders / sourcemod

SourceMod - Source Engine Scripting and Administration
http://www.sourcemod.net/
985 stars 423 forks source link

Semicolon after enum struct causes compilation error #1949

Closed dronelektron closed 1 year ago

dronelektron commented 1 year ago

Help us help you

Environment

Description

Semicolon after enum struct causes compilation error

Problematic Code (or Steps to Reproduce)

 #include <sourcemod>

enum struct Something {
    int age;
    int weight;
}; // This semicolon cause an error

public Plugin myinfo = {
    name = "",
    author = "",
    description = "",
    version = "",
    url = ""
};

Logs

drone@ANDY-PC MINGW64 ~/Desktop $ spcomp enum-struct-semicolon.sp SourcePawn Compiler 1.11.0.6932 Copyright (c) 1997-2006 ITB CompuPhase Copyright (c) 2004-2021 AlliedModders LLC

enum-struct-semicolon.sp(6) : error 155: expected newline, but found ';'

1 Error.

Wend4r commented 1 year ago

https://github.com/alliedmodders/sourcepawn/pull/532

dronelektron commented 1 year ago

Oops, didn't see this thread

Wend4r commented 1 year ago

You can try (Git Bash or Linux like)

https://github.com/Wend4r/sourcepawn-public/commit/6edba21e853d24cc28d2768ad258861179e51d35

cd sourcepawn # Enter to sourcepawn from ./alliedmodders/sourcemod 

git remote add wend4r https://github.com/Wend4r/sourcepawn-public.git
git fetch wend4r enum_struct-semicolon # Bash scripts: pack the branch name into a variable

git checkout -b enum_struct-semicolon
git pull wend4r enum_struct-semicolon #FUTURE: possible merge. # Updating 9cf9f31..6edba21: compiler/parser.cpp | 2 +-; 1 file changed, 1 insertion(+), 1 deletion(-)

cd ..
# Rebuild SourceMod with SourcePawn for your OS to using the spcomp
dronelektron commented 1 year ago

Thanks for the answer, but I don't really need it. I can wait until the developers add this feature in the next releases :)