Priority index expressions and pointer dereferencing expressions

Given a simple expression like

*a[0]

where it is adeclared as *[]string(pointer to a fragment of lines).

Where does the standard accurately explain the order in which language constructs are evaluated?

I found that none of them is actually an operator, and only the two keyword references precedencementioned in the spec:

So, what part of the specification would explain the evaluation order of the provided expression?

+4
source share
1 answer

Final section Key expressions :

- .

, , , a[0] *. (. ).

:

x T address & x * T x. , , , ; ; . (, ) . x , & x.

x * T - * x T, x. x nil, * x .

, , , .

, - (*x) , , Address Operator. , Index Expression.

:

a :

a[x] (*a)[x]

.

+3

Source: https://habr.com/ru/post/1681828/


All Articles