代码拉取完成,页面将自动刷新
apolloxlua 目前支持javascript到lua的翻译。可以在openresty和luajit里使用。这个工具分为两种模式, 一种是web模式,可以通过网页使用。另> 这里输入引用文本外一种是tool模式, 通常作为大规模翻译文件的工具使用。 agent.zy 于 18.07.21 晚
//[NameSpace("core")]
class Person{
hellow(){
console.log("base Person")
console.log(this.age)
}
setAge(v) {
this.age = v;
}
static staticSmethod (...args) {
console.log(args[1], args[2]);
console.log("i am static method");
}
}
class Person2 extends Person{
Person2 (name) {
this.name = name;
console.log("constructor..");
}
hellow(){
console.log("override ");
console.log("name=" + this.name + ",age=" + this.age);
}
}
var p1 = Person >>> New();
var p2 = Person2 >>> New("agent.zy");
p1 >>> setAge(10);
p2 >>> setAge(20);
p1 >>> hellow();
p2 >>> hellow();
1可以使用luajit的ffi或swig扩展你的服务器。在语法分析里添加相应的标准库。 2可以集成现有的lua库,包括但不限于resty*和nginx-lua-*。 3可以通过本工具的js语法,实现库的自举。
下载后解压到你的目录, 通过控制台找到项目目录
生成web模式的js文件
make web
生成工具模式的js文件
make tool
生成两种模式文件
make all
##使用方式:
web模式 : 在apolloxlua.js载入浏览器后使用一个全局的包装叫apolloxLua的变量包含一个parse的方法, 接受一个js代码串,返回lua代码串。 tool模式: 使用的方式 node apolloxlua 输入文件 输出文件
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型