🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Character Literals
The single-quite syntax, eg 'a', fails with the error 'expected expression'. It should just convert it to a uint8. I see no mention of it in the documentation on the website, so I'm assuming it doesn't work in 2.0 either. I'm currently working with 1.10. There is a simple work around; I just replace the character literal with the actuall ascii code.
Well. Figuring that out led me down a couple other paths, uncovered an obscure bug in my preprocessor, forced me to add support for saving preprocessed scripts for debuging to my mud server, and also made me notice I had never registered an index behavior for std::string, even though I'd been using it.
I did a little research (Actually, I hit "I'm feeling lucky" on google) and discovered that, in C99 atleast, the compiler actually doesn't know what a character literal is! Is is actually the preprocessor's responsibility to replace character literals with the ASCII code. So, I'm going to going to add it to the preprocessor.
It's only going to support one character literals (and escaped one character literals). If anyone want to add unicode support, they are welcome to, but they have to add it to string literals too!
It's only going to support one character literals (and escaped one character literals). If anyone want to add unicode support, they are welcome to, but they have to add it to string literals too!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement