A programming language for manipulation of streams.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

17 行
671 B

#include "tool.h"
#include "drop_if.hpp"
#include "inputs.hpp"
#include "parse_tool.h"
#include "base.hpp"
std::optional<std::shared_ptr<tool> > mktool(std::string toolname, tool_env env)
{
if(toolname=="identity") return std::make_shared<identity>(env);
if(toolname=="echo") return std::make_shared<echo>(env);
if(toolname=="pipe") return std::make_shared<pipe>(env);
if(toolname=="filter_numbers") return std::make_shared<filter_numbers>(env);
if(toolname=="filter_in") return std::make_shared<filter_in>(env);
if(toolname=="fin") return std::make_shared<file_lines>(env);
if(toolname=="stdin") return std::make_shared<stdin_lines>(env);
return std::nullopt;
}