🎉 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

Started by
5 comments, last by Deyja 19 years ago
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.
Advertisement
You're right. There is no support for character literals in the script language, yet.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

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.
Deyja,

Did you post an update to your preprocessor?
No; but I will.
Done. Still at www.omnisu.com

Minor bug fix; changed one file...
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!

This topic is closed to new replies.

Advertisement