You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
cpp-peglib/tutorial/code/repl.cc

24 lines
428 B

#include <iostream>
#include "linenoise.hpp"
using namespace std;
int main(void)
{
while (true) {
// テキスト入力
auto line = linenoise::Readline("> ");
// 空行ならスキップ
if (line.empty()) {
break;
}
// 入力テキストをそのまま出力
cout << "echo: '" << line << "'" << endl;
// 履歴に追加
linenoise::AddHistory(line.c_str());
}
return 0;
}