function parse(sText, oProp) {

		var aLines = sText.split(rLines), // split file into lines
			sLine,rMatcher,sKey,sValue,i,m,iLastIndex,iConcatOps;

		function append(s) {
			if ( sValue ) {
				sValue = sValue + s;
				iConcatOps++;
			} else {
				sValue = s;
				iConcatOps = 0;
			}
		}

		oProp.mProperties = {};

		for (i = 0; i < aLines.length; i++) {
			sLine = aLines[i];
			// ignore empty lines
			if (sLine === "" || sLine.charAt(0) === "#" || sLine.charAt(0) === "!" ) {
				continue;
			}

			// start with the full regexp incl. key/value separator
			rMatcher = rEscapesOrSeparator;
			rMatcher.lastIndex = iLastIndex = 0;
			sKey = null;
			sValue = "";

			while ( (m = rMatcher.exec(sLine)) !== null ) {
				// handle any raw, unmatched input
				if ( iLastIndex < m.index ) {
					append(sLine.slice(iLastIndex, m.index));
				}
				iLastIndex = rMatcher.lastIndex;
				if ( m[1] ) {
					// unicode escape
					if ( m[1].length !== 6 ) {
						throw new Error("Incomplete Unicode Escape '" + m[1] + "'");
					}
					append(String.fromCharCode(parseInt(m[1].slice(2), 16)));
				} else if ( m[2] ) {
					// special or simple escape
					append(mEscapes[m[2]] || m[2].slice(1));
				} else if ( m[3] ) {
					// continuation line marker
					sLine = aLines[++i];
					rMatcher.lastIndex = iLastIndex = 0;
				} else if ( m[4] ) { // only occurs in full regexp
					// key/value separator detected
					// -> remember key and switch to simplified regexp
					sKey = sValue;
					sValue = "";
					rMatcher = rEscapes;
					rMatcher.lastIndex = iLastIndex;
				}
			}
			if ( iLastIndex < sLine.length ) {
				append(sLine.slice(iLastIndex));
			}
			if ( sKey == null ) {
				sKey = sValue;
				sValue = "";
			}

			oProp.mProperties[sKey] = flatstr(sValue, sValue ? iConcatOps : 0); // Note: empty sValue implies iConcatOps == 0

		}

	}
function parse(sText, oProp) {

		var aLines = sText.split(rLines), // split file into lines
			sLine,rMatcher,sKey,sValue,i,m,iLastIndex,iConcatOps;

		function append(s) {
			if ( sValue ) {
				sValue = sValue + s;
				iConcatOps++;
			} else {
				sValue = s;
				iConcatOps = 0;
			}
		}

		oProp.mProperties = {};

		for (i = 0; i < aLines.length; i++) {
			sLine = aLines[i];
			// ignore empty lines
			if (sLine === "" || sLine.charAt(0) === "#" || sLine.charAt(0) === "!" ) {
				continue;
			}

			// start with the full regexp incl. key/value separator
			rMatcher = rEscapesOrSeparator;
			rMatcher.lastIndex = iLastIndex = 0;
			sKey = null;
			sValue = "";

			while ( (m = rMatcher.exec(sLine)) !== null ) {
				// handle any raw, unmatched input
				if ( iLastIndex < m.index ) {
					append(sLine.slice(iLastIndex, m.index));
				}
				iLastIndex = rMatcher.lastIndex;
				if ( m[1] ) {
					// unicode escape
					if ( m[1].length !== 6 ) {
						throw new Error("Incomplete Unicode Escape '" + m[1] + "'");
					}
					append(String.fromCharCode(parseInt(m[1].slice(2), 16)));
				} else if ( m[2] ) {
					// special or simple escape
					append(mEscapes[m[2]] || m[2].slice(1));
				} else if ( m[3] ) {
					// continuation line marker
					sLine = aLines[++i];
					rMatcher.lastIndex = iLastIndex = 0;
				} else if ( m[4] ) { // only occurs in full regexp
					// key/value separator detected
					// -> remember key and switch to simplified regexp
					sKey = sValue;
					sValue = "";
					rMatcher = rEscapes;
					rMatcher.lastIndex = iLastIndex;
				}
			}
			if ( iLastIndex < sLine.length ) {
				append(sLine.slice(iLastIndex));
			}
			if ( sKey == null ) {
				sKey = sValue;
				sValue = "";
			}

			oProp.mProperties[sKey] = flatstr(sValue, sValue ? iConcatOps : 0); // Note: empty sValue implies iConcatOps == 0

		}

	}
function parse ( sText , oProp ) { var aLines = sText . split ( rLines ) , // split file into lines sLine , rMatcher , sKey , sValue , i , m , iLastIndex , iConcatOps ; function append ( s ) { if ( sValue ) { sValue = sValue + s ; iConcatOps ++ ; } else { sValue = s ; iConcatOps = 0 ; } } oProp . mProperties = { } ; for ( i = 0 ; i < aLines . length ; i ++ ) { sLine = aLines [ i ] ; // ignore empty lines if ( sLine === "" || sLine . charAt ( 0 ) === "#" || sLine . charAt ( 0 ) === "!" ) { continue ; } // start with the full regexp incl. key/value separator rMatcher = rEscapesOrSeparator ; rMatcher . lastIndex = iLastIndex = 0 ; sKey = null ; sValue = "" ; while ( ( m = rMatcher . exec ( sLine ) ) !== null ) { // handle any raw, unmatched input if ( iLastIndex < m . index ) { append ( sLine . slice ( iLastIndex , m . index ) ) ; } iLastIndex = rMatcher . lastIndex ; if ( m [ 1 ] ) { // unicode escape if ( m [ 1 ] . length !== 6 ) { throw new Error ( "Incomplete Unicode Escape '" + m [ 1 ] + "'" ) ; } append ( String . fromCharCode ( parseInt ( m [ 1 ] . slice ( 2 ) , 16 ) ) ) ; } else if ( m [ 2 ] ) { // special or simple escape append ( mEscapes [ m [ 2 ] ] || m [ 2 ] . slice ( 1 ) ) ; } else if ( m [ 3 ] ) { // continuation line marker sLine = aLines [ ++ i ] ; rMatcher . lastIndex = iLastIndex = 0 ; } else if ( m [ 4 ] ) { // only occurs in full regexp // key/value separator detected // -> remember key and switch to simplified regexp sKey = sValue ; sValue = "" ; rMatcher = rEscapes ; rMatcher . lastIndex = iLastIndex ; } } if ( iLastIndex < sLine . length ) { append ( sLine . slice ( iLastIndex ) ) ; } if ( sKey == null ) { sKey = sValue ; sValue = "" ; } oProp . mProperties [ sKey ] = flatstr ( sValue , sValue ? iConcatOps : 0 ) ; // Note: empty sValue implies iConcatOps == 0 } }
/*
Parses the given text sText and sets the properties
in the properties object oProp accordingly.
@param {string} sText the text to parse
@param oProp the properties object to fill
@private
/ * Parses the given text sText and sets the properties in the properties object oProp accordingly .
Parses a text file into a property object