Browse files

[api] added method parseAST() to bypass lexer in parse(). should be r…

…efactored
  • Loading branch information...
1 parent d1a681b commit 4f8a52c9835296f6d03dee62d3fde1020b4f7897 @Marak Marak committed Sep 3, 2010
Showing with 6 additions and 1 deletion.
  1. +1 −0 lib/kyuri.js
  2. +5 −1 lib/kyuri/core.js
View
1 lib/kyuri.js
@@ -13,6 +13,7 @@ var kyuri = exports;
kyuri.version = '0.0.1';
kyuri.compile = require('kyuri/core').compile;
kyuri.parse = require('kyuri/core').parse;
+kyuri.parseAST = require('kyuri/core').parseAST;
kyuri.tokens = require('kyuri/core').tokens;
kyuri.nodes = require('kyuri/core').nodes;
kyuri.setLanguage = require('kyuri/core').setLanguage;
View
6 lib/kyuri/core.js
@@ -30,9 +30,13 @@ exports.compile = function (code, options) {
}
};
+exports.parseAST = function (ast) {
+ return parser.parse(ast);
+};
+
exports.parse = function (code) {
return parser.parse(lexer.tokenize(code));
-}
+};
exports.tokens = function (code) {
return lexer.tokenize(code);

0 comments on commit 4f8a52c

Please sign in to comment.