Skip to content

Commit

Permalink
[api] added method parseAST() to bypass lexer in parse(). should be r…
Browse files Browse the repository at this point in the history
…efactored
  • Loading branch information
Marak committed Sep 3, 2010
1 parent d1a681b commit 4f8a52c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/kyuri.js
Expand Up @@ -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;
Expand Down
6 changes: 5 additions & 1 deletion lib/kyuri/core.js
Expand Up @@ -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);
Expand Down

0 comments on commit 4f8a52c

Please sign in to comment.