(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

This commit is contained in:
rubidium 2014-09-16 20:08:44 +00:00
parent 5502a19f3d
commit 3d2f511f43
3 changed files with 3 additions and 6 deletions

View File

@ -57,10 +57,9 @@ typedef sqvector<ExpState> ExpStateVec;
class SQCompiler class SQCompiler
{ {
public: 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; _vm=v;
_lex.Init(_ss(v), rg, up,ThrowError,this);
_sourcename = SQString::Create(_ss(v), sourcename); _sourcename = SQString::Create(_ss(v), sourcename);
_lineinfo = lineinfo;_raiseerror = raiseerror; _lineinfo = lineinfo;_raiseerror = raiseerror;
} }

View File

@ -21,7 +21,6 @@
#define NEXT() {Next();_currentcolumn++;} #define NEXT() {Next();_currentcolumn++;}
#define ADD_KEYWORD(key,id) _keywords->NewSlot( SQString::Create(ss, #key) ,SQInteger(id)) #define ADD_KEYWORD(key,id) _keywords->NewSlot( SQString::Create(ss, #key) ,SQInteger(id))
SQLexer::SQLexer(){}
SQLexer::~SQLexer() SQLexer::~SQLexer()
{ {
_keywords->Release(); _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; _errfunc = efunc;
_errtarget = ed; _errtarget = ed;

View File

@ -4,9 +4,8 @@
struct SQLexer struct SQLexer
{ {
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); NORETURN void Error(const SQChar *err);
SQInteger Lex(); SQInteger Lex();
const SQChar *Tok2Str(SQInteger tok); const SQChar *Tok2Str(SQInteger tok);