function tryParseSelector(selector) {
	try {
		return esquery.parse(selector);
	} catch (err) {
		if (
			err.location &&
			err.location.start &&
			typeof err.location.start.offset === "number"
		) {
			throw new SyntaxError(
				`Syntax error in selector "${selector}" at position ${err.location.start.offset}: ${err.message}`,
			);
		}
		throw err;
	}
}
Parses a raw selector string, and throws a useful error if parsing fails.
@param {string} selector The selector string to parse.
@returns {Object} An object (from esquery) describing the matching behavior of this selector
@throws {Error} An error if the selector is invalid