Description
Describe the bug
x y : z
is parsed as Optional[Times[x, y], z]
, according to the Wolfram Language -> Show FullForm menu item. This is also reflected in how the incremental selection works ("expand selection").
The correct parsing is Times[x, Pattern[y, z]]
. There are two problems here: (1) precedence of :
vs implicit multiplication (2) confusion between Optional and Pattern.
Let us look at another example:
x y_ : z
(notice the _
) is parsed as Optional[Times[x, Pattern[y]], z]
.
The correct parsing is Times[x, Optional[Pattern[y, Blank[]], z]]
. Again, two issues: (1) precedence of :
vs implicit multiplication (2) Pattern[y]
vs Pattern[y, Blank[]]
As far as I can tell, in both cases it is only (1) that affects the functionality of the plugin, and (2) can be ignored. It affects incremental selections.
Activity