lib/utils/cssSections.js
function(content, pos, sanitize) {
			if (sanitize) {
				content = this.sanitize(content);
			}

			var stream = stringStream(content);
			stream.start = stream.pos = pos;
			var stack = [], ranges = [];
			var ch;
			while (ch = stream.next()) {
				if (ch == '{') {
					stack.push(stream.pos - 1);
				} else if (ch == '}') {
					if (!stack.length) {
						throw 'Invalid source structure (check for curly braces)';
					}
					ranges.push(range.create2(stack.pop(), stream.pos));
					if (!stack.length) {
						return ranges;
					}
				} else {
					stream.skipQuoted();
				}
			}

			return ranges;
		}
function(content, pos, sanitize) {
			if (sanitize) {
				content = this.sanitize(content);
			}

			var stream = stringStream(content);
			stream.start = stream.pos = pos;
			var stack = [], ranges = [];
			var ch;
			while (ch = stream.next()) {
				if (ch == '{') {
					stack.push(stream.pos - 1);
				} else if (ch == '}') {
					if (!stack.length) {
						throw 'Invalid source structure (check for curly braces)';
					}
					ranges.push(range.create2(stack.pop(), stream.pos));
					if (!stack.length) {
						return ranges;
					}
				} else {
					stream.skipQuoted();
				}
			}

			return ranges;
		}
function ( content , pos , sanitize ) { if ( sanitize ) { content = this . sanitize ( content ) ; } var stream = stringStream ( content ) ; stream . start = stream . pos = pos ; var stack = [ ] , ranges = [ ] ; var ch ; while ( ch = stream . next ( ) ) { if ( ch == '{' ) { stack . push ( stream . pos - 1 ) ; } else if ( ch == '}' ) { if ( ! stack . length ) { throw 'Invalid source structure (check for curly braces)' ; } ranges . push ( range . create2 ( stack . pop ( ) , stream . pos ) ) ; if ( ! stack . length ) { return ranges ; } } else { stream . skipQuoted ( ) ; } } return ranges ; }
Matches curly braces content right after given position
@param  {String} content CSS content. Must not contain comments!
@param  {Number} pos     Search start position
@return {Range}
Matches curly braces content right after given position