Descriptiongo.text/language: revamped error handling:
- ValueError now exported as new type. ValueError retains the problematic value,
allowing the user to inspect and correct it.
- Dynamically allocated errors returned in case of a syntax error are replaced
by a error variable.
- Fixed bug: return error if an "u" extension has a type without a value.
- Added benchmarks or parsing code.
- Renamed MissingLikelyData to ErrMissingLikelyData to be consistent with other
Go packages. This variable is not yet returned, so this change is not likely to cause
a big issue.
- Removed Set type as long as there is no demand for it.
The code is measurably faster after removing the dynamically allocated errors.
A ValueError is 8 bytes and should not require allocation when passed as an error.
Returning a fixed error variable instead of a ValueError did not significantly improve
performance.
I considered returning a syntax error with the position at which the error occurred.
This extra management needed for this slowed down the code a bit, so I opted not to
support this. This could still be implemented if there turns out to be a need for it.
Patch Set 1 #Patch Set 2 : diff -r 565aa3af64cd https://code.google.com/p/go.text #Patch Set 3 : diff -r 565aa3af64cd https://code.google.com/p/go.text #
Total comments: 1
Patch Set 4 : diff -r 565aa3af64cd https://code.google.com/p/go.text #Patch Set 5 : diff -r 565aa3af64cd https://code.google.com/p/go.text #Patch Set 6 : diff -r 565aa3af64cd https://code.google.com/p/go.text #
Total comments: 4
Patch Set 7 : diff -r d1f38b6467f7 https://code.google.com/p/go.text #
MessagesTotal messages: 7
|