Detect when a end keyword ends a context.