Permalink
Please sign in to comment.
Browse files
Error handling for slices in OSH.
- For string slices, the start index and length can't be negative. It's possible to implement negative indices, but the semantics are awkward, and I'd like to see which scripts use them. - 'set -o strict-word-eval' controls whether this is a fatal error or a warning + empty slice result. - Change UTF-8 error handling to use an exception in core/util.py. - Change UTF-8 error message text. - Add a test case for strict-word-eval and invalid UTF-8 when slicing strings. Still TODO: Properly handle invalid UTF-8 when taking the string length. Addresses issue #142.
- Loading branch information...
Showing
with
118 additions
and 52 deletions.
- +6 −11 core/libstr.py
- +12 −0 core/util.py
- +37 −12 core/word_eval.py
- +4 −0 spec/osh-only.test.sh
- +58 −29 spec/var-op-other.test.sh
- +1 −0 test/sh_spec.py
0 comments on commit
132cee4