If your target has an enemy within 5ft, can you sneak attack without using a finesse or ranged weapon?

A rogue and fighter are engaged in melee combat with a goblin. The rogue is unarmed. Can the rogue activate Sneak Attack?

The rules for Sneak Attack state:

Beginning at 1st level, you know how to strike subtly and exploit a foe’s distraction. Once per turn, you can deal an extra 1d6 damage to one creature you hit with an attack if you have advantage on the attack roll. The attack must use a finesse or a ranged weapon.

You don’t need advantage on the attack roll if another enemy of the target is within 5 feet of it, that enemy isn’t incapacitated, and you don’t have disadvantage on the attack roll.

The question arises from the difficulty in parsing the bolded sentence. I have heard 2 interpretations:

  1. You can sneak attack if (you have advantage and the attack is made using a finesse or ranged weapon) or (an enemy of the target is within 5ft, etc).
  2. You can sneak attack if ((you have advantage) or (an enemy of the target is within 5ft, etc)) and the attack is made using a finesse or ranged weapon.

The first interpretation hinges on the idea that when the second paragraph says "on the attack roll" it is still talking about the same "attack" as in the first paragraph. The second interpretation hinges on the idea that the first interpretation is bizarre and unnatural – if that was the intent, there are many ways that it could have been worded to be clearer.

Thematically, I am leaning towards the first – not having a finesse or ranged weapon shouldn’t stop the rogue from exploiting a distracted foe.

Considering RAW only (no twitter please), how should this feature be interpreted?