项目作者: germinolegrand

项目描述 :
JS interpreter in C++
高级语言: C++
项目地址: git://github.com/germinolegrand/Cpp.js.git
创建时间: 2018-05-18T01:23:53Z
项目社区:https://github.com/germinolegrand/Cpp.js

开源协议:

下载


Build Status

Cpp.js is a project with no pretention. It aims to be a JS interpreter in a C++ environment. The JS environment should be highly and easily manipulable from simple modern C++.

  1. var{{
  2. {"console", {{
  3. {"log", var(
  4. [](auto args){
  5. std::copy(std::begin(args), std::end(args), std::ostream_iterator<var>(std::cout));
  6. std::cout << '\n';
  7. return var{};
  8. })
  9. }
  10. }}},
  11. {"exit", var(
  12. [](auto args)->var{
  13. exit(args.size() >= 1 ? static_cast<int>(args[0].to_double()) : 0);
  14. })
  15. }
  16. }}

Currently it is still in an early stage, but is advanced enough to support a basic Interpreter.

You will find examples in tests/.

Build

This repository has submodules, don’t forget init them :

  1. # git submodule update --init

For Code::Blocks (see https://github.com/chris-be/premake-codeblocks):

  1. # cd build
  2. # premake5 codeblocks

For Linux:

  1. # cd build
  2. # premake5-linux64 gmake2
  3. # make

For MinGW64:

  1. # cd build
  2. # premake5 gmake2
  3. # mingw32-make