You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File::findStartOfStatement(): bug fix - don't give nested scopes the "match" treatment
The only "scopes" which can be nested within a `match` expression are closures, anonymous classes and other `match` expressions.
The `File::findStartOfStatement()` method has special handling for `match` expressions to find the start of a statement, but that special handling would also kick in when the `$start` token is within another scope nested within the `match`, while, in that case, the special handling is not needed and ends up resulting in an incorrect "start" pointer being returned, in most cases, even a "start pointer" which is _after_ the token for which the start of statement is requested, which should never be possible.
Fixed now by changing the special handling for `match` expressions to only kick in when the `match` expression is the _deepest_ nested scope.
Includes unit tests.
0 commit comments