Create new string in Lexer when not passed by reference
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
976b4ef2ec
commit
7f73bf07d2
|
@ -12,8 +12,8 @@ Lexer::Lexer(string* scriptString, class Script* script) {
|
|||
this -> _position = 0;
|
||||
}
|
||||
|
||||
Lexer::Lexer(string scriptString, class Script *script) {
|
||||
this -> _scriptString = &scriptString;
|
||||
Lexer::Lexer(const string& scriptString, class Script *script) {
|
||||
this -> _scriptString = new string(scriptString);
|
||||
this->_scriptSize = scriptString.size();
|
||||
this -> ScriptData = script;
|
||||
this -> _position = 0;
|
||||
|
|
|
@ -25,7 +25,7 @@ public:
|
|||
|
||||
vector<IToken*> Lex();
|
||||
explicit Lexer(string* scriptString, class Script* script);
|
||||
explicit Lexer(string scriptString, class Script* script);
|
||||
explicit Lexer(const string& scriptString, class Script* script);
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue