Merge pull request #4921 from stpettersens/master

Type definitions and tests for node luaparse module
This commit is contained in:
Horiuchi_H
2015-07-15 10:27:44 +09:00
2 changed files with 18 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
/// <reference path="luaparse.d.ts" />
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));

8
luaparse/luaparse.d.ts vendored Normal file
View File

@@ -0,0 +1,8 @@
// Type definitions for luaparse
// Project: https://github.com/oxyc/luaparse
// Definitions by: Sam Saint-Pettersen <https://github.com/stpettersens>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "luaparse" {
export function parse(code: string, options?: Object): Object;
}