Treat partial hook success '\n' to fix #2361 .

Now it will parse the #2361 code as:
```
module A
end
module B
end
```
instead of
```
module A
end module B
end
```