mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(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:
parent
5502a19f3d
commit
3d2f511f43
@ -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;
|
||||||
}
|
}
|
||||||
|
3
src/3rdparty/squirrel/squirrel/sqlexer.cpp
vendored
3
src/3rdparty/squirrel/squirrel/sqlexer.cpp
vendored
@ -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;
|
||||||
|
3
src/3rdparty/squirrel/squirrel/sqlexer.h
vendored
3
src/3rdparty/squirrel/squirrel/sqlexer.h
vendored
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user