Jump to content

  • Log In with Google      Sign In   
  • Create Account


virious

Member Since 06 Jul 2008
Offline Last Active Jul 05 2012 06:13 AM
-----

Topics I've Started

Sacrilegium by Reality Pump

06 June 2012 - 09:03 AM

Hello,

today at E3 Expo we revealed information about new game which we are currently developing. It's called Sacrilegium and you can find more information here: http://sacrilegium.com/

Regards,
virious

Parser bug: Expected expression value

04 June 2012 - 03:19 AM

Let's say I have a weird script which looks like this:

int main()
{
	int some_value;
	if(some_value >= 3)
		int a=3;
	
	return 0;
}

It should compile, but AngelScript throws me an error:
test.as (39, 2) : ERR: Expected expression value

I think this case is omitted in asCScriptNode *asCParser::ParseExprValue() method in as_parser.cpp.

Test was performed on HEAD revision of the AngelScript Posted Image.

Thanks in advance!

Debugger and values passed by reference

24 May 2012 - 04:54 AM

Hello, I am using asrun sample project in debug mode.

My script file:
void testRef( int &in ref )
{
   int localVar = ref;
}

int main()
{
   int valForRef = 5;
   testRef( valForRef );
   return 0;
}

I'm stepping 3 times, so in debug console I can see:
test.as:3; void testRef(int&in)

The result after typing command "p ref" to print the value:
[dbg]> p ref
6697168


It prints out the pointer instead of the actual value (5 in this test scenario).

This test was performed on the latest revision of the AngelScript, with slight modification with the GetFunctionIdByDecl() call in main.cpp which is no longer available in the AngelScript interface.

Thanks in advance!

GRACE2 engine - Our game engine using AngelScript :)

14 May 2012 - 02:20 AM

Hello,

I proudly present our game engine - GRACE2 (http://grace2engine.com/) which uses AngelScript as a scripting language Posted Image. That's why I am always bothering you with so many questions/requests/bugs Posted Image.

Bug in compiler

10 May 2012 - 06:29 AM

Hi, I think I've found a bug in a compiler. For the reproduction of this behaviour, use asrun sample, but modify the script in the script.as so the enum E looks similar to this one:

enum E
{
  VALUE1 = 20somegarbage,
  VALUE2 = 30moregarbage
}

The application will compile and run without any error. But it should throw some "bad suffix on number" error information.
I think that the problem is in as_tokenizer.cpp in method:

bool asCTokenizer::IsConstant(const char *source, size_t sourceLength, size_t &tokenLength, eTokenType &tokenType) const

which identifies "20somegarbage" and "30moregarbage" as ttIntConstant. In this loop:

   	 size_t n;
		for( n = 0; n < sourceLength; n++ )
		{
			if( source[n] < '0' || source[n] > '9' )
				break;
		}

it only goes to first unallowed char (in this case "s" for the VALUE1) and does nothing about the fact that 20somegarbage is not a proper constant identifier here.

For this test I'm using HEAD revision (currently 1301), but this error is present in earlier versions of the AngelScript library.

Thanks in advance!

PARTNERS