Dot should also end 'anonymous-classes-and-new', in order to propery highlight method call of temporary variable created by 'new'.
Question mark should also end 'anonymous-classes-and-new', in order to proper break out circumstances like new Random() ? true : false;
Right square brace should also end 'anonymous-classes-and-new', for circumstances like [new Random()].
Xor should also end anonymous-classes-and-new, for circumstances like new Integer(1) ^ new Integer(2).
Alternate Designs
Non was considered.
Having to enumerate these much punctuations made me think of proposing a general and simple regex to end new expression. But soon I found out that I couldn't find a way to tell when ) or ] is met, whether there will be a {} block next to it.
Benefits
The meaning of dot method call by variable and new-variable is consistent.
Every punctuation that could end a new expression is covered.
Possible Drawbacks
No obvious drawback.
Applicable Issues
Fix #213 -> dot
Fix #179 -> question mark
Fix #180 -> right square
Fix #192 -> xor
Description of the Change
Dot should also end 'anonymous-classes-and-new', in order to propery highlight method call of temporary variable created by 'new'.
Question mark should also end 'anonymous-classes-and-new', in order to proper break out circumstances like
new Random() ? true : false
;Right square brace should also end 'anonymous-classes-and-new', for circumstances like
[new Random()]
.Xor should also end
anonymous-classes-and-new
, for circumstances likenew Integer(1) ^ new Integer(2)
.Alternate Designs
Non was considered.Having to enumerate these much punctuations made me think of proposing a general and simple regex to end new expression. But soon I found out that I couldn't find a way to tell when
)
or]
is met, whether there will be a{}
block next to it.Benefits
Possible Drawbacks
No obvious drawback.
Applicable Issues
Fix #213 -> dot Fix #179 -> question mark Fix #180 -> right square Fix #192 -> xor