Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go/parser: ParseExprFrom doesn't return errors if there were too many errors #34274

Closed
griesemer opened this issue Sep 12, 2019 · 1 comment
Closed
Milestone

Comments

@griesemer
Copy link
Contributor

Here's a simple test case:

package main

import "go/parser"
import "go/token"
import "fmt"

func main() {
	src := "s[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::]"
	fset := token.NewFileSet()
	_, err := parser.ParseExprFrom(fset, "", src, 0)
	if err != nil {
		fmt.Println(err)
	}
}

This should report:

1:3: 2nd index required in 3-index slice (and 10 more errors)

But it doesn't report an error at all.

See also discussion on https://go-review.googlesource.com/c/go/+/194638 .

@griesemer griesemer added this to the Go1.14 milestone Sep 12, 2019
@gopherbot
Copy link

Change https://golang.org/cl/194638 mentions this issue: go/parser: fix ignored errors in ParseExprFrom

@golang golang locked and limited conversation to collaborators Sep 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants