What do you think about

```ruby
value = if match[4]
  context[match[4]]
else
  (match[2] || match[3]).gsub(/\\'/, "'")
end
```