Guest User

Untitled

a guest
May 24th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. int main(int argc, const char* argv[]) {
  2. flow::lang::Interpreter interpreter;
  3. interpreter.registerFunction("greetings").param<std::string>("from").bind([](Params& params) {
  4. std::cout << "Greetings, " << params.getString(1) << '\n';
  5. });
  6.  
  7. interpreter.compileSource(R"|
  8. main {
  9. greetings "World";
  10. }
  11. |");
  12.  
  13. interpreter.run("main");
  14. }
Add Comment
Please, Sign In to add comment