Merge branch 'master' into jgrpp

# Conflicts:
#	src/lang/czech.txt
#	src/order_backup.h
#	src/settings_internal.h
#	src/string.cpp
#	src/viewport.cpp
This commit is contained in:
Jonathan G Rennison
2023-02-04 11:37:45 +00:00
28 changed files with 115 additions and 96 deletions

View File

@@ -607,7 +607,6 @@ public:
switch(_token)
{
case TK_STRING_LITERAL: {
//SQObjectPtr id(SQString::Create(_ss(_vm), _lex._svalue,_lex._longstr.size()-1));
_fs->AddInstruction(_OP_LOAD, _fs->PushTarget(), _fs->GetConstant(_fs->CreateString(_lex._svalue,_lex._longstr.size()-1)));
Lex();
}
@@ -840,7 +839,6 @@ public:
unsigned char flags = (hasattrs?NEW_SLOT_ATTRIBUTES_FLAG:0)|(isstatic?NEW_SLOT_STATIC_FLAG:0);
SQInteger table = _fs->TopTarget(); //<<BECAUSE OF THIS NO COMMON EMIT FUNC IS POSSIBLE
_fs->AddInstruction(_OP_NEWSLOTA, flags, table, key, val);
//_fs->PopTarget();
}
if(separator == ',') //hack recognizes a table from the separator
_fs->SetIntructionParam(tpos, 1, nkeys);
@@ -1053,7 +1051,6 @@ public:
if(tonextcondjmp != -1)
_fs->SetIntructionParam(tonextcondjmp, 1, _fs->GetCurrentPos() - tonextcondjmp);
if(_token == TK_DEFAULT) {
// _fs->AddLineInfos(_lex._currentline, _lineinfo);
Lex(); Expect(':');
SQInteger stacksize = _fs->GetStackSize();
_last_stacksize = _fs->GetStackSize();
@@ -1167,11 +1164,6 @@ public:
}
SQTable *enums = _table(_ss(_vm)->_consts);
SQObjectPtr strongid = id;
/*SQObjectPtr dummy;
if(enums->Get(strongid,dummy)) {
dummy.Null(); strongid.Null();
Error("enumeration already exists");
}*/
enums->NewSlot(SQObjectPtr(strongid),SQObjectPtr(table));
strongid.Null();
Lex();
@@ -1318,7 +1310,6 @@ public:
funcstate->AddLineInfos(_lex._prevtoken == '\n'?_lex._lasttokenline:_lex._currentline, _lineinfo, true);
funcstate->AddInstruction(_OP_RETURN, -1);
funcstate->SetStackSize(0);
//_fs->->_stacksize = _fs->_stacksize;
SQFunctionProto *func = funcstate->BuildProto();
#ifdef _DEBUG_DUMP
funcstate->Dump(func);

View File

@@ -177,7 +177,6 @@ SQInteger SQLexer::Lex()
else if ( CUR_CHAR == '-' ) { NEXT(); RETURN_TOKEN(TK_NEWSLOT); }
else if ( CUR_CHAR == '<' ) { NEXT(); RETURN_TOKEN(TK_SHIFTL); }
else if ( CUR_CHAR == '/' ) { NEXT(); RETURN_TOKEN(TK_ATTR_OPEN); }
//else if ( CUR_CHAR == '[' ) { NEXT(); ReadMultilineString(); RETURN_TOKEN(TK_STRING_LITERAL); }
else { RETURN_TOKEN('<') }
case '>':
NEXT();

View File

@@ -453,7 +453,7 @@ void RefTable::Resize(SQUnsignedInteger size)
[[maybe_unused]] SQUnsignedInteger nfound = 0;
for(SQUnsignedInteger n = 0; n < oldnumofslots; n++) {
if(type(t->obj) != OT_NULL) {
//add back;
//add back
assert(t->refs != 0);
RefNode *nn = Add(::HashObj(t->obj)&(_numofslots-1),t->obj);
nn->refs = t->refs;

View File

@@ -140,7 +140,6 @@ void SQVM::Finalize()
SQVM::~SQVM()
{
Finalize();
//sq_free(_callsstack,_alloccallsstacksize*sizeof(CallInfo));
REMOVE_FROM_CHAIN(&_ss(this)->_gc_chain,this);
}
@@ -712,7 +711,6 @@ bool SQVM::Execute(SQObjectPtr &closure, SQInteger target, SQInteger nargs, SQIn
return false;
}
if (_funcproto(_closure(temp_reg)->_function)->_bgenerator) {
//SQFunctionProto *f = _funcproto(_closure(temp_reg)->_function);
SQGenerator *gen = SQGenerator::Create(_ss(this), _closure(temp_reg));
_GUARD(gen->Yield(this));
Return(1, ci->_target, temp_reg);
@@ -747,8 +745,10 @@ exception_restore:
if (ShouldSuspend()) { _suspended = SQTrue; _suspended_traps = traps; return true; }
const SQInstruction &_i_ = *ci->_ip++;
//dumpstack(_stackbase);
//printf("%s %d %d %d %d\n",g_InstrDesc[_i_.op].name,arg0,arg1,arg2,arg3);
#ifdef _DEBUG_DUMP
dumpstack(_stackbase);
printf("%s %d %d %d %d\n",g_InstrDesc[_i_.op].name,arg0,arg1,arg2,arg3);
#endif
switch(_i_.op)
{
case _OP_LINE:
@@ -1053,7 +1053,9 @@ common_call:
exception_trap:
{
SQObjectPtr currerror = _lasterror;
// dumpstack(_stackbase);
#ifdef _DEBUG_DUMP
dumpstack(_stackbase);
#endif
SQInteger n = 0;
SQInteger last_top = _top;
if(ci) {

View File

@@ -36,7 +36,6 @@ struct SQVM : public CHAINABLE_OBJ
};
struct CallInfo{
//CallInfo() { _generator._type = OT_NULL;}
SQInstruction *_ip;
SQObjectPtr *_literals;
SQObjectPtr _closure;