function parseSourceRanges()

in src/main.ts [610:637]


function parseSourceRanges(text: string): SourceRanges {
	const definedDependencies: DependencySourceRanges = {};
	const properties: PropertySourceRanges = {};
	const errors: ParseError[] = [];
	const node = parseTree(text, errors);

	if (node.children) {
		node.children.forEach(child => {
			const children = child.children;
			if (children) {
				const property = children[0];
				properties[property.value] = {
					name: {
						offset: property.offset,
						length: property.length
					}
				};
				if (children && children.length === 2 && isDependency(children[0].value)) {
					collectDefinedDependencies(definedDependencies, children[1]);
				}
			}
		});
	}
	return {
		dependencies: definedDependencies,
		properties: properties
	};
}