Bläddra i källkod

Added some improvements from Squirrel 3.1 beta, small fix on gumbo and updated to latest sqlite3.

mingodad 12 år sedan
förälder
incheckning
0a4e4f1df2

+ 1 - 1
SquiLu-ext/sq_fltk.cpp

@@ -3850,7 +3850,7 @@ static SQRESULT _fl_globals_fl_alert(HSQUIRRELVM v)
 {
 {
     SQ_FUNC_VARS_NO_TOP(v);
     SQ_FUNC_VARS_NO_TOP(v);
     SQ_GET_STRING(v, 2, msg);
     SQ_GET_STRING(v, 2, msg);
-    fl_alert(msg);
+    fl_alert("%s", msg);
     return 0;
     return 0;
 }
 }
 
 

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 553 - 538
SquiLu-ext/sqlite3.c


+ 26 - 16
SquiLu-ext/sqlite3.h

@@ -107,9 +107,9 @@ extern "C" {
 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
 ** [sqlite_version()] and [sqlite_source_id()].
 ** [sqlite_version()] and [sqlite_source_id()].
 */
 */
-#define SQLITE_VERSION        "3.8.1"
-#define SQLITE_VERSION_NUMBER 3008001
-#define SQLITE_SOURCE_ID      "2013-09-26 15:21:16 1f8f4fdf3ff2b8de27e167a44a19b0f479f5ee1a"
+#define SQLITE_VERSION        "3.8.2"
+#define SQLITE_VERSION_NUMBER 3008002
+#define SQLITE_SOURCE_ID      "2013-11-08 17:13:23 0077c0772a884b54d81fa3733aac6f0c364ef1a8"
 
 
 /*
 /*
 ** CAPI3REF: Run-Time Library Version Numbers
 ** CAPI3REF: Run-Time Library Version Numbers
@@ -511,6 +511,7 @@ SQLITE_API int sqlite3_exec(
 #define SQLITE_CONSTRAINT_TRIGGER      (SQLITE_CONSTRAINT | (7<<8))
 #define SQLITE_CONSTRAINT_TRIGGER      (SQLITE_CONSTRAINT | (7<<8))
 #define SQLITE_CONSTRAINT_UNIQUE       (SQLITE_CONSTRAINT | (8<<8))
 #define SQLITE_CONSTRAINT_UNIQUE       (SQLITE_CONSTRAINT | (8<<8))
 #define SQLITE_CONSTRAINT_VTAB         (SQLITE_CONSTRAINT | (9<<8))
 #define SQLITE_CONSTRAINT_VTAB         (SQLITE_CONSTRAINT | (9<<8))
+#define SQLITE_CONSTRAINT_ROWID        (SQLITE_CONSTRAINT |(10<<8))
 #define SQLITE_NOTICE_RECOVER_WAL      (SQLITE_NOTICE | (1<<8))
 #define SQLITE_NOTICE_RECOVER_WAL      (SQLITE_NOTICE | (1<<8))
 #define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8))
 #define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8))
 #define SQLITE_WARNING_AUTOINDEX       (SQLITE_WARNING | (1<<8))
 #define SQLITE_WARNING_AUTOINDEX       (SQLITE_WARNING | (1<<8))
@@ -924,6 +925,14 @@ struct sqlite3_io_methods {
 ** can be queried by passing in a pointer to a negative number.  This
 ** can be queried by passing in a pointer to a negative number.  This
 ** file-control is used internally to implement [PRAGMA mmap_size].
 ** file-control is used internally to implement [PRAGMA mmap_size].
 **
 **
+** <li>[[SQLITE_FCNTL_TRACE]]
+** The [SQLITE_FCNTL_TRACE] file control provides advisory information
+** to the VFS about what the higher layers of the SQLite stack are doing.
+** This file control is used by some VFS activity tracing [shims].
+** The argument is a zero-terminated string.  Higher layers in the
+** SQLite stack may generate instances of this file control if
+** the [SQLITE_USE_FCNTL_TRACE] compile-time option is enabled.
+**
 ** </ul>
 ** </ul>
 */
 */
 #define SQLITE_FCNTL_LOCKSTATE               1
 #define SQLITE_FCNTL_LOCKSTATE               1
@@ -943,6 +952,7 @@ struct sqlite3_io_methods {
 #define SQLITE_FCNTL_BUSYHANDLER            15
 #define SQLITE_FCNTL_BUSYHANDLER            15
 #define SQLITE_FCNTL_TEMPFILENAME           16
 #define SQLITE_FCNTL_TEMPFILENAME           16
 #define SQLITE_FCNTL_MMAP_SIZE              18
 #define SQLITE_FCNTL_MMAP_SIZE              18
+#define SQLITE_FCNTL_TRACE                  19
 
 
 /*
 /*
 ** CAPI3REF: Mutex Handle
 ** CAPI3REF: Mutex Handle
@@ -1629,27 +1639,27 @@ struct sqlite3_mem_methods {
 ** function must be threadsafe. </dd>
 ** function must be threadsafe. </dd>
 **
 **
 ** [[SQLITE_CONFIG_URI]] <dt>SQLITE_CONFIG_URI
 ** [[SQLITE_CONFIG_URI]] <dt>SQLITE_CONFIG_URI
-** <dd> This option takes a single argument of type int. If non-zero, then
+** <dd>^(This option takes a single argument of type int. If non-zero, then
 ** URI handling is globally enabled. If the parameter is zero, then URI handling
 ** URI handling is globally enabled. If the parameter is zero, then URI handling
-** is globally disabled. If URI handling is globally enabled, all filenames
+** is globally disabled.)^ ^If URI handling is globally enabled, all filenames
 ** passed to [sqlite3_open()], [sqlite3_open_v2()], [sqlite3_open16()] or
 ** passed to [sqlite3_open()], [sqlite3_open_v2()], [sqlite3_open16()] or
 ** specified as part of [ATTACH] commands are interpreted as URIs, regardless
 ** specified as part of [ATTACH] commands are interpreted as URIs, regardless
 ** of whether or not the [SQLITE_OPEN_URI] flag is set when the database
 ** of whether or not the [SQLITE_OPEN_URI] flag is set when the database
-** connection is opened. If it is globally disabled, filenames are
+** connection is opened. ^If it is globally disabled, filenames are
 ** only interpreted as URIs if the SQLITE_OPEN_URI flag is set when the
 ** only interpreted as URIs if the SQLITE_OPEN_URI flag is set when the
-** database connection is opened. By default, URI handling is globally
+** database connection is opened. ^(By default, URI handling is globally
 ** disabled. The default value may be changed by compiling with the
 ** disabled. The default value may be changed by compiling with the
-** [SQLITE_USE_URI] symbol defined.
+** [SQLITE_USE_URI] symbol defined.)^
 **
 **
 ** [[SQLITE_CONFIG_COVERING_INDEX_SCAN]] <dt>SQLITE_CONFIG_COVERING_INDEX_SCAN
 ** [[SQLITE_CONFIG_COVERING_INDEX_SCAN]] <dt>SQLITE_CONFIG_COVERING_INDEX_SCAN
-** <dd> This option takes a single integer argument which is interpreted as
+** <dd>^This option takes a single integer argument which is interpreted as
 ** a boolean in order to enable or disable the use of covering indices for
 ** a boolean in order to enable or disable the use of covering indices for
-** full table scans in the query optimizer.  The default setting is determined
+** full table scans in the query optimizer.  ^The default setting is determined
 ** by the [SQLITE_ALLOW_COVERING_INDEX_SCAN] compile-time option, or is "on"
 ** by the [SQLITE_ALLOW_COVERING_INDEX_SCAN] compile-time option, or is "on"
 ** if that compile-time option is omitted.
 ** if that compile-time option is omitted.
 ** The ability to disable the use of covering indices for full table scans
 ** The ability to disable the use of covering indices for full table scans
 ** is because some incorrectly coded legacy applications might malfunction
 ** is because some incorrectly coded legacy applications might malfunction
-** malfunction when the optimization is enabled.  Providing the ability to
+** when the optimization is enabled.  Providing the ability to
 ** disable the optimization allows the older, buggy application code to work
 ** disable the optimization allows the older, buggy application code to work
 ** without change even with newer versions of SQLite.
 ** without change even with newer versions of SQLite.
 **
 **
@@ -1678,16 +1688,16 @@ struct sqlite3_mem_methods {
 **
 **
 ** [[SQLITE_CONFIG_MMAP_SIZE]]
 ** [[SQLITE_CONFIG_MMAP_SIZE]]
 ** <dt>SQLITE_CONFIG_MMAP_SIZE
 ** <dt>SQLITE_CONFIG_MMAP_SIZE
-** <dd>SQLITE_CONFIG_MMAP_SIZE takes two 64-bit integer (sqlite3_int64) values
+** <dd>^SQLITE_CONFIG_MMAP_SIZE takes two 64-bit integer (sqlite3_int64) values
 ** that are the default mmap size limit (the default setting for
 ** that are the default mmap size limit (the default setting for
 ** [PRAGMA mmap_size]) and the maximum allowed mmap size limit.
 ** [PRAGMA mmap_size]) and the maximum allowed mmap size limit.
-** The default setting can be overridden by each database connection using
+** ^The default setting can be overridden by each database connection using
 ** either the [PRAGMA mmap_size] command, or by using the
 ** either the [PRAGMA mmap_size] command, or by using the
-** [SQLITE_FCNTL_MMAP_SIZE] file control.  The maximum allowed mmap size
+** [SQLITE_FCNTL_MMAP_SIZE] file control.  ^(The maximum allowed mmap size
 ** cannot be changed at run-time.  Nor may the maximum allowed mmap size
 ** cannot be changed at run-time.  Nor may the maximum allowed mmap size
 ** exceed the compile-time maximum mmap size set by the
 ** exceed the compile-time maximum mmap size set by the
-** [SQLITE_MAX_MMAP_SIZE] compile-time option.  
-** If either argument to this option is negative, then that argument is
+** [SQLITE_MAX_MMAP_SIZE] compile-time option.)^
+** ^If either argument to this option is negative, then that argument is
 ** changed to its compile-time default.
 ** changed to its compile-time default.
 ** </dl>
 ** </dl>
 */
 */

+ 74 - 21
SquiLu/sqstdlib/sqstdio.cpp

@@ -210,20 +210,68 @@ SQRESULT sqstd_getfile(HSQUIRRELVM v, SQInteger idx, SQFILE *file)
 
 
 
 
 
 
-static SQRESULT _io_file_lexfeed_PLAIN(SQUserPointer file)
+#define IO_BUFFER_SIZE 2048
+struct IOBuffer {
+	unsigned char buffer[IO_BUFFER_SIZE];
+	int size;
+	int ptr;
+	SQFILE file;
+};
+
+SQInteger _read_byte(IOBuffer *iobuffer)
 {
 {
-	SQInteger ret;
-	char c;
-	if( ( ret=sqstd_fread(&c,sizeof(c),1,(FILE *)file )>0) )
-		return c;
+	if(iobuffer->ptr < iobuffer->size) {
+
+		SQInteger ret = iobuffer->buffer[iobuffer->ptr];
+		iobuffer->ptr++;
+		return ret;
+	}
+	else {
+		if( (iobuffer->size = sqstd_fread(iobuffer->buffer,1,IO_BUFFER_SIZE,iobuffer->file )) > 0 )
+		{
+			SQInteger ret = iobuffer->buffer[0];
+			iobuffer->ptr = 1;
+			return ret;
+		}
+	}
+
 	return 0;
 	return 0;
 }
 }
 
 
+SQInteger _read_two_bytes(IOBuffer *iobuffer)
+{
+	if(iobuffer->ptr < iobuffer->size) {
+		if(iobuffer->size < 2) return 0;
+		SQInteger ret = *((wchar_t*)&iobuffer->buffer[iobuffer->ptr]);
+		iobuffer->ptr += 2;
+		return ret;
+	}
+	else {
+		if( (iobuffer->size = sqstd_fread(iobuffer->buffer,1,IO_BUFFER_SIZE,iobuffer->file )) > 0 )
+		{
+			if(iobuffer->size < 2) return 0;
+			SQInteger ret = *((wchar_t*)&iobuffer->buffer[0]);
+			iobuffer->ptr = 2;
+			return ret;
+		}
+	}
+
+	return 0;
+}
+
+static SQInteger _io_file_lexfeed_PLAIN(SQUserPointer iobuf)
+{
+	IOBuffer *iobuffer = (IOBuffer *)iobuf;
+	return _read_byte(iobuffer);
+
+}
+
 #ifdef SQUNICODE
 #ifdef SQUNICODE
-static SQRESULT _io_file_lexfeed_UTF8(SQUserPointer file)
+static SQInteger _io_file_lexfeed_UTF8(SQUserPointer iobuf)
 {
 {
-#define READ() \
-	if(sqstd_fread(&inchar,sizeof(inchar),1,(FILE *)file) != 1) \
+	IOBuffer *iobuffer = (IOBuffer *)iobuf;
+#define READ(iobuf) \
+	if((inchar = (unsigned char)_read_byte(iobuf)) == 0) \
 		return 0;
 		return 0;
 
 
 	static const SQInteger utf8_lengths[16] =
 	static const SQInteger utf8_lengths[16] =
@@ -237,7 +285,7 @@ static SQRESULT _io_file_lexfeed_UTF8(SQUserPointer file)
 	static unsigned char byte_masks[5] = {0,0,0x1f,0x0f,0x07};
 	static unsigned char byte_masks[5] = {0,0,0x1f,0x0f,0x07};
 	unsigned char inchar;
 	unsigned char inchar;
 	SQInteger c = 0;
 	SQInteger c = 0;
-	READ();
+	READ(iobuffer);
 	c = inchar;
 	c = inchar;
 	//
 	//
 	if(c >= 0x80) {
 	if(c >= 0x80) {
@@ -249,7 +297,7 @@ static SQRESULT _io_file_lexfeed_UTF8(SQUserPointer file)
 		tmp = c&byte_masks[codelen];
 		tmp = c&byte_masks[codelen];
 		for(SQInteger n = 0; n < codelen-1; n++) {
 		for(SQInteger n = 0; n < codelen-1; n++) {
 			tmp<<=6;
 			tmp<<=6;
-			READ();
+			READ(iobuffer);
 			tmp |= inchar & 0x3F;
 			tmp |= inchar & 0x3F;
 		}
 		}
 		c = tmp;
 		c = tmp;
@@ -258,22 +306,22 @@ static SQRESULT _io_file_lexfeed_UTF8(SQUserPointer file)
 }
 }
 #endif
 #endif
 
 
-static SQRESULT _io_file_lexfeed_UCS2_LE(SQUserPointer file)
+static SQInteger _io_file_lexfeed_UCS2_LE(SQUserPointer iobuf)
 {
 {
 	SQInteger ret;
 	SQInteger ret;
-	wchar_t c;
-	if( ( ret=sqstd_fread(&c,sizeof(c),1,(FILE *)file )>0) )
-		return (SQChar)c;
+	IOBuffer *iobuffer = (IOBuffer *)iobuf;
+	if( (ret = _read_two_bytes(iobuffer)) > 0 )
+		return ret;
 	return 0;
 	return 0;
 }
 }
 
 
-static SQRESULT _io_file_lexfeed_UCS2_BE(SQUserPointer file)
+static SQInteger _io_file_lexfeed_UCS2_BE(SQUserPointer iobuf)
 {
 {
-	SQInteger ret;
-	unsigned short c;
-	if( ( ret=sqstd_fread(&c,sizeof(c),1,(FILE *)file )>0) ) {
+	SQInteger c;
+	IOBuffer *iobuffer = (IOBuffer *)iobuf;
+	if( (c = _read_two_bytes(iobuffer)) > 0 ) {
 		c = ((c>>8)&0x00FF)| ((c<<8)&0xFF00);
 		c = ((c>>8)&0x00FF)| ((c<<8)&0xFF00);
-		return (SQChar)c;
+		return c;
 	}
 	}
 	return 0;
 	return 0;
 }
 }
@@ -332,9 +380,14 @@ SQRESULT sqstd_loadfile(HSQUIRRELVM v,const SQChar *filename,SQBool printerror,S
 #endif
 #endif
 					break;//UTF-8 ;
 					break;//UTF-8 ;
 				default: sqstd_fseek(file,0,SQ_SEEK_SET); break; // ascii
 				default: sqstd_fseek(file,0,SQ_SEEK_SET); break; // ascii
-			}
+			}
+
+			IOBuffer buffer;
+			buffer.ptr = 0;
+			buffer.size = 0;
+			buffer.file = file;
 
 
-			if(SQ_SUCCEEDED(sq_compile(v,func,file,filename,printerror,show_warnings))){
+			if(SQ_SUCCEEDED(sq_compile(v,func,&buffer,filename,printerror,show_warnings))){
 				sqstd_fclose(file);
 				sqstd_fclose(file);
 				return SQ_OK;
 				return SQ_OK;
 			}
 			}

+ 33 - 1
SquiLu/sqstdlib/sqstdsystem.cpp

@@ -35,6 +35,35 @@
 
 
 SQ_OPT_STRING_STRLEN();
 SQ_OPT_STRING_STRLEN();
 
 
+#ifdef WITH_UUID
+
+#ifdef _WIN32
+#include <Rpc.h> //uuid
+#else
+#include <uuid/uuid.h>
+#endif
+
+static SQRESULT _system_getuuid(HSQUIRRELVM v)
+{
+#ifdef _WIN32
+    UUID uuid;
+    UuidCreate ( &uuid );
+
+    UuidToStringA ( &uuid, &str );
+
+    sq_pushstring(v,s,-1);
+
+    RpcStringFreeA ( &str );
+#else
+    uuid_t uuid;
+    uuid_generate_random ( uuid );
+    char s[37];
+    uuid_unparse ( uuid, s );
+    sq_pushstring(v,s,-1);
+#endif
+	return 1;
+}
+#endif
 static SQRESULT _system_getenv(HSQUIRRELVM v)
 static SQRESULT _system_getenv(HSQUIRRELVM v)
 {
 {
 	const SQChar *s;
 	const SQChar *s;
@@ -523,7 +552,10 @@ static SQRegFunction systemlib_funcs[]={
 	_DECL_FUNC(time,-1,_SC(".t")),
 	_DECL_FUNC(time,-1,_SC(".t")),
 	_DECL_FUNC(difftime,-2,_SC(".nn")),
 	_DECL_FUNC(difftime,-2,_SC(".nn")),
 	_DECL_FUNC(exit, -1,_SC(". b|i b")),
 	_DECL_FUNC(exit, -1,_SC(". b|i b")),
-	_DECL_FUNC(sleep, 2,_SC(".n")),
+	_DECL_FUNC(sleep, 2,_SC(".n")),
+#ifdef WITH_UUID
+	_DECL_FUNC(getuuid, 0, NULL),
+#endif
 #ifndef _WIN32_WCE
 #ifndef _WIN32_WCE
 	_DECL_FUNC(getmillicount,1,_SC(".")),
 	_DECL_FUNC(getmillicount,1,_SC(".")),
 	_DECL_FUNC(getmillispan,2,_SC(".i")),
 	_DECL_FUNC(getmillispan,2,_SC(".i")),

+ 5 - 5
SquiLu/squirrel/sqcompiler.cpp

@@ -636,8 +636,6 @@ public:
 			_fs->SetIntructionParam(jpos, 1, (_fs->GetCurrentPos() - jpos));
 			_fs->SetIntructionParam(jpos, 1, (_fs->GetCurrentPos() - jpos));
 			break;
 			break;
 			}
 			}
-		case TK_IN: BIN_EXP(_OP_EXISTS, &SQCompiler::BitwiseOrExp); break;
-		case TK_INSTANCEOF: BIN_EXP(_OP_INSTANCEOF, &SQCompiler::BitwiseOrExp); break;
 		default:
 		default:
 			return;
 			return;
 		}
 		}
@@ -681,6 +679,8 @@ public:
 		case _SC('<'): BIN_EXP(_OP_CMP, &SQCompiler::ShiftExp,CMP_L); break;
 		case _SC('<'): BIN_EXP(_OP_CMP, &SQCompiler::ShiftExp,CMP_L); break;
 		case TK_GE: BIN_EXP(_OP_CMP, &SQCompiler::ShiftExp,CMP_GE); break;
 		case TK_GE: BIN_EXP(_OP_CMP, &SQCompiler::ShiftExp,CMP_GE); break;
 		case TK_LE: BIN_EXP(_OP_CMP, &SQCompiler::ShiftExp,CMP_LE); break;
 		case TK_LE: BIN_EXP(_OP_CMP, &SQCompiler::ShiftExp,CMP_LE); break;
+		case TK_IN: BIN_EXP(_OP_EXISTS, &SQCompiler::ShiftExp); break;
+		case TK_INSTANCEOF: BIN_EXP(_OP_INSTANCEOF, &SQCompiler::ShiftExp); break;
 		default: return;
 		default: return;
 		}
 		}
 	}
 	}
@@ -864,9 +864,9 @@ public:
 
 
 				switch(_token) {
 				switch(_token) {
 					case TK_IDENTIFIER:  id = _fs->CreateString(_lex._svalue);       break;
 					case TK_IDENTIFIER:  id = _fs->CreateString(_lex._svalue);       break;
-					case TK_THIS:        id = _fs->CreateString(_SC("this"));        break;
-					case TK_CONSTRUCTOR: id = _fs->CreateString(_SC("constructor")); break;
-					case TK_DESTRUCTOR: id = _fs->CreateString(_SC("destructor")); break;
+					case TK_THIS:        id = _fs->CreateString(_SC("this"), 4);        break;
+					case TK_CONSTRUCTOR: id = _fs->CreateString(_SC("constructor"), 11); break;
+					case TK_DESTRUCTOR: id = _fs->CreateString(_SC("destructor"), 10); break;
 				}
 				}
 
 
 				SQInteger pos = -1;
 				SQInteger pos = -1;

+ 2 - 1
SquiLu/squirrel/sqdebug.cpp

@@ -18,7 +18,8 @@ SQRESULT sq_getfunctioninfo(HSQUIRRELVM v,SQInteger level,SQFunctionInfo *fi)
 			SQFunctionProto *proto = c->_function;
 			SQFunctionProto *proto = c->_function;
 			fi->funcid = proto;
 			fi->funcid = proto;
 			fi->name = type(proto->_name) == OT_STRING?_stringval(proto->_name):_SC("unknown");
 			fi->name = type(proto->_name) == OT_STRING?_stringval(proto->_name):_SC("unknown");
-			fi->source = type(proto->_name) == OT_STRING?_stringval(proto->_sourcename):_SC("unknown");
+			fi->source = type(proto->_sourcename) == OT_STRING?_stringval(proto->_sourcename):_SC("unknown");
+			fi->line = proto->_lineinfos[0]._line;
 			return SQ_OK;
 			return SQ_OK;
 		}
 		}
 	}
 	}

+ 2 - 1
SquiLu/squirrel/sqfuncstate.cpp

@@ -403,7 +403,8 @@ void SQFuncState::AddInstruction(SQInstruction &i)
 				pi._arg0 = (unsigned char)pi._arg1;
 				pi._arg0 = (unsigned char)pi._arg1;
 				pi._arg1 = i._arg1;
 				pi._arg1 = i._arg1;
 				return;
 				return;
-			}
+			}
+			break;
 		case _OP_SET:
 		case _OP_SET:
 		case _OP_NEWSLOT:
 		case _OP_NEWSLOT:
 			if(i._arg0 == i._arg3) {
 			if(i._arg0 == i._arg3) {

+ 5 - 5
SquiLu/squirrel/sqlexer.cpp

@@ -349,10 +349,10 @@ SQInteger SQLexer::Lex()
 	return 0;
 	return 0;
 }
 }
 
 
-SQInteger SQLexer::GetIDType(SQChar *s)
-{
-	SQObjectPtr t;
-	if(_keywords->Get(SQString::Create(_sharedstate, s), t)) {
+SQInteger SQLexer::GetIDType(const SQChar *s,SQInteger len)
+{
+	SQObjectPtr t;
+	if(_keywords->GetStr(s,len, t)) {
 		return SQInteger(_integer(t));
 		return SQInteger(_integer(t));
 	}
 	}
 	return TK_IDENTIFIER;
 	return TK_IDENTIFIER;
@@ -618,7 +618,7 @@ SQInteger SQLexer::ReadID()
 		NEXT();
 		NEXT();
 	} while(scisalnum(CUR_CHAR) || CUR_CHAR == _SC('_'));
 	} while(scisalnum(CUR_CHAR) || CUR_CHAR == _SC('_'));
 	TERMINATE_BUFFER();
 	TERMINATE_BUFFER();
-	res = GetIDType(&_longstr[0]);
+	res = GetIDType(&_longstr[0],_longstr.size() - 1);
 	if(res == TK_IDENTIFIER || res == TK_CONSTRUCTOR || res == TK_DESTRUCTOR) {
 	if(res == TK_IDENTIFIER || res == TK_CONSTRUCTOR || res == TK_DESTRUCTOR) {
 		_svalue = &_longstr[0];
 		_svalue = &_longstr[0];
 	}
 	}

+ 1 - 1
SquiLu/squirrel/sqlexer.h

@@ -18,7 +18,7 @@ struct SQLexer
 	SQInteger Lex();
 	SQInteger Lex();
 	const SQChar *Tok2Str(SQInteger tok);
 	const SQChar *Tok2Str(SQInteger tok);
 private:
 private:
-	SQInteger GetIDType(SQChar *s);
+	SQInteger GetIDType(const SQChar *s,SQInteger len);
 	SQInteger ReadString(SQInteger ndelim,bool verbatim);
 	SQInteger ReadString(SQInteger ndelim,bool verbatim);
 	SQInteger ReadNumber();
 	SQInteger ReadNumber();
 	void LexBlockComment();
 	void LexBlockComment();

+ 18 - 0
SquiLu/squirrel/sqtable.h

@@ -73,6 +73,24 @@ public:
 		}while((n = n->next));
 		}while((n = n->next));
 		return NULL;
 		return NULL;
 	}
 	}
+	//for compiler use
+	inline bool GetStr(const SQChar* key,SQInteger keylen,SQObjectPtr &val)
+	{
+		SQHash hash = _hashstr(key,keylen);
+		_HashNode *n = &_nodes[hash & (_numofnodes - 1)];
+		_HashNode *res = NULL;
+		do{
+			if(type(n->key) == OT_STRING && (scstrcmp(_stringval(n->key),key) == 0)){
+				res = n;
+				break;
+			}
+		}while((n = n->next));
+		if (res) {
+			val = _realval(res->val);
+			return true;
+		}
+		return false;
+	}
 	bool Get(const SQObjectPtr &key,SQObjectPtr &val);
 	bool Get(const SQObjectPtr &key,SQObjectPtr &val);
 	bool Exists(const SQObjectPtr &key);
 	bool Exists(const SQObjectPtr &key);
 	void Remove(const SQObjectPtr &key);
 	void Remove(const SQObjectPtr &key);

+ 2 - 2
gumbo/parser.c

@@ -743,7 +743,7 @@ static bool is_html_integration_point(const GumboNode* node) {
 static void append_node(
 static void append_node(
     GumboParser* parser, GumboNode* parent, GumboNode* node) {
     GumboParser* parser, GumboNode* parent, GumboNode* node) {
   assert(node->parent == NULL);
   assert(node->parent == NULL);
-  assert(node->index_within_parent = -1);
+  assert(node->index_within_parent == -1);
   GumboVector* children;
   GumboVector* children;
   if (parent->type == GUMBO_NODE_ELEMENT) {
   if (parent->type == GUMBO_NODE_ELEMENT) {
     children = &parent->v.element.children;
     children = &parent->v.element.children;
@@ -762,7 +762,7 @@ static void append_node(
 static void insert_node(
 static void insert_node(
     GumboParser* parser, GumboNode* parent, int index, GumboNode* node) {
     GumboParser* parser, GumboNode* parent, int index, GumboNode* node) {
   assert(node->parent == NULL);
   assert(node->parent == NULL);
-  assert(node->index_within_parent = -1);
+  assert(node->index_within_parent == -1);
   assert(parent->type == GUMBO_NODE_ELEMENT);
   assert(parent->type == GUMBO_NODE_ELEMENT);
   GumboVector* children = &parent->v.element.children;
   GumboVector* children = &parent->v.element.children;
   assert(index >= 0);
   assert(index >= 0);

Vissa filer visades inte eftersom för många filer har ändrats