neverlosecc / source2gen

Source2 games SDK generator
http://s2gen.com
Apache License 2.0
193 stars 31 forks source link

Generic typenames output "fix" #12

Open NotOfficer opened 10 months ago

NotOfficer commented 10 months ago

Im writing a parser and this change makes things alot easier. Example: CUtlVector< CStrongHandle< InfoForResourceTypeCTextureBase > > changes to CUtlVector<CStrongHandle<InfoForResourceTypeCTextureBase>>

es3n1n commented 10 months ago

Ok i thought about it a bit more and the only question that i have is that is there any other types that would have spaces in their names? Can't we just remove all the spaces?

NotOfficer commented 10 months ago

For example [[maybe_unused]] uint8_t __pad0000[0x8]; // 0x0 will be affected if we remove all spaces -> [[maybe_unused]]uint8_t ...

es3n1n commented 10 months ago

For example [[maybe_unused]] uint8_t __pad0000[0x8]; // 0x0 will be affected if we remove all spaces -> [[maybe_unused]]uint8_t ...

what? no. there's no [[maybe_unused]] in their schema, we add it by ourselves huh

NotOfficer commented 10 months ago

well i just mentioned it will get affected aswell. the [[maybe_unused]] part is already added when the function where i added the replacing gets called

es3n1n commented 10 months ago

well i just mentioned it will get affected aswell. the [[maybe_unused]] part is already added when the function where i added the replacing gets called

What stops you from replacing the spaces before adding the maybe_unused attribute?

NotOfficer commented 10 months ago

thats the first function i found to do the replacing in, the code wasnt easy to understand and i do t know for certain if its "safe" to just replace spaces for all types

es3n1n commented 10 months ago

I'll leave this PR open for a while. I'll get back to it whenever I have time (no ETA, sorry)

upd: you can surely push updates to it by yourself if you want; i'll review them