src/parse/state/tag.js/readAttribute
function readAttribute ( parser, uniqueNames ) {
	const start = parser.index;

	let name = parser.readUntil( /(\s|=|\/|>)/ );
	if ( !name ) return null;
	if ( uniqueNames.has( name ) ) {
		parser.error( 'Attributes need to be unique', start );
	}

	uniqueNames.add( name );

	parser.allowWhitespace();

	if ( /^on:/.test( name ) ) {
		parser.eat( '=', true );
		return readEventHandlerDirective( parser, start, name.slice( 3 ) );
	}

	if ( /^bind:/.test( name ) ) {
		return readBindingDirective( parser, start, name.slice( 5 ) );
	}

	if ( /^ref:/.test( name ) ) {
		return {
			start,
			end: parser.index,
			type: 'Ref',
			name: name.slice( 4 )
		};
	}

	let value;

	// :foo is shorthand for foo='{{foo}}'
	if ( /^:\w+$/.test( name ) ) {
		name = name.slice( 1 );
		value = getShorthandValue( start + 1, name );
	} else {
		value = parser.eat( '=' ) ? readAttributeValue( parser ) : true;
	}

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