Equivalent struct literals may be written in several ways:
T{1, 2}
T{a: 1, b: 2}
T{b: 2, a: 1}
The 'eg' tool should allow a pattern using any of these forms to match any of these expressions. That means internally converting to the named form and doing name-based (not index-based) matching of subtrees. The output should be emitted in the same form as the original.
Also note that the T might not be present in the AST. It can be elided when the struct literal is part of a larger literal (struct, array, map) from which the type can be inferred.
Equivalent struct literals may be written in several ways: T{1, 2} T{a: 1, b: 2} T{b: 2, a: 1} The 'eg' tool should allow a pattern using any of these forms to match any of these expressions. That means internally converting to the named form and doing name-based (not index-based) matching of subtrees. The output should be emitted in the same form as the original.