diff --git a/luaparse/luaparse-tests.ts b/luaparse/luaparse-tests.ts new file mode 100644 index 0000000000..af10d12d64 --- /dev/null +++ b/luaparse/luaparse-tests.ts @@ -0,0 +1,10 @@ +/// + +import luaparse = require('luaparse'); + +var luacode: string = '-- this is hello world in lua.\nprint(\'hello world\')'; +var ast: Object = luaparse.parse(luacode); +console.log(JSON.stringify(ast)); + +ast = luaparse.parse(luacode, {comments: false}); +console.log(JSON.stringify(ast)); diff --git a/luaparse/luaparse.d.ts b/luaparse/luaparse.d.ts new file mode 100644 index 0000000000..311bf651dc --- /dev/null +++ b/luaparse/luaparse.d.ts @@ -0,0 +1,8 @@ +// Type definitions for luaparse +// Project: https://github.com/oxyc/luaparse +// Definitions by: Sam Saint-Pettersen +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "luaparse" { + export function parse(code: string, options?: Object): Object; +}