lib/packages/parsers.js
function(raw_directive, view_config, is_top_directive) {

		var directive_name = raw_directive.name,
			config = this._directives_schema[directive_name];

		if (!config) Lava.t("Unknown directive: " + directive_name);

		if (config.view_config_presence) {
			if (view_config && !config.view_config_presence) Lava.t('Directive must not be inside view definition: ' + directive_name);
			if (!view_config && config.view_config_presence) Lava.t('Directive must be inside view definition: ' + directive_name);
		}

		if (config.is_top_directive && !is_top_directive) Lava.t("Directive must be at the top of the block content: " + directive_name);

		return this['_x' + directive_name](raw_directive, view_config);

	}
function(raw_directive, view_config, is_top_directive) {

		var directive_name = raw_directive.name,
			config = this._directives_schema[directive_name];

		if (!config) Lava.t("Unknown directive: " + directive_name);

		if (config.view_config_presence) {
			if (view_config && !config.view_config_presence) Lava.t('Directive must not be inside view definition: ' + directive_name);
			if (!view_config && config.view_config_presence) Lava.t('Directive must be inside view definition: ' + directive_name);
		}

		if (config.is_top_directive && !is_top_directive) Lava.t("Directive must be at the top of the block content: " + directive_name);

		return this['_x' + directive_name](raw_directive, view_config);

	}
function ( raw_directive , view_config , is_top_directive ) { var directive_name = raw_directive . name , config = this . _directives_schema [ directive_name ] ; if ( ! config ) Lava . t ( "Unknown directive: " + directive_name ) ; if ( config . view_config_presence ) { if ( view_config && ! config . view_config_presence ) Lava . t ( 'Directive must not be inside view definition: ' + directive_name ) ; if ( ! view_config && config . view_config_presence ) Lava . t ( 'Directive must be inside view definition: ' + directive_name ) ; } if ( config . is_top_directive && ! is_top_directive ) Lava . t ( "Directive must be at the top of the block content: " + directive_name ) ; return this [ '_x' + directive_name ] ( raw_directive , view_config ) ; }
Handle directive tag
@param {_cRawDirective} raw_directive Raw directive tag
@param {(_cView|_cWidget)} view_config Config of the directive's parent view
@param {boolean} is_top_directive Code style validation switch. Some directives must be at the top of templates
@returns {*} Compiled template item or nothing
Handle directive tag