I could look at perhaps checking for a space before the closing `{` which might also fix this as from what I can see, it is prematurely ending and then the highlighting after this is incorrect.