yoheimuta/go-protoparser

error parsring if file ends with comment _and_ no newline

Closed this issue · 3 comments

2019/12/11 13:34:59 Lexer encountered the error "found "\x00" but expected [
] at /go/pkg/mod/github.com/yoheimuta/go-protoparser/v4@v4.0.0/internal/lexer/scanner/comment.go:12"

Looks like https://github.com/yoheimuta/go-protoparser/blob/master/internal/lexer/scanner/comment.go#L9-L17 is a bit too strict

@kung-foo Thank you for your suggestion!

I agree with you. Besides, I guess allowing the comment with no newline wouldn't bother anyone.

I fixed it.

This only came up because I selected a large part of a proto file and commented it out for testing. Not because I usually write comments at the bottom of a file :)

@kung-foo That makes sense! Thank you for your clear explanation.