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

		var current_block,
			result = [],
			type,
			i = 0,
			count = blocks.length,
			x;

		for (; i < count; i++) {

			current_block = blocks[i];
			type = (typeof(current_block) == 'string') ? 'string' : current_block.type;

			if (type == 'tag') {

				x = current_block.x;

				if (x) {

					if ('type' in x) {

						if ('widget' in x) Lava.t("Malformed tag: both x:type and x:widget present");
						type = x.type;
						if (['view', 'container', 'static'].indexOf(type) == -1) Lava.t("Unknown x:type attribute: " + type);

					} else if ('widget' in x) {

						type = 'widget';

					} else if (Lava.sugar_map[current_block.name]) {

						type = 'sugar';

					} else {

						Lava.t("Tag with control attributes and no sugar or type on it: " + current_block.name);

					}

				} else if (Lava.sugar_map[current_block.name]) {

					type = 'sugar';

				} // else type = 'tag' - default

			}

			this[this._compile_handlers[type]](result, current_block, view_config);

		}

		return result;

	}
function(blocks, view_config) {

		var current_block,
			result = [],
			type,
			i = 0,
			count = blocks.length,
			x;

		for (; i < count; i++) {

			current_block = blocks[i];
			type = (typeof(current_block) == 'string') ? 'string' : current_block.type;

			if (type == 'tag') {

				x = current_block.x;

				if (x) {

					if ('type' in x) {

						if ('widget' in x) Lava.t("Malformed tag: both x:type and x:widget present");
						type = x.type;
						if (['view', 'container', 'static'].indexOf(type) == -1) Lava.t("Unknown x:type attribute: " + type);

					} else if ('widget' in x) {

						type = 'widget';

					} else if (Lava.sugar_map[current_block.name]) {

						type = 'sugar';

					} else {

						Lava.t("Tag with control attributes and no sugar or type on it: " + current_block.name);

					}

				} else if (Lava.sugar_map[current_block.name]) {

					type = 'sugar';

				} // else type = 'tag' - default

			}

			this[this._compile_handlers[type]](result, current_block, view_config);

		}

		return result;

	}
function ( blocks , view_config ) { var current_block , result = [ ] , type , i = 0 , count = blocks . length , x ; for ( ; i < count ; i ++ ) { current_block = blocks [ i ] ; type = ( typeof ( current_block ) == 'string' ) ? 'string' : current_block . type ; if ( type == 'tag' ) { x = current_block . x ; if ( x ) { if ( 'type' in x ) { if ( 'widget' in x ) Lava . t ( "Malformed tag: both x:type and x:widget present" ) ; type = x . type ; if ( [ 'view' , 'container' , 'static' ] . indexOf ( type ) == - 1 ) Lava . t ( "Unknown x:type attribute: " + type ) ; } else if ( 'widget' in x ) { type = 'widget' ; } else if ( Lava . sugar_map [ current_block . name ] ) { type = 'sugar' ; } else { Lava . t ( "Tag with control attributes and no sugar or type on it: " + current_block . name ) ; } } else if ( Lava . sugar_map [ current_block . name ] ) { type = 'sugar' ; } // else type = 'tag' - default } this [ this . _compile_handlers [ type ] ] ( result , current_block , view_config ) ; } return result ; }
Compile raw template config
@param {_tRawTemplate} blocks
@param {_cView} [view_config]
@returns {_tTemplate}
Compile raw template config