1 | var exports = module.exports;
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | exports.compile = function(compiler, args, content, parents, options, blockName) {
|
16 | var code = '_ctx._yog.load(' + args[0] + ', ' + args[1] + ');'
|
17 | return code;
|
18 | };
|
19 |
|
20 | exports.parse = function(str, line, parser, types) {
|
21 | parser.on(types.STRING, function (token) {
|
22 | this.out.unshift(token.match);
|
23 | });
|
24 | parser.on(types.VAR, function (token) {
|
25 | if (token.match === 'external') {
|
26 | this.out.push(true);
|
27 | }else {
|
28 | this.out.unshift('_ctx.' + token.match);
|
29 | }
|
30 | });
|
31 | return true;
|
32 | };
|
33 |
|
34 | exports.ends = false;
|