Uses a two-scope begin/end model to correctly highlight catch parameter.
It wraps Exception ... | or Exception ... ) as a scope, allowing parameter to only sit in this scope, to resolve the parsing sequence issue (first exception type, then parameter identifier).
Alternate Designs
A more complex two-scope design:
scope 1: (...Exception
scope 2: |...Exception
scope 3: parameter...)
Problem: cannot correctly highlight when there's a storage-modifer (like final)
It makes use of the fact that catch (ex1 | ex2 | ex3 param) is in terms of structure the same as catch (ex1 (ex2 (ex3 param) (every time a | is met, the remaining part is actually a new catch-parameter pattern)
Problem: still cannot elegantly handle the base case: catch (final ex3 param).
Benefits
Can correctly highlight catch parameter when it is placed in new line or with a comment in between.
Description of the Change
Uses a two-scope begin/end model to correctly highlight catch parameter.
It wraps
Exception ... |
orException ... )
as a scope, allowing parameter to only sit in this scope, to resolve the parsing sequence issue (first exception type, then parameter identifier).Alternate Designs
A more complex two-scope design:
(...Exception
|...Exception
parameter...)
Problem: cannot correctly highlight when there's a storage-modifer (like final)
Recursive design:
It makes use of the fact that
catch (ex1 | ex2 | ex3 param)
is in terms of structure the same ascatch (ex1 (ex2 (ex3 param)
(every time a|
is met, the remaining part is actually a new catch-parameter pattern)Problem: still cannot elegantly handle the base case:
catch (final ex3 param)
.Benefits
Can correctly highlight catch parameter when it is placed in new line or with a comment in between.
Possible Drawbacks
Don't see any afak.
Applicable Issues
Fix #219