scala/scala — pull request #1980 by retronym (2013-01-26 16:08:40+00:00)
Title: [backport] SI-2968 Fix brace healing for `^case (class|object) {`

Squashed commit of the following:

commit 24828531f62ce05402c96c04d7096e82d5f4e3bf
Author: Jason Zaugg
Date: Sun Oct 21 23:34:35 2012 +0200

SI-2968 Fix brace healing for `^case (class|object) {`

The scanner coalesces the pair of tokens into CASEOBJECT or
CASECLASS, but fails to set `offset` back to the start of `case`.
Brace healing is then unable to correctly guess the location of
the missing brace.

This commit resets `offset` and `lastOffset`, as though
caseobject were a single keyword. Only the former was neccessary
to fix this bug; I haven't found a test that shows the need for
the latter.
(cherry picked from commit cbad218dba47d49a39897b86d467c384538fdd53)

Review by @adriaanm