Arrays / Indexing operators ?,
Members - Reputation: 122
Posted 17 May 2004 - 11:49 AM
Moderators - Reputation: 4363
Posted 17 May 2004 - 01:03 PM
Native support for arrays are more complicated, and I will not work on that for a while yet. But I plan to support it one day.
If you (or someone else) are interested in adding the support for the indexing operator yourself maybe I can walk you through it. There should be relatively few things that needs to be done.
1. Add a new flag for the RegisterOperator()
2. Treat the flag
3. Add the [ and ] tokens
4. Add parsing of the indexing operator
5. Compile the indexing operator in CompilePostOperator (Much of the code from CompileFunctionCall() can be reused.)
Until the indexing operator is done, I suggest you register an object method. The actual C++ function used for registering the overloaded  operator will be the same anyway.
www.AngelCode.com - game development and more...
AngelScript - free scripting library - Tower - free puzzle game