mirror of
https://gitlab.com/niansa/pilang3.git
synced 2025-03-06 20:49:20 +01:00
21 lines
434 B
C++
21 lines
434 B
C++
#include <iostream>
|
|
#include "pilang.hpp"
|
|
using namespace Pilang3;
|
|
|
|
|
|
class StdIO {
|
|
public:
|
|
static Variable print(Environment&, Cmdargs& args) {
|
|
std::cout << std::get<std::string>(args[0].data) << std::endl;
|
|
return Variable({
|
|
Variable::id_null,
|
|
0
|
|
});
|
|
}
|
|
|
|
StdIO() {
|
|
Pilang3::builtinCmds["print"] = {print, 1, {Variable::id_string}, false};
|
|
}
|
|
};
|
|
|
|
static StdIO inst;
|