Jump to content
  • Advertisement
Sign in to follow this  
Dokam

Change '' '' statements

This topic is 4441 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to change the sintax of angelscript from: function() { ... } to something like function() if( ... ) ... end if ( ... ) .. else .. end end But I dont know where to start. Its posible? [Edited by - Dokam on May 21, 2006 2:03:46 PM]

Share this post


Link to post
Share on other sites
Advertisement
You'll want to change the as_parser.cpp file, so that it parses the statement blocks correctly.

Take a look at the method asCParser::ParseStatementBlock() and how it is used. Your first change would be for it to not require the start token '{', and then you can rename the end token '}' to 'end' in the as_tokendef.h. Another change is to always require a statement block after if statements, as currently a statement block or a single statement is allowed.

Share this post


Link to post
Share on other sites
Thanks for the info, im on the right way now.

Another question, could I configure the language not case sensitive? I dont like scripters go with case sensitive problems when naming and using variables and function names.

Share this post


Link to post
Share on other sites
You'll have to see if WL has done all the string comparisons through one function, or just used strcmp all over the place. If the latter, do a 'find in files' for whatever function he is using, and change it to your own.

Share this post


Link to post
Share on other sites
You should take a look at the as_tokenizer.cpp, and modify it to convert characters to lowercase as it tokenizes the script.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by gilad_novik
This is not a bad idea. Maybe there should be an option for the engine to use case insensitive syntax (when parsing)?

maybe via some sort of optional #pragma-like statement at the beginning of each script?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!