In the sentence "Mary walked over to the boy, laughing at the joke.", who do you think is laughing? Just give your gut feeling, no need to worry about what grammar rules might apply.
Mary is laughing
The boy is laughing
I'm not sure, but probably Mary?
I'm not sure, but probably the boy?
If you hadn't asked, I would've had a clear idea one way or the other, but now I am flashing back to high school English classes and I am panicking about passing the test even though this is not a test and have no idea any more
I've forgotten how to English
I have already overthought this question, so I'm not going to explain the background unless someone asks me to in the comments. I'm just curious what instinctive sense other people have on it.