Commit e0cb80e4 authored by Robert Griesemer's avatar Robert Griesemer
Browse files

cmd/compile/internal/syntax: provide BadExpr where needed, call correct error handler

- For "if" statements without a condition, provide a BadExpr rather than nil
  (clients expect IfStmt.Cond != nil since the parser is taking care of
  reporting a missing condition).

- For 3-index slice expressions, also provide BadExpr where an index is
  required but missing.

- Declare a parser-local error method to hide the embedded error method
  so we don't use it by mistake.

Accidentally found while adjusting prototype parser to work for generics.

Change-Id: Iacc211cc60869be05efe9ae630d65dff1dac00a0
Reviewed-on: https://go-review.googlesource.com/c/go/+/261218


Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
parent aeae46a7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment