Why there is ASTERISK2 grammar?

Hi guys,

In my understanding, ASTERISK2 can be produced by repeat PrefixTypeOp 2 times. ** and * * are the same thing. What I’ve missed? Many thanks!

** is also an operator for comptime array repetition, e.g.:

const a = [_]u8{32} ** 100;

Here, a is an array of 100 u8s of the value 32. Using * * instead of ** is not permitted there, hence the separate ASTERISK2 token.

1 Like

It’s probably going to be removed in favour of @splat.

1 Like

That would make perfect sense. A that point I guess the **/ASTERISK2 token would be removed, simplifying the grammar.