can-stache.js
function(section, mode, stache, lineNo){

			if(mode === ">") {
				// Partials use liveBindingPartialRenderers
				section.add(mustacheCore.makeLiveBindingPartialRenderer(stache, copyState({ filename: section.filename, lineNo: lineNo })));

			} else if(mode === "/") {

				var createdSection = section.last();
				if ( createdSection.startedWith === "<" ) {
					inlinePartials[ stache ] = section.endSubSectionAndReturnRenderer();
					section.removeCurrentNode();
				} else {
					section.endSection();
				}

				// to avoid "Blocks are nested too deeply" when linting
				//!steal-remove-start
				if (process.env.NODE_ENV !== 'production') {
					if(section instanceof HTMLSectionBuilder) {
						var last = state.sectionElementStack[state.sectionElementStack.length - 1];
						if (last.tag && last.type === "section" && stache !== "" && stache !== last.tag) {
							if (filename) {
								dev.warn(filename + ":" + lineNo + ": unexpected closing tag {{/" + stache + "}} expected {{/" + last.tag + "}}");
							}
							else {
								dev.warn(lineNo + ": unexpected closing tag {{/" + stache + "}} expected {{/" + last.tag + "}}");
							}
						}
					}
				}
				//!steal-remove-end

				if(section instanceof HTMLSectionBuilder) {
					state.sectionElementStack.pop();
				}
			} else if(mode === "else") {

				section.inverse();

			} else {

				// If we are an HTMLSection, we will generate a
				// a LiveBindingBranchRenderer; otherwise, a StringBranchRenderer.
				// A LiveBindingBranchRenderer function processes
				// the mustache text, and sets up live binding if an observable is read.
				// A StringBranchRenderer function processes the mustache text and returns a
				// text value.
				var makeRenderer = section instanceof HTMLSectionBuilder ?
					mustacheCore.makeLiveBindingBranchRenderer:
					mustacheCore.makeStringBranchRenderer;

				if(mode === "{" || mode === "&") {

					// Adds a renderer function that just reads a value or calls a helper.
					section.add(makeRenderer(null,stache, copyState({ filename: section.filename, lineNo: lineNo })));

				} else if(mode === "#" || mode === "^" || mode === "<") {
					// Adds a renderer function and starts a section.
					var renderer = makeRenderer(mode, stache, copyState({ filename: section.filename, lineNo: lineNo }));
					var sectionItem = {
						type: "section"
					};
					section.startSection(renderer);
					section.last().startedWith = mode;

					// If we are a directly nested section, count how many we are within
					if(section instanceof HTMLSectionBuilder) {
						//!steal-remove-start
						if (process.env.NODE_ENV !== 'production') {
							var tag = typeof renderer.exprData.closingTag === 'function' ?
								renderer.exprData.closingTag() : stache;
							sectionItem.tag = tag;
						}
						//!steal-remove-end

						state.sectionElementStack.push(sectionItem);
					}
				} else {
					// Adds a renderer function that only updates text.
					section.add(makeRenderer(null, stache, copyState({text: true, filename: section.filename, lineNo: lineNo })));
				}

			}
		}
function(section, mode, stache, lineNo){

			if(mode === ">") {
				// Partials use liveBindingPartialRenderers
				section.add(mustacheCore.makeLiveBindingPartialRenderer(stache, copyState({ filename: section.filename, lineNo: lineNo })));

			} else if(mode === "/") {

				var createdSection = section.last();
				if ( createdSection.startedWith === "<" ) {
					inlinePartials[ stache ] = section.endSubSectionAndReturnRenderer();
					section.removeCurrentNode();
				} else {
					section.endSection();
				}

				// to avoid "Blocks are nested too deeply" when linting
				//!steal-remove-start
				if (process.env.NODE_ENV !== 'production') {
					if(section instanceof HTMLSectionBuilder) {
						var last = state.sectionElementStack[state.sectionElementStack.length - 1];
						if (last.tag && last.type === "section" && stache !== "" && stache !== last.tag) {
							if (filename) {
								dev.warn(filename + ":" + lineNo + ": unexpected closing tag {{/" + stache + "}} expected {{/" + last.tag + "}}");
							}
							else {
								dev.warn(lineNo + ": unexpected closing tag {{/" + stache + "}} expected {{/" + last.tag + "}}");
							}
						}
					}
				}
				//!steal-remove-end

				if(section instanceof HTMLSectionBuilder) {
					state.sectionElementStack.pop();
				}
			} else if(mode === "else") {

				section.inverse();

			} else {

				// If we are an HTMLSection, we will generate a
				// a LiveBindingBranchRenderer; otherwise, a StringBranchRenderer.
				// A LiveBindingBranchRenderer function processes
				// the mustache text, and sets up live binding if an observable is read.
				// A StringBranchRenderer function processes the mustache text and returns a
				// text value.
				var makeRenderer = section instanceof HTMLSectionBuilder ?
					mustacheCore.makeLiveBindingBranchRenderer:
					mustacheCore.makeStringBranchRenderer;

				if(mode === "{" || mode === "&") {

					// Adds a renderer function that just reads a value or calls a helper.
					section.add(makeRenderer(null,stache, copyState({ filename: section.filename, lineNo: lineNo })));

				} else if(mode === "#" || mode === "^" || mode === "<") {
					// Adds a renderer function and starts a section.
					var renderer = makeRenderer(mode, stache, copyState({ filename: section.filename, lineNo: lineNo }));
					var sectionItem = {
						type: "section"
					};
					section.startSection(renderer);
					section.last().startedWith = mode;

					// If we are a directly nested section, count how many we are within
					if(section instanceof HTMLSectionBuilder) {
						//!steal-remove-start
						if (process.env.NODE_ENV !== 'production') {
							var tag = typeof renderer.exprData.closingTag === 'function' ?
								renderer.exprData.closingTag() : stache;
							sectionItem.tag = tag;
						}
						//!steal-remove-end

						state.sectionElementStack.push(sectionItem);
					}
				} else {
					// Adds a renderer function that only updates text.
					section.add(makeRenderer(null, stache, copyState({text: true, filename: section.filename, lineNo: lineNo })));
				}

			}
		}
function ( section , mode , stache , lineNo ) { if ( mode === ">" ) { // Partials use liveBindingPartialRenderers section . add ( mustacheCore . makeLiveBindingPartialRenderer ( stache , copyState ( { filename : section . filename , lineNo : lineNo } ) ) ) ; } else if ( mode === "/" ) { var createdSection = section . last ( ) ; if ( createdSection . startedWith === "<" ) { inlinePartials [ stache ] = section . endSubSectionAndReturnRenderer ( ) ; section . removeCurrentNode ( ) ; } else { section . endSection ( ) ; } // to avoid "Blocks are nested too deeply" when linting //!steal-remove-start if ( process . env . NODE_ENV !== 'production' ) { if ( section instanceof HTMLSectionBuilder ) { var last = state . sectionElementStack [ state . sectionElementStack . length - 1 ] ; if ( last . tag && last . type === "section" && stache !== "" && stache !== last . tag ) { if ( filename ) { dev . warn ( filename + ":" + lineNo + ": unexpected closing tag {{/" + stache + "}} expected {{/" + last . tag + "}}" ) ; } else { dev . warn ( lineNo + ": unexpected closing tag {{/" + stache + "}} expected {{/" + last . tag + "}}" ) ; } } } } //!steal-remove-end if ( section instanceof HTMLSectionBuilder ) { state . sectionElementStack . pop ( ) ; } } else if ( mode === "else" ) { section . inverse ( ) ; } else { // If we are an HTMLSection, we will generate a // a LiveBindingBranchRenderer; otherwise, a StringBranchRenderer. // A LiveBindingBranchRenderer function processes // the mustache text, and sets up live binding if an observable is read. // A StringBranchRenderer function processes the mustache text and returns a // text value. var makeRenderer = section instanceof HTMLSectionBuilder ? mustacheCore . makeLiveBindingBranchRenderer : mustacheCore . makeStringBranchRenderer ; if ( mode === "{" || mode === "&" ) { // Adds a renderer function that just reads a value or calls a helper. section . add ( makeRenderer ( null , stache , copyState ( { filename : section . filename , lineNo : lineNo } ) ) ) ; } else if ( mode === "#" || mode === "^" || mode === "<" ) { // Adds a renderer function and starts a section. var renderer = makeRenderer ( mode , stache , copyState ( { filename : section . filename , lineNo : lineNo } ) ) ; var sectionItem = { type : "section" } ; section . startSection ( renderer ) ; section . last ( ) . startedWith = mode ; // If we are a directly nested section, count how many we are within if ( section instanceof HTMLSectionBuilder ) { //!steal-remove-start if ( process . env . NODE_ENV !== 'production' ) { var tag = typeof renderer . exprData . closingTag === 'function' ? renderer . exprData . closingTag ( ) : stache ; sectionItem . tag = tag ; } //!steal-remove-end state . sectionElementStack . push ( sectionItem ) ; } } else { // Adds a renderer function that only updates text. section . add ( makeRenderer ( null , stache , copyState ( { text : true , filename : section . filename , lineNo : lineNo } ) ) ) ; } } }
The HTML section that is the root section for the entire template.
The HTML section that is the root section for the entire template .