[DiscordArchive] or is it...?
[DiscordArchive] or is it...?
Archived author: mynameismeat • Posted: 2023-08-30T14:35:44.184000+00:00
Original source
or, more so kinda goes off of "conditions" of the the current char in the key and the next char in the key
0. if (curr is member of [' ', '.', '-'], convert to '_'
1. if isNotUpper(current) && isUpper(next), convert "aB" to "A_B"
2. if isNotNumeric(current) && isNumeric(next), convert "a1" to "a_1"
3. if isNumeric(current) && isNotNumeric(next), convert "1a" to "1_a"
and then the whole thing is upcased (so "toggle_XP_cost" becomes "TOGGLE_XP_COST") and then its prefixed with AC\_ in the wrapping function
Archived author: AlexanderESmith • Posted: 2023-08-30T14:36:05.727000+00:00
Original source
I seeee
Archived author: mynameismeat • Posted: 2023-08-30T14:36:06.431000+00:00
Original source
https://github.com/azerothcore/azerothco...#L238-L282
Archived author: mynameismeat • Posted: 2023-08-30T14:36:42.475000+00:00
Original source
but maybe that is it. Best way to confirm for sure is to pull open gdb and take a look.
Archived author: mynameismeat • Posted: 2023-08-30T14:36:54.109000+00:00
Original source
or a million `printf`s
Archived author: AlexanderESmith • Posted: 2023-08-30T14:36:57.797000+00:00
Original source
hahah
Archived author: AlexanderESmith • Posted: 2023-08-30T14:37:41.744000+00:00
Original source
Yeah I did mine totally different (obviously, since Bash isn't C++);
```VARNAME_CONVERTED=$(echo $VARNAME | awk '{print $1}' \
| sed 's/\([A-Z]\)/ \1/g' \
| sed 's/^ //g' \
| sed 's/ /_/g' \
| sed 's/\./_/g' \
| sed 's/__/_/g' \
| sed 's/[a-z]/\U&/g' \
| sed 's/X_P/XP/g' \
| sed 's/G_M/GM/g')
```
Archived author: AlexanderESmith • Posted: 2023-08-30T14:38:05.225000+00:00
Original source
message.txt
Archived author: mynameismeat • Posted: 2023-08-30T14:38:25.755000+00:00
Original source
you can do `sed -e 's/blah/blah/' -e 's/blah/blah'` to do all those rules in one command
Archived author: mynameismeat • Posted: 2023-08-30T14:38:37.054000+00:00
Original source
irrelevant nitpick but its the first thing I think of lol