assyrianic / SourceGo

SourceGo is a transpiler that transforms a subset of Golang-like code to equivalent SourcePawn.
https://forums.alliedmods.net/showthread.php?t=328269
MIT License
25 stars 3 forks source link

Add Temp-Naming for Anonymous Structs #4

Open assyrianic opened 3 years ago

assyrianic commented 3 years ago

Golang allows you make (local) variables from anonymous structs such as:

foo := struct { name [64]char }{"Greg"}

Let's support that.

Have it generate into something like:

enum struct TmpStruct1 {
    char name[64];
}

...

TmpStruct1 foo;
foo.name = "Greg";