Recursive expression with optional parentesis.

How to define recursive arithmetical expression with optional parenthesis in Lezer?
I try this:

@top Template { statement* }

statement {
    ArithExpr
}

ArithExpr {
    ArithExpr ArithOp ArithExpr |
    '(' ArithExpr ')' |
    number
}

ArithOp { '+' | '-' | '*' | '/' }

@tokens {
    number { @digit+ }
}

@detectDelim

but got an error:

shift/reduce conflict between
  ArithOp -> · "+"
and
  ArithExpr -> ArithExpr ArithOp ArithExpr
With input:
  ArithExpr ArithOp ArithExpr · "+" …
The reduction of ArithExpr is allowed before "+" because of this rule:
  ArithExpr -> ArithExpr · ArithOp ArithExpr
Shared origin: statement+ -> · ArithExpr
  via ArithExpr -> ArithExpr ArithOp · ArithExpr
    via ArithExpr -> ArithExpr · ArithOp ArithExpr
      ArithOp -> · "+"

and don’t understand how to resolve that.
Could you please help?
BTW, the similar grammar works in ANTLR v4.

It doesn’t know whether to parse 1 + 1 + 1 as (1 + 1) + 1 or 1 + (1 + 1). See the use of precedences in the binary expressions in the JavaScript example for a possible solution.

Without specifying precedence? I haven’t tried, but from what I know about ANTLR, I doubt that is correct.

Yes, ANTLR resolves ambiguities in favor of the alternative given first, and by default associates operators left to right.
Thank you for the answer, gonna look into the JS grammar.