Util: Move vector<Token> ownership to Job class

This commit is contained in:
Riyyi
2022-06-26 23:13:25 +02:00
parent bc01b34e58
commit 8fb1a1a8e9
7 changed files with 58 additions and 34 deletions
+4 -8
View File
@@ -104,10 +104,8 @@ Value::Value(const std::initializer_list<Value>& values)
Value Value::parse(const std::string& input)
{
std::shared_ptr<Job> job = std::make_shared<Job>(input);
Parser parser(job);
Value value = parser.parse();
Job job(input);
Value value = job.fire();
return value;
}
@@ -232,10 +230,8 @@ std::istream& operator>>(std::istream& input, Value& value)
}
inputString.append(buffer, input.gcount());
std::shared_ptr<Job> job = std::make_shared<Job>(inputString);
Parser parser(job);
value = parser.parse();
Job job(inputString);
value = job.fire();
return input;
}