src/parse/read/directives.js/readBindingDirective
export function readBindingDirective ( parser, start, name ) {
	let value;

	if ( parser.eat( '=' ) ) {
		const quoteMark = (
			parser.eat( `'` ) ? `'` :
			parser.eat( `"` ) ? `"` :
			null
		);

		const a = parser.index;

		if ( parser.eat( '{{' ) ) {
			let message = 'bound values should not be wrapped';
			const b = parser.template.indexOf( '}}', a );
			if ( b !== -1 ) {
				const value = parser.template.slice( parser.index, b );
				message += ` — use '${value}', not '{{${value}}}'`;
			}

			parser.error( message, a );
		}

		// this is a bit of a hack so that we can give Acorn something parseable
		let b;
		if ( quoteMark ) {
			b = parser.index = parser.template.indexOf( quoteMark, parser.index );
		} else {
			parser.readUntil( /[\s\r\n\/>]/ );
			b = parser.index;
		}

		const source = spaces( a ) + parser.template.slice( a, b );
		value = parseExpressionAt( source, a );

		if ( value.type !== 'Identifier' && value.type !== 'MemberExpression' ) {
			parser.error( `Expected valid property name` );
		}

		parser.allowWhitespace();

		if ( quoteMark ) {
			parser.eat( quoteMark, true );
		}
	} else {
		// shorthand – bind:foo equivalent to bind:foo='foo'
		value = {
			type: 'Identifier',
			start: start + 5,
			end: parser.index,
			name
		};
	}

	return {
		start,
		end: parser.index,
		type: 'Binding',
		name,
		value
	};
}