(svn r26836) -Fix [Squirrel]: merge SQLexer::Init with the constructor; there's no need to construct first and then call init in the next line

pull/155/head
rubidium 10 years ago
parent 5502a19f3d
commit 3d2f511f43

@ -57,10 +57,9 @@ typedef sqvector<ExpState> ExpStateVec;
class SQCompiler
{
public:
SQCompiler(SQVM *v, SQLEXREADFUNC rg, SQUserPointer up, const SQChar* sourcename, bool raiseerror, bool lineinfo)
SQCompiler(SQVM *v, SQLEXREADFUNC rg, SQUserPointer up, const SQChar* sourcename, bool raiseerror, bool lineinfo) : _lex(_ss(v), rg, up,ThrowError,this)
{
_vm=v;
_lex.Init(_ss(v), rg, up,ThrowError,this);
_sourcename = SQString::Create(_ss(v), sourcename);
_lineinfo = lineinfo;_raiseerror = raiseerror;
}

@ -21,7 +21,6 @@
#define NEXT() {Next();_currentcolumn++;}
#define ADD_KEYWORD(key,id) _keywords->NewSlot( SQString::Create(ss, #key) ,SQInteger(id))
SQLexer::SQLexer(){}
SQLexer::~SQLexer()
{
_keywords->Release();
@ -36,7 +35,7 @@ void SQLexer::APPEND_CHAR(WChar c)
}
}
void SQLexer::Init(SQSharedState *ss, SQLEXREADFUNC rg, SQUserPointer up,CompilerErrorFunc efunc,void *ed)
SQLexer::SQLexer(SQSharedState *ss, SQLEXREADFUNC rg, SQUserPointer up,CompilerErrorFunc efunc,void *ed)
{
_errfunc = efunc;
_errtarget = ed;

@ -4,9 +4,8 @@
struct SQLexer
{
SQLexer();
~SQLexer();
void Init(SQSharedState *ss,SQLEXREADFUNC rg,SQUserPointer up,CompilerErrorFunc efunc,void *ed);
SQLexer(SQSharedState *ss,SQLEXREADFUNC rg,SQUserPointer up,CompilerErrorFunc efunc,void *ed);
NORETURN void Error(const SQChar *err);
SQInteger Lex();
const SQChar *Tok2Str(SQInteger tok);

Loading…
Cancel
Save