Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / handlebars / lib / handlebars / compiler / ast.js
1 let AST = {
2   // Public API used to evaluate derived attributes regarding AST nodes
3   helpers: {
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));
11     },
12
13     scopedId: function(path) {
14       return (/^\.|this\b/).test(path.original);
15     },
16
17     // an ID is simple if it only has one part, and that part is not
18     // `..` or `this`.
19     simpleId: function(path) {
20       return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth;
21     }
22   }
23 };
24
25
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.
28 export default AST;