2 // Public API used to evaluate derived attributes regarding AST nodes
4 // a mustache is definitely a helper if:
5 // * it is an eligible helper, and
6 // * it has at least one parameter or hash segment
7 helperExpression: function(node) {
8 return (node.type === 'SubExpression')
9 || ((node.type === 'MustacheStatement' || node.type === 'BlockStatement')
10 && !!((node.params && node.params.length) || node.hash));
13 scopedId: function(path) {
14 return (/^\.|this\b/).test(path.original);
17 // an ID is simple if it only has one part, and that part is not
19 simpleId: function(path) {
20 return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth;
26 // Must be exported as an object rather than the root of the module as the jison lexer
27 // must modify the object to operate properly.