v0.2.0
This release contains a couple of bug-fixes and one minor addition.
Fixes:
- If a
protocompile.SourceResolver
has anAccessor
function that returns an error that wraps anErrNotExist
, it could incorrectly abort searching through import paths. It instead required that the function directly return that error sentinel, without wrapping. Now it correctly handles if theErrNotExist
error is wrapped. - When using an error reporter that accumulates many errors (vs. failing after the first one) and parsing source with an invalid string literal that contained incorrect escape sequences, the lexer could get into an incorrect state and report many confusing errors. It effectively behaved as if the incorrect escape sequence was the end of the string literal; it would then report tokenization errors about the rest of the string literal contents, as if they were regular source code not inside a string literal. This has been fixed, and error messages in these situations are now intuitive.
Additions:
- The
protocompile.SearchResult
type has a new fieldParseResult
. This allows the compiler to make more efficient use of the result if the resolver already has an instance ofparser.Result
. Previously, the resolver would have to decide to return either the file descriptor proto or the AST. Now it can return both.